@payloadcms/ui 4.0.0-internal.bc5cf8c → 4.0.0-internal.c7d5de4

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 (669) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/css/forms.css +6 -3
  3. package/dist/css/theme.css +2 -1
  4. package/dist/css/z-index.css +9 -0
  5. package/dist/elements/APIKeyInput/index.css +4 -4
  6. package/dist/elements/AddNewRelation/index.css +28 -28
  7. package/dist/elements/AnimateHeight/usePatchAnimateHeight.d.ts.map +1 -1
  8. package/dist/elements/AppHeader/index.css +2 -15
  9. package/dist/elements/AppHeader/index.d.ts +2 -1
  10. package/dist/elements/AppHeader/index.d.ts.map +1 -1
  11. package/dist/elements/AppHeader/index.js +6 -8
  12. package/dist/elements/AppHeader/index.js.map +1 -1
  13. package/dist/elements/ArrayAction/index.d.ts.map +1 -1
  14. package/dist/elements/ArrayAction/index.js +1 -0
  15. package/dist/elements/ArrayAction/index.js.map +1 -1
  16. package/dist/elements/Button/index.d.ts.map +1 -1
  17. package/dist/elements/Button/index.js +5 -0
  18. package/dist/elements/Button/index.js.map +1 -1
  19. package/dist/elements/ClipboardAction/ClipboardActionLabel.d.ts.map +1 -1
  20. package/dist/elements/ClipboardAction/index.d.ts.map +1 -1
  21. package/dist/elements/ClipboardAction/index.js +1 -0
  22. package/dist/elements/ClipboardAction/index.js.map +1 -1
  23. package/dist/elements/CodeEditor/CodeEditor.d.ts.map +1 -1
  24. package/dist/elements/CodeEditor/index.css +5 -0
  25. package/dist/elements/Collapsible/index.d.ts.map +1 -1
  26. package/dist/elements/Collapsible/index.js +2 -0
  27. package/dist/elements/Collapsible/index.js.map +1 -1
  28. package/dist/elements/ColumnSelection/Popup.d.ts.map +1 -1
  29. package/dist/elements/ColumnSelection/Popup.js +6 -6
  30. package/dist/elements/ColumnSelection/Popup.js.map +1 -1
  31. package/dist/elements/ColumnSelection/matchesColumnSearch.d.ts +10 -0
  32. package/dist/elements/ColumnSelection/matchesColumnSearch.d.ts.map +1 -0
  33. package/dist/elements/ColumnSelection/matchesColumnSearch.js +21 -0
  34. package/dist/elements/ColumnSelection/matchesColumnSearch.js.map +1 -0
  35. package/dist/elements/ColumnSelection/matchesColumnSearch.spec.js +87 -0
  36. package/dist/elements/ColumnSelection/matchesColumnSearch.spec.js.map +1 -0
  37. package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
  38. package/dist/elements/DatePicker/getFormattedLocale.d.ts.map +1 -1
  39. package/dist/elements/DatePicker/index.css +3 -3
  40. package/dist/elements/DatePicker/index.js +1 -1
  41. package/dist/elements/DatePicker/index.js.map +1 -1
  42. package/dist/elements/Dialog/DialogTitle/index.d.ts.map +1 -1
  43. package/dist/elements/DocumentControls/index.css +0 -2
  44. package/dist/elements/DocumentControls/index.d.ts +2 -2
  45. package/dist/elements/DocumentControls/index.d.ts.map +1 -1
  46. package/dist/elements/DocumentControls/index.js +1 -0
  47. package/dist/elements/DocumentControls/index.js.map +1 -1
  48. package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts +2 -2
  49. package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
  50. package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
  51. package/dist/elements/DocumentFields/index.css +9 -0
  52. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -1
  53. package/dist/elements/DocumentLocked/index.d.ts +2 -2
  54. package/dist/elements/DocumentLocked/index.d.ts.map +1 -1
  55. package/dist/elements/DocumentLocked/index.js.map +1 -1
  56. package/dist/elements/DraggableSortable/DragOverlayPreview/index.css +1 -1
  57. package/dist/elements/DraggableSortable/useDraggableSortable/index.d.ts.map +1 -1
  58. package/dist/elements/Drawer/index.d.ts.map +1 -1
  59. package/dist/elements/Drawer/index.js +1 -0
  60. package/dist/elements/Drawer/index.js.map +1 -1
  61. package/dist/elements/Drawer/useDrawerSlug.d.ts.map +1 -1
  62. package/dist/elements/DrawerActionHeader/index.d.ts.map +1 -1
  63. package/dist/elements/EditUpload/index.d.ts.map +1 -1
  64. package/dist/elements/EditUpload/index.js +4 -0
  65. package/dist/elements/EditUpload/index.js.map +1 -1
  66. package/dist/elements/FieldSelect/reduceFieldOptions.d.ts.map +1 -1
  67. package/dist/elements/HTMLDiff/diff/index.d.ts.map +1 -1
  68. package/dist/elements/HTMLDiff/index.d.ts.map +1 -1
  69. package/dist/elements/Hierarchy/ColumnBrowser/Column/index.css +3 -1
  70. package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.css +1 -0
  71. package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts.map +1 -1
  72. package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts +1 -1
  73. package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts.map +1 -1
  74. package/dist/elements/Hierarchy/ColumnBrowser/types.js.map +1 -1
  75. package/dist/elements/Hierarchy/DocHeaderButton/index.js +12 -12
  76. package/dist/elements/Hierarchy/DocHeaderButton/index.js.map +1 -1
  77. package/dist/elements/Hierarchy/Field/index.client.js +14 -14
  78. package/dist/elements/Hierarchy/Field/index.client.js.map +1 -1
  79. package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts.map +1 -0
  80. package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js.map +1 -0
  81. package/dist/elements/Hierarchy/Modal/index.css +88 -0
  82. package/dist/elements/Hierarchy/Modal/index.d.ts +20 -0
  83. package/dist/elements/Hierarchy/Modal/index.d.ts.map +1 -0
  84. package/dist/elements/Hierarchy/{Drawer → Modal}/index.js +105 -81
  85. package/dist/elements/Hierarchy/Modal/index.js.map +1 -0
  86. package/dist/elements/Hierarchy/{Drawer → Modal}/types.d.ts +22 -18
  87. package/dist/elements/Hierarchy/Modal/types.d.ts.map +1 -0
  88. package/dist/elements/Hierarchy/Modal/types.js.map +1 -0
  89. package/dist/elements/Hierarchy/Modal/useHierarchyModal.d.ts +30 -0
  90. package/dist/elements/Hierarchy/Modal/useHierarchyModal.d.ts.map +1 -0
  91. package/dist/elements/Hierarchy/{Drawer/useHierarchyDrawer.js → Modal/useHierarchyModal.js} +51 -50
  92. package/dist/elements/Hierarchy/Modal/useHierarchyModal.js.map +1 -0
  93. package/dist/elements/Hierarchy/MoveMany/index.d.ts +2 -2
  94. package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -1
  95. package/dist/elements/Hierarchy/MoveMany/index.js +9 -9
  96. package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -1
  97. package/dist/elements/Hierarchy/Search/useHierarchySearch.d.ts.map +1 -1
  98. package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts +1 -1
  99. package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts.map +1 -1
  100. package/dist/elements/Hierarchy/Tree/TreeNode/index.css +38 -13
  101. package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
  102. package/dist/elements/Hierarchy/Tree/TreeNode/index.js +37 -31
  103. package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -1
  104. package/dist/elements/Hierarchy/Tree/index.css +1 -1
  105. package/dist/elements/Hierarchy/Tree/index.d.ts.map +1 -1
  106. package/dist/elements/Hierarchy/Tree/index.js +18 -5
  107. package/dist/elements/Hierarchy/Tree/index.js.map +1 -1
  108. package/dist/elements/Hierarchy/Tree/useChildren.d.ts.map +1 -1
  109. package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
  110. package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
  111. package/dist/elements/ListControls/index.js +1 -1
  112. package/dist/elements/ListControls/index.js.map +1 -1
  113. package/dist/elements/ListDrawer/index.d.ts.map +1 -1
  114. package/dist/elements/LivePreview/Toolbar/SizeInput/index.d.ts.map +1 -1
  115. package/dist/elements/LivePreview/Toolbar/SizeInput/index.js +1 -0
  116. package/dist/elements/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
  117. package/dist/elements/LivePreview/Window/index.css +6 -0
  118. package/dist/elements/LoadingOverlay/reducer.d.ts.map +1 -1
  119. package/dist/elements/Locked/index.css +7 -4
  120. package/dist/elements/Locked/index.d.ts +2 -2
  121. package/dist/elements/Locked/index.d.ts.map +1 -1
  122. package/dist/elements/Locked/index.js +66 -53
  123. package/dist/elements/Locked/index.js.map +1 -1
  124. package/dist/elements/Nav/SettingsMenuButton/index.css +5 -0
  125. package/dist/elements/Nav/SettingsMenuButton/index.d.ts +1 -1
  126. package/dist/elements/Nav/SettingsMenuButton/index.d.ts.map +1 -1
  127. package/dist/elements/Nav/SettingsMenuButton/index.js +1 -1
  128. package/dist/elements/Nav/SettingsMenuButton/index.js.map +1 -1
  129. package/dist/elements/Nav/index.css +0 -5
  130. package/dist/elements/Pagination/index.css +5 -0
  131. package/dist/elements/Pagination/index.d.ts.map +1 -1
  132. package/dist/elements/Pagination/index.js +21 -21
  133. package/dist/elements/Pagination/index.js.map +1 -1
  134. package/dist/elements/Popup/PopupTrigger/index.d.ts +1 -0
  135. package/dist/elements/Popup/PopupTrigger/index.d.ts.map +1 -1
  136. package/dist/elements/Popup/PopupTrigger/index.js +3 -0
  137. package/dist/elements/Popup/PopupTrigger/index.js.map +1 -1
  138. package/dist/elements/Popup/index.d.ts +6 -0
  139. package/dist/elements/Popup/index.d.ts.map +1 -1
  140. package/dist/elements/Popup/index.js +2 -0
  141. package/dist/elements/Popup/index.js.map +1 -1
  142. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.d.ts.map +1 -1
  143. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts.map +1 -1
  144. package/dist/elements/ReactSelect/DefaultMenuPortal.d.ts +7 -0
  145. package/dist/elements/ReactSelect/DefaultMenuPortal.d.ts.map +1 -0
  146. package/dist/elements/ReactSelect/DefaultMenuPortal.js +120 -0
  147. package/dist/elements/ReactSelect/DefaultMenuPortal.js.map +1 -0
  148. package/dist/elements/ReactSelect/DropdownIndicator/index.css +1 -1
  149. package/dist/elements/ReactSelect/DropdownIndicator/index.d.ts.map +1 -1
  150. package/dist/elements/ReactSelect/DropdownIndicator/index.js +19 -12
  151. package/dist/elements/ReactSelect/DropdownIndicator/index.js.map +1 -1
  152. package/dist/elements/ReactSelect/getCaptureMenuScroll.d.ts.map +1 -1
  153. package/dist/elements/ReactSelect/getMenuListStyles.d.ts +1 -1
  154. package/dist/elements/ReactSelect/getMenuListStyles.d.ts.map +1 -1
  155. package/dist/elements/ReactSelect/getMenuListStyles.js +13 -5
  156. package/dist/elements/ReactSelect/getMenuListStyles.js.map +1 -1
  157. package/dist/elements/ReactSelect/getMenuStyles.d.ts +10 -0
  158. package/dist/elements/ReactSelect/getMenuStyles.d.ts.map +1 -0
  159. package/dist/elements/ReactSelect/getMenuStyles.js +21 -0
  160. package/dist/elements/ReactSelect/getMenuStyles.js.map +1 -0
  161. package/dist/elements/ReactSelect/index.css +10 -3
  162. package/dist/elements/ReactSelect/index.d.ts.map +1 -1
  163. package/dist/elements/ReactSelect/index.js +25 -102
  164. package/dist/elements/ReactSelect/index.js.map +1 -1
  165. package/dist/elements/ReactSelect/types.d.ts +2 -2
  166. package/dist/elements/ReactSelect/types.d.ts.map +1 -1
  167. package/dist/elements/ReactSelect/types.js.map +1 -1
  168. package/dist/elements/RelationshipTable/AddNewButton.d.ts +2 -2
  169. package/dist/elements/RelationshipTable/AddNewButton.d.ts.map +1 -1
  170. package/dist/elements/RelationshipTable/index.css +1 -2
  171. package/dist/elements/Search/ListSearchFilter/index.d.ts.map +1 -1
  172. package/dist/elements/Search/ListSearchFilter/index.js +1 -0
  173. package/dist/elements/Search/ListSearchFilter/index.js.map +1 -1
  174. package/dist/elements/Search/SearchInput/index.d.ts +2 -0
  175. package/dist/elements/Search/SearchInput/index.d.ts.map +1 -1
  176. package/dist/elements/Search/SearchInput/index.js +22 -19
  177. package/dist/elements/Search/SearchInput/index.js.map +1 -1
  178. package/dist/elements/SelectAll/index.css +3 -1
  179. package/dist/elements/SelectRow/index.d.ts +2 -2
  180. package/dist/elements/SelectRow/index.d.ts.map +1 -1
  181. package/dist/elements/SelectRow/index.js.map +1 -1
  182. package/dist/elements/SidebarRow/index.css +0 -2
  183. package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js +24 -24
  184. package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js.map +1 -1
  185. package/dist/elements/Table/DefaultCell/fields/index.d.ts +1 -1
  186. package/dist/elements/Table/DefaultCell/fields/index.d.ts.map +1 -1
  187. package/dist/elements/Table/OrderableRow.d.ts.map +1 -1
  188. package/dist/elements/Table/OrderableRowDragPreview.d.ts.map +1 -1
  189. package/dist/elements/Table/index.css +25 -2
  190. package/dist/elements/Tabs/index.d.ts.map +1 -1
  191. package/dist/elements/Thumbnail/createThumbnail.d.ts.map +1 -1
  192. package/dist/elements/TimezonePicker/index.css +1 -1
  193. package/dist/elements/Upload/index.d.ts.map +1 -1
  194. package/dist/elements/UserMenu/SubMenuHeader/index.d.ts.map +1 -1
  195. package/dist/elements/UserMenu/SubMenuHeader/index.js +8 -9
  196. package/dist/elements/UserMenu/SubMenuHeader/index.js.map +1 -1
  197. package/dist/elements/UserMenu/index.css +26 -1
  198. package/dist/elements/UserMenu/index.d.ts +1 -0
  199. package/dist/elements/UserMenu/index.d.ts.map +1 -1
  200. package/dist/elements/UserMenu/index.js +2 -1
  201. package/dist/elements/UserMenu/index.js.map +1 -1
  202. package/dist/elements/WhereBuilder/Condition/Relationship/optionsReducer.d.ts.map +1 -1
  203. package/dist/elements/WhereBuilder/Condition/Select/formatOptions.d.ts.map +1 -1
  204. package/dist/elements/WhereBuilder/Condition/validOperators.d.ts.map +1 -1
  205. package/dist/elements/WhereBuilder/field-types.d.ts.map +1 -1
  206. package/dist/exports/client/index.d.ts +4 -3
  207. package/dist/exports/client/index.d.ts.map +1 -1
  208. package/dist/exports/client/index.js +1 -1
  209. package/dist/exports/client/index.js.map +3 -3
  210. package/dist/exports/layouts.d.ts +1 -0
  211. package/dist/exports/layouts.d.ts.map +1 -1
  212. package/dist/exports/layouts.js +1 -0
  213. package/dist/exports/layouts.js.map +1 -1
  214. package/dist/exports/rsc/index.d.ts +3 -0
  215. package/dist/exports/rsc/index.d.ts.map +1 -1
  216. package/dist/exports/rsc/index.js +3 -0
  217. package/dist/exports/rsc/index.js.map +1 -1
  218. package/dist/exports/shared/index.d.ts +1 -0
  219. package/dist/exports/shared/index.d.ts.map +1 -1
  220. package/dist/exports/shared/index.js +2 -2
  221. package/dist/exports/shared/index.js.map +4 -4
  222. package/dist/fields/Array/index.d.ts +1 -1
  223. package/dist/fields/Array/index.d.ts.map +1 -1
  224. package/dist/fields/Array/index.js +7 -4
  225. package/dist/fields/Array/index.js.map +1 -1
  226. package/dist/fields/Blocks/SectionTitle/index.d.ts.map +1 -1
  227. package/dist/fields/Blocks/SectionTitle/index.js +1 -0
  228. package/dist/fields/Blocks/SectionTitle/index.js.map +1 -1
  229. package/dist/fields/Blocks/index.d.ts +1 -1
  230. package/dist/fields/Blocks/index.d.ts.map +1 -1
  231. package/dist/fields/Blocks/index.js +6 -3
  232. package/dist/fields/Blocks/index.js.map +1 -1
  233. package/dist/fields/Checkbox/index.d.ts +1 -1
  234. package/dist/fields/Code/index.css +1 -1
  235. package/dist/fields/Code/index.d.ts +2 -2
  236. package/dist/fields/Collapsible/index.d.ts +1 -1
  237. package/dist/fields/ConfirmPassword/index.d.ts +4 -0
  238. package/dist/fields/ConfirmPassword/index.d.ts.map +1 -1
  239. package/dist/fields/ConfirmPassword/index.js +37 -33
  240. package/dist/fields/ConfirmPassword/index.js.map +1 -1
  241. package/dist/fields/DateTime/index.d.ts +1 -1
  242. package/dist/fields/Email/index.d.ts +1 -1
  243. package/dist/fields/Group/index.css +1 -7
  244. package/dist/fields/Group/index.d.ts +2 -2
  245. package/dist/fields/JSON/index.d.ts +1 -1
  246. package/dist/fields/Join/index.d.ts +1 -1
  247. package/dist/fields/Number/Input.d.ts.map +1 -1
  248. package/dist/fields/Number/Input.js +29 -25
  249. package/dist/fields/Number/Input.js.map +1 -1
  250. package/dist/fields/Number/index.d.ts +1 -1
  251. package/dist/fields/Number/types.d.ts +4 -0
  252. package/dist/fields/Number/types.d.ts.map +1 -1
  253. package/dist/fields/Number/types.js.map +1 -1
  254. package/dist/fields/Password/input.d.ts.map +1 -1
  255. package/dist/fields/Password/input.js +33 -29
  256. package/dist/fields/Password/input.js.map +1 -1
  257. package/dist/fields/Password/types.d.ts +7 -3
  258. package/dist/fields/Password/types.d.ts.map +1 -1
  259. package/dist/fields/Password/types.js.map +1 -1
  260. package/dist/fields/Point/index.d.ts +1 -1
  261. package/dist/fields/Relationship/Input.d.ts.map +1 -1
  262. package/dist/fields/Relationship/Input.js +4 -0
  263. package/dist/fields/Relationship/Input.js.map +1 -1
  264. package/dist/fields/Relationship/findOptionsByValue.d.ts.map +1 -1
  265. package/dist/fields/Relationship/index.d.ts +1 -1
  266. package/dist/fields/Relationship/optionsReducer.d.ts.map +1 -1
  267. package/dist/fields/Relationship/select-components/MultiValueLabel/index.css +1 -1
  268. package/dist/fields/Relationship/types.d.ts +4 -0
  269. package/dist/fields/Relationship/types.d.ts.map +1 -1
  270. package/dist/fields/Relationship/types.js.map +1 -1
  271. package/dist/fields/Row/index.d.ts +1 -1
  272. package/dist/fields/Select/Input.d.ts +4 -0
  273. package/dist/fields/Select/Input.d.ts.map +1 -1
  274. package/dist/fields/Select/Input.js +45 -40
  275. package/dist/fields/Select/Input.js.map +1 -1
  276. package/dist/fields/Select/index.d.ts +1 -1
  277. package/dist/fields/Select/index.d.ts.map +1 -1
  278. package/dist/fields/Slug/index.d.ts +7 -5
  279. package/dist/fields/Slug/index.d.ts.map +1 -1
  280. package/dist/fields/Slug/index.js +6 -4
  281. package/dist/fields/Slug/index.js.map +1 -1
  282. package/dist/fields/Tabs/index.d.ts +1 -1
  283. package/dist/fields/Text/Input.d.ts.map +1 -1
  284. package/dist/fields/Text/Input.js +25 -21
  285. package/dist/fields/Text/Input.js.map +1 -1
  286. package/dist/fields/Text/index.d.ts +1 -1
  287. package/dist/fields/Text/types.d.ts +6 -2
  288. package/dist/fields/Text/types.d.ts.map +1 -1
  289. package/dist/fields/Text/types.js.map +1 -1
  290. package/dist/fields/Textarea/Input.d.ts.map +1 -1
  291. package/dist/fields/Textarea/Input.js +27 -23
  292. package/dist/fields/Textarea/Input.js.map +1 -1
  293. package/dist/fields/Textarea/index.css +1 -1
  294. package/dist/fields/Textarea/index.d.ts +1 -1
  295. package/dist/fields/Textarea/types.d.ts +4 -0
  296. package/dist/fields/Textarea/types.d.ts.map +1 -1
  297. package/dist/fields/Textarea/types.js.map +1 -1
  298. package/dist/fields/index.d.ts.map +1 -1
  299. package/dist/fields/index.js +2 -0
  300. package/dist/fields/index.js.map +1 -1
  301. package/dist/fields/mergeFieldStyles.d.ts +1 -1
  302. package/dist/fields/mergeFieldStyles.d.ts.map +1 -1
  303. package/dist/forms/Form/context.d.ts.map +1 -1
  304. package/dist/forms/Form/createNestedClientFieldPath.d.ts.map +1 -1
  305. package/dist/forms/Form/errorMessages.d.ts.map +1 -1
  306. package/dist/forms/Form/mergeServerFormState.d.ts.map +1 -1
  307. package/dist/forms/Form/reduceToSerializableFields.d.ts.map +1 -1
  308. package/dist/forms/Form/rowHelpers.d.ts.map +1 -1
  309. package/dist/forms/Form/rows.d.ts.map +1 -1
  310. package/dist/forms/Form/types.d.ts +2 -2
  311. package/dist/forms/Form/types.d.ts.map +1 -1
  312. package/dist/forms/Form/types.js.map +1 -1
  313. package/dist/forms/RenderFields/RenderField.d.ts +1 -1
  314. package/dist/forms/RenderFields/RenderField.d.ts.map +1 -1
  315. package/dist/forms/RenderFields/RenderField.js +10 -0
  316. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  317. package/dist/forms/RenderFields/index.css +4 -4
  318. package/dist/forms/WatchChildErrors/buildPathSegments.d.ts.map +1 -1
  319. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts +1 -0
  320. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
  321. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +21 -5
  322. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
  323. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/index.d.ts +2 -2
  324. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/index.d.ts.map +1 -1
  325. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/index.js.map +1 -1
  326. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/iterateFields.d.ts +2 -2
  327. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/iterateFields.d.ts.map +1 -1
  328. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/iterateFields.js.map +1 -1
  329. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.d.ts +2 -2
  330. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.d.ts.map +1 -1
  331. package/dist/forms/fieldSchemasToFormState/calculateDefaultValues/promise.js.map +1 -1
  332. package/dist/forms/fieldSchemasToFormState/index.d.ts +2 -1
  333. package/dist/forms/fieldSchemasToFormState/index.d.ts.map +1 -1
  334. package/dist/forms/fieldSchemasToFormState/index.js +2 -0
  335. package/dist/forms/fieldSchemasToFormState/index.js.map +1 -1
  336. package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts +2 -1
  337. package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts.map +1 -1
  338. package/dist/forms/fieldSchemasToFormState/iterateFields.js +2 -0
  339. package/dist/forms/fieldSchemasToFormState/iterateFields.js.map +1 -1
  340. package/dist/forms/useField/index.d.ts.map +1 -1
  341. package/dist/forms/withCondition/index.d.ts +1 -1
  342. package/dist/forms/withCondition/index.d.ts.map +1 -1
  343. package/dist/graphics/Icon/index.js +1 -1
  344. package/dist/graphics/Icon/index.js.map +1 -1
  345. package/dist/hooks/useDebouncedCallback.d.ts.map +1 -1
  346. package/dist/hooks/useDelay.d.ts.map +1 -1
  347. package/dist/hooks/useElementHeightVariable.d.ts.map +1 -1
  348. package/dist/hooks/useHotkey.d.ts.map +1 -1
  349. package/dist/hooks/useIntersect.d.ts.map +1 -1
  350. package/dist/hooks/usePopupWindow.d.ts +1 -1
  351. package/dist/hooks/usePopupWindow.d.ts.map +1 -1
  352. package/dist/hooks/useRelatedCollections.d.ts.map +1 -1
  353. package/dist/hooks/useResize.d.ts.map +1 -1
  354. package/dist/hooks/useUseAsTitle.d.ts.map +1 -1
  355. package/dist/layouts/Root/index.d.ts.map +1 -1
  356. package/dist/layouts/Root/index.js +7 -3
  357. package/dist/layouts/Root/index.js.map +1 -1
  358. package/dist/layouts/Root/index.spec.js +20 -0
  359. package/dist/layouts/Root/index.spec.js.map +1 -0
  360. package/dist/layouts/Root/viewport.d.ts +5 -0
  361. package/dist/layouts/Root/viewport.d.ts.map +1 -0
  362. package/dist/layouts/Root/viewport.js +17 -0
  363. package/dist/layouts/Root/viewport.js.map +1 -0
  364. package/dist/providers/Auth/index.d.ts +8 -10
  365. package/dist/providers/Auth/index.d.ts.map +1 -1
  366. package/dist/providers/Auth/index.js +3 -8
  367. package/dist/providers/Auth/index.js.map +1 -1
  368. package/dist/providers/ClientFunction/index.d.ts.map +1 -1
  369. package/dist/providers/DocumentInfo/index.js.map +1 -1
  370. package/dist/providers/DocumentInfo/types.d.ts +6 -6
  371. package/dist/providers/DocumentInfo/types.d.ts.map +1 -1
  372. package/dist/providers/DocumentInfo/types.js.map +1 -1
  373. package/dist/providers/DocumentInfo/useGetDocPermissions.d.ts.map +1 -1
  374. package/dist/providers/ListQuery/index.d.ts.map +1 -1
  375. package/dist/providers/ListQuery/index.js +8 -1
  376. package/dist/providers/ListQuery/index.js.map +1 -1
  377. package/dist/providers/ListQuery/mergeQuery.d.ts.map +1 -1
  378. package/dist/providers/ListQuery/sanitizeQuery.d.ts.map +1 -1
  379. package/dist/providers/LivePreview/sizeReducer.d.ts +1 -1
  380. package/dist/providers/LivePreview/sizeReducer.d.ts.map +1 -1
  381. package/dist/providers/Root/index.d.ts +2 -2
  382. package/dist/providers/Root/index.d.ts.map +1 -1
  383. package/dist/providers/Root/index.js.map +1 -1
  384. package/dist/providers/TableColumns/buildColumnState/filterFields.d.ts.map +1 -1
  385. package/dist/providers/TableColumns/buildColumnState/filterFieldsWithPermissions.d.ts.map +1 -1
  386. package/dist/providers/TableColumns/buildColumnState/findValueFromPath.d.ts.map +1 -1
  387. package/dist/providers/TableColumns/buildColumnState/index.d.ts.map +1 -1
  388. package/dist/providers/TableColumns/getInitialColumns.d.ts +1 -1
  389. package/dist/providers/TableColumns/getInitialColumns.d.ts.map +1 -1
  390. package/dist/providers/Theme/index.d.ts +2 -2
  391. package/dist/providers/Theme/index.d.ts.map +1 -1
  392. package/dist/providers/Theme/index.js +2 -1
  393. package/dist/providers/Theme/index.js.map +1 -1
  394. package/dist/providers/Theme/shared.d.ts +3 -0
  395. package/dist/providers/Theme/shared.d.ts.map +1 -0
  396. package/dist/providers/Theme/shared.js +2 -0
  397. package/dist/providers/Theme/shared.js.map +1 -0
  398. package/dist/providers/UploadEdits/index.d.ts.map +1 -1
  399. package/dist/providers/UploadHandlers/index.d.ts.map +1 -1
  400. package/dist/styles.css +19 -5
  401. package/dist/templates/Default/index.d.ts.map +1 -1
  402. package/dist/templates/Default/index.js +6 -0
  403. package/dist/templates/Default/index.js.map +1 -1
  404. package/dist/utilities/api.d.ts.map +1 -1
  405. package/dist/utilities/buildClientFieldSchemaMap/index.d.ts.map +1 -1
  406. package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts.map +1 -1
  407. package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -1
  408. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -1
  409. package/dist/utilities/buildFormState.d.ts +2 -2
  410. package/dist/utilities/buildFormState.d.ts.map +1 -1
  411. package/dist/utilities/buildFormState.js +1 -0
  412. package/dist/utilities/buildFormState.js.map +1 -1
  413. package/dist/utilities/checkDependencies.d.ts.map +1 -1
  414. package/dist/utilities/combineFieldLabel.d.ts.map +1 -1
  415. package/dist/utilities/copyDataFromLocale.d.ts.map +1 -1
  416. package/dist/utilities/copyDataFromLocale.js +1 -0
  417. package/dist/utilities/copyDataFromLocale.js.map +1 -1
  418. package/dist/utilities/filterOutUploadFields.d.ts.map +1 -1
  419. package/dist/utilities/findLocaleFromCode.d.ts.map +1 -1
  420. package/dist/utilities/formatAbsoluteURL.d.ts.map +1 -1
  421. package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -1
  422. package/dist/utilities/formatDocTitle/formatRelationshipTitle.d.ts.map +1 -1
  423. package/dist/utilities/formatDocTitle/index.d.ts +1 -1
  424. package/dist/utilities/formatDocTitle/index.d.ts.map +1 -1
  425. package/dist/utilities/formatDocTitle/index.js +1 -1
  426. package/dist/utilities/formatDocTitle/index.js.map +1 -1
  427. package/dist/utilities/formatFields.d.ts.map +1 -1
  428. package/dist/utilities/formatMetadata.d.ts.map +1 -1
  429. package/dist/utilities/formatRelativeDate.d.ts +15 -0
  430. package/dist/utilities/formatRelativeDate.d.ts.map +1 -0
  431. package/dist/utilities/formatRelativeDate.js +62 -0
  432. package/dist/utilities/formatRelativeDate.js.map +1 -0
  433. package/dist/utilities/generateFieldID.d.ts.map +1 -1
  434. package/dist/utilities/getColumns.d.ts.map +1 -1
  435. package/dist/utilities/getDisplayedFieldValue.d.ts.map +1 -1
  436. package/dist/utilities/getDocPreferences.d.ts +2 -2
  437. package/dist/utilities/getDocPreferences.d.ts.map +1 -1
  438. package/dist/utilities/getDocPreferences.js.map +1 -1
  439. package/dist/utilities/getDocumentData.d.ts +2 -2
  440. package/dist/utilities/getDocumentData.d.ts.map +1 -1
  441. package/dist/utilities/getDocumentData.js.map +1 -1
  442. package/dist/utilities/getDocumentPermissions.d.ts.map +1 -1
  443. package/dist/utilities/getGlobalData.d.ts +2 -2
  444. package/dist/utilities/getGlobalData.d.ts.map +1 -1
  445. package/dist/utilities/getGlobalData.js.map +1 -1
  446. package/dist/utilities/getHasScheduledPublish.d.ts +2 -2
  447. package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -1
  448. package/dist/utilities/getHasScheduledPublish.js.map +1 -1
  449. package/dist/utilities/getIsLocked.d.ts +2 -2
  450. package/dist/utilities/getIsLocked.d.ts.map +1 -1
  451. package/dist/utilities/getIsLocked.js.map +1 -1
  452. package/dist/utilities/getLanguageDir.d.ts +12 -0
  453. package/dist/utilities/getLanguageDir.d.ts.map +1 -0
  454. package/dist/utilities/getLanguageDir.js +12 -0
  455. package/dist/utilities/getLanguageDir.js.map +1 -0
  456. package/dist/utilities/getOffsetTop.d.ts.map +1 -1
  457. package/dist/utilities/getRequestHighContrast.d.ts.map +1 -1
  458. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  459. package/dist/utilities/getRequestTheme.d.ts +1 -1
  460. package/dist/utilities/getRequestTheme.d.ts.map +1 -1
  461. package/dist/utilities/getRequestTheme.js +1 -1
  462. package/dist/utilities/getRequestTheme.js.map +1 -1
  463. package/dist/utilities/getRouteWithoutAdmin.d.ts.map +1 -1
  464. package/dist/utilities/getSupportedMonacoLocale.d.ts.map +1 -1
  465. package/dist/utilities/getVersions.d.ts +2 -2
  466. package/dist/utilities/getVersions.d.ts.map +1 -1
  467. package/dist/utilities/getVersions.js +2 -5
  468. package/dist/utilities/getVersions.js.map +1 -1
  469. package/dist/utilities/handleAuthRedirect.d.ts +2 -2
  470. package/dist/utilities/handleAuthRedirect.d.ts.map +1 -1
  471. package/dist/utilities/handleAuthRedirect.js.map +1 -1
  472. package/dist/utilities/handleBackToDashboard.d.ts.map +1 -1
  473. package/dist/utilities/handleFormStateLocking.d.ts +2 -2
  474. package/dist/utilities/handleFormStateLocking.d.ts.map +1 -1
  475. package/dist/utilities/handleFormStateLocking.js.map +1 -1
  476. package/dist/utilities/handleGoBack.d.ts.map +1 -1
  477. package/dist/utilities/handleLivePreview.d.ts +1 -0
  478. package/dist/utilities/handleLivePreview.d.ts.map +1 -1
  479. package/dist/utilities/handlePreview.d.ts.map +1 -1
  480. package/dist/utilities/handleServerFunctions.d.ts.map +1 -1
  481. package/dist/utilities/handleStaleDataCheck.d.ts.map +1 -1
  482. package/dist/utilities/handleTakeOver.d.ts +5 -5
  483. package/dist/utilities/handleTakeOver.d.ts.map +1 -1
  484. package/dist/utilities/handleTakeOver.js.map +1 -1
  485. package/dist/utilities/hasOptionLabelJSXElement.d.ts.map +1 -1
  486. package/dist/utilities/hasSavePermission.d.ts.map +1 -1
  487. package/dist/utilities/initReq.d.ts.map +1 -1
  488. package/dist/utilities/isClientUserObject.d.ts +2 -2
  489. package/dist/utilities/isClientUserObject.d.ts.map +1 -1
  490. package/dist/utilities/isClientUserObject.js.map +1 -1
  491. package/dist/utilities/isCustomAdminView.d.ts.map +1 -1
  492. package/dist/utilities/isEditing.d.ts.map +1 -1
  493. package/dist/utilities/isPathMatchingRoute.d.ts.map +1 -1
  494. package/dist/utilities/isPublicAdminRoute.d.ts.map +1 -1
  495. package/dist/utilities/isURLAllowed.d.ts.map +1 -1
  496. package/dist/utilities/isURLAllowed.js +9 -3
  497. package/dist/utilities/isURLAllowed.js.map +1 -1
  498. package/dist/utilities/recentlyViewed.d.ts +16 -0
  499. package/dist/utilities/recentlyViewed.d.ts.map +1 -0
  500. package/dist/utilities/recentlyViewed.js +21 -0
  501. package/dist/utilities/recentlyViewed.js.map +1 -0
  502. package/dist/utilities/recentlyViewed.spec.js +92 -0
  503. package/dist/utilities/recentlyViewed.spec.js.map +1 -0
  504. package/dist/utilities/reduceFieldsToOptions.d.ts.map +1 -1
  505. package/dist/utilities/reduceFieldsToValuesWithValidation.d.ts.map +1 -1
  506. package/dist/utilities/renderTable.d.ts +2 -2
  507. package/dist/utilities/renderTable.d.ts.map +1 -1
  508. package/dist/utilities/resolveFilterOptions.d.ts +1 -1
  509. package/dist/utilities/resolveFilterOptions.d.ts.map +1 -1
  510. package/dist/utilities/sanitizeFilterOptionsQuery.d.ts.map +1 -1
  511. package/dist/utilities/scrollToID.d.ts.map +1 -1
  512. package/dist/utilities/selectiveCache.d.ts.map +1 -1
  513. package/dist/utilities/setsAreEqual.d.ts.map +1 -1
  514. package/dist/utilities/slugify.d.ts +1 -1
  515. package/dist/utilities/slugify.js +1 -1
  516. package/dist/utilities/slugify.js.map +1 -1
  517. package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
  518. package/dist/utilities/upsertPreferences.d.ts.map +1 -1
  519. package/dist/views/Account/ResetPreferences/index.d.ts +2 -2
  520. package/dist/views/Account/ResetPreferences/index.d.ts.map +1 -1
  521. package/dist/views/Account/ResetPreferences/index.js.map +1 -1
  522. package/dist/views/Account/Settings/index.d.ts +2 -2
  523. package/dist/views/Account/Settings/index.d.ts.map +1 -1
  524. package/dist/views/Account/Settings/index.js.map +1 -1
  525. package/dist/views/CollectionTrash/generateCollectionTrashMetadata.d.ts.map +1 -1
  526. package/dist/views/Dashboard/Default/ModularDashboard/WidgetConfigDrawer.d.ts.map +1 -1
  527. package/dist/views/Dashboard/Default/ModularDashboard/WidgetConfigDrawer.js +27 -23
  528. package/dist/views/Dashboard/Default/ModularDashboard/WidgetConfigDrawer.js.map +1 -1
  529. package/dist/views/Dashboard/Default/ModularDashboard/index.css +2 -0
  530. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js +1 -1
  531. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js.map +1 -1
  532. package/dist/views/Dashboard/Default/ModularDashboard/utils/getItemsFromPreferences.d.ts +2 -2
  533. package/dist/views/Dashboard/Default/ModularDashboard/utils/getItemsFromPreferences.d.ts.map +1 -1
  534. package/dist/views/Dashboard/Default/ModularDashboard/utils/getItemsFromPreferences.js.map +1 -1
  535. package/dist/views/Dashboard/Default/index.d.ts +2 -2
  536. package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
  537. package/dist/views/Dashboard/Default/index.js.map +1 -1
  538. package/dist/views/Document/getCustomDocumentViewByKey.d.ts +1 -1
  539. package/dist/views/Document/getCustomDocumentViewByKey.d.ts.map +1 -1
  540. package/dist/views/Document/getCustomViewByRoute.d.ts +1 -1
  541. package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
  542. package/dist/views/Document/getDocumentView.d.ts.map +1 -1
  543. package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
  544. package/dist/views/Document/index.d.ts +1 -1
  545. package/dist/views/Document/index.d.ts.map +1 -1
  546. package/dist/views/Document/index.js +17 -1
  547. package/dist/views/Document/index.js.map +1 -1
  548. package/dist/views/Document/recordRecentlyViewed.d.ts +12 -0
  549. package/dist/views/Document/recordRecentlyViewed.d.ts.map +1 -0
  550. package/dist/views/Document/recordRecentlyViewed.js +40 -0
  551. package/dist/views/Document/recordRecentlyViewed.js.map +1 -0
  552. package/dist/views/Edit/index.d.ts.map +1 -1
  553. package/dist/views/Edit/index.js +1 -1
  554. package/dist/views/Edit/index.js.map +1 -1
  555. package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts +2 -2
  556. package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts.map +1 -1
  557. package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -1
  558. package/dist/views/HierarchyList/HierarchyTable/types.d.ts +2 -2
  559. package/dist/views/HierarchyList/HierarchyTable/types.d.ts.map +1 -1
  560. package/dist/views/HierarchyList/HierarchyTable/types.js.map +1 -1
  561. package/dist/views/HierarchyList/TypeFilter/index.d.ts.map +1 -1
  562. package/dist/views/HierarchyList/TypeFilter/index.js +3 -0
  563. package/dist/views/HierarchyList/TypeFilter/index.js.map +1 -1
  564. package/dist/views/HierarchyList/index.d.ts.map +1 -1
  565. package/dist/views/HierarchyList/index.js +2 -6
  566. package/dist/views/HierarchyList/index.js.map +1 -1
  567. package/dist/views/List/createSerializableValue.d.ts.map +1 -1
  568. package/dist/views/List/extractRelationshipDisplayValue.d.ts.map +1 -1
  569. package/dist/views/List/extractValueOrRelationshipID.d.ts.map +1 -1
  570. package/dist/views/List/generateListViewMetadata.d.ts.map +1 -1
  571. package/dist/views/List/handleGroupBy.d.ts.map +1 -1
  572. package/dist/views/List/handleHierarchy.d.ts +1 -1
  573. package/dist/views/List/handleHierarchy.d.ts.map +1 -1
  574. package/dist/views/List/index.d.ts.map +1 -1
  575. package/dist/views/List/index.js +1 -7
  576. package/dist/views/List/index.js.map +1 -1
  577. package/dist/views/List/renderListViewSlots.d.ts.map +1 -1
  578. package/dist/views/List/resolveAllFilterOptions.d.ts.map +1 -1
  579. package/dist/views/List/transformColumnsToSelect.d.ts.map +1 -1
  580. package/dist/views/Logout/LogoutClient.js +28 -32
  581. package/dist/views/Logout/LogoutClient.js.map +1 -1
  582. package/dist/views/NotFound/page.d.ts.map +1 -1
  583. package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -1
  584. package/dist/views/Root/generatePageMetadata.d.ts.map +1 -1
  585. package/dist/views/Root/getCustomCollectionViewByRoute.d.ts +1 -1
  586. package/dist/views/Root/getCustomCollectionViewByRoute.d.ts.map +1 -1
  587. package/dist/views/Root/getCustomGlobalViewByRoute.d.ts +1 -1
  588. package/dist/views/Root/getCustomGlobalViewByRoute.d.ts.map +1 -1
  589. package/dist/views/Root/getCustomViewByKey.d.ts.map +1 -1
  590. package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
  591. package/dist/views/Root/getRouteData.d.ts.map +1 -1
  592. package/dist/views/Root/index.d.ts.map +1 -1
  593. package/dist/views/Unauthorized/index.d.ts.map +1 -1
  594. package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts.map +1 -1
  595. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -1
  596. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.d.ts.map +1 -1
  597. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
  598. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +1 -0
  599. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
  600. package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
  601. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts.map +1 -1
  602. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +1 -0
  603. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
  604. package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts.map +1 -1
  605. package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
  606. package/dist/views/Version/SelectComparison/index.js +1 -0
  607. package/dist/views/Version/SelectComparison/index.js.map +1 -1
  608. package/dist/views/Versions/buildColumns.d.ts +1 -1
  609. package/dist/views/Versions/buildColumns.d.ts.map +1 -1
  610. package/dist/views/Versions/fetchVersions.d.ts +8 -8
  611. package/dist/views/Versions/fetchVersions.d.ts.map +1 -1
  612. package/dist/views/Versions/fetchVersions.js.map +1 -1
  613. package/dist/views/Versions/types.d.ts +2 -2
  614. package/dist/views/Versions/types.d.ts.map +1 -1
  615. package/dist/views/Versions/types.js.map +1 -1
  616. package/dist/widgets/CollectionCards/getCollectionCardsData.d.ts +2 -2
  617. package/dist/widgets/CollectionCards/getCollectionCardsData.d.ts.map +1 -1
  618. package/dist/widgets/CollectionCards/getCollectionCardsData.js.map +1 -1
  619. package/dist/widgets/CollectionCards/index.client.js.map +1 -1
  620. package/dist/widgets/CollectionQuery/SortField/index.d.ts +3 -0
  621. package/dist/widgets/CollectionQuery/SortField/index.d.ts.map +1 -0
  622. package/dist/widgets/CollectionQuery/SortField/index.js +118 -0
  623. package/dist/widgets/CollectionQuery/SortField/index.js.map +1 -0
  624. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.d.ts +18 -0
  625. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.d.ts.map +1 -0
  626. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.js +91 -0
  627. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.js.map +1 -0
  628. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.spec.js +100 -0
  629. package/dist/widgets/CollectionQuery/getCollectionFieldPaths.spec.js.map +1 -0
  630. package/dist/widgets/CollectionQuery/index.css +64 -0
  631. package/dist/widgets/CollectionQuery/index.d.ts +16 -0
  632. package/dist/widgets/CollectionQuery/index.d.ts.map +1 -0
  633. package/dist/widgets/CollectionQuery/index.js +328 -0
  634. package/dist/widgets/CollectionQuery/index.js.map +1 -0
  635. package/dist/widgets/RecentlyViewed/CollectionsField/index.css +14 -0
  636. package/dist/widgets/RecentlyViewed/CollectionsField/index.d.ts +10 -0
  637. package/dist/widgets/RecentlyViewed/CollectionsField/index.d.ts.map +1 -0
  638. package/dist/widgets/RecentlyViewed/CollectionsField/index.js +76 -0
  639. package/dist/widgets/RecentlyViewed/CollectionsField/index.js.map +1 -0
  640. package/dist/widgets/RecentlyViewed/index.d.ts +10 -0
  641. package/dist/widgets/RecentlyViewed/index.d.ts.map +1 -0
  642. package/dist/widgets/RecentlyViewed/index.js +148 -0
  643. package/dist/widgets/RecentlyViewed/index.js.map +1 -0
  644. package/dist/widgets/WidgetCard/index.css +155 -0
  645. package/dist/widgets/WidgetCard/index.d.ts +19 -0
  646. package/dist/widgets/WidgetCard/index.d.ts.map +1 -0
  647. package/dist/widgets/WidgetCard/index.js +49 -0
  648. package/dist/widgets/WidgetCard/index.js.map +1 -0
  649. package/package.json +6 -509
  650. package/dist/elements/Hierarchy/Drawer/fetchAncestorPath.d.ts.map +0 -1
  651. package/dist/elements/Hierarchy/Drawer/fetchAncestorPath.js.map +0 -1
  652. package/dist/elements/Hierarchy/Drawer/index.css +0 -90
  653. package/dist/elements/Hierarchy/Drawer/index.d.ts +0 -20
  654. package/dist/elements/Hierarchy/Drawer/index.d.ts.map +0 -1
  655. package/dist/elements/Hierarchy/Drawer/index.js.map +0 -1
  656. package/dist/elements/Hierarchy/Drawer/types.d.ts.map +0 -1
  657. package/dist/elements/Hierarchy/Drawer/types.js.map +0 -1
  658. package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.d.ts +0 -30
  659. package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.d.ts.map +0 -1
  660. package/dist/elements/Hierarchy/Drawer/useHierarchyDrawer.js.map +0 -1
  661. package/dist/elements/Nav/NavToggler/index.css +0 -12
  662. package/dist/elements/Nav/NavToggler/index.d.ts +0 -9
  663. package/dist/elements/Nav/NavToggler/index.d.ts.map +0 -1
  664. package/dist/elements/Nav/NavToggler/index.js +0 -91
  665. package/dist/elements/Nav/NavToggler/index.js.map +0 -1
  666. package/dist/elements/Nav/SettingsMenuButton/index.scss +0 -11
  667. /package/dist/elements/Hierarchy/{Drawer → Modal}/fetchAncestorPath.d.ts +0 -0
  668. /package/dist/elements/Hierarchy/{Drawer → Modal}/fetchAncestorPath.js +0 -0
  669. /package/dist/elements/Hierarchy/{Drawer → Modal}/types.js +0 -0
@@ -1,57 +1,56 @@
1
1
  'use client';
2
2
 
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- import { createElement as _createElement } from "react";
5
4
  import { useModal } from '@faceless-ui/modal';
6
- import React, { useCallback, useId, useMemo, useRef } from 'react';
5
+ import React, { useCallback, useId, useMemo, useRef, useState } from 'react';
7
6
  export * from './types.js';
8
7
  import { useConfig } from '../../../providers/Config/index.js';
9
8
  import { useEditDepth } from '../../../providers/EditDepth/index.js';
10
9
  import { useHierarchy } from '../../../providers/Hierarchy/index.js';
11
- import { DrawerToggler } from '../../Drawer/index.js';
12
- import { baseClass, HierarchyDrawer } from './index.js';
13
- export const formatHierarchyDrawerSlug = ({
10
+ import { DrawerToggler as ModalToggler } from '../../Drawer/index.js';
11
+ import { baseClass, HierarchyModal } from './index.js';
12
+ export const formatHierarchyModalSlug = ({
14
13
  depth,
15
14
  uuid
16
- }) => `hierarchy-drawer_${depth}_${uuid}`;
17
- export const HierarchyDrawerToggler = ({
15
+ }) => `hierarchy-modal_${depth}_${uuid}`;
16
+ export const HierarchyModalToggler = ({
18
17
  children,
19
18
  className,
20
19
  disabled,
21
- drawerSlug,
20
+ modalSlug,
22
21
  onClick,
23
22
  ...rest
24
23
  }) => {
25
- return /*#__PURE__*/_jsx(DrawerToggler, {
24
+ return /*#__PURE__*/_jsx(ModalToggler, {
26
25
  className: [className, `${baseClass}__toggler`].filter(Boolean).join(' '),
27
26
  disabled: disabled,
28
27
  onClick: onClick,
29
- slug: drawerSlug,
28
+ slug: modalSlug,
30
29
  ...rest,
31
30
  children: children
32
31
  });
33
32
  };
34
33
  /**
35
- * Hook for using a hierarchy drawer for selecting hierarchy items.
34
+ * Hook for using a hierarchy modal for selecting hierarchy items.
36
35
  *
37
36
  * @example
38
37
  * ```tsx
39
- * const [HierarchyDrawer, HierarchyDrawerToggler, { closeDrawer, openDrawer }] = useHierarchyDrawer({
38
+ * const [HierarchyModal, HierarchyModalToggler, { closeModal, openModal }] = useHierarchyModal({
40
39
  * collectionSlug: 'categories',
41
40
  * })
42
41
  *
43
42
  * return (
44
43
  * <>
45
- * <HierarchyDrawer
44
+ * <HierarchyModal
46
45
  * onSave={(selections) => console.log(selections)}
47
46
  * hasMany={true}
48
47
  * />
49
- * <HierarchyDrawerToggler>Select Categories</HierarchyDrawerToggler>
48
+ * <HierarchyModalToggler>Select Categories</HierarchyModalToggler>
50
49
  * </>
51
50
  * )
52
51
  * ```
53
52
  */
54
- export const useHierarchyDrawer = ({
53
+ export const useHierarchyModal = ({
55
54
  disabledIds,
56
55
  filterByCollection: filterByCollectionProp,
57
56
  hierarchyCollectionSlug,
@@ -81,15 +80,16 @@ export const useHierarchyDrawer = ({
81
80
  }
82
81
  return allowedCollections !== null ? allowedCollections.map(c => c.slug) : undefined;
83
82
  }, [filterByCollectionProp, allowedCollections]);
84
- const drawerDepth = useEditDepth();
83
+ const modalDepth = useEditDepth();
85
84
  const uuid = useId();
86
85
  const {
87
86
  closeModal,
88
87
  openModal,
89
88
  toggleModal
90
89
  } = useModal();
91
- const drawerSlug = formatHierarchyDrawerSlug({
92
- depth: drawerDepth,
90
+ const [reopenCount, setReopenCount] = useState(0);
91
+ const modalSlug = formatHierarchyModalSlug({
92
+ depth: modalDepth,
93
93
  uuid
94
94
  });
95
95
  // Store modal functions in refs to ensure stable callbacks
@@ -101,48 +101,49 @@ export const useHierarchyDrawer = ({
101
101
  openModalRef.current = openModal;
102
102
  toggleModalRef.current = toggleModal;
103
103
  // Stable callbacks using refs - these will NEVER change
104
- const toggleDrawer = useCallback(() => {
105
- toggleModalRef.current(drawerSlug);
106
- }, [drawerSlug]);
107
- const closeDrawer = useCallback(() => {
108
- closeModalRef.current(drawerSlug);
109
- }, [drawerSlug]);
110
- const openDrawer = useCallback(() => {
111
- openModalRef.current(drawerSlug);
112
- }, [drawerSlug]);
113
- const MemoizedDrawer = useMemo(() => {
114
- const DrawerComponent = props => /*#__PURE__*/_createElement(HierarchyDrawer, {
104
+ const toggleHierarchyModal = useCallback(() => {
105
+ toggleModalRef.current(modalSlug);
106
+ }, [modalSlug]);
107
+ const closeHierarchyModal = useCallback(() => {
108
+ closeModalRef.current(modalSlug);
109
+ }, [modalSlug]);
110
+ const openHierarchyModal = useCallback(() => {
111
+ setReopenCount(count => count + 1);
112
+ openModalRef.current(modalSlug);
113
+ }, [modalSlug]);
114
+ const MemoizedModal = useMemo(() => {
115
+ const ModalComponent = props => /*#__PURE__*/_jsx(HierarchyModal, {
115
116
  ...props,
116
117
  baseFilter: baseFilter,
117
- closeDrawer: closeDrawer,
118
+ closeModal: closeHierarchyModal,
118
119
  disabledIds: disabledIds,
119
- drawerSlug: drawerSlug,
120
120
  filterByCollection: filterByCollection,
121
121
  hierarchyCollectionSlug: hierarchyCollectionSlug,
122
122
  Icon: Icon,
123
- key: drawerSlug,
123
+ modalSlug: modalSlug,
124
124
  parentFieldName: parentFieldName,
125
+ reopenCount: reopenCount,
125
126
  useAsTitle: useAsTitle
126
- });
127
- return DrawerComponent;
128
- }, [baseFilter, drawerSlug, closeDrawer, disabledIds, filterByCollection, Icon, parentFieldName, hierarchyCollectionSlug, useAsTitle]);
129
- const MemoizedDrawerToggler = useMemo(() => {
130
- const TogglerComponent = props_0 => /*#__PURE__*/_jsx(HierarchyDrawerToggler, {
127
+ }, modalSlug);
128
+ return ModalComponent;
129
+ }, [baseFilter, closeHierarchyModal, disabledIds, filterByCollection, Icon, modalSlug, parentFieldName, reopenCount, hierarchyCollectionSlug, useAsTitle]);
130
+ const MemoizedModalToggler = useMemo(() => {
131
+ const TogglerComponent = props_0 => /*#__PURE__*/_jsx(HierarchyModalToggler, {
131
132
  ...props_0,
132
- drawerSlug: drawerSlug
133
+ modalSlug: modalSlug
133
134
  });
134
135
  return TogglerComponent;
135
- }, [drawerSlug]);
136
- const MemoizedDrawerState = useMemo(() => ({
137
- closeDrawer,
138
- drawerDepth,
139
- drawerSlug,
140
- // Note: Not tracking isDrawerOpen to prevent re-renders when other modals change state
136
+ }, [modalSlug]);
137
+ const MemoizedModalState = useMemo(() => ({
138
+ closeModal: closeHierarchyModal,
139
+ modalDepth,
140
+ modalSlug,
141
+ // Note: Not tracking isModalOpen to prevent re-renders when other modals change state
141
142
  // Consumers needing this can use useModal() directly
142
- isDrawerOpen: false,
143
- openDrawer,
144
- toggleDrawer
145
- }), [drawerDepth, drawerSlug, toggleDrawer, closeDrawer, openDrawer]);
146
- return [MemoizedDrawer, MemoizedDrawerToggler, MemoizedDrawerState];
143
+ isModalOpen: false,
144
+ openModal: openHierarchyModal,
145
+ toggleModal: toggleHierarchyModal
146
+ }), [closeHierarchyModal, modalDepth, modalSlug, openHierarchyModal, toggleHierarchyModal]);
147
+ return [MemoizedModal, MemoizedModalToggler, MemoizedModalState];
147
148
  };
148
- //# sourceMappingURL=useHierarchyDrawer.js.map
149
+ //# sourceMappingURL=useHierarchyModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHierarchyModal.js","names":["useModal","React","useCallback","useId","useMemo","useRef","useState","useConfig","useEditDepth","useHierarchy","DrawerToggler","ModalToggler","baseClass","HierarchyModal","formatHierarchyModalSlug","depth","uuid","HierarchyModalToggler","children","className","disabled","modalSlug","onClick","rest","_jsx","filter","Boolean","join","slug","useHierarchyModal","disabledIds","filterByCollection","filterByCollectionProp","hierarchyCollectionSlug","Icon","getEntityConfig","allowedCollections","baseFilter","collectionConfig","collectionSlug","useAsTitle","admin","hierarchyConfig","hierarchy","undefined","parentFieldName","map","c","modalDepth","closeModal","openModal","toggleModal","reopenCount","setReopenCount","closeModalRef","openModalRef","toggleModalRef","current","toggleHierarchyModal","closeHierarchyModal","openHierarchyModal","count","MemoizedModal","ModalComponent","props","MemoizedModalToggler","TogglerComponent","MemoizedModalState","isModalOpen"],"sources":["../../../../src/elements/Hierarchy/Modal/useHierarchyModal.tsx"],"sourcesContent":["'use client'\nimport { useModal } from '@faceless-ui/modal'\nimport React, { useCallback, useId, useMemo, useRef, useState } from 'react'\n\nimport type { HierarchyModalProps, HierarchyModalTogglerProps, UseHierarchyModal } from './types.js'\n\nexport * from './types.js'\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useEditDepth } from '../../../providers/EditDepth/index.js'\nimport { useHierarchy } from '../../../providers/Hierarchy/index.js'\nimport { DrawerToggler as ModalToggler } from '../../Drawer/index.js'\nimport { baseClass, HierarchyModal } from './index.js'\n\nexport const formatHierarchyModalSlug = ({\n depth,\n uuid,\n}: {\n depth: number\n uuid: string\n}): string => `hierarchy-modal_${depth}_${uuid}`\n\nexport const HierarchyModalToggler: React.FC<HierarchyModalTogglerProps> = ({\n children,\n className,\n disabled,\n modalSlug,\n onClick,\n ...rest\n}) => {\n return (\n <ModalToggler\n className={[className, `${baseClass}__toggler`].filter(Boolean).join(' ')}\n disabled={disabled}\n onClick={onClick}\n slug={modalSlug}\n {...rest}\n >\n {children}\n </ModalToggler>\n )\n}\n\n/**\n * Hook for using a hierarchy modal for selecting hierarchy items.\n *\n * @example\n * ```tsx\n * const [HierarchyModal, HierarchyModalToggler, { closeModal, openModal }] = useHierarchyModal({\n * collectionSlug: 'categories',\n * })\n *\n * return (\n * <>\n * <HierarchyModal\n * onSave={(selections) => console.log(selections)}\n * hasMany={true}\n * />\n * <HierarchyModalToggler>Select Categories</HierarchyModalToggler>\n * </>\n * )\n * ```\n */\nexport const useHierarchyModal: UseHierarchyModal = ({\n disabledIds,\n filterByCollection: filterByCollectionProp,\n hierarchyCollectionSlug,\n Icon,\n}) => {\n const { getEntityConfig } = useConfig()\n const { allowedCollections, baseFilter } = useHierarchy()\n const collectionConfig = getEntityConfig({ collectionSlug: hierarchyCollectionSlug })\n\n const useAsTitle = collectionConfig?.admin?.useAsTitle\n const hierarchyConfig =\n collectionConfig?.hierarchy && typeof collectionConfig.hierarchy === 'object'\n ? collectionConfig.hierarchy\n : undefined\n const parentFieldName = hierarchyConfig?.parentFieldName\n\n // Use explicit prop if provided, otherwise fall back to allowedCollections from context\n // - allowedCollections is null/undefined: no filtering (undefined)\n // - allowedCollections is []: folder accepts everything, show only unrestricted destinations ([])\n // - allowedCollections has values: show folders accepting those types\n // Memoize to prevent new array references on every render\n const filterByCollection = useMemo(() => {\n if (filterByCollectionProp !== undefined) {\n return filterByCollectionProp\n }\n return allowedCollections !== null ? allowedCollections.map((c) => c.slug) : undefined\n }, [filterByCollectionProp, allowedCollections])\n\n const modalDepth = useEditDepth()\n const uuid = useId()\n const { closeModal, openModal, toggleModal } = useModal()\n const [reopenCount, setReopenCount] = useState(0)\n\n const modalSlug = formatHierarchyModalSlug({\n depth: modalDepth,\n uuid,\n })\n\n // Store modal functions in refs to ensure stable callbacks\n // This prevents re-renders when other modals (like DocumentDrawer) change state\n const closeModalRef = useRef(closeModal)\n const openModalRef = useRef(openModal)\n const toggleModalRef = useRef(toggleModal)\n closeModalRef.current = closeModal\n openModalRef.current = openModal\n toggleModalRef.current = toggleModal\n\n // Stable callbacks using refs - these will NEVER change\n const toggleHierarchyModal = useCallback(() => {\n toggleModalRef.current(modalSlug)\n }, [modalSlug])\n\n const closeHierarchyModal = useCallback(() => {\n closeModalRef.current(modalSlug)\n }, [modalSlug])\n\n const openHierarchyModal = useCallback(() => {\n setReopenCount((count) => count + 1)\n openModalRef.current(modalSlug)\n }, [modalSlug])\n\n const MemoizedModal = useMemo(() => {\n const ModalComponent: React.FC<HierarchyModalProps> = (props) => (\n <HierarchyModal\n key={modalSlug}\n {...props}\n baseFilter={baseFilter}\n closeModal={closeHierarchyModal}\n disabledIds={disabledIds}\n filterByCollection={filterByCollection}\n hierarchyCollectionSlug={hierarchyCollectionSlug}\n Icon={Icon}\n modalSlug={modalSlug}\n parentFieldName={parentFieldName}\n reopenCount={reopenCount}\n useAsTitle={useAsTitle}\n />\n )\n\n return ModalComponent\n }, [\n baseFilter,\n closeHierarchyModal,\n disabledIds,\n filterByCollection,\n Icon,\n modalSlug,\n parentFieldName,\n reopenCount,\n hierarchyCollectionSlug,\n useAsTitle,\n ])\n\n const MemoizedModalToggler = useMemo(() => {\n const TogglerComponent: React.FC<Omit<HierarchyModalTogglerProps, 'modalSlug'>> = (props) => (\n <HierarchyModalToggler {...props} modalSlug={modalSlug} />\n )\n\n return TogglerComponent\n }, [modalSlug])\n\n const MemoizedModalState = useMemo(\n () => ({\n closeModal: closeHierarchyModal,\n modalDepth,\n modalSlug,\n // Note: Not tracking isModalOpen to prevent re-renders when other modals change state\n // Consumers needing this can use useModal() directly\n isModalOpen: false,\n openModal: openHierarchyModal,\n toggleModal: toggleHierarchyModal,\n }),\n [closeHierarchyModal, modalDepth, modalSlug, openHierarchyModal, toggleHierarchyModal],\n )\n\n return [MemoizedModal, MemoizedModalToggler, MemoizedModalState]\n}\n"],"mappings":"AAAA;;;AACA,SAASA,QAAQ,QAAQ;AACzB,OAAOC,KAAA,IAASC,WAAW,EAAEC,KAAK,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAIrE,cAAc;AAEd,SAASC,SAAS,QAAQ;AAC1B,SAASC,YAAY,QAAQ;AAC7B,SAASC,YAAY,QAAQ;AAC7B,SAASC,aAAA,IAAiBC,YAAY,QAAQ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X,cAAA;MAEE,GAAGmD,KAAK;MACT3B,UAAA,EAAYA,UAAA;MACZY,UAAA,EAAYU,mBAAA;MACZ7B,WAAA,EAAaA,WAAA;MACbC,kBAAA,EAAoBA,kBAAA;MACpBE,uBAAA,EAAyBA,uBAAA;MACzBC,IAAA,EAAMA,IAAA;MACNb,SAAA,EAAWA,SAAA;MACXwB,eAAA,EAAiBA,eAAA;MACjBO,WAAA,EAAaA,WAAA;MACbZ,UAAA,EAAYA;OAXPnB,SAAA;IAeT,OAAO0C,cAAA;EACT,GAAG,CACD1B,UAAA,EACAsB,mBAAA,EACA7B,WAAA,EACAC,kBAAA,EACAG,IAAA,EACAb,SAAA,EACAwB,eAAA,EACAO,WAAA,EACAnB,uBAAA,EACAO,UAAA,CACD;EAED,MAAMyB,oBAAA,GAAuB7D,OAAA,CAAQ;IACnC,MAAM8D,gBAAA,GAA6EF,OAAA,iBACjFxC,IAAA,CAACP,qBAAA;MAAuB,GAAG+C,OAAK;MAAE3C,SAAA,EAAWA;;IAG/C,OAAO6C,gBAAA;EACT,GAAG,CAAC7C,SAAA,CAAU;EAEd,MAAM8C,kBAAA,GAAqB/D,OAAA,CACzB,OAAO;IACL6C,UAAA,EAAYU,mBAAA;IACZX,UAAA;IACA3B,SAAA;IACA;IACA;IACA+C,WAAA,EAAa;IACblB,SAAA,EAAWU,kBAAA;IACXT,WAAA,EAAaO;EACf,IACA,CAACC,mBAAA,EAAqBX,UAAA,EAAY3B,SAAA,EAAWuC,kBAAA,EAAoBF,oBAAA,CAAqB;EAGxF,OAAO,CAACI,aAAA,EAAeG,oBAAA,EAAsBE,kBAAA,CAAmB;AAClE","ignoreList":[]}
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  export declare const baseClass = "move-many";
3
3
  type MoveManyProps = {
4
- /** Current parent ID - drawer will open expanded to this location */
4
+ /** Current parent ID - modal will open expanded to this location */
5
5
  currentParentID?: null | number | string;
6
6
  /** The hierarchy collection slug (e.g., 'folders') */
7
7
  hierarchySlug: string;
8
- /** Icon to display in the hierarchy drawer */
8
+ /** Icon to display in the hierarchy modal */
9
9
  Icon?: React.ReactNode;
10
10
  /** When multiple MoveMany components are rendered on the page, this will differentiate them */
11
11
  modalPrefix?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Hierarchy/MoveMany/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAe7D,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,KAAK,aAAa,GAAG;IACnB,qEAAqE;IACrE,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;IACxC,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAA;IACrB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;KAAE,CAAC,CAAA;CACzD,CAAA;AAeD,wBAAgB,QAAQ,CAAC,EACvB,eAAe,EACf,aAAa,EACb,IAAI,EACJ,WAAW,EACX,SAAS,EACT,UAAU,GACX,EAAE,aAAa,qBA4Qf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Hierarchy/MoveMany/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAe7D,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,KAAK,aAAa,GAAG;IACnB,oEAAoE;IACpE,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;IACxC,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;KAAE,CAAC,CAAA;CACzD,CAAA;AAeD,wBAAgB,QAAQ,CAAC,EACvB,eAAe,EACf,aAAa,EACb,IAAI,EACJ,WAAW,EACX,SAAS,EACT,UAAU,GACX,EAAE,aAAa,qBAiQf"}
@@ -15,7 +15,7 @@ import { requests } from '../../../utilities/api.js';
15
15
  import { ConfirmationModal } from '../../ConfirmationModal/index.js';
16
16
  import { ListSelectionButton } from '../../ListSelection/index.js';
17
17
  import { Translation } from '../../Translation/index.js';
18
- import { useHierarchyDrawer } from '../Drawer/useHierarchyDrawer.js';
18
+ import { useHierarchyModal } from '../Modal/useHierarchyModal.js';
19
19
  export const baseClass = 'move-many';
20
20
  /**
21
21
  * Gets the parent field name from the hierarchy config.
@@ -87,10 +87,10 @@ export function MoveMany({
87
87
  const parentIds = selections[hierarchySlug]?.ids;
88
88
  return parentIds?.length ? new Set(parentIds) : undefined;
89
89
  }, [selections, hierarchySlug]);
90
- const [HierarchyDrawer,, {
91
- closeDrawer,
92
- openDrawer
93
- }] = useHierarchyDrawer({
90
+ const [HierarchyModal,, {
91
+ closeModal,
92
+ openModal: openHierarchyModal
93
+ }] = useHierarchyModal({
94
94
  disabledIds,
95
95
  filterByCollection: requiredCollections,
96
96
  hierarchyCollectionSlug: hierarchySlug,
@@ -210,7 +210,7 @@ export function MoveMany({
210
210
  }));
211
211
  }
212
212
  if (!hasErrors || totalMoved > 0) {
213
- closeDrawer();
213
+ closeModal();
214
214
  onSuccess?.();
215
215
  }
216
216
  } catch (_err) {
@@ -218,7 +218,7 @@ export function MoveMany({
218
218
  } finally {
219
219
  setDestination(null);
220
220
  }
221
- }, [closeDrawer, destination, selections, parentFieldName, locale, api, i18n, t, label, onSuccess]);
221
+ }, [closeModal, destination, selections, parentFieldName, locale, api, i18n, t, label, onSuccess]);
222
222
  if (count === 0 || !canMove) {
223
223
  return null;
224
224
  }
@@ -226,9 +226,9 @@ export function MoveMany({
226
226
  children: [/*#__PURE__*/_jsx(ListSelectionButton, {
227
227
  "aria-label": t('general:move'),
228
228
  className: `${baseClass}__toggle`,
229
- onClick: openDrawer,
229
+ onClick: openHierarchyModal,
230
230
  children: t('general:move')
231
- }), /*#__PURE__*/_jsx(HierarchyDrawer, {
231
+ }), /*#__PURE__*/_jsx(HierarchyModal, {
232
232
  hasMany: false,
233
233
  initialSelections: currentParentID ? [currentParentID] : null,
234
234
  onMoveToRoot: handleMoveToRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useModal","getTranslation","formatAdminURL","qs","React","useCallback","useMemo","useState","toast","useConfig","useDocumentSelection","useLocale","useTranslation","requests","ConfirmationModal","ListSelectionButton","Translation","useHierarchyDrawer","baseClass","getParentFieldName","hierarchyConfig","config","hierarchy","undefined","parentFieldName","MoveMany","currentParentID","hierarchySlug","Icon","modalPrefix","onSuccess","selections","i18n","t","code","locale","openModal","collections","routes","api","getSelectionsWithMetadata","destination","setDestination","confirmMoveDrawerSlug","requiredCollections","selectionsWithMeta","required","Set","collectionSlug","items","Object","entries","metadata","allowedCollections","slug","add","size","Array","from","disabledIds","parentIds","ids","length","HierarchyDrawer","closeDrawer","openDrawer","filterByCollection","hierarchyCollectionSlug","count","label","totalCount","labels","find","c","collectionLabel","plural","singular","push","join","hierarchyCollectionConfig","canMove","handleDrawerSave","selectionsMap","firstSelection","values","next","value","destinationId","id","destinationTitle","path","title","String","handleMoveToRoot","handleConfirmMove","totalMoved","hasErrors","queryString","stringify","where","in","addQueryPrefix","url","apiRoute","response","patch","body","JSON","headers","language","credentials","json","status","errors","error","message","description","map","movedCount","docs","successKey","success","_err","_jsxs","Fragment","_jsx","className","onClick","hasMany","initialSelections","onMoveToRoot","onSave","showMoveToRoot","elements","1","children","i18nKey","variables","confirmingLabel","heading","modalSlug","onConfirm"],"sources":["../../../../src/elements/Hierarchy/MoveMany/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { toast } from 'sonner'\n\nimport type { SelectionWithPath } from '../Drawer/types.js'\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useDocumentSelection } from '../../../providers/DocumentSelection/index.js'\nimport { useLocale } from '../../../providers/Locale/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { requests } from '../../../utilities/api.js'\nimport { ConfirmationModal } from '../../ConfirmationModal/index.js'\nimport { ListSelectionButton } from '../../ListSelection/index.js'\nimport { Translation } from '../../Translation/index.js'\nimport { useHierarchyDrawer } from '../Drawer/useHierarchyDrawer.js'\n\nexport const baseClass = 'move-many'\n\ntype MoveManyProps = {\n /** Current parent ID - drawer will open expanded to this location */\n currentParentID?: null | number | string\n /** The hierarchy collection slug (e.g., 'folders') */\n hierarchySlug: string\n /** Icon to display in the hierarchy drawer */\n Icon?: React.ReactNode\n /** When multiple MoveMany components are rendered on the page, this will differentiate them */\n modalPrefix?: string\n /** Callback after successful move */\n onSuccess?: () => void\n /** Selections grouped by collection slug */\n selections: Record<string, { ids: (number | string)[] }>\n}\n\n/**\n * Gets the parent field name from the hierarchy config.\n */\nfunction getParentFieldName(\n hierarchyConfig: ClientCollectionConfig | undefined,\n): string | undefined {\n const config =\n hierarchyConfig?.hierarchy && typeof hierarchyConfig.hierarchy === 'object'\n ? hierarchyConfig.hierarchy\n : undefined\n return config?.parentFieldName\n}\n\nexport function MoveMany({\n currentParentID,\n hierarchySlug,\n Icon,\n modalPrefix,\n onSuccess,\n selections,\n}: MoveManyProps) {\n const { i18n, t } = useTranslation()\n const { code: locale } = useLocale()\n const { openModal } = useModal()\n const {\n config: {\n collections,\n routes: { api },\n },\n } = useConfig()\n\n const { getSelectionsWithMetadata } = useDocumentSelection()\n\n const [destination, setDestination] = useState<{\n id: null | number | string\n title: string\n } | null>(null)\n\n const confirmMoveDrawerSlug = `${modalPrefix ? `${modalPrefix}-` : ''}confirm-move-many`\n\n // Compute required collections from selection metadata\n // For related items: add their collection slug\n // For folders: add their allowedCollections values\n const requiredCollections = useMemo(() => {\n const selectionsWithMeta = getSelectionsWithMetadata()\n const required = new Set<string>()\n\n for (const [collectionSlug, { selections: items }] of Object.entries(selectionsWithMeta)) {\n if (collectionSlug === hierarchySlug) {\n // For folders, add their allowedCollections to required set\n for (const { metadata } of items) {\n if (metadata.allowedCollections) {\n for (const slug of metadata.allowedCollections) {\n required.add(slug)\n }\n }\n }\n } else {\n // For related items, add their collection slug\n required.add(collectionSlug)\n }\n }\n\n return required.size > 0 ? Array.from(required) : undefined\n }, [getSelectionsWithMetadata, hierarchySlug])\n\n // Folders being moved cannot be selected as destination (can't move into themselves)\n const disabledIds = useMemo(() => {\n const parentIds = selections[hierarchySlug]?.ids\n return parentIds?.length ? new Set(parentIds) : undefined\n }, [selections, hierarchySlug])\n\n const [HierarchyDrawer, , { closeDrawer, openDrawer }] = useHierarchyDrawer({\n disabledIds,\n filterByCollection: requiredCollections,\n hierarchyCollectionSlug: hierarchySlug,\n Icon,\n })\n\n // Calculate total count and label\n const { count, label } = useMemo(() => {\n let totalCount = 0\n const labels: string[] = []\n\n for (const [collectionSlug, { ids }] of Object.entries(selections)) {\n const config = collections.find((c) => c.slug === collectionSlug)\n\n if (config && ids.length > 0) {\n totalCount += ids.length\n const collectionLabel = getTranslation(\n ids.length > 1 ? config.labels.plural : config.labels.singular,\n i18n,\n )\n labels.push(collectionLabel)\n }\n }\n\n return {\n count: totalCount,\n label: labels.join(', '),\n }\n }, [selections, collections, i18n])\n\n const hierarchyCollectionConfig = collections.find((c) => c.slug === hierarchySlug)\n const parentFieldName = getParentFieldName(hierarchyCollectionConfig)\n\n // Check if hierarchy has a valid parentFieldName\n const canMove = parentFieldName !== undefined\n\n const handleDrawerSave = useCallback(\n ({ selections: selectionsMap }: { selections: Map<number | string, SelectionWithPath> }) => {\n if (selectionsMap.size === 0) {\n return\n }\n\n const firstSelection = selectionsMap.values().next().value\n const destinationId = firstSelection?.id\n const destinationTitle =\n firstSelection?.path?.[firstSelection.path.length - 1]?.title || String(destinationId)\n\n setDestination({ id: destinationId, title: destinationTitle })\n openModal(confirmMoveDrawerSlug)\n },\n [openModal, confirmMoveDrawerSlug],\n )\n\n const handleMoveToRoot = useCallback(() => {\n setDestination({ id: null, title: t('hierarchy:noParent') })\n openModal(confirmMoveDrawerSlug)\n }, [openModal, confirmMoveDrawerSlug, t])\n\n const handleConfirmMove = useCallback(async () => {\n if (destination === null) {\n return\n }\n\n let totalMoved = 0\n let hasErrors = false\n\n try {\n for (const [collectionSlug, { ids }] of Object.entries(selections)) {\n if (ids.length === 0) {\n continue\n }\n\n const queryString = qs.stringify(\n {\n locale,\n where: { id: { in: ids } },\n },\n { addQueryPrefix: true },\n )\n\n const url = formatAdminURL({\n apiRoute: api,\n path: `/${collectionSlug}${queryString}`,\n })\n\n const response = await requests.patch(url, {\n body: JSON.stringify({ [parentFieldName]: destination.id }),\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n credentials: 'include',\n },\n })\n\n const json = await response.json()\n\n if (response.status >= 400) {\n hasErrors = true\n\n if (json?.errors?.length > 0) {\n toast.error(json.message || t('error:unknown'), {\n description: json.errors\n .map((error: { message: string }) => error.message)\n .join('\\n'),\n })\n } else {\n toast.error(json?.message || t('error:unknown'))\n }\n\n continue\n }\n\n const movedCount = json?.docs?.length || 0\n totalMoved += movedCount\n\n if (json?.errors?.length > 0) {\n hasErrors = true\n toast.error(json.message, {\n description: json.errors.map((error: { message: string }) => error.message).join('\\n'),\n })\n }\n }\n\n if (totalMoved > 0) {\n const successKey =\n destination.id === null ? 'hierarchy:itemsMovedToRoot' : 'hierarchy:itemsMovedTo'\n\n toast.success(\n t(successKey, {\n destination: destination.title,\n title: label,\n }),\n )\n }\n\n if (!hasErrors || totalMoved > 0) {\n closeDrawer()\n onSuccess?.()\n }\n } catch (_err) {\n toast.error(t('error:unknown'))\n } finally {\n setDestination(null)\n }\n }, [\n closeDrawer,\n destination,\n selections,\n parentFieldName,\n locale,\n api,\n i18n,\n t,\n label,\n onSuccess,\n ])\n\n if (count === 0 || !canMove) {\n return null\n }\n\n return (\n <React.Fragment>\n <ListSelectionButton\n aria-label={t('general:move')}\n className={`${baseClass}__toggle`}\n onClick={openDrawer}\n >\n {t('general:move')}\n </ListSelectionButton>\n <HierarchyDrawer\n hasMany={false}\n initialSelections={currentParentID ? [currentParentID] : null}\n onMoveToRoot={handleMoveToRoot}\n onSave={handleDrawerSave}\n showMoveToRoot\n />\n <ConfirmationModal\n body={\n <p>\n {destination?.id === null ? (\n <Translation\n elements={{\n '1': ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"hierarchy:moveItemsToRootConfirmation\"\n t={t}\n variables={{\n count,\n label,\n }}\n />\n ) : (\n <Translation\n elements={{\n '1': ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"general:moveConfirm\"\n t={t}\n variables={{\n count,\n destination: destination?.title || '',\n label,\n }}\n />\n )}\n </p>\n }\n confirmingLabel={t('general:moving')}\n heading={t('general:confirmMove')}\n modalSlug={confirmMoveDrawerSlug}\n onConfirm={handleConfirmMove}\n />\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAA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UACF;;;MAKRqE,eAAA,EAAiBzG,CAAA,CAAE;MACnB0G,OAAA,EAAS1G,CAAA,CAAE;MACX2G,SAAA,EAAWjG,qBAAA;MACXkG,SAAA,EAAW/C;;;AAInB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useModal","getTranslation","formatAdminURL","qs","React","useCallback","useMemo","useState","toast","useConfig","useDocumentSelection","useLocale","useTranslation","requests","ConfirmationModal","ListSelectionButton","Translation","useHierarchyModal","baseClass","getParentFieldName","hierarchyConfig","config","hierarchy","undefined","parentFieldName","MoveMany","currentParentID","hierarchySlug","Icon","modalPrefix","onSuccess","selections","i18n","t","code","locale","openModal","collections","routes","api","getSelectionsWithMetadata","destination","setDestination","confirmMoveDrawerSlug","requiredCollections","selectionsWithMeta","required","Set","collectionSlug","items","Object","entries","metadata","allowedCollections","slug","add","size","Array","from","disabledIds","parentIds","ids","length","HierarchyModal","closeModal","openHierarchyModal","filterByCollection","hierarchyCollectionSlug","count","label","totalCount","labels","find","c","collectionLabel","plural","singular","push","join","hierarchyCollectionConfig","canMove","handleDrawerSave","selectionsMap","firstSelection","values","next","value","destinationId","id","destinationTitle","path","title","String","handleMoveToRoot","handleConfirmMove","totalMoved","hasErrors","queryString","stringify","where","in","addQueryPrefix","url","apiRoute","response","patch","body","JSON","headers","language","credentials","json","status","errors","error","message","description","map","movedCount","docs","successKey","success","_err","_jsxs","Fragment","_jsx","className","onClick","hasMany","initialSelections","onMoveToRoot","onSave","showMoveToRoot","elements","1","children","i18nKey","variables","confirmingLabel","heading","modalSlug","onConfirm"],"sources":["../../../../src/elements/Hierarchy/MoveMany/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { toast } from 'sonner'\n\nimport type { SelectionWithPath } from '../Modal/types.js'\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useDocumentSelection } from '../../../providers/DocumentSelection/index.js'\nimport { useLocale } from '../../../providers/Locale/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { requests } from '../../../utilities/api.js'\nimport { ConfirmationModal } from '../../ConfirmationModal/index.js'\nimport { ListSelectionButton } from '../../ListSelection/index.js'\nimport { Translation } from '../../Translation/index.js'\nimport { useHierarchyModal } from '../Modal/useHierarchyModal.js'\n\nexport const baseClass = 'move-many'\n\ntype MoveManyProps = {\n /** Current parent ID - modal will open expanded to this location */\n currentParentID?: null | number | string\n /** The hierarchy collection slug (e.g., 'folders') */\n hierarchySlug: string\n /** Icon to display in the hierarchy modal */\n Icon?: React.ReactNode\n /** When multiple MoveMany components are rendered on the page, this will differentiate them */\n modalPrefix?: string\n /** Callback after successful move */\n onSuccess?: () => void\n /** Selections grouped by collection slug */\n selections: Record<string, { ids: (number | string)[] }>\n}\n\n/**\n * Gets the parent field name from the hierarchy config.\n */\nfunction getParentFieldName(\n hierarchyConfig: ClientCollectionConfig | undefined,\n): string | undefined {\n const config =\n hierarchyConfig?.hierarchy && typeof hierarchyConfig.hierarchy === 'object'\n ? hierarchyConfig.hierarchy\n : undefined\n return config?.parentFieldName\n}\n\nexport function MoveMany({\n currentParentID,\n hierarchySlug,\n Icon,\n modalPrefix,\n onSuccess,\n selections,\n}: MoveManyProps) {\n const { i18n, t } = useTranslation()\n const { code: locale } = useLocale()\n const { openModal } = useModal()\n const {\n config: {\n collections,\n routes: { api },\n },\n } = useConfig()\n\n const { getSelectionsWithMetadata } = useDocumentSelection()\n\n const [destination, setDestination] = useState<{\n id: null | number | string\n title: string\n } | null>(null)\n\n const confirmMoveDrawerSlug = `${modalPrefix ? `${modalPrefix}-` : ''}confirm-move-many`\n\n // Compute required collections from selection metadata\n // For related items: add their collection slug\n // For folders: add their allowedCollections values\n const requiredCollections = useMemo(() => {\n const selectionsWithMeta = getSelectionsWithMetadata()\n const required = new Set<string>()\n\n for (const [collectionSlug, { selections: items }] of Object.entries(selectionsWithMeta)) {\n if (collectionSlug === hierarchySlug) {\n // For folders, add their allowedCollections to required set\n for (const { metadata } of items) {\n if (metadata.allowedCollections) {\n for (const slug of metadata.allowedCollections) {\n required.add(slug)\n }\n }\n }\n } else {\n // For related items, add their collection slug\n required.add(collectionSlug)\n }\n }\n\n return required.size > 0 ? Array.from(required) : undefined\n }, [getSelectionsWithMetadata, hierarchySlug])\n\n // Folders being moved cannot be selected as destination (can't move into themselves)\n const disabledIds = useMemo(() => {\n const parentIds = selections[hierarchySlug]?.ids\n return parentIds?.length ? new Set(parentIds) : undefined\n }, [selections, hierarchySlug])\n\n const [HierarchyModal, , { closeModal, openModal: openHierarchyModal }] = useHierarchyModal({\n disabledIds,\n filterByCollection: requiredCollections,\n hierarchyCollectionSlug: hierarchySlug,\n Icon,\n })\n\n // Calculate total count and label\n const { count, label } = useMemo(() => {\n let totalCount = 0\n const labels: string[] = []\n\n for (const [collectionSlug, { ids }] of Object.entries(selections)) {\n const config = collections.find((c) => c.slug === collectionSlug)\n\n if (config && ids.length > 0) {\n totalCount += ids.length\n const collectionLabel = getTranslation(\n ids.length > 1 ? config.labels.plural : config.labels.singular,\n i18n,\n )\n labels.push(collectionLabel)\n }\n }\n\n return {\n count: totalCount,\n label: labels.join(', '),\n }\n }, [selections, collections, i18n])\n\n const hierarchyCollectionConfig = collections.find((c) => c.slug === hierarchySlug)\n const parentFieldName = getParentFieldName(hierarchyCollectionConfig)\n\n // Check if hierarchy has a valid parentFieldName\n const canMove = parentFieldName !== undefined\n\n const handleDrawerSave = useCallback(\n ({ selections: selectionsMap }: { selections: Map<number | string, SelectionWithPath> }) => {\n if (selectionsMap.size === 0) {\n return\n }\n\n const firstSelection = selectionsMap.values().next().value\n const destinationId = firstSelection?.id\n const destinationTitle =\n firstSelection?.path?.[firstSelection.path.length - 1]?.title || String(destinationId)\n\n setDestination({ id: destinationId, title: destinationTitle })\n openModal(confirmMoveDrawerSlug)\n },\n [openModal, confirmMoveDrawerSlug],\n )\n\n const handleMoveToRoot = useCallback(() => {\n setDestination({ id: null, title: t('hierarchy:noParent') })\n openModal(confirmMoveDrawerSlug)\n }, [openModal, confirmMoveDrawerSlug, t])\n\n const handleConfirmMove = useCallback(async () => {\n if (destination === null) {\n return\n }\n\n let totalMoved = 0\n let hasErrors = false\n\n try {\n for (const [collectionSlug, { ids }] of Object.entries(selections)) {\n if (ids.length === 0) {\n continue\n }\n\n const queryString = qs.stringify(\n {\n locale,\n where: { id: { in: ids } },\n },\n { addQueryPrefix: true },\n )\n\n const url = formatAdminURL({\n apiRoute: api,\n path: `/${collectionSlug}${queryString}`,\n })\n\n const response = await requests.patch(url, {\n body: JSON.stringify({ [parentFieldName]: destination.id }),\n headers: {\n 'Accept-Language': i18n.language,\n 'Content-Type': 'application/json',\n credentials: 'include',\n },\n })\n\n const json = await response.json()\n\n if (response.status >= 400) {\n hasErrors = true\n\n if (json?.errors?.length > 0) {\n toast.error(json.message || t('error:unknown'), {\n description: json.errors\n .map((error: { message: string }) => error.message)\n .join('\\n'),\n })\n } else {\n toast.error(json?.message || t('error:unknown'))\n }\n\n continue\n }\n\n const movedCount = json?.docs?.length || 0\n totalMoved += movedCount\n\n if (json?.errors?.length > 0) {\n hasErrors = true\n toast.error(json.message, {\n description: json.errors.map((error: { message: string }) => error.message).join('\\n'),\n })\n }\n }\n\n if (totalMoved > 0) {\n const successKey =\n destination.id === null ? 'hierarchy:itemsMovedToRoot' : 'hierarchy:itemsMovedTo'\n\n toast.success(\n t(successKey, {\n destination: destination.title,\n title: label,\n }),\n )\n }\n\n if (!hasErrors || totalMoved > 0) {\n closeModal()\n onSuccess?.()\n }\n } catch (_err) {\n toast.error(t('error:unknown'))\n } finally {\n setDestination(null)\n }\n }, [closeModal, destination, selections, parentFieldName, locale, api, i18n, t, label, onSuccess])\n\n if (count === 0 || !canMove) {\n return null\n }\n\n return (\n <React.Fragment>\n <ListSelectionButton\n aria-label={t('general:move')}\n className={`${baseClass}__toggle`}\n onClick={openHierarchyModal}\n >\n {t('general:move')}\n </ListSelectionButton>\n <HierarchyModal\n hasMany={false}\n initialSelections={currentParentID ? [currentParentID] : null}\n onMoveToRoot={handleMoveToRoot}\n onSave={handleDrawerSave}\n showMoveToRoot\n />\n <ConfirmationModal\n body={\n <p>\n {destination?.id === null ? (\n <Translation\n elements={{\n '1': ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"hierarchy:moveItemsToRootConfirmation\"\n t={t}\n variables={{\n count,\n label,\n }}\n />\n ) : (\n <Translation\n elements={{\n '1': ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"general:moveConfirm\"\n t={t}\n variables={{\n count,\n destination: destination?.title || '',\n label,\n }}\n />\n )}\n </p>\n }\n confirmingLabel={t('general:moving')}\n heading={t('general:confirmMove')}\n modalSlug={confirmMoveDrawerSlug}\n onConfirm={handleConfirmMove}\n />\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AACtD,SAASC,KAAK,QAAQ;AAItB,SAASC,SAAS,QAAQ;AAC1B,SAASC,oBAAoB,QAAQ;AACrC,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,iBAAiB,QAAQ;AAClC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,WAAW,QAAQ;AAC5B,SAASC,iBAAiB,QAAQ;AAElC,OAAO,MAAMC,SAAA,GAAY;AAiBzB;;;AAGA,SAASC,mBACPC,eAAmD;EAEnD,MAAMC,MAAA,GACJD,eAAA,EAAiBE,SAAA,IAAa,OAAOF,eAAA,CAAgBE,SAAS,KAAK,WAC/DF,eAAA,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,UAAmB;MACjC6G,OAAA,EAAS9D,kBAAA;gBAERhC,CAAA,CAAE;qBAEL4F,IAAA,CAAC9D,cAAA;MACCiE,OAAA,EAAS;MACTC,iBAAA,EAAmBvG,eAAA,GAAkB,CAACA,eAAA,CAAgB,GAAG;MACzDwG,YAAA,EAAcrC,gBAAA;MACdsC,MAAA,EAAQlD,gBAAA;MACRmD,cAAc;qBAEhBP,IAAA,CAAC/G,iBAAA;MACC4F,IAAA,eACEmB,IAAA,CAAC;kBACEpF,WAAA,EAAa+C,EAAA,KAAO,oBACnBqC,IAAA,CAAC7G,WAAA;UACCqH,QAAA,EAAU;YACR,KAAKC,CAAC;cAAEC;YAAQ,CAAE,kBAAKV,IAAA,CAAC;wBAAQU;;UAClC;UACAC,OAAA,EAAQ;UACRvG,CAAA,EAAGA,CAAA;UACHwG,SAAA,EAAW;YACTrE,KAAA;YACAC;UACF;0BAGFwD,IAAA,CAAC7G,WAAA;UACCqH,QAAA,EAAU;YACR,KAAKC,CAAC;cAAEC,QAAQ,EAARA;YAAQ,CAAE,kBAAKV,IAAA,CAAC;wBAAQU;;UAClC;UACAC,OAAA,EAAQ;UACRvG,CAAA,EAAGA,CAAA;UACHwG,SAAA,EAAW;YACTrE,KAAA;YACA3B,WAAA,EAAaA,WAAA,EAAakD,KAAA,IAAS;YACnCtB;UACF;;;MAKRqE,eAAA,EAAiBzG,CAAA,CAAE;MACnB0G,OAAA,EAAS1G,CAAA,CAAE;MACX2G,SAAA,EAAWjG,qBAAA;MACXkG,SAAA,EAAW/C;;;AAInB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useHierarchySearch.d.ts","sourceRoot":"","sources":["../../../../src/elements/Hierarchy/Search/useHierarchySearch.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,yEAMhC,sBAAsB,KAAG,wBAmH3B,CAAA"}
1
+ {"version":3,"file":"useHierarchySearch.d.ts","sourceRoot":"","sources":["../../../../src/elements/Hierarchy/Search/useHierarchySearch.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,kBAAkB,4EAM5B,sBAAsB,KAAG,wBAmH3B,CAAA"}
@@ -18,7 +18,7 @@ export declare const useTreeFocus: () => TreeFocusContextType;
18
18
  export declare const useFocusableItem: ({ id, type, ref, }: {
19
19
  id: string;
20
20
  ref: React.RefObject<HTMLElement>;
21
- type: "load-more" | "node";
21
+ type: 'load-more' | 'node';
22
22
  }) => {
23
23
  handleFocus: () => void;
24
24
  isFocused: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"TreeFocusContext.d.ts","sourceRoot":"","sources":["../../../../src/elements/Hierarchy/Tree/TreeFocusContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACjC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;IACxB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC7C,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAA;IAC3C,YAAY,EAAE,CAAC,EAAE,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAA;IACzC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC,CAAA;AAID,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAgFrE,CAAA;AAED,eAAO,MAAM,YAAY,4BAMxB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,oBAI9B;IACD,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACjC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAA;CAC3B;;;;CAsCA,CAAA"}
1
+ {"version":3,"file":"TreeFocusContext.d.ts","sourceRoot":"","sources":["../../../../src/elements/Hierarchy/Tree/TreeFocusContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACjC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;IACxB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC7C,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAA;IAC3C,YAAY,EAAE,CAAC,EAAE,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAA;IACzC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC,CAAA;AAID,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAgFrE,CAAA;AAED,eAAO,MAAM,YAAY,4BAMxB,CAAA;AAED,eAAO,MAAM,gBAAgB,uBAI1B;IACD,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACjC,IAAI,EAAE,WAAW,GAAG,MAAM,CAAA;CAC3B;;;;CAsCA,CAAA"}
@@ -8,32 +8,43 @@
8
8
  margin-left: 0;
9
9
  margin-right: 0;
10
10
  }
11
+
12
+ &:focus-visible {
13
+ outline: none;
14
+ }
11
15
  }
12
16
 
13
- .tree-node__content {
14
- padding: var(--tree-node-padding-y) var(--spacer-2);
15
- padding-left: calc(
16
- (var(--tree-depth, 0) * var(--tree-indent)) + (var(--spacer-1) * var(--tree-depth)) +
17
- var(--spacer-1)
17
+ .tree-node:focus-visible > .tree-node__content-wrapper > .tree-node__content {
18
+ outline: var(--accessibility-outline);
19
+ outline-offset: var(--accessibility-outline-offset);
20
+ }
21
+
22
+ .tree-node__content-wrapper {
23
+ margin-left: calc(
24
+ (var(--tree-depth, 0) * var(--tree-indent)) + (var(--spacer-1) * var(--tree-depth))
18
25
  );
26
+ margin-bottom: var(--tree-row-gap);
27
+ }
28
+
29
+ .tree-node__content {
30
+ display: flex;
31
+ align-items: center;
19
32
  transition: background-color 100ms ease;
20
33
  font-size: var(--tree-font-size);
21
34
  line-height: var(--tree-node-content-height);
22
- margin-bottom: var(--tree-row-gap);
23
35
  }
24
36
 
25
37
  .tree-node__toggle {
26
38
  background: none;
27
39
  border: none;
28
- padding: 0;
40
+ padding-block: var(--spacer-1);
41
+ padding-inline-start: var(--spacer-1);
29
42
  margin: 0;
30
43
  display: flex;
31
44
  align-items: center;
32
45
  justify-content: center;
33
46
  cursor: default;
34
47
  color: var(--color-icon-tertiary);
35
- width: var(--tree-chevron-width);
36
- height: var(--tree-chevron-width);
37
48
  flex-shrink: 0;
38
49
  border-radius: var(--button-radius);
39
50
 
@@ -42,13 +53,27 @@
42
53
  }
43
54
  }
44
55
 
45
- .tree-node__toggle-spacer {
46
- width: calc(var(--tree-chevron-width) + var(--tree-chevron-spacing));
47
- flex-shrink: 0;
56
+ .tree-node__node-trigger {
57
+ border: none;
58
+ background: none;
59
+ margin: 0;
60
+ padding: 0;
61
+ color: inherit;
62
+ font: inherit;
63
+ min-width: 0;
64
+ flex: 1;
65
+ display: flex;
66
+ align-items: center;
67
+ gap: var(--spacer-1);
68
+ text-align: left;
69
+ cursor: pointer;
70
+ padding-block: var(--spacer-1);
71
+ padding-inline-end: var(--spacer-1);
48
72
  }
49
73
 
50
74
  .tree-node__title {
51
- padding-left: var(--spacer-1);
75
+ padding-left: 0;
76
+ margin-left: var(--spacer-1);
52
77
  }
53
78
 
54
79
  .tree-node__loading {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/Hierarchy/Tree/TreeNode/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAQhD,OAAO,aAAa,CAAA;AAqBpB,eAAO,MAAM,QAAQ,GAAI,uNAkBtB,aAAa,sBA0Mf,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/Hierarchy/Tree/TreeNode/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAQhD,OAAO,aAAa,CAAA;AAqBpB,eAAO,MAAM,QAAQ,0NAkBlB,aAAa,sBAgNf,CAAA"}
@@ -82,7 +82,6 @@ export const TreeNode = ({
82
82
  }, [loadMoreFromHook, setFocusedId]);
83
83
  const {
84
84
  handleFocus,
85
- isFocused,
86
85
  tabIndex
87
86
  } = useFocusableItem({
88
87
  id: `node-${node.id}`,
@@ -152,36 +151,43 @@ export const TreeNode = ({
152
151
  '--tree-depth': depth
153
152
  },
154
153
  tabIndex: tabIndex,
155
- children: [/*#__PURE__*/_jsxs("div", {
156
- className: [`${baseClass}__content`, 'sidebar-row', selected && `${baseClass}__content--selected`, selected && 'sidebar-row--selected'].filter(Boolean).join(' '),
157
- children: [hasChildren ? /*#__PURE__*/_jsx("button", {
158
- "aria-label": expanded ? t('general:collapse') : t('general:open'),
159
- className: `${baseClass}__toggle`,
160
- onClick: handleToggle,
161
- onMouseDown: e_2 => e_2.preventDefault(),
162
- tabIndex: -1,
163
- type: "button",
164
- children: /*#__PURE__*/_jsx(ChevronIcon, {
165
- direction: expanded ? 'down' : 'right'
166
- })
167
- }) : /*#__PURE__*/_jsx("div", {
168
- className: `${baseClass}__toggle-spacer`
169
- }), Boolean(icon) && /*#__PURE__*/_jsx("span", {
170
- className: "sidebar-row__icon",
171
- children: icon
172
- }), /*#__PURE__*/_jsx("span", {
173
- className: `${baseClass}__title sidebar-row__title`,
174
- onClick: handleSelectClick,
175
- onMouseDown: e_3 => e_3.preventDefault(),
176
- title: node.title,
177
- children: node.title
178
- }), isLoading && expanded && /*#__PURE__*/_jsx("span", {
179
- className: `${baseClass}__loading`,
180
- children: /*#__PURE__*/_jsx(Spinner, {
181
- loadingText: null,
182
- size: "sm"
183
- })
184
- })]
154
+ children: [/*#__PURE__*/_jsx("div", {
155
+ className: `${baseClass}__content-wrapper`,
156
+ children: /*#__PURE__*/_jsxs("div", {
157
+ className: [`${baseClass}__content`, 'sidebar-row', selected && `${baseClass}__content--selected`, selected && 'sidebar-row--selected'].filter(Boolean).join(' '),
158
+ children: [hasChildren && /*#__PURE__*/_jsx("button", {
159
+ "aria-label": expanded ? t('general:collapse') : t('general:open'),
160
+ className: `${baseClass}__toggle`,
161
+ onClick: handleToggle,
162
+ onMouseDown: e_2 => e_2.preventDefault(),
163
+ tabIndex: -1,
164
+ type: "button",
165
+ children: /*#__PURE__*/_jsx(ChevronIcon, {
166
+ direction: expanded ? 'down' : 'right',
167
+ size: 16
168
+ })
169
+ }), /*#__PURE__*/_jsxs("button", {
170
+ className: [`${baseClass}__node-trigger`, selected && `${baseClass}__node-trigger--selected`].filter(Boolean).join(' '),
171
+ onClick: handleSelectClick,
172
+ onMouseDown: e_3 => e_3.preventDefault(),
173
+ tabIndex: -1,
174
+ title: node.title,
175
+ type: "button",
176
+ children: [Boolean(icon) && /*#__PURE__*/_jsx("span", {
177
+ className: "sidebar-row__icon",
178
+ children: icon
179
+ }), /*#__PURE__*/_jsx("span", {
180
+ className: `${baseClass}__title sidebar-row__title`,
181
+ children: node.title
182
+ })]
183
+ }), isLoading && expanded && /*#__PURE__*/_jsx("span", {
184
+ className: `${baseClass}__loading`,
185
+ children: /*#__PURE__*/_jsx(Spinner, {
186
+ loadingText: null,
187
+ size: "sm"
188
+ })
189
+ })]
190
+ })
185
191
  }), expanded && children && children.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
186
192
  children: [/*#__PURE__*/_jsx("div", {
187
193
  className: `${baseClass}__children`,