@payloadcms/ui 4.0.0-internal.af6aad0 → 4.0.0-internal.b8a92d2

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 (855) hide show
  1. package/dist/css/app.css +1 -0
  2. package/dist/css/colors.css +9 -8
  3. package/dist/css/forms.css +1 -0
  4. package/dist/css/preflight.css +1 -0
  5. package/dist/css/spacing.css +12 -0
  6. package/dist/css/typography.css +158 -14
  7. package/dist/elements/APIKeyInput/index.d.ts +2 -0
  8. package/dist/elements/APIKeyInput/index.d.ts.map +1 -1
  9. package/dist/elements/APIKeyInput/index.js +27 -29
  10. package/dist/elements/APIKeyInput/index.js.map +1 -1
  11. package/dist/elements/AddNewRelation/index.css +4 -0
  12. package/dist/elements/AddNewRelation/index.js +2 -2
  13. package/dist/elements/AddNewRelation/index.js.map +1 -1
  14. package/dist/elements/AppHeader/EditViewWidthSettings/index.css +5 -0
  15. package/dist/elements/AppHeader/EditViewWidthSettings/index.d.ts +4 -0
  16. package/dist/elements/AppHeader/EditViewWidthSettings/index.d.ts.map +1 -0
  17. package/dist/elements/AppHeader/EditViewWidthSettings/index.js +77 -0
  18. package/dist/elements/AppHeader/EditViewWidthSettings/index.js.map +1 -0
  19. package/dist/{icons/CollapseLayers → elements/AppHeader/SettingsMenu}/index.css +1 -1
  20. package/dist/elements/AppHeader/SettingsMenu/index.d.ts +4 -0
  21. package/dist/elements/AppHeader/SettingsMenu/index.d.ts.map +1 -0
  22. package/dist/elements/AppHeader/SettingsMenu/index.js +59 -0
  23. package/dist/elements/AppHeader/SettingsMenu/index.js.map +1 -0
  24. package/dist/elements/AppHeader/TypeSizeSettings/index.d.ts +3 -0
  25. package/dist/elements/AppHeader/TypeSizeSettings/index.d.ts.map +1 -0
  26. package/dist/elements/AppHeader/TypeSizeSettings/index.js +58 -0
  27. package/dist/elements/AppHeader/TypeSizeSettings/index.js.map +1 -0
  28. package/dist/elements/AppHeader/index.css +3 -4
  29. package/dist/elements/AppHeader/index.d.ts +8 -1
  30. package/dist/elements/AppHeader/index.d.ts.map +1 -1
  31. package/dist/elements/AppHeader/index.js +16 -6
  32. package/dist/elements/AppHeader/index.js.map +1 -1
  33. package/dist/elements/Autosave/index.d.ts.map +1 -1
  34. package/dist/elements/Autosave/index.js +2 -3
  35. package/dist/elements/Autosave/index.js.map +1 -1
  36. package/dist/elements/Banner/index.css +4 -0
  37. package/dist/elements/Banner/index.d.ts.map +1 -1
  38. package/dist/elements/Banner/index.js +1 -0
  39. package/dist/elements/Banner/index.js.map +1 -1
  40. package/dist/elements/BulkUpload/ActionsBar/index.css +1 -0
  41. package/dist/elements/BulkUpload/AddingFilesView/index.css +2 -4
  42. package/dist/elements/BulkUpload/FileSidebar/index.css +1 -0
  43. package/dist/elements/BulkUpload/FormsManager/createFormData.d.ts +1 -1
  44. package/dist/elements/BulkUpload/FormsManager/createFormData.d.ts.map +1 -1
  45. package/dist/elements/BulkUpload/FormsManager/createFormData.js +7 -3
  46. package/dist/elements/BulkUpload/FormsManager/createFormData.js.map +1 -1
  47. package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
  48. package/dist/elements/BulkUpload/FormsManager/index.js +18 -12
  49. package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
  50. package/dist/elements/BulkUpload/index.css +2 -0
  51. package/dist/elements/Button/index.css +0 -23
  52. package/dist/elements/Button/types.d.ts +1 -1
  53. package/dist/elements/Button/types.d.ts.map +1 -1
  54. package/dist/elements/Button/types.js.map +1 -1
  55. package/dist/elements/Collapsible/index.css +1 -0
  56. package/dist/elements/CopyLocaleData/index.d.ts.map +1 -1
  57. package/dist/elements/CopyLocaleData/index.js +8 -9
  58. package/dist/elements/CopyLocaleData/index.js.map +1 -1
  59. package/dist/elements/DatePicker/index.css +2 -0
  60. package/dist/elements/DefaultListViewTabs/index.css +0 -1
  61. package/dist/elements/DefaultListViewTabs/index.d.ts.map +1 -1
  62. package/dist/elements/DefaultListViewTabs/index.js +62 -84
  63. package/dist/elements/DefaultListViewTabs/index.js.map +1 -1
  64. package/dist/elements/DeleteMany/index.d.ts.map +1 -1
  65. package/dist/elements/DeleteMany/index.js +2 -3
  66. package/dist/elements/DeleteMany/index.js.map +1 -1
  67. package/dist/elements/Dialog/index.css +1 -0
  68. package/dist/elements/DocumentControls/index.css +1 -0
  69. package/dist/elements/DocumentDrawer/types.d.ts +1 -1
  70. package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
  71. package/dist/elements/DocumentDrawer/types.js.map +1 -1
  72. package/dist/elements/DocumentFields/index.css +2 -0
  73. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +1 -0
  74. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -1
  75. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +3 -2
  76. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
  77. package/dist/elements/DocumentHeader/Tabs/index.css +1 -0
  78. package/dist/elements/DocumentHeader/Tabs/index.d.ts +1 -0
  79. package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
  80. package/dist/elements/DocumentHeader/Tabs/index.js +5 -3
  81. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
  82. package/dist/elements/DocumentHeader/index.css +1 -0
  83. package/dist/elements/DocumentHeader/index.d.ts +1 -0
  84. package/dist/elements/DocumentHeader/index.d.ts.map +1 -1
  85. package/dist/elements/DocumentHeader/index.js +4 -2
  86. package/dist/elements/DocumentHeader/index.js.map +1 -1
  87. package/dist/elements/Drawer/types.d.ts +2 -2
  88. package/dist/elements/Drawer/types.d.ts.map +1 -1
  89. package/dist/elements/Drawer/types.js.map +1 -1
  90. package/dist/elements/DuplicateDocument/index.d.ts.map +1 -1
  91. package/dist/elements/DuplicateDocument/index.js +2 -3
  92. package/dist/elements/DuplicateDocument/index.js.map +1 -1
  93. package/dist/elements/EditMany/DrawerContent.d.ts.map +1 -1
  94. package/dist/elements/EditMany/DrawerContent.js +2 -3
  95. package/dist/elements/EditMany/DrawerContent.js.map +1 -1
  96. package/dist/elements/EditUpload/index.css +1 -1
  97. package/dist/elements/FieldDiffContainer/index.css +1 -0
  98. package/dist/elements/FieldDiffLabel/index.css +1 -0
  99. package/dist/elements/FileDetails/StaticFileDetails/index.css +2 -0
  100. package/dist/elements/HTMLDiff/index.css +1 -0
  101. package/dist/elements/Hierarchy/ColumnBrowser/Column/index.css +4 -22
  102. package/dist/elements/Hierarchy/ColumnBrowser/Column/index.d.ts.map +1 -1
  103. package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js +49 -68
  104. package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js.map +1 -1
  105. package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.css +15 -100
  106. package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.d.ts.map +1 -1
  107. package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js +137 -97
  108. package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js.map +1 -1
  109. package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts +1 -1
  110. package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts.map +1 -1
  111. package/dist/elements/Hierarchy/ColumnBrowser/index.js +23 -51
  112. package/dist/elements/Hierarchy/ColumnBrowser/index.js.map +1 -1
  113. package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts +3 -26
  114. package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts.map +1 -1
  115. package/dist/elements/Hierarchy/ColumnBrowser/types.js.map +1 -1
  116. package/dist/elements/Hierarchy/DocHeaderButton/index.d.ts.map +1 -1
  117. package/dist/elements/Hierarchy/DocHeaderButton/index.js +1 -6
  118. package/dist/elements/Hierarchy/DocHeaderButton/index.js.map +1 -1
  119. package/dist/elements/Hierarchy/DocHeaderButton/index.server.js +3 -1
  120. package/dist/elements/Hierarchy/DocHeaderButton/index.server.js.map +1 -1
  121. package/dist/elements/Hierarchy/Field/SelectedHierarchies.css +36 -0
  122. package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts +13 -0
  123. package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts.map +1 -0
  124. package/dist/elements/Hierarchy/Field/SelectedHierarchies.js +141 -0
  125. package/dist/elements/Hierarchy/Field/SelectedHierarchies.js.map +1 -0
  126. package/dist/elements/Hierarchy/Field/index.client.d.ts +0 -5
  127. package/dist/elements/Hierarchy/Field/index.client.d.ts.map +1 -1
  128. package/dist/elements/Hierarchy/Field/index.client.js +95 -120
  129. package/dist/elements/Hierarchy/Field/index.client.js.map +1 -1
  130. package/dist/elements/Hierarchy/Field/index.css +34 -3
  131. package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts +4 -18
  132. package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts.map +1 -1
  133. package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js +24 -88
  134. package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js.map +1 -1
  135. package/dist/elements/Hierarchy/Modal/index.css +53 -4
  136. package/dist/elements/Hierarchy/Modal/index.d.ts +2 -5
  137. package/dist/elements/Hierarchy/Modal/index.d.ts.map +1 -1
  138. package/dist/elements/Hierarchy/Modal/index.js +99 -136
  139. package/dist/elements/Hierarchy/Modal/index.js.map +1 -1
  140. package/dist/elements/Hierarchy/Modal/types.d.ts +0 -15
  141. package/dist/elements/Hierarchy/Modal/types.d.ts.map +1 -1
  142. package/dist/elements/Hierarchy/Modal/types.js.map +1 -1
  143. package/dist/elements/Hierarchy/MoveMany/index.d.ts +3 -7
  144. package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -1
  145. package/dist/elements/Hierarchy/MoveMany/index.js +171 -45
  146. package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -1
  147. package/dist/elements/Hierarchy/Search/index.css +9 -2
  148. package/dist/elements/Hierarchy/Search/index.d.ts.map +1 -1
  149. package/dist/elements/Hierarchy/Search/index.js +73 -6
  150. package/dist/elements/Hierarchy/Search/index.js.map +1 -1
  151. package/dist/elements/Hierarchy/Search/types.d.ts +6 -2
  152. package/dist/elements/Hierarchy/Search/types.d.ts.map +1 -1
  153. package/dist/elements/Hierarchy/Search/types.js.map +1 -1
  154. package/dist/elements/Hierarchy/Search/useHierarchySearch.d.ts.map +1 -1
  155. package/dist/elements/Hierarchy/Search/useHierarchySearch.js +2 -3
  156. package/dist/elements/Hierarchy/Search/useHierarchySearch.js.map +1 -1
  157. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts +4 -0
  158. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts.map +1 -1
  159. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js +186 -101
  160. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js.map +1 -1
  161. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.d.ts.map +1 -1
  162. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js +21 -1
  163. package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js.map +1 -1
  164. package/dist/elements/Hierarchy/Tree/LoadMore/index.css +3 -3
  165. package/dist/elements/Hierarchy/Tree/TreeNode/index.css +29 -59
  166. package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts +1 -1
  167. package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
  168. package/dist/elements/Hierarchy/Tree/TreeNode/index.js +10 -54
  169. package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -1
  170. package/dist/elements/Hierarchy/Tree/index.css +9 -8
  171. package/dist/elements/Hierarchy/Tree/index.d.ts.map +1 -1
  172. package/dist/elements/Hierarchy/Tree/index.js +47 -29
  173. package/dist/elements/Hierarchy/Tree/index.js.map +1 -1
  174. package/dist/elements/Hierarchy/Tree/types.d.ts +1 -9
  175. package/dist/elements/Hierarchy/Tree/types.d.ts.map +1 -1
  176. package/dist/elements/Hierarchy/Tree/types.js.map +1 -1
  177. package/dist/elements/Hierarchy/Tree/useChildren.d.ts.map +1 -1
  178. package/dist/elements/Hierarchy/Tree/useChildren.js +1 -11
  179. package/dist/elements/Hierarchy/Tree/useChildren.js.map +1 -1
  180. package/dist/elements/ItemsDrawer/index.css +3 -0
  181. package/dist/elements/ListControls/index.css +1 -0
  182. package/dist/elements/ListControls/index.d.ts.map +1 -1
  183. package/dist/elements/ListControls/index.js +7 -2
  184. package/dist/elements/ListControls/index.js.map +1 -1
  185. package/dist/elements/ListControls/types.d.ts +3 -5
  186. package/dist/elements/ListControls/types.d.ts.map +1 -1
  187. package/dist/elements/ListControls/types.js.map +1 -1
  188. package/dist/elements/ListControlsBar/index.css +1 -0
  189. package/dist/elements/ListHeader/TitleActions/ListEmptyTrashButton.d.ts.map +1 -1
  190. package/dist/elements/ListHeader/TitleActions/ListEmptyTrashButton.js +3 -4
  191. package/dist/elements/ListHeader/TitleActions/ListEmptyTrashButton.js.map +1 -1
  192. package/dist/elements/LivePreview/Window/index.css +1 -0
  193. package/dist/elements/LivePreview/Window/index.js +1 -1
  194. package/dist/elements/LivePreview/Window/index.js.map +1 -1
  195. package/dist/elements/Localizer/index.js +1 -1
  196. package/dist/elements/Localizer/index.js.map +1 -1
  197. package/dist/elements/Nav/NavSidebarToggle/index.js +1 -1
  198. package/dist/elements/Nav/NavSidebarToggle/index.js.map +1 -1
  199. package/dist/elements/Nav/NavWrapper/index.d.ts +0 -1
  200. package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -1
  201. package/dist/elements/Nav/NavWrapper/index.js +18 -12
  202. package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
  203. package/dist/elements/Nav/SidebarTabs/index.css +2 -1
  204. package/dist/elements/Nav/SidebarTabs/renderTabServerFn.js +3 -2
  205. package/dist/elements/Nav/SidebarTabs/renderTabServerFn.js.map +1 -1
  206. package/dist/elements/Nav/context.d.ts +1 -0
  207. package/dist/elements/Nav/context.d.ts.map +1 -1
  208. package/dist/elements/Nav/context.js +67 -92
  209. package/dist/elements/Nav/context.js.map +1 -1
  210. package/dist/elements/Nav/index.css +44 -47
  211. package/dist/elements/Nav/index.d.ts +0 -4
  212. package/dist/elements/Nav/index.d.ts.map +1 -1
  213. package/dist/elements/Nav/index.js +1 -16
  214. package/dist/elements/Nav/index.js.map +1 -1
  215. package/dist/elements/NavGroup/index.css +15 -29
  216. package/dist/elements/PageControls/index.css +1 -0
  217. package/dist/elements/PillSelector/index.css +1 -0
  218. package/dist/elements/Popup/PopupButtonList/index.css +16 -32
  219. package/dist/elements/Popup/index.css +0 -6
  220. package/dist/elements/Popup/index.d.ts +0 -10
  221. package/dist/elements/Popup/index.d.ts.map +1 -1
  222. package/dist/elements/Popup/index.js +5 -12
  223. package/dist/elements/Popup/index.js.map +1 -1
  224. package/dist/elements/PreviewSizes/index.css +2 -0
  225. package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts.map +1 -1
  226. package/dist/elements/PublishButton/ScheduleDrawer/index.js +8 -30
  227. package/dist/elements/PublishButton/ScheduleDrawer/index.js.map +1 -1
  228. package/dist/elements/PublishButton/ScheduleDrawer/types.d.ts +1 -1
  229. package/dist/elements/PublishButton/ScheduleDrawer/types.d.ts.map +1 -1
  230. package/dist/elements/PublishButton/ScheduleDrawer/types.js.map +1 -1
  231. package/dist/elements/PublishButton/index.css +1 -0
  232. package/dist/elements/PublishButton/index.d.ts.map +1 -1
  233. package/dist/elements/PublishButton/index.js +16 -31
  234. package/dist/elements/PublishButton/index.js.map +1 -1
  235. package/dist/elements/PublishMany/DrawerContent.d.ts.map +1 -1
  236. package/dist/elements/PublishMany/DrawerContent.js +2 -3
  237. package/dist/elements/PublishMany/DrawerContent.js.map +1 -1
  238. package/dist/elements/QueryPresets/QueryPresetBar/index.d.ts.map +1 -1
  239. package/dist/elements/QueryPresets/QueryPresetBar/index.js +14 -1
  240. package/dist/elements/QueryPresets/QueryPresetBar/index.js.map +1 -1
  241. package/dist/elements/QueryPresets/fields/Heading/index.css +1 -0
  242. package/dist/elements/ReactSelect/types.d.ts +0 -5
  243. package/dist/elements/ReactSelect/types.d.ts.map +1 -1
  244. package/dist/elements/ReactSelect/types.js.map +1 -1
  245. package/dist/elements/RenderTitle/index.css +1 -0
  246. package/dist/elements/RestoreMany/index.d.ts.map +1 -1
  247. package/dist/elements/RestoreMany/index.js +2 -3
  248. package/dist/elements/RestoreMany/index.js.map +1 -1
  249. package/dist/elements/SaveDraftButton/index.d.ts.map +1 -1
  250. package/dist/elements/SaveDraftButton/index.js +2 -3
  251. package/dist/elements/SaveDraftButton/index.js.map +1 -1
  252. package/dist/elements/SelectAll/index.d.ts.map +1 -1
  253. package/dist/elements/SelectAll/index.js +2 -1
  254. package/dist/elements/SelectAll/index.js.map +1 -1
  255. package/dist/elements/SelectRow/index.d.ts.map +1 -1
  256. package/dist/elements/SelectRow/index.js +2 -1
  257. package/dist/elements/SelectRow/index.js.map +1 -1
  258. package/dist/elements/SidebarRow/index.css +5 -1
  259. package/dist/elements/SidebarToggle/index.css +1 -3
  260. package/dist/elements/Status/index.d.ts.map +1 -1
  261. package/dist/elements/Status/index.js +2 -3
  262. package/dist/elements/Status/index.js.map +1 -1
  263. package/dist/elements/StepNav/index.d.ts.map +1 -1
  264. package/dist/elements/StepNav/index.js +10 -14
  265. package/dist/elements/StepNav/index.js.map +1 -1
  266. package/dist/elements/StepNav/types.d.ts +0 -6
  267. package/dist/elements/StepNav/types.d.ts.map +1 -1
  268. package/dist/elements/StepNav/types.js.map +1 -1
  269. package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.css +7 -5
  270. package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.d.ts.map +1 -1
  271. package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js +3 -14
  272. package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js.map +1 -1
  273. package/dist/elements/Table/OrderableTable.d.ts.map +1 -1
  274. package/dist/elements/Table/OrderableTable.js +2 -3
  275. package/dist/elements/Table/OrderableTable.js.map +1 -1
  276. package/dist/elements/Table/RelationshipProvider/index.d.ts.map +1 -1
  277. package/dist/elements/Table/RelationshipProvider/index.js +2 -3
  278. package/dist/elements/Table/RelationshipProvider/index.js.map +1 -1
  279. package/dist/elements/Table/index.css +1 -0
  280. package/dist/elements/TableSection/index.css +1 -0
  281. package/dist/elements/Tabs/index.css +1 -0
  282. package/dist/elements/Thumbnail/index.css +1 -0
  283. package/dist/elements/TimezonePicker/index.css +1 -0
  284. package/dist/elements/Tooltip/index.css +7 -0
  285. package/dist/elements/UnpublishButton/index.d.ts.map +1 -1
  286. package/dist/elements/UnpublishButton/index.js +3 -4
  287. package/dist/elements/UnpublishButton/index.js.map +1 -1
  288. package/dist/elements/UnpublishMany/DrawerContent.d.ts.map +1 -1
  289. package/dist/elements/UnpublishMany/DrawerContent.js +2 -3
  290. package/dist/elements/UnpublishMany/DrawerContent.js.map +1 -1
  291. package/dist/elements/UserMenu/LanguageMenu/index.d.ts.map +1 -1
  292. package/dist/elements/UserMenu/LanguageMenu/index.js +39 -83
  293. package/dist/elements/UserMenu/LanguageMenu/index.js.map +1 -1
  294. package/dist/elements/UserMenu/SettingsMenu/index.d.ts.map +1 -1
  295. package/dist/elements/UserMenu/SettingsMenu/index.js +21 -57
  296. package/dist/elements/UserMenu/SettingsMenu/index.js.map +1 -1
  297. package/dist/elements/UserMenu/ThemeMenu/index.d.ts.map +1 -1
  298. package/dist/elements/UserMenu/ThemeMenu/index.js +39 -83
  299. package/dist/elements/UserMenu/ThemeMenu/index.js.map +1 -1
  300. package/dist/elements/UserMenu/index.css +2 -32
  301. package/dist/elements/UserMenu/index.d.ts +0 -1
  302. package/dist/elements/UserMenu/index.d.ts.map +1 -1
  303. package/dist/elements/UserMenu/index.js +51 -77
  304. package/dist/elements/UserMenu/index.js.map +1 -1
  305. package/dist/elements/WhereBuilder/Condition/Relationship/index.js +1 -1
  306. package/dist/elements/WhereBuilder/Condition/Relationship/index.js.map +1 -1
  307. package/dist/elements/WhereBuilder/Condition/index.css +1 -0
  308. package/dist/elements/WhereBuilder/index.css +2 -0
  309. package/dist/exports/client/index.d.ts +2 -4
  310. package/dist/exports/client/index.d.ts.map +1 -1
  311. package/dist/exports/client/index.js +1 -1
  312. package/dist/exports/client/index.js.map +3 -3
  313. package/dist/exports/rsc/index.d.ts +2 -0
  314. package/dist/exports/rsc/index.d.ts.map +1 -1
  315. package/dist/exports/rsc/index.js +2 -0
  316. package/dist/exports/rsc/index.js.map +1 -1
  317. package/dist/fields/Array/index.css +1 -0
  318. package/dist/fields/Array/index.d.ts.map +1 -1
  319. package/dist/fields/Array/index.js +2 -3
  320. package/dist/fields/Array/index.js.map +1 -1
  321. package/dist/fields/Blocks/index.css +1 -0
  322. package/dist/fields/Blocks/index.d.ts.map +1 -1
  323. package/dist/fields/Blocks/index.js +2 -3
  324. package/dist/fields/Blocks/index.js.map +1 -1
  325. package/dist/fields/Checkbox/Input.d.ts +2 -2
  326. package/dist/fields/Checkbox/Input.d.ts.map +1 -1
  327. package/dist/fields/Checkbox/Input.js +152 -134
  328. package/dist/fields/Checkbox/Input.js.map +1 -1
  329. package/dist/fields/Checkbox/index.css +163 -168
  330. package/dist/fields/FieldDescription/index.css +5 -0
  331. package/dist/fields/FieldLabel/index.css +8 -27
  332. package/dist/fields/FieldLabel/index.d.ts.map +1 -1
  333. package/dist/fields/FieldLabel/index.js +4 -5
  334. package/dist/fields/FieldLabel/index.js.map +1 -1
  335. package/dist/fields/Group/index.css +1 -0
  336. package/dist/fields/RadioGroup/Radio/index.css +1 -0
  337. package/dist/fields/RadioGroup/index.css +1 -1
  338. package/dist/fields/Relationship/Input.d.ts.map +1 -1
  339. package/dist/fields/Relationship/Input.js +8 -27
  340. package/dist/fields/Relationship/Input.js.map +1 -1
  341. package/dist/fields/Relationship/optionsReducer.d.ts.map +1 -1
  342. package/dist/fields/Relationship/optionsReducer.js +0 -2
  343. package/dist/fields/Relationship/optionsReducer.js.map +1 -1
  344. package/dist/fields/Relationship/types.d.ts +0 -24
  345. package/dist/fields/Relationship/types.d.ts.map +1 -1
  346. package/dist/fields/Relationship/types.js.map +1 -1
  347. package/dist/fields/Row/index.css +2 -0
  348. package/dist/fields/Slug/index.d.ts.map +1 -1
  349. package/dist/fields/Slug/index.js +2 -3
  350. package/dist/fields/Slug/index.js.map +1 -1
  351. package/dist/fields/Tabs/index.css +1 -0
  352. package/dist/fields/Textarea/index.css +1 -1
  353. package/dist/fields/Upload/Input.d.ts.map +1 -1
  354. package/dist/fields/Upload/Input.js +2 -3
  355. package/dist/fields/Upload/Input.js.map +1 -1
  356. package/dist/fields/shared/index.d.ts +1 -1
  357. package/dist/fields/shared/index.d.ts.map +1 -1
  358. package/dist/fields/shared/index.js.map +1 -1
  359. package/dist/forms/Form/context.d.ts +3 -1
  360. package/dist/forms/Form/context.d.ts.map +1 -1
  361. package/dist/forms/Form/context.js +3 -1
  362. package/dist/forms/Form/context.js.map +1 -1
  363. package/dist/forms/Form/index.d.ts.map +1 -1
  364. package/dist/forms/Form/index.js +15 -7
  365. package/dist/forms/Form/index.js.map +1 -1
  366. package/dist/forms/NullifyField/index.d.ts.map +1 -1
  367. package/dist/forms/NullifyField/index.js +2 -3
  368. package/dist/forms/NullifyField/index.js.map +1 -1
  369. package/dist/forms/RenderFields/index.css +1 -7
  370. package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
  371. package/dist/forms/fieldSchemasToFormState/renderField.js +3 -2
  372. package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
  373. package/dist/forms/fieldSchemasToFormState/serverFunctions/mergeAllowedFieldOverrides.d.ts +12 -0
  374. package/dist/forms/fieldSchemasToFormState/serverFunctions/mergeAllowedFieldOverrides.d.ts.map +1 -0
  375. package/dist/forms/fieldSchemasToFormState/serverFunctions/mergeAllowedFieldOverrides.js +42 -0
  376. package/dist/forms/fieldSchemasToFormState/serverFunctions/mergeAllowedFieldOverrides.js.map +1 -0
  377. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts +8 -6
  378. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts.map +1 -1
  379. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js +22 -9
  380. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js.map +1 -1
  381. package/dist/forms/fieldSchemasToFormState/types.d.ts +1 -0
  382. package/dist/forms/fieldSchemasToFormState/types.d.ts.map +1 -1
  383. package/dist/forms/fieldSchemasToFormState/types.js.map +1 -1
  384. package/dist/hooks/useControllableState.js +3 -3
  385. package/dist/hooks/useControllableState.js.map +1 -1
  386. package/dist/hooks/usePayloadAPI.d.ts.map +1 -1
  387. package/dist/hooks/usePayloadAPI.js +2 -3
  388. package/dist/hooks/usePayloadAPI.js.map +1 -1
  389. package/dist/layouts/Root/index.d.ts.map +1 -1
  390. package/dist/layouts/Root/index.js +19 -5
  391. package/dist/layouts/Root/index.js.map +1 -1
  392. package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
  393. package/dist/providers/DocumentInfo/index.js +32 -22
  394. package/dist/providers/DocumentInfo/index.js.map +1 -1
  395. package/dist/providers/Hierarchy/index.d.ts.map +1 -1
  396. package/dist/providers/Hierarchy/index.js +24 -53
  397. package/dist/providers/Hierarchy/index.js.map +1 -1
  398. package/dist/providers/Hierarchy/types.d.ts +0 -2
  399. package/dist/providers/Hierarchy/types.d.ts.map +1 -1
  400. package/dist/providers/Hierarchy/types.js.map +1 -1
  401. package/dist/providers/LivePreview/index.d.ts.map +1 -1
  402. package/dist/providers/LivePreview/index.js +13 -6
  403. package/dist/providers/LivePreview/index.js.map +1 -1
  404. package/dist/providers/Locale/index.d.ts +1 -5
  405. package/dist/providers/Locale/index.d.ts.map +1 -1
  406. package/dist/providers/Locale/index.js +61 -140
  407. package/dist/providers/Locale/index.js.map +1 -1
  408. package/dist/providers/Root/index.d.ts +4 -1
  409. package/dist/providers/Root/index.d.ts.map +1 -1
  410. package/dist/providers/Root/index.js +25 -16
  411. package/dist/providers/Root/index.js.map +1 -1
  412. package/dist/providers/Selection/index.d.ts.map +1 -1
  413. package/dist/providers/Selection/index.js +2 -3
  414. package/dist/providers/Selection/index.js.map +1 -1
  415. package/dist/providers/ServerFunctions/index.d.ts +5 -1
  416. package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
  417. package/dist/providers/ServerFunctions/index.js +15 -0
  418. package/dist/providers/ServerFunctions/index.js.map +1 -1
  419. package/dist/providers/TableColumns/buildColumnState/index.d.ts.map +1 -1
  420. package/dist/providers/TableColumns/buildColumnState/index.js +0 -1
  421. package/dist/providers/TableColumns/buildColumnState/index.js.map +1 -1
  422. package/dist/providers/Theme/index.d.ts +17 -1
  423. package/dist/providers/Theme/index.d.ts.map +1 -1
  424. package/dist/providers/Theme/index.js +253 -81
  425. package/dist/providers/Theme/index.js.map +1 -1
  426. package/dist/providers/Theme/shared.d.ts +8 -0
  427. package/dist/providers/Theme/shared.d.ts.map +1 -1
  428. package/dist/providers/Theme/shared.js +6 -0
  429. package/dist/providers/Theme/shared.js.map +1 -1
  430. package/dist/styles.css +182 -23
  431. package/dist/templates/Default/Wrapper/index.css +3 -2
  432. package/dist/templates/Default/Wrapper/index.d.ts +0 -2
  433. package/dist/templates/Default/Wrapper/index.d.ts.map +1 -1
  434. package/dist/templates/Default/Wrapper/index.js +6 -12
  435. package/dist/templates/Default/Wrapper/index.js.map +1 -1
  436. package/dist/templates/Default/index.css +2 -3
  437. package/dist/templates/Default/index.d.ts.map +1 -1
  438. package/dist/templates/Default/index.js +15 -17
  439. package/dist/templates/Default/index.js.map +1 -1
  440. package/dist/utilities/buildFormState.d.ts.map +1 -1
  441. package/dist/utilities/buildFormState.js +6 -2
  442. package/dist/utilities/buildFormState.js.map +1 -1
  443. package/dist/utilities/formatAbsoluteURL.d.ts +1 -1
  444. package/dist/utilities/formatAbsoluteURL.d.ts.map +1 -1
  445. package/dist/utilities/formatAbsoluteURL.js +18 -8
  446. package/dist/utilities/formatAbsoluteURL.js.map +1 -1
  447. package/dist/utilities/getHasScheduledPublish.d.ts +2 -3
  448. package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -1
  449. package/dist/utilities/getHasScheduledPublish.js +2 -5
  450. package/dist/utilities/getHasScheduledPublish.js.map +1 -1
  451. package/dist/utilities/handleAuthRedirect.d.ts.map +1 -1
  452. package/dist/utilities/handleAuthRedirect.js +4 -1
  453. package/dist/utilities/handleAuthRedirect.js.map +1 -1
  454. package/dist/utilities/handleServerFunctions.d.ts.map +1 -1
  455. package/dist/utilities/handleServerFunctions.js +4 -2
  456. package/dist/utilities/handleServerFunctions.js.map +1 -1
  457. package/dist/utilities/initReq.d.ts.map +1 -1
  458. package/dist/utilities/initReq.js +40 -5
  459. package/dist/utilities/initReq.js.map +1 -1
  460. package/dist/utilities/isAbsoluteURL.d.ts +3 -0
  461. package/dist/utilities/isAbsoluteURL.d.ts.map +1 -0
  462. package/dist/utilities/isAbsoluteURL.js +15 -0
  463. package/dist/utilities/isAbsoluteURL.js.map +1 -0
  464. package/dist/utilities/isHttpURL.d.ts +3 -0
  465. package/dist/utilities/isHttpURL.d.ts.map +1 -0
  466. package/dist/utilities/isHttpURL.js +12 -0
  467. package/dist/utilities/isHttpURL.js.map +1 -0
  468. package/dist/utilities/isPathMatchingRoute.d.ts.map +1 -1
  469. package/dist/utilities/isPathMatchingRoute.js +7 -5
  470. package/dist/utilities/isPathMatchingRoute.js.map +1 -1
  471. package/dist/utilities/isPublicAdminRoute.d.ts.map +1 -1
  472. package/dist/utilities/isPublicAdminRoute.js +9 -6
  473. package/dist/utilities/isPublicAdminRoute.js.map +1 -1
  474. package/dist/utilities/schedulePublishHandler.d.ts +8 -1
  475. package/dist/utilities/schedulePublishHandler.d.ts.map +1 -1
  476. package/dist/utilities/schedulePublishHandler.js +72 -5
  477. package/dist/utilities/schedulePublishHandler.js.map +1 -1
  478. package/dist/utilities/serverFunctionRegistry.d.ts.map +1 -1
  479. package/dist/utilities/serverFunctionRegistry.js +2 -1
  480. package/dist/utilities/serverFunctionRegistry.js.map +1 -1
  481. package/dist/utilities/slugify.d.ts.map +1 -1
  482. package/dist/utilities/slugify.js +2 -0
  483. package/dist/utilities/slugify.js.map +1 -1
  484. package/dist/views/API/index.client.d.ts.map +1 -1
  485. package/dist/views/API/index.client.js +2 -3
  486. package/dist/views/API/index.client.js.map +1 -1
  487. package/dist/views/API/index.css +1 -0
  488. package/dist/views/Account/index.d.ts +1 -1
  489. package/dist/views/Account/index.d.ts.map +1 -1
  490. package/dist/views/Account/index.js +8 -5
  491. package/dist/views/Account/index.js.map +1 -1
  492. package/dist/views/Dashboard/Default/ModularDashboard/index.css +2 -0
  493. package/dist/views/Dashboard/Default/ModularDashboard/index.d.ts.map +1 -1
  494. package/dist/views/Dashboard/Default/ModularDashboard/index.js +1 -0
  495. package/dist/views/Dashboard/Default/ModularDashboard/index.js.map +1 -1
  496. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.d.ts.map +1 -1
  497. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.js +3 -1
  498. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.js.map +1 -1
  499. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.d.ts.map +1 -1
  500. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js +2 -0
  501. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js.map +1 -1
  502. package/dist/views/Dashboard/index.d.ts.map +1 -1
  503. package/dist/views/Dashboard/index.js +2 -3
  504. package/dist/views/Dashboard/index.js.map +1 -1
  505. package/dist/views/Document/handleServerFunction.d.ts.map +1 -1
  506. package/dist/views/Document/handleServerFunction.js +2 -0
  507. package/dist/views/Document/handleServerFunction.js.map +1 -1
  508. package/dist/views/Document/index.d.ts +1 -1
  509. package/dist/views/Document/index.d.ts.map +1 -1
  510. package/dist/views/Document/index.js +10 -6
  511. package/dist/views/Document/index.js.map +1 -1
  512. package/dist/views/Document/renderDocumentSlots.d.ts +1 -0
  513. package/dist/views/Document/renderDocumentSlots.d.ts.map +1 -1
  514. package/dist/views/Document/renderDocumentSlots.js +7 -4
  515. package/dist/views/Document/renderDocumentSlots.js.map +1 -1
  516. package/dist/views/Edit/Auth/APIKey.d.ts +1 -1
  517. package/dist/views/Edit/Auth/APIKey.d.ts.map +1 -1
  518. package/dist/views/Edit/Auth/APIKey.js +233 -59
  519. package/dist/views/Edit/Auth/APIKey.js.map +1 -1
  520. package/dist/views/Edit/Auth/APIKeyGenerationModal.d.ts +12 -0
  521. package/dist/views/Edit/Auth/APIKeyGenerationModal.d.ts.map +1 -0
  522. package/dist/views/Edit/Auth/APIKeyGenerationModal.js +117 -0
  523. package/dist/views/Edit/Auth/APIKeyGenerationModal.js.map +1 -0
  524. package/dist/views/Edit/Auth/index.css +91 -0
  525. package/dist/views/Edit/Auth/index.d.ts.map +1 -1
  526. package/dist/views/Edit/Auth/index.js +10 -28
  527. package/dist/views/Edit/Auth/index.js.map +1 -1
  528. package/dist/views/Edit/Auth/types.d.ts +3 -1
  529. package/dist/views/Edit/Auth/types.d.ts.map +1 -1
  530. package/dist/views/Edit/Auth/types.js.map +1 -1
  531. package/dist/views/Edit/index.css +44 -0
  532. package/dist/views/Edit/index.d.ts.map +1 -1
  533. package/dist/views/Edit/index.js +13 -0
  534. package/dist/views/Edit/index.js.map +1 -1
  535. package/dist/views/Edit/useEditViewWidth.d.ts +8 -0
  536. package/dist/views/Edit/useEditViewWidth.d.ts.map +1 -0
  537. package/dist/views/Edit/useEditViewWidth.js +56 -0
  538. package/dist/views/Edit/useEditViewWidth.js.map +1 -0
  539. package/dist/views/ForgotPassword/ForgotPasswordForm/index.css +14 -0
  540. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
  541. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +209 -161
  542. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
  543. package/dist/views/ForgotPassword/index.d.ts.map +1 -1
  544. package/dist/views/ForgotPassword/index.js +2 -11
  545. package/dist/views/ForgotPassword/index.js.map +1 -1
  546. package/dist/views/HierarchyList/DocumentListSelection/index.d.ts.map +1 -1
  547. package/dist/views/HierarchyList/DocumentListSelection/index.js +105 -100
  548. package/dist/views/HierarchyList/DocumentListSelection/index.js.map +1 -1
  549. package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts +1 -6
  550. package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts.map +1 -1
  551. package/dist/views/HierarchyList/HierarchyListHeader/index.js +8 -10
  552. package/dist/views/HierarchyList/HierarchyListHeader/index.js.map +1 -1
  553. package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.d.ts.map +1 -1
  554. package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.js +10 -11
  555. package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.js.map +1 -1
  556. package/dist/views/HierarchyList/HierarchyTable/SlotTable.css +1 -0
  557. package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts.map +1 -1
  558. package/dist/views/HierarchyList/HierarchyTable/SlotTable.js +6 -3
  559. package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -1
  560. package/dist/views/HierarchyList/HierarchyTable/index.css +0 -51
  561. package/dist/views/HierarchyList/HierarchyTable/index.d.ts +1 -13
  562. package/dist/views/HierarchyList/HierarchyTable/index.d.ts.map +1 -1
  563. package/dist/views/HierarchyList/HierarchyTable/index.js +38 -156
  564. package/dist/views/HierarchyList/HierarchyTable/index.js.map +1 -1
  565. package/dist/views/HierarchyList/HierarchyTable/types.d.ts +0 -6
  566. package/dist/views/HierarchyList/HierarchyTable/types.d.ts.map +1 -1
  567. package/dist/views/HierarchyList/HierarchyTable/types.js.map +1 -1
  568. package/dist/views/HierarchyList/index.css +1 -0
  569. package/dist/views/HierarchyList/index.d.ts.map +1 -1
  570. package/dist/views/HierarchyList/index.js +20 -103
  571. package/dist/views/HierarchyList/index.js.map +1 -1
  572. package/dist/views/List/ListHeader/index.css +1 -0
  573. package/dist/views/List/ListHeader/index.d.ts +0 -1
  574. package/dist/views/List/ListHeader/index.d.ts.map +1 -1
  575. package/dist/views/List/ListHeader/index.js +2 -6
  576. package/dist/views/List/ListHeader/index.js.map +1 -1
  577. package/dist/views/List/ListSelection/index.d.ts.map +1 -1
  578. package/dist/views/List/ListSelection/index.js +122 -138
  579. package/dist/views/List/ListSelection/index.js.map +1 -1
  580. package/dist/views/List/handleHierarchy.d.ts +1 -6
  581. package/dist/views/List/handleHierarchy.d.ts.map +1 -1
  582. package/dist/views/List/handleHierarchy.js +3 -34
  583. package/dist/views/List/handleHierarchy.js.map +1 -1
  584. package/dist/views/List/handleServerFunction.d.ts.map +1 -1
  585. package/dist/views/List/handleServerFunction.js +3 -1
  586. package/dist/views/List/handleServerFunction.js.map +1 -1
  587. package/dist/views/List/index.client.d.ts.map +1 -1
  588. package/dist/views/List/index.client.js +6 -129
  589. package/dist/views/List/index.client.js.map +1 -1
  590. package/dist/views/List/index.css +2 -0
  591. package/dist/views/List/index.d.ts.map +1 -1
  592. package/dist/views/List/index.js +18 -28
  593. package/dist/views/List/index.js.map +1 -1
  594. package/dist/views/NotFound/client.d.ts +2 -0
  595. package/dist/views/NotFound/client.d.ts.map +1 -0
  596. package/dist/views/NotFound/client.js +4 -0
  597. package/dist/views/NotFound/client.js.map +1 -0
  598. package/dist/views/NotFound/page.d.ts.map +1 -1
  599. package/dist/views/NotFound/page.js +4 -3
  600. package/dist/views/NotFound/page.js.map +1 -1
  601. package/dist/views/Root/getRouteData.d.ts.map +1 -1
  602. package/dist/views/Root/getRouteData.js +2 -8
  603. package/dist/views/Root/getRouteData.js.map +1 -1
  604. package/dist/views/Root/index.d.ts.map +1 -1
  605. package/dist/views/Root/index.js +31 -22
  606. package/dist/views/Root/index.js.map +1 -1
  607. package/dist/views/Verify/index.d.ts +1 -1
  608. package/dist/views/Verify/index.d.ts.map +1 -1
  609. package/dist/views/Verify/index.js +4 -4
  610. package/dist/views/Verify/index.js.map +1 -1
  611. package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
  612. package/dist/views/Version/Default/SetStepNav.js +10 -13
  613. package/dist/views/Version/Default/SetStepNav.js.map +1 -1
  614. package/dist/views/Version/Default/index.css +2 -0
  615. package/dist/views/Version/Default/index.d.ts.map +1 -1
  616. package/dist/views/Version/Default/index.js +12 -13
  617. package/dist/views/Version/Default/index.js.map +1 -1
  618. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts +1 -0
  619. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts.map +1 -1
  620. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +56 -50
  621. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
  622. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -1
  623. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +41 -27
  624. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
  625. package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.css +8 -0
  626. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
  627. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +10 -0
  628. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
  629. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.css +1 -0
  630. package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.css +1 -0
  631. package/dist/views/Version/RenderFieldsToDiff/index.css +2 -0
  632. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts.map +1 -1
  633. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +33 -1
  634. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
  635. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts +8 -2
  636. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts.map +1 -1
  637. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +17 -19
  638. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
  639. package/dist/views/Version/Restore/index.d.ts.map +1 -1
  640. package/dist/views/Version/Restore/index.js +9 -6
  641. package/dist/views/Version/Restore/index.js.map +1 -1
  642. package/dist/views/Versions/VersionPillLabel/VersionPillLabel.d.ts.map +1 -1
  643. package/dist/views/Versions/VersionPillLabel/VersionPillLabel.js +2 -3
  644. package/dist/views/Versions/VersionPillLabel/VersionPillLabel.js.map +1 -1
  645. package/dist/views/Versions/VersionPillLabel/index.css +1 -0
  646. package/dist/views/Versions/index.css +1 -0
  647. package/dist/widgets/CollectionCards/index.client.js +1 -1
  648. package/dist/widgets/CollectionCards/index.client.js.map +1 -1
  649. package/dist/widgets/CollectionCards/index.css +43 -33
  650. package/dist/widgets/CollectionCards/index.js +1 -1
  651. package/dist/widgets/CollectionCards/index.js.map +1 -1
  652. package/dist/widgets/RecentlyViewed/DocumentActivity/index.css +193 -0
  653. package/dist/widgets/RecentlyViewed/DocumentActivity/index.d.ts +5 -0
  654. package/dist/widgets/RecentlyViewed/DocumentActivity/index.d.ts.map +1 -0
  655. package/dist/widgets/RecentlyViewed/DocumentActivity/index.js +225 -0
  656. package/dist/widgets/RecentlyViewed/DocumentActivity/index.js.map +1 -0
  657. package/dist/widgets/RecentlyViewed/DocumentItem/index.css +181 -0
  658. package/dist/widgets/RecentlyViewed/DocumentItem/index.d.ts +11 -0
  659. package/dist/widgets/RecentlyViewed/DocumentItem/index.d.ts.map +1 -0
  660. package/dist/widgets/RecentlyViewed/DocumentItem/index.js +104 -0
  661. package/dist/widgets/RecentlyViewed/DocumentItem/index.js.map +1 -0
  662. package/dist/widgets/RecentlyViewed/getDocumentThumbnail.d.ts +10 -0
  663. package/dist/widgets/RecentlyViewed/getDocumentThumbnail.d.ts.map +1 -0
  664. package/dist/widgets/RecentlyViewed/getDocumentThumbnail.js +85 -0
  665. package/dist/widgets/RecentlyViewed/getDocumentThumbnail.js.map +1 -0
  666. package/dist/widgets/RecentlyViewed/getDocumentWidgetData.d.ts +7 -0
  667. package/dist/widgets/RecentlyViewed/getDocumentWidgetData.d.ts.map +1 -0
  668. package/dist/widgets/RecentlyViewed/getDocumentWidgetData.js +206 -0
  669. package/dist/widgets/RecentlyViewed/getDocumentWidgetData.js.map +1 -0
  670. package/dist/widgets/RecentlyViewed/index.d.ts +3 -5
  671. package/dist/widgets/RecentlyViewed/index.d.ts.map +1 -1
  672. package/dist/widgets/RecentlyViewed/index.js +10 -140
  673. package/dist/widgets/RecentlyViewed/index.js.map +1 -1
  674. package/dist/widgets/RecentlyViewed/shared.d.ts +38 -0
  675. package/dist/widgets/RecentlyViewed/shared.d.ts.map +1 -0
  676. package/dist/widgets/RecentlyViewed/shared.js +70 -0
  677. package/dist/widgets/RecentlyViewed/shared.js.map +1 -0
  678. package/dist/widgets/UploadDropzone/index.client.d.ts +7 -0
  679. package/dist/widgets/UploadDropzone/index.client.d.ts.map +1 -0
  680. package/dist/widgets/UploadDropzone/index.client.js +134 -0
  681. package/dist/widgets/UploadDropzone/index.client.js.map +1 -0
  682. package/dist/widgets/UploadDropzone/index.css +50 -0
  683. package/dist/widgets/UploadDropzone/index.d.ts +8 -0
  684. package/dist/widgets/UploadDropzone/index.d.ts.map +1 -0
  685. package/dist/widgets/UploadDropzone/index.js +29 -0
  686. package/dist/widgets/UploadDropzone/index.js.map +1 -0
  687. package/dist/widgets/Welcome/index.css +13 -0
  688. package/dist/widgets/Welcome/index.d.ts +5 -0
  689. package/dist/widgets/Welcome/index.d.ts.map +1 -0
  690. package/dist/widgets/Welcome/index.js +26 -0
  691. package/dist/widgets/Welcome/index.js.map +1 -0
  692. package/dist/widgets/WidgetIcon/assets/images.svg +3 -0
  693. package/dist/widgets/WidgetIcon/assets/pin-solid.svg +3 -0
  694. package/dist/widgets/WidgetIcon/assets/pin.svg +3 -0
  695. package/dist/widgets/WidgetIcon/assets/table.svg +3 -0
  696. package/dist/widgets/WidgetIcon/index.css +23 -0
  697. package/dist/widgets/WidgetIcon/index.d.ts +6 -0
  698. package/dist/widgets/WidgetIcon/index.d.ts.map +1 -0
  699. package/dist/widgets/WidgetIcon/index.js +10 -0
  700. package/dist/widgets/WidgetIcon/index.js.map +1 -0
  701. package/package.json +11 -5
  702. package/dist/elements/ClipboardAction/clipboardUtilities.spec.js +0 -120
  703. package/dist/elements/ClipboardAction/clipboardUtilities.spec.js.map +0 -1
  704. package/dist/elements/ClipboardAction/isClipboardDataValid.spec.js +0 -144
  705. package/dist/elements/ClipboardAction/isClipboardDataValid.spec.js.map +0 -1
  706. package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.spec.js +0 -885
  707. package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.spec.js.map +0 -1
  708. package/dist/elements/ColumnSelection/matchesColumnSearch.spec.js +0 -87
  709. package/dist/elements/ColumnSelection/matchesColumnSearch.spec.js.map +0 -1
  710. package/dist/elements/CommandPalette/buildActions.spec.js +0 -158
  711. package/dist/elements/CommandPalette/buildActions.spec.js.map +0 -1
  712. package/dist/elements/CommandPalette/highlightLabel.spec.js +0 -78
  713. package/dist/elements/CommandPalette/highlightLabel.spec.js.map +0 -1
  714. package/dist/elements/FieldSelect/reduceFieldOptions.spec.js +0 -143
  715. package/dist/elements/FieldSelect/reduceFieldOptions.spec.js.map +0 -1
  716. package/dist/elements/Hierarchy/CreateNewButton/index.css +0 -9
  717. package/dist/elements/Hierarchy/CreateNewButton/index.d.ts +0 -9
  718. package/dist/elements/Hierarchy/CreateNewButton/index.d.ts.map +0 -1
  719. package/dist/elements/Hierarchy/CreateNewButton/index.js +0 -111
  720. package/dist/elements/Hierarchy/CreateNewButton/index.js.map +0 -1
  721. package/dist/elements/Hierarchy/Modal/Footer/index.css +0 -45
  722. package/dist/elements/Hierarchy/Modal/Footer/index.d.ts +0 -28
  723. package/dist/elements/Hierarchy/Modal/Footer/index.d.ts.map +0 -1
  724. package/dist/elements/Hierarchy/Modal/Footer/index.js +0 -166
  725. package/dist/elements/Hierarchy/Modal/Footer/index.js.map +0 -1
  726. package/dist/elements/Hierarchy/getFolderHierarchySlug.d.ts +0 -22
  727. package/dist/elements/Hierarchy/getFolderHierarchySlug.d.ts.map +0 -1
  728. package/dist/elements/Hierarchy/getFolderHierarchySlug.js +0 -17
  729. package/dist/elements/Hierarchy/getFolderHierarchySlug.js.map +0 -1
  730. package/dist/elements/Hierarchy/move/moveDocuments.d.ts +0 -34
  731. package/dist/elements/Hierarchy/move/moveDocuments.d.ts.map +0 -1
  732. package/dist/elements/Hierarchy/move/moveDocuments.js +0 -94
  733. package/dist/elements/Hierarchy/move/moveDocuments.js.map +0 -1
  734. package/dist/elements/SegmentedControl/index.css +0 -58
  735. package/dist/elements/SegmentedControl/index.d.ts +0 -19
  736. package/dist/elements/SegmentedControl/index.d.ts.map +0 -1
  737. package/dist/elements/SegmentedControl/index.js +0 -104
  738. package/dist/elements/SegmentedControl/index.js.map +0 -1
  739. package/dist/elements/StepNav/DropTarget/index.css +0 -20
  740. package/dist/elements/StepNav/DropTarget/index.d.ts +0 -16
  741. package/dist/elements/StepNav/DropTarget/index.d.ts.map +0 -1
  742. package/dist/elements/StepNav/DropTarget/index.js +0 -71
  743. package/dist/elements/StepNav/DropTarget/index.js.map +0 -1
  744. package/dist/elements/Toasts/fieldErrors.spec.js +0 -46
  745. package/dist/elements/Toasts/fieldErrors.spec.js.map +0 -1
  746. package/dist/elements/UserMenu/HoverSubmenuGroup.d.ts +0 -18
  747. package/dist/elements/UserMenu/HoverSubmenuGroup.d.ts.map +0 -1
  748. package/dist/elements/UserMenu/HoverSubmenuGroup.js +0 -38
  749. package/dist/elements/UserMenu/HoverSubmenuGroup.js.map +0 -1
  750. package/dist/elements/UserMenu/useHoverSubmenu.d.ts +0 -21
  751. package/dist/elements/UserMenu/useHoverSubmenu.d.ts.map +0 -1
  752. package/dist/elements/UserMenu/useHoverSubmenu.js +0 -260
  753. package/dist/elements/UserMenu/useHoverSubmenu.js.map +0 -1
  754. package/dist/elements/ViewModeToggle/index.d.ts +0 -8
  755. package/dist/elements/ViewModeToggle/index.d.ts.map +0 -1
  756. package/dist/elements/ViewModeToggle/index.js +0 -29
  757. package/dist/elements/ViewModeToggle/index.js.map +0 -1
  758. package/dist/elements/WhereBuilder/Condition/Relationship/optionsReducer.spec.js +0 -152
  759. package/dist/elements/WhereBuilder/Condition/Relationship/optionsReducer.spec.js.map +0 -1
  760. package/dist/elements/WhereBuilder/conditionValue.spec.js +0 -65
  761. package/dist/elements/WhereBuilder/conditionValue.spec.js.map +0 -1
  762. package/dist/fields/Upload/Input.spec.js +0 -241
  763. package/dist/fields/Upload/Input.spec.js.map +0 -1
  764. package/dist/forms/fieldSchemasToFormState/fieldSchemasToFormState.spec.d.ts +0 -2
  765. package/dist/forms/fieldSchemasToFormState/fieldSchemasToFormState.spec.d.ts.map +0 -1
  766. package/dist/forms/fieldSchemasToFormState/fieldSchemasToFormState.spec.js +0 -67
  767. package/dist/forms/fieldSchemasToFormState/fieldSchemasToFormState.spec.js.map +0 -1
  768. package/dist/icons/CollapseLayers/index.d.ts +0 -7
  769. package/dist/icons/CollapseLayers/index.d.ts.map +0 -1
  770. package/dist/icons/CollapseLayers/index.js +0 -23
  771. package/dist/icons/CollapseLayers/index.js.map +0 -1
  772. package/dist/icons/Table/index.css +0 -5
  773. package/dist/icons/Table/index.d.ts +0 -7
  774. package/dist/icons/Table/index.d.ts.map +0 -1
  775. package/dist/icons/Table/index.js +0 -25
  776. package/dist/icons/Table/index.js.map +0 -1
  777. package/dist/layouts/Root/index.spec.js +0 -20
  778. package/dist/layouts/Root/index.spec.js.map +0 -1
  779. package/dist/providers/Auth/authSessionRequests.spec.js +0 -121
  780. package/dist/providers/Auth/authSessionRequests.spec.js.map +0 -1
  781. package/dist/providers/Auth/sessionActivity.spec.js +0 -44
  782. package/dist/providers/Auth/sessionActivity.spec.js.map +0 -1
  783. package/dist/providers/Auth/tabSessionSync/index.spec.js +0 -463
  784. package/dist/providers/Auth/tabSessionSync/index.spec.js.map +0 -1
  785. package/dist/providers/Auth/useAuthSessionTimers.spec.js +0 -311
  786. package/dist/providers/Auth/useAuthSessionTimers.spec.js.map +0 -1
  787. package/dist/providers/HierarchyDnd/index.css +0 -51
  788. package/dist/providers/HierarchyDnd/index.d.ts +0 -21
  789. package/dist/providers/HierarchyDnd/index.d.ts.map +0 -1
  790. package/dist/providers/HierarchyDnd/index.js +0 -163
  791. package/dist/providers/HierarchyDnd/index.js.map +0 -1
  792. package/dist/providers/HierarchyDnd/types.d.ts +0 -56
  793. package/dist/providers/HierarchyDnd/types.d.ts.map +0 -1
  794. package/dist/providers/HierarchyDnd/types.js +0 -21
  795. package/dist/providers/HierarchyDnd/types.js.map +0 -1
  796. package/dist/providers/RouteTransition/ProgressBar/index.spec.js +0 -44
  797. package/dist/providers/RouteTransition/ProgressBar/index.spec.js.map +0 -1
  798. package/dist/providers/TableColumns/buildColumnState/index.spec.js +0 -40
  799. package/dist/providers/TableColumns/buildColumnState/index.spec.js.map +0 -1
  800. package/dist/utilities/appendCacheTag.spec.js +0 -34
  801. package/dist/utilities/appendCacheTag.spec.js.map +0 -1
  802. package/dist/utilities/formatMetadata.spec.js +0 -83
  803. package/dist/utilities/formatMetadata.spec.js.map +0 -1
  804. package/dist/utilities/fuzzyMatch.spec.js +0 -38
  805. package/dist/utilities/fuzzyMatch.spec.js.map +0 -1
  806. package/dist/utilities/isCustomAdminView.spec.js +0 -90
  807. package/dist/utilities/isCustomAdminView.spec.js.map +0 -1
  808. package/dist/utilities/isPathMatchingRoute.spec.js +0 -178
  809. package/dist/utilities/isPathMatchingRoute.spec.js.map +0 -1
  810. package/dist/utilities/normalizeRelationshipValue.spec.js +0 -373
  811. package/dist/utilities/normalizeRelationshipValue.spec.js.map +0 -1
  812. package/dist/utilities/recentlyViewed.spec.js +0 -92
  813. package/dist/utilities/recentlyViewed.spec.js.map +0 -1
  814. package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.css +0 -216
  815. package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.d.ts +0 -20
  816. package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.d.ts.map +0 -1
  817. package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.js +0 -182
  818. package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.js.map +0 -1
  819. package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.css +0 -38
  820. package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.d.ts +0 -15
  821. package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.d.ts.map +0 -1
  822. package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.js +0 -85
  823. package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.js.map +0 -1
  824. package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.css +0 -98
  825. package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.d.ts +0 -27
  826. package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.d.ts.map +0 -1
  827. package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.js +0 -84
  828. package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.js.map +0 -1
  829. package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.d.ts +0 -19
  830. package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.d.ts.map +0 -1
  831. package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.js +0 -100
  832. package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.js.map +0 -1
  833. package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.d.ts +0 -53
  834. package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.d.ts.map +0 -1
  835. package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.js +0 -145
  836. package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.js.map +0 -1
  837. package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.d.ts +0 -8
  838. package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.d.ts.map +0 -1
  839. package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.js +0 -21
  840. package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.js.map +0 -1
  841. package/dist/views/HierarchyList/HierarchyCards/index.css +0 -115
  842. package/dist/views/HierarchyList/HierarchyCards/index.d.ts +0 -80
  843. package/dist/views/HierarchyList/HierarchyCards/index.d.ts.map +0 -1
  844. package/dist/views/HierarchyList/HierarchyCards/index.js +0 -457
  845. package/dist/views/HierarchyList/HierarchyCards/index.js.map +0 -1
  846. package/dist/views/Root/getCustomCollectionViewByRoute.spec.js +0 -168
  847. package/dist/views/Root/getCustomCollectionViewByRoute.spec.js.map +0 -1
  848. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +0 -861
  849. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +0 -1
  850. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +0 -47
  851. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +0 -1
  852. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +0 -135
  853. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +0 -1
  854. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.spec.js +0 -100
  855. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.spec.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { initI18n } from '@payloadcms/translations';
2
2
  import { createLocalReq, executeAuthStrategies, getAccessResults, getPayload, getRequestLanguage, parseCookies } from 'payload';
3
+ import { applyUserReadAccess } from 'payload/internal';
3
4
  import { getRequestLocale } from './getRequestLocale.js';
4
5
  import { selectiveCache } from './selectiveCache.js';
5
6
  const partialReqCache = selectiveCache('partialReq');
@@ -19,7 +20,7 @@ export const initReq = async function ({
19
20
  }) {
20
21
  const headers = await serverAdapter.getHeaders();
21
22
  const cookies = parseCookies(headers);
22
- const partialResult = await partialReqCache.get(async () => {
23
+ const getPartialResult = async () => {
23
24
  const config = await configPromise;
24
25
  const payload = await getPayload({
25
26
  config,
@@ -51,8 +52,9 @@ export const initReq = async function ({
51
52
  responseHeaders,
52
53
  user
53
54
  };
54
- }, 'global');
55
- return reqCache.get(async () => {
55
+ };
56
+ const partialResult = await partialReqCache.get(getPartialResult, 'global');
57
+ const getResult = async () => {
56
58
  const {
57
59
  i18n,
58
60
  languageCode,
@@ -64,6 +66,10 @@ export const initReq = async function ({
64
66
  req: reqOverrides,
65
67
  ...optionsOverrides
66
68
  } = overrides || {};
69
+ const hasOptionsUserOverride = Object.hasOwn(optionsOverrides, 'user');
70
+ const hasReqUserOverride = Object.hasOwn(reqOverrides ?? {}, 'user');
71
+ const hasUserOverride = hasOptionsUserOverride || hasReqUserOverride;
72
+ const userOverride = hasOptionsUserOverride ? optionsOverrides.user : reqOverrides?.user;
67
73
  const req = await createLocalReq({
68
74
  req: {
69
75
  headers,
@@ -76,10 +82,37 @@ export const initReq = async function ({
76
82
  },
77
83
  ...(optionsOverrides || {})
78
84
  }, payload);
85
+ if (hasUserOverride && userOverride == null) {
86
+ req.user = null;
87
+ }
88
+ let userWithReadAccess = req.user;
79
89
  const locale = await getRequestLocale({
80
90
  req
81
91
  });
82
92
  req.locale = locale?.code;
93
+ if (!hasUserOverride && req.user) {
94
+ try {
95
+ const collectionSlug = req.user.collection ?? payload.config.admin.user;
96
+ const collection = payload.collections[collectionSlug]?.config;
97
+ if (!collection?.auth) {
98
+ throw new Error('Authenticated user collection not found');
99
+ }
100
+ userWithReadAccess = await applyUserReadAccess({
101
+ collection,
102
+ depth: collection.auth.depth,
103
+ overrideAccess: false,
104
+ req,
105
+ showHiddenFields: false,
106
+ user: req.user
107
+ });
108
+ } catch (error) {
109
+ payload.logger.error({
110
+ err: error
111
+ });
112
+ req.user = null;
113
+ userWithReadAccess = null;
114
+ }
115
+ }
83
116
  const permissions = await getAccessResults({
84
117
  req
85
118
  });
@@ -89,9 +122,11 @@ export const initReq = async function ({
89
122
  languageCode,
90
123
  locale,
91
124
  permissions,
92
- req
125
+ req,
126
+ user: userWithReadAccess
93
127
  };
94
- }, key).then(result => {
128
+ };
129
+ return reqCache.get(getResult, key, overrides).then(result => {
95
130
  // Shallow-copy req before returning to prevent
96
131
  // mutations from propagating to the cached req object.
97
132
  // This ensures parallel operations using the same cache key don't affect each other.
@@ -1 +1 @@
1
- {"version":3,"file":"initReq.js","names":["initI18n","createLocalReq","executeAuthStrategies","getAccessResults","getPayload","getRequestLanguage","parseCookies","getRequestLocale","selectiveCache","partialReqCache","reqCache","initReq","canSetHeaders","configPromise","importMap","key","overrides","serverAdapter","headers","getHeaders","cookies","partialResult","get","config","payload","cron","languageCode","i18n","context","language","responseHeaders","user","req","reqOverrides","optionsOverrides","host","server","locale","code","permissions","then","result"],"sources":["../../src/utilities/initReq.ts"],"sourcesContent":["import type { I18n, I18nClient } from '@payloadcms/translations'\nimport type {\n ImportMap,\n InitReqResult,\n PayloadRequest,\n SanitizedConfig,\n ServerAdapter,\n} from 'payload'\n\nimport { initI18n } from '@payloadcms/translations'\nimport {\n createLocalReq,\n executeAuthStrategies,\n getAccessResults,\n getPayload,\n getRequestLanguage,\n parseCookies,\n} from 'payload'\n\nimport { getRequestLocale } from './getRequestLocale.js'\nimport { selectiveCache } from './selectiveCache.js'\n\ntype PartialResult = {\n i18n: I18nClient\n} & Pick<InitReqResult, 'languageCode'> &\n Pick<PayloadRequest, 'payload' | 'responseHeaders' | 'user'>\n\nconst partialReqCache = selectiveCache<PartialResult>('partialReq')\nconst reqCache = selectiveCache<InitReqResult>('req')\n\n/**\n * Initializes a full request object, including the `req` object and access control.\n * Reads headers/cookies through the supplied `serverAdapter` so the function is\n * framework-agnostic; the consuming framework wires its own adapter.\n */\nexport const initReq = async function ({\n canSetHeaders,\n configPromise,\n importMap,\n key,\n overrides,\n serverAdapter,\n}: {\n canSetHeaders?: boolean\n configPromise: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n key: string\n overrides?: Parameters<typeof createLocalReq>[0]\n serverAdapter: ServerAdapter\n}): Promise<InitReqResult> {\n const headers = await serverAdapter.getHeaders()\n const cookies = parseCookies(headers)\n\n const partialResult = await partialReqCache.get(async () => {\n const config = await configPromise\n const payload = await getPayload({ config, cron: true, importMap })\n const languageCode = getRequestLanguage({\n config,\n cookies,\n headers,\n })\n\n const i18n: I18nClient = await initI18n({\n config: config.i18n,\n context: 'client',\n language: languageCode,\n })\n\n const { responseHeaders, user } = await executeAuthStrategies({\n canSetHeaders,\n headers,\n payload,\n })\n\n return {\n i18n,\n languageCode,\n payload,\n responseHeaders,\n user,\n }\n }, 'global')\n\n return reqCache\n .get(async () => {\n const { i18n, languageCode, payload, responseHeaders, user } = partialResult\n\n const { req: reqOverrides, ...optionsOverrides } = overrides || {}\n\n const req = await createLocalReq(\n {\n req: {\n headers,\n host: headers.get('host'),\n i18n: i18n as I18n,\n responseHeaders,\n server: serverAdapter,\n user,\n ...(reqOverrides || {}),\n },\n ...(optionsOverrides || {}),\n },\n payload,\n )\n\n const locale = await getRequestLocale({\n req,\n })\n\n req.locale = locale?.code\n\n const permissions = await getAccessResults({\n req,\n })\n\n return {\n cookies,\n headers,\n languageCode,\n locale,\n permissions,\n req,\n }\n }, key)\n .then((result) => {\n // Shallow-copy req before returning to prevent\n // mutations from propagating to the cached req object.\n // This ensures parallel operations using the same cache key don't affect each other.\n return {\n ...result,\n req: {\n ...result.req,\n ...(result.req?.context\n ? {\n context: { ...result.req.context },\n }\n : {}),\n },\n }\n })\n}\n"],"mappings":"AASA,SAASA,QAAQ,QAAQ;AACzB,SACEC,cAAc,EACdC,qBAAqB,EACrBC,gBAAgB,EAChBC,UAAU,EACVC,kBAAkB,EAClBC,YAAY,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,cAAA,CAChB;MACE+B,GAAA,EAAK;QACHd,OAAA;QACAiB,IAAA,EAAMjB,OAAA,CAAQI,GAAG,CAAC;QAClBK,IAAA,EAAMA,IAAA;QACNG,eAAA;QACAM,MAAA,EAAQnB,aAAA;QACRc,IAAA;QACA,IAAIE,YAAA,IAAgB,CAAC,CAAC;MACxB;MACA,IAAIC,gBAAA,IAAoB,CAAC,CAAC;IAC5B,GACAV,OAAA;IAGF,MAAMa,MAAA,GAAS,MAAM9B,gBAAA,CAAiB;MACpCyB;IACF;IAEAA,GAAA,CAAIK,MAAM,GAAGA,MAAA,EAAQC,IAAA;IAErB,MAAMC,WAAA,GAAc,MAAMpC,gBAAA,CAAiB;MACzC6B;IACF;IAEA,OAAO;MACLZ,OAAA;MACAF,OAAA;MACAQ,YAAA;MACAW,MAAA;MACAE,WAAA;MACAP;IACF;EACF,GAAGjB,GAAA,EACFyB,IAAI,CAAEC,MAAA;IACL;IACA;IACA;IACA,OAAO;MACL,GAAGA,MAAM;MACTT,GAAA,EAAK;QACH,GAAGS,MAAA,CAAOT,GAAG;QACb,IAAIS,MAAA,CAAOT,GAAG,EAAEJ,OAAA,GACZ;UACEA,OAAA,EAAS;YAAE,GAAGa,MAAA,CAAOT,GAAG,CAACJ;UAAQ;QACnC,IACA,CAAC,CAAC;MACR;IACF;EACF;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"initReq.js","names":["initI18n","createLocalReq","executeAuthStrategies","getAccessResults","getPayload","getRequestLanguage","parseCookies","applyUserReadAccess","getRequestLocale","selectiveCache","partialReqCache","reqCache","initReq","canSetHeaders","configPromise","importMap","key","overrides","serverAdapter","headers","getHeaders","cookies","getPartialResult","config","payload","cron","languageCode","i18n","context","language","responseHeaders","user","partialResult","get","getResult","req","reqOverrides","optionsOverrides","hasOptionsUserOverride","Object","hasOwn","hasReqUserOverride","hasUserOverride","userOverride","host","server","userWithReadAccess","locale","code","collectionSlug","collection","admin","collections","auth","Error","depth","overrideAccess","showHiddenFields","error","logger","err","permissions","then","result"],"sources":["../../src/utilities/initReq.ts"],"sourcesContent":["import type { I18n, I18nClient } from '@payloadcms/translations'\nimport type {\n ImportMap,\n InitReqResult,\n PayloadRequest,\n SanitizedConfig,\n ServerAdapter,\n} from 'payload'\n\nimport { initI18n } from '@payloadcms/translations'\nimport {\n createLocalReq,\n executeAuthStrategies,\n getAccessResults,\n getPayload,\n getRequestLanguage,\n parseCookies,\n} from 'payload'\nimport { applyUserReadAccess } from 'payload/internal'\n\nimport { getRequestLocale } from './getRequestLocale.js'\nimport { selectiveCache } from './selectiveCache.js'\n\ntype PartialResult = {\n i18n: I18nClient\n} & Pick<InitReqResult, 'languageCode'> &\n Pick<PayloadRequest, 'payload' | 'responseHeaders' | 'user'>\n\nconst partialReqCache = selectiveCache<PartialResult>('partialReq')\nconst reqCache = selectiveCache<InitReqResult>('req')\n\n/**\n * Initializes a full request object, including the `req` object and access control.\n * Reads headers/cookies through the supplied `serverAdapter` so the function is\n * framework-agnostic; the consuming framework wires its own adapter.\n */\nexport const initReq = async function ({\n canSetHeaders,\n configPromise,\n importMap,\n key,\n overrides,\n serverAdapter,\n}: {\n canSetHeaders?: boolean\n configPromise: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n key: string\n overrides?: Parameters<typeof createLocalReq>[0]\n serverAdapter: ServerAdapter\n}): Promise<InitReqResult> {\n const headers = await serverAdapter.getHeaders()\n const cookies = parseCookies(headers)\n\n const getPartialResult = async () => {\n const config = await configPromise\n const payload = await getPayload({ config, cron: true, importMap })\n const languageCode = getRequestLanguage({\n config,\n cookies,\n headers,\n })\n\n const i18n: I18nClient = await initI18n({\n config: config.i18n,\n context: 'client',\n language: languageCode,\n })\n\n const { responseHeaders, user } = await executeAuthStrategies({\n canSetHeaders,\n headers,\n payload,\n })\n\n return {\n i18n,\n languageCode,\n payload,\n responseHeaders,\n user,\n }\n }\n\n const partialResult = await partialReqCache.get(getPartialResult, 'global')\n\n const getResult = async () => {\n const { i18n, languageCode, payload, responseHeaders, user } = partialResult\n\n const { req: reqOverrides, ...optionsOverrides } = overrides || {}\n const hasOptionsUserOverride = Object.hasOwn(optionsOverrides, 'user')\n const hasReqUserOverride = Object.hasOwn(reqOverrides ?? {}, 'user')\n const hasUserOverride = hasOptionsUserOverride || hasReqUserOverride\n const userOverride = hasOptionsUserOverride ? optionsOverrides.user : reqOverrides?.user\n\n const req = await createLocalReq(\n {\n req: {\n headers,\n host: headers.get('host'),\n i18n: i18n as I18n,\n responseHeaders,\n server: serverAdapter,\n user,\n ...(reqOverrides || {}),\n },\n ...(optionsOverrides || {}),\n },\n payload,\n )\n\n if (hasUserOverride && userOverride == null) {\n req.user = null\n }\n\n let userWithReadAccess = req.user\n\n const locale = await getRequestLocale({ req })\n req.locale = locale?.code\n\n if (!hasUserOverride && req.user) {\n try {\n const collectionSlug = req.user.collection ?? payload.config.admin.user\n const collection = payload.collections[collectionSlug]?.config\n\n if (!collection?.auth) {\n throw new Error('Authenticated user collection not found')\n }\n\n userWithReadAccess = await applyUserReadAccess({\n collection,\n depth: collection.auth.depth,\n overrideAccess: false,\n req,\n showHiddenFields: false,\n user: req.user,\n })\n } catch (error) {\n payload.logger.error({ err: error })\n req.user = null\n userWithReadAccess = null\n }\n }\n\n const permissions = await getAccessResults({ req })\n\n return {\n cookies,\n headers,\n languageCode,\n locale,\n permissions,\n req,\n user: userWithReadAccess,\n }\n }\n\n return reqCache.get(getResult, key, overrides).then((result) => {\n // Shallow-copy req before returning to prevent\n // mutations from propagating to the cached req object.\n // This ensures parallel operations using the same cache key don't affect each other.\n return {\n ...result,\n req: {\n ...result.req,\n ...(result.req?.context\n ? {\n context: { ...result.req.context },\n }\n : {}),\n },\n }\n })\n}\n"],"mappings":"AASA,SAASA,QAAQ,QAAQ;AACzB,SACEC,cAAc,EACdC,qBAAqB,EACrBC,gBAAgB,EAChBC,UAAU,EACVC,kBAAkB,EAClBC,YAAY,QACP;AACP,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,gBA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vC,mBAAA,CAAoB;UAC7C2C,UAAA;UACAK,KAAA,EAAOL,UAAA,CAAWG,IAAI,CAACE,KAAK;UAC5BC,cAAA,EAAgB;UAChBrB,GAAA;UACAsB,gBAAA,EAAkB;UAClB1B,IAAA,EAAMI,GAAA,CAAIJ;QACZ;MACF,EAAE,OAAO2B,KAAA,EAAO;QACdlC,OAAA,CAAQmC,MAAM,CAACD,KAAK,CAAC;UAAEE,GAAA,EAAKF;QAAM;QAClCvB,GAAA,CAAIJ,IAAI,GAAG;QACXe,kBAAA,GAAqB;MACvB;IACF;IAEA,MAAMe,WAAA,GAAc,MAAM1D,gBAAA,CAAiB;MAAEgC;IAAI;IAEjD,OAAO;MACLd,OAAA;MACAF,OAAA;MACAO,YAAA;MACAqB,MAAA;MACAc,WAAA;MACA1B,GAAA;MACAJ,IAAA,EAAMe;IACR;EACF;EAEA,OAAOnC,QAAA,CAASsB,GAAG,CAACC,SAAA,EAAWlB,GAAA,EAAKC,SAAA,EAAW6C,IAAI,CAAEC,MAAA;IACnD;IACA;IACA;IACA,OAAO;MACL,GAAGA,MAAM;MACT5B,GAAA,EAAK;QACH,GAAG4B,MAAA,CAAO5B,GAAG;QACb,IAAI4B,MAAA,CAAO5B,GAAG,EAAEP,OAAA,GACZ;UACEA,OAAA,EAAS;YAAE,GAAGmC,MAAA,CAAO5B,GAAG,CAACP;UAAQ;QACnC,IACA,CAAC,CAAC;MACR;IACF;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ /** Checks whether a URL is absolute or relative. */
2
+ export declare const isAbsoluteURL: (incomingURL?: string | URL) => boolean;
3
+ //# sourceMappingURL=isAbsoluteURL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isAbsoluteURL.d.ts","sourceRoot":"","sources":["../../src/utilities/isAbsoluteURL.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,eAAO,MAAM,aAAa,iBAAkB,MAAM,GAAG,GAAG,KAAG,OAe1D,CAAA"}
@@ -0,0 +1,15 @@
1
+ /** Checks whether a URL is absolute or relative. */export const isAbsoluteURL = incomingURL => {
2
+ if (!incomingURL) {
3
+ return false;
4
+ }
5
+ if (incomingURL instanceof URL) {
6
+ return true;
7
+ }
8
+ try {
9
+ new URL(incomingURL);
10
+ return true;
11
+ } catch {
12
+ return false;
13
+ }
14
+ };
15
+ //# sourceMappingURL=isAbsoluteURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isAbsoluteURL.js","names":["isAbsoluteURL","incomingURL","URL"],"sources":["../../src/utilities/isAbsoluteURL.ts"],"sourcesContent":["/** Checks whether a URL is absolute or relative. */\nexport const isAbsoluteURL = (incomingURL?: string | URL): boolean => {\n if (!incomingURL) {\n return false\n }\n\n if (incomingURL instanceof URL) {\n return true\n }\n\n try {\n new URL(incomingURL)\n return true\n } catch {\n return false\n }\n}\n"],"mappings":"AAAA,oDACA,OAAO,MAAMA,aAAA,GAAiBC,WAAA;EAC5B,IAAI,CAACA,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAIA,WAAA,YAAuBC,GAAA,EAAK;IAC9B,OAAO;EACT;EAEA,IAAI;IACF,IAAIA,GAAA,CAAID,WAAA;IACR,OAAO;EACT,EAAE,MAAM;IACN,OAAO;EACT;AACF","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ /** Allows only HTTP(S) URLs, e.g. `http://` or `https://`. */
2
+ export declare const isHttpURL: (incomingURL?: string | URL) => boolean;
3
+ //# sourceMappingURL=isHttpURL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHttpURL.d.ts","sourceRoot":"","sources":["../../src/utilities/isHttpURL.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,eAAO,MAAM,SAAS,iBAAkB,MAAM,GAAG,GAAG,KAAG,OAatD,CAAA"}
@@ -0,0 +1,12 @@
1
+ /** Allows only HTTP(S) URLs, e.g. `http://` or `https://`. */export const isHttpURL = incomingURL => {
2
+ if (!incomingURL) {
3
+ return false;
4
+ }
5
+ try {
6
+ const url = typeof incomingURL === 'string' ? new URL(incomingURL, window.location.origin) : incomingURL;
7
+ return url.protocol === 'http:' || url.protocol === 'https:';
8
+ } catch {
9
+ return false;
10
+ }
11
+ };
12
+ //# sourceMappingURL=isHttpURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHttpURL.js","names":["isHttpURL","incomingURL","url","URL","window","location","origin","protocol"],"sources":["../../src/utilities/isHttpURL.ts"],"sourcesContent":["/** Allows only HTTP(S) URLs, e.g. `http://` or `https://`. */\nexport const isHttpURL = (incomingURL?: string | URL): boolean => {\n if (!incomingURL) {\n return false\n }\n\n try {\n const url =\n typeof incomingURL === 'string' ? new URL(incomingURL, window.location.origin) : incomingURL\n\n return url.protocol === 'http:' || url.protocol === 'https:'\n } catch {\n return false\n }\n}\n"],"mappings":"AAAA,8DACA,OAAO,MAAMA,SAAA,GAAaC,WAAA;EACxB,IAAI,CAACA,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAI;IACF,MAAMC,GAAA,GACJ,OAAOD,WAAA,KAAgB,WAAW,IAAIE,GAAA,CAAIF,WAAA,EAAaG,MAAA,CAAOC,QAAQ,CAACC,MAAM,IAAIL,WAAA;IAEnF,OAAOC,GAAA,CAAIK,QAAQ,KAAK,WAAWL,GAAA,CAAIK,QAAQ,KAAK;EACtD,EAAE,MAAM;IACN,OAAO;EACT;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"isPathMatchingRoute.d.ts","sourceRoot":"","sources":["../../src/utilities/isPathMatchingRoute.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,gEAM7B;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,YA4BA,CAAA"}
1
+ {"version":3,"file":"isPathMatchingRoute.d.ts","sourceRoot":"","sources":["../../src/utilities/isPathMatchingRoute.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,gEAM7B;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,YA6BA,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { pathToRegexp } from 'path-to-regexp';
2
+ import { stripTrailingSlash } from 'payload/shared';
2
3
  export const isPathMatchingRoute = ({
3
4
  currentRoute,
4
5
  exact,
@@ -9,21 +10,22 @@ export const isPathMatchingRoute = ({
9
10
  if (!viewPath) {
10
11
  return false;
11
12
  }
13
+ const normalizedCurrentRoute = strict ? currentRoute : stripTrailingSlash(currentRoute);
12
14
  const keys = [];
13
15
  const regex = pathToRegexp(viewPath, keys, {
14
16
  sensitive,
15
17
  strict
16
18
  });
17
- const match = regex.exec(currentRoute);
18
- const viewRoute = match?.[0] || viewPath;
19
+ const match = regex.exec(normalizedCurrentRoute);
20
+ const viewRoute = strict ? match?.[0] || viewPath : stripTrailingSlash(match?.[0] || viewPath);
19
21
  if (exact) {
20
- return currentRoute === viewRoute;
22
+ return normalizedCurrentRoute === viewRoute;
21
23
  }
22
24
  if (!exact) {
23
- if (!currentRoute.startsWith(viewRoute)) {
25
+ if (!normalizedCurrentRoute.startsWith(viewRoute)) {
24
26
  return false;
25
27
  }
26
- const remainingPath = currentRoute.slice(viewRoute.length);
28
+ const remainingPath = normalizedCurrentRoute.slice(viewRoute.length);
27
29
  return remainingPath === '' || remainingPath.startsWith('/');
28
30
  }
29
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"isPathMatchingRoute.js","names":["pathToRegexp","isPathMatchingRoute","currentRoute","exact","path","viewPath","sensitive","strict","keys","regex","match","exec","viewRoute","startsWith","remainingPath","slice","length"],"sources":["../../src/utilities/isPathMatchingRoute.ts"],"sourcesContent":["import { pathToRegexp } from 'path-to-regexp'\n\nexport const isPathMatchingRoute = ({\n currentRoute,\n exact,\n path: viewPath,\n sensitive,\n strict,\n}: {\n currentRoute: string\n exact?: boolean\n path?: string\n sensitive?: boolean\n strict?: boolean\n}) => {\n if (!viewPath) {\n return false\n }\n\n const keys = []\n\n const regex = pathToRegexp(viewPath, keys, {\n sensitive,\n strict,\n })\n\n const match = regex.exec(currentRoute)\n const viewRoute = match?.[0] || viewPath\n\n if (exact) {\n return currentRoute === viewRoute\n }\n\n if (!exact) {\n if (!currentRoute.startsWith(viewRoute)) {\n return false\n }\n\n const remainingPath = currentRoute.slice(viewRoute.length)\n\n return remainingPath === '' || remainingPath.startsWith('/')\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ;AAE7B,OAAO,MAAMC,mBAAA,GAAsBA,CAAC;EAClCC,YAAY;EACZC,KAAK;EACLC,IAAA,EAAMC,QAAQ;EACdC,SAAS;EACTC;AAAM,CAOP;EACC,IAAI,CAACF,QAAA,EAAU;IACb,OAAO;EACT;EAEA,MAAMG,IAAA,GAAO,EAAE;EAEf,MAAMC,KAAA,GAAQT,YAAA,CAAaK,QAAA,EAAUG,IAAA,EAAM;IACzCF,SAAA;IACAC;EACF;EAEA,MAAMG,KAAA,GAAQD,KAAA,CAAME,IAAI,CAACT,YAAA;EACzB,MAAMU,SAAA,GAAYF,KAAA,GAAQ,EAAE,IAAIL,QAAA;EAEhC,IAAIF,KAAA,EAAO;IACT,OAAOD,YAAA,KAAiBU,SAAA;EAC1B;EAEA,IAAI,CAACT,KAAA,EAAO;IACV,IAAI,CAACD,YAAA,CAAaW,UAAU,CAACD,SAAA,GAAY;MACvC,OAAO;IACT;IAEA,MAAME,aAAA,GAAgBZ,YAAA,CAAaa,KAAK,CAACH,SAAA,CAAUI,MAAM;IAEzD,OAAOF,aAAA,KAAkB,MAAMA,aAAA,CAAcD,UAAU,CAAC;EAC1D;AACF","ignoreList":[]}
1
+ {"version":3,"file":"isPathMatchingRoute.js","names":["pathToRegexp","stripTrailingSlash","isPathMatchingRoute","currentRoute","exact","path","viewPath","sensitive","strict","normalizedCurrentRoute","keys","regex","match","exec","viewRoute","startsWith","remainingPath","slice","length"],"sources":["../../src/utilities/isPathMatchingRoute.ts"],"sourcesContent":["import { pathToRegexp } from 'path-to-regexp'\nimport { stripTrailingSlash } from 'payload/shared'\n\nexport const isPathMatchingRoute = ({\n currentRoute,\n exact,\n path: viewPath,\n sensitive,\n strict,\n}: {\n currentRoute: string\n exact?: boolean\n path?: string\n sensitive?: boolean\n strict?: boolean\n}) => {\n if (!viewPath) {\n return false\n }\n\n const normalizedCurrentRoute = strict ? currentRoute : stripTrailingSlash(currentRoute)\n const keys = []\n\n const regex = pathToRegexp(viewPath, keys, {\n sensitive,\n strict,\n })\n\n const match = regex.exec(normalizedCurrentRoute)\n const viewRoute = strict ? match?.[0] || viewPath : stripTrailingSlash(match?.[0] || viewPath)\n\n if (exact) {\n return normalizedCurrentRoute === viewRoute\n }\n\n if (!exact) {\n if (!normalizedCurrentRoute.startsWith(viewRoute)) {\n return false\n }\n\n const remainingPath = normalizedCurrentRoute.slice(viewRoute.length)\n\n return remainingPath === '' || remainingPath.startsWith('/')\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ;AAC7B,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,mBAAA,GAAsBA,CAAC;EAClCC,YAAY;EACZC,KAAK;EACLC,IAAA,EAAMC,QAAQ;EACdC,SAAS;EACTC;AAAM,CAOP;EACC,IAAI,CAACF,QAAA,EAAU;IACb,OAAO;EACT;EAEA,MAAMG,sBAAA,GAAyBD,MAAA,GAASL,YAAA,GAAeF,kBAAA,CAAmBE,YAAA;EAC1E,MAAMO,IAAA,GAAO,EAAE;EAEf,MAAMC,KAAA,GAAQX,YAAA,CAAaM,QAAA,EAAUI,IAAA,EAAM;IACzCH,SAAA;IACAC;EACF;EAEA,MAAMI,KAAA,GAAQD,KAAA,CAAME,IAAI,CAACJ,sBAAA;EACzB,MAAMK,SAAA,GAAYN,MAAA,GAASI,KAAA,GAAQ,EAAE,IAAIN,QAAA,GAAWL,kBAAA,CAAmBW,KAAA,GAAQ,EAAE,IAAIN,QAAA;EAErF,IAAIF,KAAA,EAAO;IACT,OAAOK,sBAAA,KAA2BK,SAAA;EACpC;EAEA,IAAI,CAACV,KAAA,EAAO;IACV,IAAI,CAACK,sBAAA,CAAuBM,UAAU,CAACD,SAAA,GAAY;MACjD,OAAO;IACT;IAEA,MAAME,aAAA,GAAgBP,sBAAA,CAAuBQ,KAAK,CAACH,SAAA,CAAUI,MAAM;IAEnE,OAAOF,aAAA,KAAkB,MAAMA,aAAA,CAAcD,UAAU,CAAC;EAC1D;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"isPublicAdminRoute.d.ts","sourceRoot":"","sources":["../../src/utilities/isPublicAdminRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAmB9C,eAAO,MAAM,kBAAkB,mCAI5B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAaH,CAAA"}
1
+ {"version":3,"file":"isPublicAdminRoute.d.ts","sourceRoot":"","sources":["../../src/utilities/isPublicAdminRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAmB9C,eAAO,MAAM,kBAAkB,mCAI5B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAuBH,CAAA"}
@@ -6,16 +6,19 @@ export const isPublicAdminRoute = ({
6
6
  config,
7
7
  route
8
8
  }) => {
9
+ const routeWithoutAdmin = getRouteWithoutAdmin({
10
+ adminRoute,
11
+ route
12
+ });
13
+ const routeSegments = routeWithoutAdmin.split('/').filter(Boolean);
14
+ const isVerifyRoute = routeSegments.length === 3 && routeSegments[1] === 'verify' && config.collections.some(collection => collection.slug === routeSegments[0] && Boolean(collection.auth));
15
+ if (isVerifyRoute) {
16
+ return true;
17
+ }
9
18
  return publicAdminRoutes.some(routeSegment => {
10
19
  const segment = config.admin?.routes?.[routeSegment] || routeSegment;
11
- const routeWithoutAdmin = getRouteWithoutAdmin({
12
- adminRoute,
13
- route
14
- });
15
20
  if (routeWithoutAdmin.startsWith(segment)) {
16
21
  return true;
17
- } else if (routeWithoutAdmin.includes('/verify/')) {
18
- return true;
19
22
  } else {
20
23
  return false;
21
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"isPublicAdminRoute.js","names":["getRouteWithoutAdmin","publicAdminRoutes","isPublicAdminRoute","adminRoute","config","route","some","routeSegment","segment","admin","routes","routeWithoutAdmin","startsWith","includes"],"sources":["../../src/utilities/isPublicAdminRoute.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { getRouteWithoutAdmin } from './getRouteWithoutAdmin.js'\n\n// Routes that are accessible without admin authentication\nconst publicAdminRoutes: (keyof Pick<\n SanitizedConfig['admin']['routes'],\n 'createFirstUser' | 'forgot' | 'inactivity' | 'login' | 'logout' | 'reset' | 'unauthorized'\n>)[] = [\n 'createFirstUser',\n 'forgot',\n 'login',\n 'logout',\n 'forgot',\n 'inactivity',\n 'unauthorized',\n 'reset',\n]\n\nexport const isPublicAdminRoute = ({\n adminRoute,\n config,\n route,\n}: {\n adminRoute: string\n config: SanitizedConfig\n route: string\n}): boolean => {\n return publicAdminRoutes.some((routeSegment) => {\n const segment = config.admin?.routes?.[routeSegment] || routeSegment\n const routeWithoutAdmin = getRouteWithoutAdmin({ adminRoute, route })\n\n if (routeWithoutAdmin.startsWith(segment)) {\n return true\n } else if (routeWithoutAdmin.includes('/verify/')) {\n return true\n } else {\n return false\n }\n })\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC;AACA,MAAMC,iBAAA,GAGC,CACL,mBACA,UACA,SACA,UACA,UACA,cACA,gBACA,QACD;AAED,OAAO,MAAMC,kBAAA,GAAqBA,CAAC;EACjCC,UAAU;EACVC,MAAM;EACNC;AAAK,CAKN;EACC,OAAOJ,iBAAA,CAAkBK,IAAI,CAAEC,YAAA;IAC7B,MAAMC,OAAA,GAAUJ,MAAA,CAAOK,KAAK,EAAEC,MAAA,GAASH,YAAA,CAAa,IAAIA,YAAA;IACxD,MAAMI,iBAAA,GAAoBX,oBAAA,CAAqB;MAAEG,UAAA;MAAYE;IAAM;IAEnE,IAAIM,iBAAA,CAAkBC,UAAU,CAACJ,OAAA,GAAU;MACzC,OAAO;IACT,OAAO,IAAIG,iBAAA,CAAkBE,QAAQ,CAAC,aAAa;MACjD,OAAO;IACT,OAAO;MACL,OAAO;IACT;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"isPublicAdminRoute.js","names":["getRouteWithoutAdmin","publicAdminRoutes","isPublicAdminRoute","adminRoute","config","route","routeWithoutAdmin","routeSegments","split","filter","Boolean","isVerifyRoute","length","collections","some","collection","slug","auth","routeSegment","segment","admin","routes","startsWith"],"sources":["../../src/utilities/isPublicAdminRoute.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { getRouteWithoutAdmin } from './getRouteWithoutAdmin.js'\n\n// Routes that are accessible without admin authentication\nconst publicAdminRoutes: (keyof Pick<\n SanitizedConfig['admin']['routes'],\n 'createFirstUser' | 'forgot' | 'inactivity' | 'login' | 'logout' | 'reset' | 'unauthorized'\n>)[] = [\n 'createFirstUser',\n 'forgot',\n 'login',\n 'logout',\n 'forgot',\n 'inactivity',\n 'unauthorized',\n 'reset',\n]\n\nexport const isPublicAdminRoute = ({\n adminRoute,\n config,\n route,\n}: {\n adminRoute: string\n config: SanitizedConfig\n route: string\n}): boolean => {\n const routeWithoutAdmin = getRouteWithoutAdmin({ adminRoute, route })\n const routeSegments = routeWithoutAdmin.split('/').filter(Boolean)\n const isVerifyRoute =\n routeSegments.length === 3 &&\n routeSegments[1] === 'verify' &&\n config.collections.some(\n (collection) => collection.slug === routeSegments[0] && Boolean(collection.auth),\n )\n\n if (isVerifyRoute) {\n return true\n }\n\n return publicAdminRoutes.some((routeSegment) => {\n const segment = config.admin?.routes?.[routeSegment] || routeSegment\n\n if (routeWithoutAdmin.startsWith(segment)) {\n return true\n } else {\n return false\n }\n })\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC;AACA,MAAMC,iBAAA,GAGC,CACL,mBACA,UACA,SACA,UACA,UACA,cACA,gBACA,QACD;AAED,OAAO,MAAMC,kBAAA,GAAqBA,CAAC;EACjCC,UAAU;EACVC,MAAM;EACNC;AAAK,CAKN;EACC,MAAMC,iBAAA,GAAoBN,oBAAA,CAAqB;IAAEG,UAAA;IAAYE;EAAM;EACnE,MAAME,aAAA,GAAgBD,iBAAA,CAAkBE,KAAK,CAAC,KAAKC,MAAM,CAACC,OAAA;EAC1D,MAAMC,aAAA,GACJJ,aAAA,CAAcK,MAAM,KAAK,KACzBL,aAAa,CAAC,EAAE,KAAK,YACrBH,MAAA,CAAOS,WAAW,CAACC,IAAI,CACpBC,UAAA,IAAeA,UAAA,CAAWC,IAAI,KAAKT,aAAa,CAAC,EAAE,IAAIG,OAAA,CAAQK,UAAA,CAAWE,IAAI;EAGnF,IAAIN,aAAA,EAAe;IACjB,OAAO;EACT;EAEA,OAAOV,iBAAA,CAAkBa,IAAI,CAAEI,YAAA;IAC7B,MAAMC,OAAA,GAAUf,MAAA,CAAOgB,KAAK,EAAEC,MAAA,GAASH,YAAA,CAAa,IAAIA,YAAA;IAExD,IAAIZ,iBAAA,CAAkBgB,UAAU,CAACH,OAAA,GAAU;MACzC,OAAO;IACT,OAAO;MACL,OAAO;IACT;EACF;AACF","ignoreList":[]}
@@ -1,4 +1,5 @@
1
- import { type SchedulePublishTaskInput, type ServerFunction } from 'payload';
1
+ import type { SchedulePublishTaskInput, ServerFunction } from 'payload';
2
+ import type { UpcomingEvent } from '../elements/PublishButton/ScheduleDrawer/types.js';
2
3
  export type SchedulePublishHandlerArgs = {
3
4
  date?: Date;
4
5
  /**
@@ -8,5 +9,11 @@ export type SchedulePublishHandlerArgs = {
8
9
  localeToPublish?: string;
9
10
  timezone?: string;
10
11
  } & Pick<SchedulePublishTaskInput, 'doc' | 'global' | 'type'>;
12
+ export type GetUpcomingScheduledPublishHandlerArgs = {
13
+ collectionSlug?: string;
14
+ globalSlug?: string;
15
+ id?: number | string;
16
+ };
17
+ export declare const getUpcomingScheduledPublishHandler: ServerFunction<GetUpcomingScheduledPublishHandlerArgs, Promise<UpcomingEvent[]>>;
11
18
  export declare const schedulePublishHandler: ServerFunction<SchedulePublishHandlerArgs>;
12
19
  //# sourceMappingURL=schedulePublishHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schedulePublishHandler.d.ts","sourceRoot":"","sources":["../../src/utilities/schedulePublishHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,wBAAwB,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAE5F,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,wBAAwB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAA;AAE7D,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,0BAA0B,CAuD7E,CAAA"}
1
+ {"version":3,"file":"schedulePublishHandler.d.ts","sourceRoot":"","sources":["../../src/utilities/schedulePublishHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAKvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAA;AAKtF,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,wBAAwB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAA;AAE7D,MAAM,MAAM,sCAAsC,GAAG;IACnD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,kCAAkC,EAAE,cAAc,CAC7D,sCAAsC,EACtC,OAAO,CAAC,aAAa,EAAE,CAAC,CAiDzB,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,0BAA0B,CA+D7E,CAAA"}
@@ -1,4 +1,62 @@
1
- import { canAccessAdmin } from 'payload';
1
+ import { canAccessAdmin, Forbidden } from 'payload';
2
+ import { hasScheduledPublishEnabled } from 'payload/shared';
3
+ import { buildUpcomingScheduleWhere } from '../elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.js';
4
+ import { getDocumentPermissions } from './getDocumentPermissions.js';
5
+ export const getUpcomingScheduledPublishHandler = async ({
6
+ id,
7
+ collectionSlug,
8
+ globalSlug,
9
+ req
10
+ }) => {
11
+ const {
12
+ payload
13
+ } = req;
14
+ await canAccessAdmin({
15
+ req
16
+ });
17
+ const collectionConfig = collectionSlug ? payload.collections[collectionSlug]?.config : undefined;
18
+ const globalConfig = globalSlug ? payload.config.globals.find(({
19
+ slug
20
+ }) => slug === globalSlug) : undefined;
21
+ const entityConfig = collectionConfig || globalConfig;
22
+ const hasValidTarget = Boolean(entityConfig && hasScheduledPublishEnabled(entityConfig) && (collectionConfig && id !== undefined && !globalSlug || globalConfig && !collectionSlug));
23
+ if (!hasValidTarget) {
24
+ throw new Forbidden(req.t);
25
+ }
26
+ const {
27
+ hasPublishPermission
28
+ } = await getDocumentPermissions({
29
+ id,
30
+ collectionConfig,
31
+ data: {},
32
+ globalConfig,
33
+ req
34
+ });
35
+ if (!hasPublishPermission) {
36
+ throw new Forbidden(req.t);
37
+ }
38
+ const {
39
+ docs
40
+ } = await payload.db.find({
41
+ collection: 'payload-jobs',
42
+ limit: 0,
43
+ sort: 'waitUntil',
44
+ where: buildUpcomingScheduleWhere({
45
+ id,
46
+ collectionSlug,
47
+ globalSlug
48
+ })
49
+ });
50
+ return docs.map(job => ({
51
+ id: job.id,
52
+ input: {
53
+ type: job.input?.type === 'unpublish' ? 'unpublish' : 'publish',
54
+ locale: job.input?.locale,
55
+ timezone: job.input?.timezone
56
+ },
57
+ waitUntil: job.waitUntil
58
+ }));
59
+ };
2
60
  export const schedulePublishHandler = async ({
3
61
  type,
4
62
  date,
@@ -23,9 +81,15 @@ export const schedulePublishHandler = async ({
23
81
  collection: 'payload-jobs',
24
82
  req,
25
83
  where: {
26
- id: {
27
- equals: deleteID
28
- }
84
+ and: [{
85
+ id: {
86
+ equals: deleteID
87
+ }
88
+ }, {
89
+ taskSlug: {
90
+ equals: 'schedulePublish'
91
+ }
92
+ }]
29
93
  }
30
94
  });
31
95
  }
@@ -36,7 +100,10 @@ export const schedulePublishHandler = async ({
36
100
  global,
37
101
  locale: localeToPublish,
38
102
  timezone,
39
- user: user.id
103
+ user: user && user.collection ? {
104
+ relationTo: user.collection,
105
+ value: user.id
106
+ } : undefined
40
107
  },
41
108
  task: 'schedulePublish',
42
109
  waitUntil: date
@@ -1 +1 @@
1
- {"version":3,"file":"schedulePublishHandler.js","names":["canAccessAdmin","schedulePublishHandler","type","date","deleteID","doc","global","localeToPublish","req","timezone","i18n","payload","user","delete","collection","where","id","equals","jobs","queue","input","locale","task","waitUntil","err","error","value","relationTo","logger","message","t"],"sources":["../../src/utilities/schedulePublishHandler.ts"],"sourcesContent":["import { canAccessAdmin, type SchedulePublishTaskInput, type ServerFunction } from 'payload'\n\nexport type SchedulePublishHandlerArgs = {\n date?: Date\n /**\n * The job id to delete to remove a scheduled publish event\n */\n deleteID?: number | string\n localeToPublish?: string\n timezone?: string\n} & Pick<SchedulePublishTaskInput, 'doc' | 'global' | 'type'>\n\nexport const schedulePublishHandler: ServerFunction<SchedulePublishHandlerArgs> = async ({\n type,\n date,\n deleteID,\n doc,\n global,\n localeToPublish,\n req,\n timezone,\n}) => {\n const { i18n, payload, user } = req\n\n await canAccessAdmin({ req })\n\n try {\n if (deleteID) {\n await payload.delete({\n collection: 'payload-jobs',\n req,\n where: { id: { equals: deleteID } },\n })\n }\n\n await payload.jobs.queue({\n input: {\n type,\n doc,\n global,\n locale: localeToPublish,\n timezone,\n user: user.id,\n },\n task: 'schedulePublish',\n waitUntil: date,\n })\n } catch (err) {\n let error\n\n if (deleteID) {\n error = `Error deleting scheduled publish event with ID ${deleteID}`\n } else {\n error = `Error scheduling ${type} for `\n if (doc) {\n error += `document with ID ${doc.value} in collection ${doc.relationTo}`\n }\n }\n\n payload.logger.error({ err }, error)\n\n return {\n error,\n }\n }\n\n return { message: i18n.t('general:success') }\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAA4D;AAYnF,OAAO,MAAMC,sBAAA,GAAqE,MAAAA,CAAO;EACvFC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,GAAG;EACHC,MAAM;EACNC,eAAe;EACfC,GAAG;EACHC;AAAQ,CACT;EACC,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAI,CAAE,GAAGJ,GAAA;EAEhC,MAAMR,cAAA,CAAe;IAAEQ;EAAI;EAE3B,IAAI;IACF,IAAIJ,QAAA,EAAU;MACZ,MAAMO,OAAA,CAAQE,MAAM,CAAC;QACnBC,UAAA,EAAY;QACZN,GAAA;QACAO,KAAA,EAAO;UAAEC,EAAA,EAAI;YAAEC,MAAA,EAAQb;UAAS;QAAE;MACpC;IACF;IAEA,MAAMO,OAAA,CAAQO,IAAI,CAACC,KAAK,CAAC;MACvBC,KAAA,EAAO;QACLlB,IAAA;QACAG,GAAA;QACAC,MAAA;QACAe,MAAA,EAAQd,eAAA;QACRE,QAAA;QACAG,IAAA,EAAMA,IAAA,CAAKI;MACb;MACAM,IAAA,EAAM;MACNC,SAAA,EAAWpB;IACb;EACF,EAAE,OAAOqB,GAAA,EAAK;IACZ,IAAIC,KAAA;IAEJ,IAAIrB,QAAA,EAAU;MACZqB,KAAA,GAAQ,kDAAkDrB,QAAA,EAAU;IACtE,OAAO;MACLqB,KAAA,GAAQ,oBAAoBvB,IAAA,OAAW;MACvC,IAAIG,GAAA,EAAK;QACPoB,KAAA,IAAS,oBAAoBpB,GAAA,CAAIqB,KAAK,kBAAkBrB,GAAA,CAAIsB,UAAU,EAAE;MAC1E;IACF;IAEAhB,OAAA,CAAQiB,MAAM,CAACH,KAAK,CAAC;MAAED;IAAI,GAAGC,KAAA;IAE9B,OAAO;MACLA;IACF;EACF;EAEA,OAAO;IAAEI,OAAA,EAASnB,IAAA,CAAKoB,CAAC,CAAC;EAAmB;AAC9C","ignoreList":[]}
1
+ {"version":3,"file":"schedulePublishHandler.js","names":["canAccessAdmin","Forbidden","hasScheduledPublishEnabled","buildUpcomingScheduleWhere","getDocumentPermissions","getUpcomingScheduledPublishHandler","id","collectionSlug","globalSlug","req","payload","collectionConfig","collections","config","undefined","globalConfig","globals","find","slug","entityConfig","hasValidTarget","Boolean","t","hasPublishPermission","data","docs","db","collection","limit","sort","where","map","job","input","type","locale","timezone","waitUntil","schedulePublishHandler","date","deleteID","doc","global","localeToPublish","i18n","user","delete","and","equals","taskSlug","jobs","queue","relationTo","value","task","err","error","logger","message"],"sources":["../../src/utilities/schedulePublishHandler.ts"],"sourcesContent":["import type { SchedulePublishTaskInput, ServerFunction } from 'payload'\n\nimport { canAccessAdmin, Forbidden } from 'payload'\nimport { hasScheduledPublishEnabled } from 'payload/shared'\n\nimport type { UpcomingEvent } from '../elements/PublishButton/ScheduleDrawer/types.js'\n\nimport { buildUpcomingScheduleWhere } from '../elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.js'\nimport { getDocumentPermissions } from './getDocumentPermissions.js'\n\nexport type SchedulePublishHandlerArgs = {\n date?: Date\n /**\n * The job id to delete to remove a scheduled publish event\n */\n deleteID?: number | string\n localeToPublish?: string\n timezone?: string\n} & Pick<SchedulePublishTaskInput, 'doc' | 'global' | 'type'>\n\nexport type GetUpcomingScheduledPublishHandlerArgs = {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n}\n\nexport const getUpcomingScheduledPublishHandler: ServerFunction<\n GetUpcomingScheduledPublishHandlerArgs,\n Promise<UpcomingEvent[]>\n> = async ({ id, collectionSlug, globalSlug, req }) => {\n const { payload } = req\n\n await canAccessAdmin({ req })\n\n const collectionConfig = collectionSlug ? payload.collections[collectionSlug]?.config : undefined\n const globalConfig = globalSlug\n ? payload.config.globals.find(({ slug }) => slug === globalSlug)\n : undefined\n const entityConfig = collectionConfig || globalConfig\n const hasValidTarget = Boolean(\n entityConfig &&\n hasScheduledPublishEnabled(entityConfig) &&\n ((collectionConfig && id !== undefined && !globalSlug) || (globalConfig && !collectionSlug)),\n )\n\n if (!hasValidTarget) {\n throw new Forbidden(req.t)\n }\n\n const { hasPublishPermission } = await getDocumentPermissions({\n id,\n collectionConfig,\n data: {},\n globalConfig,\n req,\n })\n\n if (!hasPublishPermission) {\n throw new Forbidden(req.t)\n }\n\n const { docs } = await payload.db.find<UpcomingEvent>({\n collection: 'payload-jobs',\n limit: 0,\n sort: 'waitUntil',\n where: buildUpcomingScheduleWhere({ id, collectionSlug, globalSlug }),\n })\n\n return docs.map((job) => ({\n id: job.id,\n input: {\n type: job.input?.type === 'unpublish' ? 'unpublish' : 'publish',\n locale: job.input?.locale,\n timezone: job.input?.timezone,\n },\n waitUntil: job.waitUntil,\n }))\n}\n\nexport const schedulePublishHandler: ServerFunction<SchedulePublishHandlerArgs> = async ({\n type,\n date,\n deleteID,\n doc,\n global,\n localeToPublish,\n req,\n timezone,\n}) => {\n const { i18n, payload, user } = req\n\n await canAccessAdmin({ req })\n\n try {\n if (deleteID) {\n await payload.delete({\n collection: 'payload-jobs',\n req,\n where: {\n and: [{ id: { equals: deleteID } }, { taskSlug: { equals: 'schedulePublish' } }],\n },\n })\n }\n\n await payload.jobs.queue({\n input: {\n type,\n doc,\n global,\n locale: localeToPublish,\n timezone,\n user:\n user && user.collection\n ? {\n relationTo: user.collection,\n value: user.id,\n }\n : undefined,\n },\n task: 'schedulePublish',\n waitUntil: date,\n })\n } catch (err) {\n let error\n\n if (deleteID) {\n error = `Error deleting scheduled publish event with ID ${deleteID}`\n } else {\n error = `Error scheduling ${type} for `\n if (doc) {\n error += `document with ID ${doc.value} in collection ${doc.relationTo}`\n }\n }\n\n payload.logger.error({ err }, error)\n\n return {\n error,\n }\n }\n\n return { message: i18n.t('general:success') }\n}\n"],"mappings":"AAEA,SAASA,cAAc,EAAEC,SAAS,QAAQ;AAC1C,SAASC,0BAA0B,QAAQ;AAI3C,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,sBAAsB,QAAQ;AAkBvC,OAAO,MAAMC,kCAAA,GAGT,MAAAA,CAAO;EAAEC,EAAE;EAAEC,cAAc;EAAEC,UAAU;EAAEC;AAAG,CAAE;EAChD,MAAM;IAAEC;EAAO,CAAE,GAAGD,GAAA;EAEpB,MAAMT,cAAA,CAAe;IAAES;EAAI;EAE3B,MAAME,gBAAA,GAAmBJ,cAAA,GAAiBG,OAAA,CAAQE,WAAW,CAACL,cAAA,CAAe,EAAEM,MAAA,GAASC,SAAA;EACxF,MAAMC,YAAA,GAAeP,UAAA,GACjBE,OAAA,CAAQG,MAAM,CAACG,OAAO,CAACC,IAAI,CAAC,CAAC;IAAEC;EAAI,CAAE,KAAKA,IAAA,KA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AAC,CAAC;EAAmB;AAC9C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"serverFunctionRegistry.d.ts","sourceRoot":"","sources":["../../src/utilities/serverFunctionRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAe7C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAc1E,CAAA"}
1
+ {"version":3,"file":"serverFunctionRegistry.d.ts","sourceRoot":"","sources":["../../src/utilities/serverFunctionRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAkB7C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAe1E,CAAA"}
@@ -7,7 +7,7 @@ import { renderListHandler } from '../views/List/handleServerFunction.js';
7
7
  import { buildFormStateHandler } from './buildFormState.js';
8
8
  import { buildTableStateHandler } from './buildTableState.js';
9
9
  import { copyDataFromLocaleHandler } from './copyDataFromLocale.js';
10
- import { schedulePublishHandler } from './schedulePublishHandler.js';
10
+ import { getUpcomingScheduledPublishHandler, schedulePublishHandler } from './schedulePublishHandler.js';
11
11
  import { slugifyHandler } from './slugify.js';
12
12
  import { switchLanguageHandler } from './switchLanguageHandler.js';
13
13
  /**
@@ -29,6 +29,7 @@ export const sharedServerFunctions = {
29
29
  'copy-data-from-locale': copyDataFromLocaleHandler,
30
30
  'form-state': buildFormStateHandler,
31
31
  'get-default-layout': getDefaultLayoutHandler,
32
+ 'get-upcoming-scheduled-publish': getUpcomingScheduledPublishHandler,
32
33
  'render-document': renderDocumentHandler,
33
34
  'render-document-slots': renderDocumentSlotsHandler,
34
35
  'render-field': _internal_renderFieldHandler,
@@ -1 +1 @@
1
- {"version":3,"file":"serverFunctionRegistry.js","names":["renderTabHandler","_internal_renderFieldHandler","getDefaultLayoutHandler","renderWidgetHandler","renderDocumentHandler","renderDocumentSlotsHandler","renderListHandler","buildFormStateHandler","buildTableStateHandler","copyDataFromLocaleHandler","schedulePublishHandler","slugifyHandler","switchLanguageHandler","sharedServerFunctions","slugify"],"sources":["../../src/utilities/serverFunctionRegistry.ts"],"sourcesContent":["import type { ServerFunction } from 'payload'\n\nimport { renderTabHandler } from '../elements/Nav/SidebarTabs/renderTabServerFn.js'\nimport { _internal_renderFieldHandler } from '../forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js'\nimport { getDefaultLayoutHandler, renderWidgetHandler } from '../views/Dashboard/serverFunctions.js'\nimport { renderDocumentHandler } from '../views/Document/handleServerFunction.js'\nimport { renderDocumentSlotsHandler } from '../views/Document/renderDocumentSlots.js'\nimport { renderListHandler } from '../views/List/handleServerFunction.js'\nimport { buildFormStateHandler } from './buildFormState.js'\nimport { buildTableStateHandler } from './buildTableState.js'\nimport { copyDataFromLocaleHandler } from './copyDataFromLocale.js'\nimport { schedulePublishHandler } from './schedulePublishHandler.js'\nimport { slugifyHandler } from './slugify.js'\nimport { switchLanguageHandler } from './switchLanguageHandler.js'\n\n/**\n * The complete, framework-agnostic set of Payload server functions.\n *\n * Every adapter (`@payloadcms/next`, `@payloadcms/tanstack-start`) dispatches\n * from this single registry via `createServerFunctionHandler`, so a handler\n * added here reaches every framework and the adapter lists can't drift.\n *\n * Handlers may return values containing React elements (e.g. `customComponents`\n * inside form state, the `Document` / `List` nodes from render-document /\n * render-list, the render-field / render-widget output). Adapters ship those\n * over the wire as RSC payloads: Next.js does this natively, while the TanStack\n * Start adapter passes a `transformResult` (`serializeForRsc`) to\n * `createServerFunctionHandler` that converts elements into\n * `renderServerComponent` handles.\n */\nexport const sharedServerFunctions: Record<string, ServerFunction<any, any>> = {\n 'copy-data-from-locale': copyDataFromLocaleHandler,\n 'form-state': buildFormStateHandler,\n 'get-default-layout': getDefaultLayoutHandler,\n 'render-document': renderDocumentHandler,\n 'render-document-slots': renderDocumentSlotsHandler,\n 'render-field': _internal_renderFieldHandler,\n 'render-list': renderListHandler,\n 'render-tab': renderTabHandler,\n 'render-widget': renderWidgetHandler,\n 'schedule-publish': schedulePublishHandler,\n slugify: slugifyHandler,\n 'switch-language': switchLanguageHandler,\n 'table-state': buildTableStateHandler,\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ;AACjC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,uBAAuB,EAAEC,mBAAmB,QAAQ;AAC7D,SAASC,qBAAqB,QAAQ;AACtC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,sBAAsB,QAAQ;AACvC,SAASC,cAAc,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ;AAEtC;;;;;;;;;;;;;;;AAeA,OAAO,MAAMC,qBAAA,GAAkE;EAC7E,yBAAyBJ,yBAAA;EACzB,cAAcF,qBAAA;EACd,sBAAsBL,uBAAA;EACtB,mBAAmBE,qBAAA;EACnB,yBAAyBC,0BAAA;EACzB,gBAAgBJ,4BAAA;EAChB,eAAeK,iBAAA;EACf,cAAcN,gBAAA;EACd,iBAAiBG,mBAAA;EACjB,oBAAoBO,sBAAA;EACpBI,OAAA,EAASH,cAAA;EACT,mBAAmBC,qBAAA;EACnB,eAAeJ;AACjB","ignoreList":[]}
1
+ {"version":3,"file":"serverFunctionRegistry.js","names":["renderTabHandler","_internal_renderFieldHandler","getDefaultLayoutHandler","renderWidgetHandler","renderDocumentHandler","renderDocumentSlotsHandler","renderListHandler","buildFormStateHandler","buildTableStateHandler","copyDataFromLocaleHandler","getUpcomingScheduledPublishHandler","schedulePublishHandler","slugifyHandler","switchLanguageHandler","sharedServerFunctions","slugify"],"sources":["../../src/utilities/serverFunctionRegistry.ts"],"sourcesContent":["import type { ServerFunction } from 'payload'\n\nimport { renderTabHandler } from '../elements/Nav/SidebarTabs/renderTabServerFn.js'\nimport { _internal_renderFieldHandler } from '../forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js'\nimport { getDefaultLayoutHandler, renderWidgetHandler } from '../views/Dashboard/serverFunctions.js'\nimport { renderDocumentHandler } from '../views/Document/handleServerFunction.js'\nimport { renderDocumentSlotsHandler } from '../views/Document/renderDocumentSlots.js'\nimport { renderListHandler } from '../views/List/handleServerFunction.js'\nimport { buildFormStateHandler } from './buildFormState.js'\nimport { buildTableStateHandler } from './buildTableState.js'\nimport { copyDataFromLocaleHandler } from './copyDataFromLocale.js'\nimport {\n getUpcomingScheduledPublishHandler,\n schedulePublishHandler,\n} from './schedulePublishHandler.js'\nimport { slugifyHandler } from './slugify.js'\nimport { switchLanguageHandler } from './switchLanguageHandler.js'\n\n/**\n * The complete, framework-agnostic set of Payload server functions.\n *\n * Every adapter (`@payloadcms/next`, `@payloadcms/tanstack-start`) dispatches\n * from this single registry via `createServerFunctionHandler`, so a handler\n * added here reaches every framework and the adapter lists can't drift.\n *\n * Handlers may return values containing React elements (e.g. `customComponents`\n * inside form state, the `Document` / `List` nodes from render-document /\n * render-list, the render-field / render-widget output). Adapters ship those\n * over the wire as RSC payloads: Next.js does this natively, while the TanStack\n * Start adapter passes a `transformResult` (`serializeForRsc`) to\n * `createServerFunctionHandler` that converts elements into\n * `renderServerComponent` handles.\n */\nexport const sharedServerFunctions: Record<string, ServerFunction<any, any>> = {\n 'copy-data-from-locale': copyDataFromLocaleHandler,\n 'form-state': buildFormStateHandler,\n 'get-default-layout': getDefaultLayoutHandler,\n 'get-upcoming-scheduled-publish': getUpcomingScheduledPublishHandler,\n 'render-document': renderDocumentHandler,\n 'render-document-slots': renderDocumentSlotsHandler,\n 'render-field': _internal_renderFieldHandler,\n 'render-list': renderListHandler,\n 'render-tab': renderTabHandler,\n 'render-widget': renderWidgetHandler,\n 'schedule-publish': schedulePublishHandler,\n slugify: slugifyHandler,\n 'switch-language': switchLanguageHandler,\n 'table-state': buildTableStateHandler,\n}\n"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ;AACjC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,uBAAuB,EAAEC,mBAAmB,QAAQ;AAC7D,SAASC,qBAAqB,QAAQ;AACtC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AAClC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,yBAAyB,QAAQ;AAC1C,SACEC,kCAAkC,EAClCC,sBAAsB,QACjB;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ;AAEtC;;;;;;;;;;;;;;;AAeA,OAAO,MAAMC,qBAAA,GAAkE;EAC7E,yBAAyBL,yBAAA;EACzB,cAAcF,qBAAA;EACd,sBAAsBL,uBAAA;EACtB,kCAAkCQ,kCAAA;EAClC,mBAAmBN,qBAAA;EACnB,yBAAyBC,0BAAA;EACzB,gBAAgBJ,4BAAA;EAChB,eAAeK,iBAAA;EACf,cAAcN,gBAAA;EACd,iBAAiBG,mBAAA;EACjB,oBAAoBQ,sBAAA;EACpBI,OAAA,EAASH,cAAA;EACT,mBAAmBC,qBAAA;EACnB,eAAeL;AACjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../src/utilities/slugify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAE/B,MAAM,SAAS,CAAA;AAGhB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,CACzC,yBAAyB,EACzB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAqF7B,CAAA"}
1
+ {"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../src/utilities/slugify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAE/B,MAAM,SAAS,CAAA;AAGhB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,EAAE,cAAc,CACzC,yBAAyB,EACzB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAuF7B,CAAA"}
@@ -75,6 +75,7 @@ export const slugifyHandler = async args => {
75
75
  draftsEnabled: hasDraftsEnabled(collectionConfig),
76
76
  field: field.name,
77
77
  locale: localeToScope,
78
+ overrideAccess: true,
78
79
  req,
79
80
  value: result
80
81
  });
@@ -84,6 +85,7 @@ export const slugifyHandler = async args => {
84
85
  collection: collectionConfig,
85
86
  field: field.name,
86
87
  locale: localeToScope,
88
+ overrideAccess: true,
87
89
  req,
88
90
  slugify
89
91
  });
@@ -1 +1 @@
1
- {"version":3,"file":"slugify.js","names":["executeAccess","getFieldByPath","getSlugFallbackValue","getUniqueFieldValue","hasDraftsEnabled","UnauthorizedError","slugify","defaultSlugify","slugifyHandler","args","id","collectionSlug","data","globalSlug","locale","path","req","valueToSlugify","user","docConfig","payload","collections","config","globals","find","g","slug","Error","field","fields","flattenedFields","customSlugify","custom","undefined","result","collectionConfig","type","canRead","disableErrors","access","read","localeToScope","localized","excludeId","collection","draftsEnabled","name","value"],"sources":["../../src/utilities/slugify.ts"],"sourcesContent":["import type { Slugify } from 'payload/shared'\n\nimport {\n executeAccess,\n getFieldByPath,\n getSlugFallbackValue,\n getUniqueFieldValue,\n hasDraftsEnabled,\n type ServerFunction,\n type SlugifyServerFunctionArgs,\n UnauthorizedError,\n} from 'payload'\nimport { slugify as defaultSlugify } from 'payload/shared'\n\n/**\n * This server function is directly related to the {@link https://payloadcms.com/docs/fields/slug | Slug Field}.\n * This is a server function that is used to invoke the user's custom slugify function from the client.\n * This pattern is required, as there is no other way for us to pass their function across the client-server boundary.\n * - Not through props\n * - Not from a server function defined within a server component (see below)\n * When a server function contains non-serializable data within its closure, it gets passed through the boundary (and breaks).\n * The only way to pass server functions to the client (that contain non-serializable data) is if it is globally defined.\n * But we also cannot define this function alongside the server component, as we will not have access to their custom slugify function.\n * See `ServerFunctionsProvider` for more details.\n */\nexport const slugifyHandler: ServerFunction<\n SlugifyServerFunctionArgs,\n Promise<ReturnType<Slugify>>\n> = async (args) => {\n const { id, collectionSlug, data, globalSlug, locale, path, req, valueToSlugify } = args\n\n if (!req.user) {\n throw new UnauthorizedError()\n }\n\n const docConfig = collectionSlug\n ? req.payload.collections[collectionSlug]?.config\n : globalSlug\n ? req.payload.config.globals.find((g) => g.slug === globalSlug)\n : null\n\n if (!docConfig) {\n throw new Error()\n }\n\n const { field } = getFieldByPath({\n config: req.payload.config,\n fields: docConfig.flattenedFields,\n path,\n })\n\n const customSlugify = (\n typeof field?.custom?.slugify === 'function' ? field.custom.slugify : undefined\n ) as Slugify\n\n const slugify = (valueToSlugify: unknown) =>\n customSlugify\n ? customSlugify({ data, req, valueToSlugify })\n : defaultSlugify(valueToSlugify as string)\n\n const result = await slugify(valueToSlugify)\n\n const collectionConfig = collectionSlug ? req.payload.collections[collectionSlug]?.config : null\n\n // Uniqueness dedupe only applies to a collection's slug field. Globals have no collection to\n // dedupe against, so their result is returned as-is.\n if (!collectionConfig || !field || field.type !== 'slug' || !('name' in field)) {\n return result\n }\n\n // Probing reads across the whole collection with the raw db, so require unrestricted read access —\n // a row-filtered (`Where`) result is treated as not allowed, since scoping the probe to readable\n // rows would break uniqueness.\n const canRead = await executeAccess(\n { slug: collectionConfig.slug, disableErrors: true, req },\n collectionConfig.access.read,\n )\n\n if (canRead !== true) {\n return result\n }\n\n // A localized slug is unique per-locale, so scope the probe to the current locale — otherwise it\n // dedupes against the default locale and can hand back a colliding value. The client passes the\n // active admin locale; fall back to the request's own locale.\n const localeToScope = field.localized ? (locale ?? req.locale ?? undefined) : undefined\n\n // The current doc is excluded so a regenerate can reuse its own value rather than bump past it.\n const excludeId = typeof id === 'string' || typeof id === 'number' ? id : undefined\n\n // A source resolved to a value: dedupe it the same way the next save would, so the generate button\n // can't hand back a slug that's already taken. With no source, return the `<singular>-N` fallback.\n if (result) {\n return getUniqueFieldValue({\n id: excludeId,\n collection: collectionConfig.slug,\n draftsEnabled: hasDraftsEnabled(collectionConfig),\n field: field.name,\n locale: localeToScope,\n req,\n value: result,\n })\n }\n\n return getSlugFallbackValue({\n id: excludeId,\n collection: collectionConfig,\n field: field.name,\n locale: localeToScope,\n req,\n slugify,\n })\n}\n"],"mappings":"AAEA,SACEA,aAAa,EACbC,cAAc,EACdC,oBAAoB,EACpBC,mBAAmB,EACnBC,gBAAgB,EAGhBC,iBAAiB,QACZ;AACP,SAASC,OAAA,IAAWC,cAAc,QAAQ;AAE1C;;;;;;;;;;;AAWA,OAAO,MAAMC,cAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IAAEC,EAAE;IAAEC,cAAc;IAAEC,IAAI;IAAEC,UAAU;IAAEC,MAAM;IAAEC,IAAI;IAAEC,GAAG;IAAEC;EAAc,CAAE,GAAGR,IAAA;EAEpF,IAAI,CAACO,GAAA,CAAIE,IAAI,EAAE;IACb,MAAM,IAAIb,iBAAA;EACZ;EAEA,MAAMc,SAAA,GAAYR,cAAA,GACdK,GAAA,CAAII,OAAO,CAACC,WAAW,CAACV,cAAA,CAAe,EAAEW,MAAA,GACzCT,UAAA,GACEG,GAAA,CAAII,OAAO,CAACE,MAAM,CAACC,OAAO,CAACC,IAAI,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI,KAAKb,UAAA,IAClD;EAEN,IAAI,CAACM,SAAA,EAAW;IACd,MAAM,IAAIQ,KAAA;EACZ;EAEA,MAAM;IAAEC;EAAK,CAAE,GAAG3B,cAAA,CAAe;IAC/BqB,MAAA,EAAQN,GAAA,CAAII,OAAO,CAACE,MAAM;IAC1BO,MAAA,E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AAezC,gBAAA,CAAiB+B,gBAAA;MAChCP,KAAA,EAAOA,KAAA,CAAMkB,IAAI;MACjBhC,MAAA,EAAQ2B,aAAA;MACRzB,GAAA;MACA+B,KAAA,EAAOb;IACT;EACF;EAEA,OAAOhC,oBAAA,CAAqB;IAC1BQ,EAAA,EAAIiC,SAAA;IACJC,UAAA,EAAYT,gBAAA;IACZP,KAAA,EAAOA,KAAA,CAAMkB,IAAI;IACjBhC,MAAA,EAAQ2B,aAAA;IACRzB,GAAA;IACAV;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"slugify.js","names":["executeAccess","getFieldByPath","getSlugFallbackValue","getUniqueFieldValue","hasDraftsEnabled","UnauthorizedError","slugify","defaultSlugify","slugifyHandler","args","id","collectionSlug","data","globalSlug","locale","path","req","valueToSlugify","user","docConfig","payload","collections","config","globals","find","g","slug","Error","field","fields","flattenedFields","customSlugify","custom","undefined","result","collectionConfig","type","canRead","disableErrors","access","read","localeToScope","localized","excludeId","collection","draftsEnabled","name","overrideAccess","value"],"sources":["../../src/utilities/slugify.ts"],"sourcesContent":["import type { Slugify } from 'payload/shared'\n\nimport {\n executeAccess,\n getFieldByPath,\n getSlugFallbackValue,\n getUniqueFieldValue,\n hasDraftsEnabled,\n type ServerFunction,\n type SlugifyServerFunctionArgs,\n UnauthorizedError,\n} from 'payload'\nimport { slugify as defaultSlugify } from 'payload/shared'\n\n/**\n * This server function is directly related to the {@link https://payloadcms.com/docs/fields/slug | Slug Field}.\n * This is a server function that is used to invoke the user's custom slugify function from the client.\n * This pattern is required, as there is no other way for us to pass their function across the client-server boundary.\n * - Not through props\n * - Not from a server function defined within a server component (see below)\n * When a server function contains non-serializable data within its closure, it gets passed through the boundary (and breaks).\n * The only way to pass server functions to the client (that contain non-serializable data) is if it is globally defined.\n * But we also cannot define this function alongside the server component, as we will not have access to their custom slugify function.\n * See `ServerFunctionsProvider` for more details.\n */\nexport const slugifyHandler: ServerFunction<\n SlugifyServerFunctionArgs,\n Promise<ReturnType<Slugify>>\n> = async (args) => {\n const { id, collectionSlug, data, globalSlug, locale, path, req, valueToSlugify } = args\n\n if (!req.user) {\n throw new UnauthorizedError()\n }\n\n const docConfig = collectionSlug\n ? req.payload.collections[collectionSlug]?.config\n : globalSlug\n ? req.payload.config.globals.find((g) => g.slug === globalSlug)\n : null\n\n if (!docConfig) {\n throw new Error()\n }\n\n const { field } = getFieldByPath({\n config: req.payload.config,\n fields: docConfig.flattenedFields,\n path,\n })\n\n const customSlugify = (\n typeof field?.custom?.slugify === 'function' ? field.custom.slugify : undefined\n ) as Slugify\n\n const slugify = (valueToSlugify: unknown) =>\n customSlugify\n ? customSlugify({ data, req, valueToSlugify })\n : defaultSlugify(valueToSlugify as string)\n\n const result = await slugify(valueToSlugify)\n\n const collectionConfig = collectionSlug ? req.payload.collections[collectionSlug]?.config : null\n\n // Uniqueness dedupe only applies to a collection's slug field. Globals have no collection to\n // dedupe against, so their result is returned as-is.\n if (!collectionConfig || !field || field.type !== 'slug' || !('name' in field)) {\n return result\n }\n\n // Probing reads across the whole collection with the raw db, so require unrestricted read access —\n // a row-filtered (`Where`) result is treated as not allowed, since scoping the probe to readable\n // rows would break uniqueness.\n const canRead = await executeAccess(\n { slug: collectionConfig.slug, disableErrors: true, req },\n collectionConfig.access.read,\n )\n\n if (canRead !== true) {\n return result\n }\n\n // A localized slug is unique per-locale, so scope the probe to the current locale — otherwise it\n // dedupes against the default locale and can hand back a colliding value. The client passes the\n // active admin locale; fall back to the request's own locale.\n const localeToScope = field.localized ? (locale ?? req.locale ?? undefined) : undefined\n\n // The current doc is excluded so a regenerate can reuse its own value rather than bump past it.\n const excludeId = typeof id === 'string' || typeof id === 'number' ? id : undefined\n\n // A source resolved to a value: dedupe it the same way the next save would, so the generate button\n // can't hand back a slug that's already taken. With no source, return the `<singular>-N` fallback.\n if (result) {\n return getUniqueFieldValue({\n id: excludeId,\n collection: collectionConfig.slug,\n draftsEnabled: hasDraftsEnabled(collectionConfig),\n field: field.name,\n locale: localeToScope,\n overrideAccess: true,\n req,\n value: result,\n })\n }\n\n return getSlugFallbackValue({\n id: excludeId,\n collection: collectionConfig,\n field: field.name,\n locale: localeToScope,\n overrideAccess: true,\n req,\n slugify,\n })\n}\n"],"mappings":"AAEA,SACEA,aAAa,EACbC,cAAc,EACdC,oBAAoB,EACpBC,mBAAmB,EACnBC,gBAAgB,EAGhBC,iBAAiB,QACZ;AACP,SAASC,OAAA,IAAWC,cAAc,QAAQ;AAE1C;;;;;;;;;;;AAWA,OAAO,MAAMC,cAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IAAEC,EAAE;IAAEC,cAAc;IAAEC,IAAI;IAAEC,UAAU;IAAEC,MAAM;IAAEC,IAAI;IAAEC,GAAG;IAAEC;EAAc,CAAE,GAAGR,IAAA;EAEpF,IAAI,CAACO,GAAA,CAAIE,IAAI,EAAE;IACb,MAAM,IAAIb,iBAAA;EACZ;EAEA,MAAMc,SAAA,GAAYR,cAAA,GACdK,GAAA,CAAII,OAAO,CAACC,WAAW,CAACV,cAAA,CAAe,EAAEW,MAAA,GACzCT,UAAA,GACEG,GAAA,CAAII,OAAO,CAACE,MAAM,CAACC,OAAO,CAACC,IAAI,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI,KAAKb,UAAA,IAClD;EAEN,IAAI,CAACM,SAAA,EAAW;IACd,MAAM,IAAIQ,KAAA;EACZ;EAEA,MAAM;IAAEC;EAAK,CAAE,GAAG3B,cAAA,CAAe;IAC/BqB,MAAA,EAAQN,GAAA,CAAII,OAAO,CAACE,MAAM;IAC1BO,MAAA,EAAQV,SAAA,CAAUW,eAAe;IACjCf;EACF;EAEA,MAAMgB,aAAA,GACJ,OAAOH,KAAA,EAAOI,MAAA,EAAQ1B,OAAA,KAAY,aAAasB,KAAA,CAAMI,MAAM,CAAC1B,OAAO,GAAG2B,SAAA;EAGxE,MAAM3B,OAAA,GAAWW,cAAA,IACfc,aAAA,GACIA,aAAA,CAAc;IAAEnB,IAAA;IAAM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ACZP,KAAA,EAAOA,KAAA,CAAMkB,IAAI;IACjBhC,MAAA,EAAQ2B,aAAA;IACRM,cAAA,EAAgB;IAChB/B,GAAA;IACAV;EACF;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/API/index.client.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,OAAO,aAAa,CAAA;AAKpB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAkPjC,CAAA"}
1
+ {"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/API/index.client.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,OAAO,aAAa,CAAA;AAKpB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAmPjC,CAAA"}
@@ -34,9 +34,8 @@ export const APIViewClient = () => {
34
34
  i18n,
35
35
  t
36
36
  } = useTranslation();
37
- const {
38
- code
39
- } = useLocale();
37
+ const currentLocale = useLocale();
38
+ const code = currentLocale?.code;
40
39
  const {
41
40
  config: {
42
41
  defaultDepth,