@payloadcms/ui 4.0.0-internal.a7ca468 → 4.0.0-internal.af6aad0
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.
- package/dist/elements/AddNewRelation/index.css +0 -4
- package/dist/elements/AddNewRelation/index.js +2 -2
- package/dist/elements/AddNewRelation/index.js.map +1 -1
- package/dist/elements/AppHeader/index.css +5 -0
- package/dist/elements/AppHeader/index.d.ts +1 -8
- package/dist/elements/AppHeader/index.d.ts.map +1 -1
- package/dist/elements/AppHeader/index.js +4 -13
- package/dist/elements/AppHeader/index.js.map +1 -1
- package/dist/elements/ArrayAction/index.d.ts +1 -0
- package/dist/elements/ArrayAction/index.d.ts.map +1 -1
- package/dist/elements/ArrayAction/index.js +45 -32
- package/dist/elements/ArrayAction/index.js.map +1 -1
- package/dist/elements/BulkUpload/AddFilesView/index.css +10 -4
- package/dist/elements/BulkUpload/AddFilesView/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/AddFilesView/index.js +71 -51
- package/dist/elements/BulkUpload/AddFilesView/index.js.map +1 -1
- package/dist/elements/Button/index.css +25 -2
- package/dist/elements/Button/index.d.ts.map +1 -1
- package/dist/elements/Button/index.js +2 -0
- package/dist/elements/Button/index.js.map +1 -1
- package/dist/elements/Button/types.d.ts +1 -1
- package/dist/elements/Button/types.d.ts.map +1 -1
- package/dist/elements/Button/types.js.map +1 -1
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.d.ts +10 -0
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.d.ts.map +1 -1
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.js +65 -3
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.js.map +1 -1
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.spec.js +345 -1
- package/dist/elements/ClipboardAction/mergeFormStateFromClipboard.spec.js.map +1 -1
- package/dist/elements/DefaultListViewTabs/index.css +1 -0
- package/dist/elements/DefaultListViewTabs/index.d.ts.map +1 -1
- package/dist/elements/DefaultListViewTabs/index.js +84 -62
- package/dist/elements/DefaultListViewTabs/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/types.d.ts +1 -1
- package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/types.js.map +1 -1
- package/dist/elements/Drawer/index.css +10 -4
- package/dist/elements/Drawer/types.d.ts +2 -2
- package/dist/elements/Drawer/types.d.ts.map +1 -1
- package/dist/elements/Drawer/types.js.map +1 -1
- package/dist/elements/Dropzone/index.css +10 -4
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.js +3 -2
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.js.map +1 -1
- package/dist/elements/FileManager/index.css +0 -30
- package/dist/elements/FileManager/index.d.ts.map +1 -1
- package/dist/elements/FileManager/index.js +379 -287
- package/dist/elements/FileManager/index.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.css +22 -4
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js +68 -49
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.css +100 -15
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js +97 -137
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/index.js +51 -23
- package/dist/elements/Hierarchy/ColumnBrowser/index.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts +26 -3
- package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/types.js.map +1 -1
- package/dist/elements/Hierarchy/CreateNewButton/index.css +9 -0
- package/dist/elements/Hierarchy/CreateNewButton/index.d.ts +9 -0
- package/dist/elements/Hierarchy/CreateNewButton/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/CreateNewButton/index.js +111 -0
- package/dist/elements/Hierarchy/CreateNewButton/index.js.map +1 -0
- package/dist/elements/Hierarchy/DocHeaderButton/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.js +6 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.js.map +1 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.js +1 -3
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.js.map +1 -1
- package/dist/elements/Hierarchy/Field/index.client.d.ts +5 -0
- package/dist/elements/Hierarchy/Field/index.client.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Field/index.client.js +120 -95
- package/dist/elements/Hierarchy/Field/index.client.js.map +1 -1
- package/dist/elements/Hierarchy/Field/index.css +3 -34
- package/dist/elements/Hierarchy/Modal/Footer/index.css +45 -0
- package/dist/elements/Hierarchy/Modal/Footer/index.d.ts +28 -0
- package/dist/elements/Hierarchy/Modal/Footer/index.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Modal/Footer/index.js +166 -0
- package/dist/elements/Hierarchy/Modal/Footer/index.js.map +1 -0
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts +18 -4
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js +88 -24
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js.map +1 -1
- package/dist/elements/Hierarchy/Modal/index.css +4 -53
- package/dist/elements/Hierarchy/Modal/index.d.ts +5 -2
- package/dist/elements/Hierarchy/Modal/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/index.js +136 -99
- package/dist/elements/Hierarchy/Modal/index.js.map +1 -1
- package/dist/elements/Hierarchy/Modal/types.d.ts +15 -0
- package/dist/elements/Hierarchy/Modal/types.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/types.js.map +1 -1
- package/dist/elements/Hierarchy/MoveMany/index.d.ts +7 -3
- package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/MoveMany/index.js +43 -170
- package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -1
- package/dist/elements/Hierarchy/Search/index.css +2 -9
- package/dist/elements/Hierarchy/Search/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Search/index.js +6 -73
- package/dist/elements/Hierarchy/Search/index.js.map +1 -1
- package/dist/elements/Hierarchy/Search/types.d.ts +2 -6
- package/dist/elements/Hierarchy/Search/types.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Search/types.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts +0 -4
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js +101 -186
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js +1 -21
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.server.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/LoadMore/index.css +3 -3
- package/dist/elements/Hierarchy/Tree/TreeNode/index.css +59 -29
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts +1 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js +54 -10
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/index.css +8 -9
- package/dist/elements/Hierarchy/Tree/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/index.js +29 -47
- package/dist/elements/Hierarchy/Tree/index.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/types.d.ts +9 -1
- package/dist/elements/Hierarchy/Tree/types.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/types.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/useChildren.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/useChildren.js +11 -1
- package/dist/elements/Hierarchy/Tree/useChildren.js.map +1 -1
- package/dist/elements/Hierarchy/getFolderHierarchySlug.d.ts +22 -0
- package/dist/elements/Hierarchy/getFolderHierarchySlug.d.ts.map +1 -0
- package/dist/elements/Hierarchy/getFolderHierarchySlug.js +17 -0
- package/dist/elements/Hierarchy/getFolderHierarchySlug.js.map +1 -0
- package/dist/elements/Hierarchy/move/moveDocuments.d.ts +34 -0
- package/dist/elements/Hierarchy/move/moveDocuments.d.ts.map +1 -0
- package/dist/elements/Hierarchy/move/moveDocuments.js +94 -0
- package/dist/elements/Hierarchy/move/moveDocuments.js.map +1 -0
- package/dist/elements/IDLabel/index.css +6 -0
- package/dist/elements/IDLabel/index.d.ts +1 -1
- package/dist/elements/IDLabel/index.d.ts.map +1 -1
- package/dist/elements/IDLabel/index.js +16 -21
- package/dist/elements/IDLabel/index.js.map +1 -1
- package/dist/elements/ListControls/index.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +3 -2
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/ListControls/types.d.ts +4 -0
- package/dist/elements/ListControls/types.d.ts.map +1 -1
- package/dist/elements/ListControls/types.js.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListBulkUploadButton.d.ts +1 -7
- package/dist/elements/ListHeader/TitleActions/ListBulkUploadButton.d.ts.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListBulkUploadButton.js +26 -32
- package/dist/elements/ListHeader/TitleActions/ListBulkUploadButton.js.map +1 -1
- package/dist/elements/Nav/NavSidebarToggle/index.js +1 -1
- package/dist/elements/Nav/NavSidebarToggle/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.d.ts +1 -0
- package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +12 -18
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.css +1 -2
- package/dist/elements/Nav/context.d.ts +0 -1
- package/dist/elements/Nav/context.d.ts.map +1 -1
- package/dist/elements/Nav/context.js +92 -67
- package/dist/elements/Nav/context.js.map +1 -1
- package/dist/elements/Nav/index.css +47 -42
- package/dist/elements/Nav/index.d.ts +4 -0
- package/dist/elements/Nav/index.d.ts.map +1 -1
- package/dist/elements/Nav/index.js +16 -1
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/elements/NavGroup/index.css +29 -15
- package/dist/elements/Popup/PopupButtonList/index.css +33 -17
- package/dist/elements/Popup/index.css +6 -0
- package/dist/elements/Popup/index.d.ts +10 -0
- package/dist/elements/Popup/index.d.ts.map +1 -1
- package/dist/elements/Popup/index.js +13 -6
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.js +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.js.map +1 -1
- package/dist/elements/QueryPresets/QueryPresetBar/index.js +1 -3
- package/dist/elements/QueryPresets/QueryPresetBar/index.js.map +1 -1
- package/dist/elements/ReactSelect/types.d.ts +5 -0
- package/dist/elements/ReactSelect/types.d.ts.map +1 -1
- package/dist/elements/ReactSelect/types.js.map +1 -1
- package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
- package/dist/elements/RelationshipTable/index.js +5 -2
- package/dist/elements/RelationshipTable/index.js.map +1 -1
- package/dist/elements/SegmentedControl/index.css +58 -0
- package/dist/elements/SegmentedControl/index.d.ts +19 -0
- package/dist/elements/SegmentedControl/index.d.ts.map +1 -0
- package/dist/elements/SegmentedControl/index.js +104 -0
- package/dist/elements/SegmentedControl/index.js.map +1 -0
- package/dist/elements/SelectAll/index.d.ts.map +1 -1
- package/dist/elements/SelectAll/index.js +1 -2
- package/dist/elements/SelectAll/index.js.map +1 -1
- package/dist/elements/SelectRow/index.d.ts.map +1 -1
- package/dist/elements/SelectRow/index.js +1 -2
- package/dist/elements/SelectRow/index.js.map +1 -1
- package/dist/elements/SidebarRow/index.css +1 -5
- package/dist/elements/SidebarToggle/index.css +3 -1
- package/dist/elements/SortHeader/index.d.ts.map +1 -1
- package/dist/elements/SortHeader/index.js +29 -26
- package/dist/elements/SortHeader/index.js.map +1 -1
- package/dist/elements/StepNav/DropTarget/index.css +20 -0
- package/dist/elements/StepNav/DropTarget/index.d.ts +16 -0
- package/dist/elements/StepNav/DropTarget/index.d.ts.map +1 -0
- package/dist/elements/StepNav/DropTarget/index.js +71 -0
- package/dist/elements/StepNav/DropTarget/index.js.map +1 -0
- package/dist/elements/StepNav/index.css +64 -14
- package/dist/elements/StepNav/index.d.ts.map +1 -1
- package/dist/elements/StepNav/index.js +147 -69
- package/dist/elements/StepNav/index.js.map +1 -1
- package/dist/elements/StepNav/types.d.ts +6 -0
- package/dist/elements/StepNav/types.d.ts.map +1 -1
- package/dist/elements/StepNav/types.js.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.css +5 -7
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js +14 -3
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js.map +1 -1
- package/dist/elements/Table/DefaultCell/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/index.js +3 -11
- package/dist/elements/Table/DefaultCell/index.js.map +1 -1
- package/dist/elements/Upload/UploadFromURLModal/index.d.ts +1 -1
- package/dist/elements/Upload/UploadFromURLModal/index.d.ts.map +1 -1
- package/dist/elements/Upload/UploadFromURLModal/index.js.map +1 -1
- package/dist/elements/Upload/index.css +39 -32
- package/dist/elements/Upload/index.d.ts.map +1 -1
- package/dist/elements/Upload/index.js +37 -99
- package/dist/elements/Upload/index.js.map +1 -1
- package/dist/elements/Upload/usePasteFromClipboard.d.ts +14 -0
- package/dist/elements/Upload/usePasteFromClipboard.d.ts.map +1 -0
- package/dist/elements/Upload/usePasteFromClipboard.js +93 -0
- package/dist/elements/Upload/usePasteFromClipboard.js.map +1 -0
- package/dist/elements/Upload/useUploadFromUrl.d.ts +20 -0
- package/dist/elements/Upload/useUploadFromUrl.d.ts.map +1 -0
- package/dist/elements/Upload/useUploadFromUrl.js +201 -0
- package/dist/elements/Upload/useUploadFromUrl.js.map +1 -0
- package/dist/elements/UploadDropzoneContent/index.css +31 -0
- package/dist/elements/UploadDropzoneContent/index.d.ts +17 -0
- package/dist/elements/UploadDropzoneContent/index.d.ts.map +1 -0
- package/dist/elements/UploadDropzoneContent/index.js +62 -0
- package/dist/elements/UploadDropzoneContent/index.js.map +1 -0
- package/dist/elements/UserMenu/HoverSubmenuGroup.d.ts +18 -0
- package/dist/elements/UserMenu/HoverSubmenuGroup.d.ts.map +1 -0
- package/dist/elements/UserMenu/HoverSubmenuGroup.js +38 -0
- package/dist/elements/UserMenu/HoverSubmenuGroup.js.map +1 -0
- package/dist/elements/UserMenu/LanguageMenu/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/LanguageMenu/index.js +83 -39
- package/dist/elements/UserMenu/LanguageMenu/index.js.map +1 -1
- package/dist/elements/UserMenu/SettingsMenu/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/SettingsMenu/index.js +57 -21
- package/dist/elements/UserMenu/SettingsMenu/index.js.map +1 -1
- package/dist/elements/UserMenu/ThemeMenu/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/ThemeMenu/index.js +83 -39
- package/dist/elements/UserMenu/ThemeMenu/index.js.map +1 -1
- package/dist/elements/UserMenu/index.css +32 -2
- package/dist/elements/UserMenu/index.d.ts +1 -0
- package/dist/elements/UserMenu/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/index.js +77 -51
- package/dist/elements/UserMenu/index.js.map +1 -1
- package/dist/elements/UserMenu/useHoverSubmenu.d.ts +21 -0
- package/dist/elements/UserMenu/useHoverSubmenu.d.ts.map +1 -0
- package/dist/elements/UserMenu/useHoverSubmenu.js +260 -0
- package/dist/elements/UserMenu/useHoverSubmenu.js.map +1 -0
- package/dist/elements/ViewModeToggle/index.d.ts +8 -0
- package/dist/elements/ViewModeToggle/index.d.ts.map +1 -0
- package/dist/elements/ViewModeToggle/index.js +29 -0
- package/dist/elements/ViewModeToggle/index.js.map +1 -0
- package/dist/elements/WhereBuilder/conditionValue.d.ts +32 -0
- package/dist/elements/WhereBuilder/conditionValue.d.ts.map +1 -0
- package/dist/elements/WhereBuilder/conditionValue.js +32 -0
- package/dist/elements/WhereBuilder/conditionValue.js.map +1 -0
- package/dist/elements/WhereBuilder/conditionValue.spec.js +65 -0
- package/dist/elements/WhereBuilder/conditionValue.spec.js.map +1 -0
- package/dist/elements/WhereBuilder/index.d.ts.map +1 -1
- package/dist/elements/WhereBuilder/index.js +15 -4
- package/dist/elements/WhereBuilder/index.js.map +1 -1
- package/dist/exports/client/index.d.ts +6 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +1 -1
- package/dist/exports/client/index.js.map +3 -3
- package/dist/fields/Array/ArrayRow.d.ts +1 -0
- package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
- package/dist/fields/Array/ArrayRow.js +2 -0
- package/dist/fields/Array/ArrayRow.js.map +1 -1
- package/dist/fields/Array/index.d.ts.map +1 -1
- package/dist/fields/Array/index.js +38 -10
- package/dist/fields/Array/index.js.map +1 -1
- package/dist/fields/Blocks/BlockRow.d.ts +1 -0
- package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
- package/dist/fields/Blocks/BlockRow.js +2 -0
- package/dist/fields/Blocks/BlockRow.js.map +1 -1
- package/dist/fields/Blocks/RowActions.d.ts +1 -0
- package/dist/fields/Blocks/RowActions.d.ts.map +1 -1
- package/dist/fields/Blocks/RowActions.js +22 -19
- package/dist/fields/Blocks/RowActions.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +35 -7
- package/dist/fields/Blocks/index.js.map +1 -1
- package/dist/fields/Checkbox/Input.d.ts +2 -2
- package/dist/fields/Checkbox/Input.d.ts.map +1 -1
- package/dist/fields/Checkbox/Input.js +134 -152
- package/dist/fields/Checkbox/Input.js.map +1 -1
- package/dist/fields/Checkbox/index.css +168 -155
- package/dist/fields/Relationship/Input.d.ts.map +1 -1
- package/dist/fields/Relationship/Input.js +24 -6
- package/dist/fields/Relationship/Input.js.map +1 -1
- package/dist/fields/Relationship/optionsReducer.d.ts.map +1 -1
- package/dist/fields/Relationship/optionsReducer.js +2 -0
- package/dist/fields/Relationship/optionsReducer.js.map +1 -1
- package/dist/fields/Relationship/types.d.ts +24 -0
- package/dist/fields/Relationship/types.d.ts.map +1 -1
- package/dist/fields/Relationship/types.js.map +1 -1
- package/dist/fields/Upload/Input.d.ts.map +1 -1
- package/dist/fields/Upload/Input.js +44 -16
- package/dist/fields/Upload/Input.js.map +1 -1
- package/dist/fields/Upload/Input.spec.js +241 -0
- package/dist/fields/Upload/Input.spec.js.map +1 -0
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +4 -1
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +1 -0
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/icons/CollapseLayers/index.css +5 -0
- package/dist/icons/CollapseLayers/index.d.ts +7 -0
- package/dist/icons/CollapseLayers/index.d.ts.map +1 -0
- package/dist/icons/CollapseLayers/index.js +23 -0
- package/dist/icons/CollapseLayers/index.js.map +1 -0
- package/dist/icons/Edit/index.d.ts +0 -1
- package/dist/icons/Edit/index.d.ts.map +1 -1
- package/dist/icons/Edit/index.js +4 -4
- package/dist/icons/Edit/index.js.map +1 -1
- package/dist/icons/Table/index.css +5 -0
- package/dist/icons/Table/index.d.ts +7 -0
- package/dist/icons/Table/index.d.ts.map +1 -0
- package/dist/icons/Table/index.js +25 -0
- package/dist/icons/Table/index.js.map +1 -0
- package/dist/providers/Actions/index.d.ts +1 -0
- package/dist/providers/Actions/index.d.ts.map +1 -1
- package/dist/providers/Actions/index.js +43 -11
- package/dist/providers/Actions/index.js.map +1 -1
- package/dist/providers/Auth/AuthSessionDebug/index.css +48 -0
- package/dist/providers/Auth/AuthSessionDebug/index.d.ts +13 -0
- package/dist/providers/Auth/AuthSessionDebug/index.d.ts.map +1 -0
- package/dist/providers/Auth/AuthSessionDebug/index.js +93 -0
- package/dist/providers/Auth/AuthSessionDebug/index.js.map +1 -0
- package/dist/providers/Auth/AuthSessionDebug/utilities.d.ts +21 -0
- package/dist/providers/Auth/AuthSessionDebug/utilities.d.ts.map +1 -0
- package/dist/providers/Auth/AuthSessionDebug/utilities.js +53 -0
- package/dist/providers/Auth/AuthSessionDebug/utilities.js.map +1 -0
- package/dist/providers/Auth/authSessionRequests.d.ts +27 -0
- package/dist/providers/Auth/authSessionRequests.d.ts.map +1 -0
- package/dist/providers/Auth/authSessionRequests.js +119 -0
- package/dist/providers/Auth/authSessionRequests.js.map +1 -0
- package/dist/providers/Auth/authSessionRequests.spec.js +121 -0
- package/dist/providers/Auth/authSessionRequests.spec.js.map +1 -0
- package/dist/providers/Auth/index.d.ts +2 -56
- package/dist/providers/Auth/index.d.ts.map +1 -1
- package/dist/providers/Auth/index.js +283 -135
- package/dist/providers/Auth/index.js.map +1 -1
- package/dist/providers/Auth/sessionActivity.d.ts +23 -0
- package/dist/providers/Auth/sessionActivity.d.ts.map +1 -0
- package/dist/providers/Auth/sessionActivity.js +49 -0
- package/dist/providers/Auth/sessionActivity.js.map +1 -0
- package/dist/providers/Auth/sessionActivity.spec.js +44 -0
- package/dist/providers/Auth/sessionActivity.spec.js.map +1 -0
- package/dist/providers/Auth/sessionTiming.d.ts +11 -0
- package/dist/providers/Auth/sessionTiming.d.ts.map +1 -0
- package/dist/providers/Auth/sessionTiming.js +18 -0
- package/dist/providers/Auth/sessionTiming.js.map +1 -0
- package/dist/providers/Auth/tabSessionSync/index.d.ts +17 -0
- package/dist/providers/Auth/tabSessionSync/index.d.ts.map +1 -0
- package/dist/providers/Auth/tabSessionSync/index.js +263 -0
- package/dist/providers/Auth/tabSessionSync/index.js.map +1 -0
- package/dist/providers/Auth/tabSessionSync/index.spec.js +463 -0
- package/dist/providers/Auth/tabSessionSync/index.spec.js.map +1 -0
- package/dist/providers/Auth/tabSessionSync/types.d.ts +107 -0
- package/dist/providers/Auth/tabSessionSync/types.d.ts.map +1 -0
- package/dist/providers/Auth/tabSessionSync/types.js +6 -0
- package/dist/providers/Auth/tabSessionSync/types.js.map +1 -0
- package/dist/providers/Auth/tabSessionSync/useTabSessionSync.d.ts +11 -0
- package/dist/providers/Auth/tabSessionSync/useTabSessionSync.d.ts.map +1 -0
- package/dist/providers/Auth/tabSessionSync/useTabSessionSync.js +90 -0
- package/dist/providers/Auth/tabSessionSync/useTabSessionSync.js.map +1 -0
- package/dist/providers/Auth/tabSessionSync/utilities.d.ts +26 -0
- package/dist/providers/Auth/tabSessionSync/utilities.d.ts.map +1 -0
- package/dist/providers/Auth/tabSessionSync/utilities.js +159 -0
- package/dist/providers/Auth/tabSessionSync/utilities.js.map +1 -0
- package/dist/providers/Auth/types.d.ts +65 -0
- package/dist/providers/Auth/types.d.ts.map +1 -0
- package/dist/providers/Auth/types.js +2 -0
- package/dist/providers/Auth/types.js.map +1 -0
- package/dist/providers/Auth/useAuthSessionTimers.d.ts +26 -0
- package/dist/providers/Auth/useAuthSessionTimers.d.ts.map +1 -0
- package/dist/providers/Auth/useAuthSessionTimers.js +203 -0
- package/dist/providers/Auth/useAuthSessionTimers.js.map +1 -0
- package/dist/providers/Auth/useAuthSessionTimers.spec.js +311 -0
- package/dist/providers/Auth/useAuthSessionTimers.spec.js.map +1 -0
- package/dist/providers/FormErrorHandler/index.d.ts +5 -1
- package/dist/providers/FormErrorHandler/index.d.ts.map +1 -1
- package/dist/providers/FormErrorHandler/index.js.map +1 -1
- package/dist/providers/Hierarchy/index.d.ts.map +1 -1
- package/dist/providers/Hierarchy/index.js +53 -24
- package/dist/providers/Hierarchy/index.js.map +1 -1
- package/dist/providers/Hierarchy/types.d.ts +2 -0
- package/dist/providers/Hierarchy/types.d.ts.map +1 -1
- package/dist/providers/Hierarchy/types.js.map +1 -1
- package/dist/providers/HierarchyDnd/index.css +51 -0
- package/dist/providers/HierarchyDnd/index.d.ts +21 -0
- package/dist/providers/HierarchyDnd/index.d.ts.map +1 -0
- package/dist/providers/HierarchyDnd/index.js +163 -0
- package/dist/providers/HierarchyDnd/index.js.map +1 -0
- package/dist/providers/HierarchyDnd/types.d.ts +56 -0
- package/dist/providers/HierarchyDnd/types.d.ts.map +1 -0
- package/dist/providers/HierarchyDnd/types.js +21 -0
- package/dist/providers/HierarchyDnd/types.js.map +1 -0
- package/dist/providers/Locale/index.d.ts.map +1 -1
- package/dist/providers/Locale/index.js +41 -36
- package/dist/providers/Locale/index.js.map +1 -1
- package/dist/providers/Root/index.js +4 -4
- package/dist/providers/Root/index.js.map +1 -1
- package/dist/providers/RouteTransition/ProgressBar/index.js +4 -1
- package/dist/providers/RouteTransition/ProgressBar/index.js.map +1 -1
- package/dist/providers/RouteTransition/ProgressBar/index.spec.js +44 -0
- package/dist/providers/RouteTransition/ProgressBar/index.spec.js.map +1 -0
- package/dist/providers/RouteTransition/index.d.ts +2 -0
- package/dist/providers/RouteTransition/index.d.ts.map +1 -1
- package/dist/providers/RouteTransition/index.js +42 -14
- package/dist/providers/RouteTransition/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/templates/Default/Wrapper/index.css +2 -1
- package/dist/templates/Default/Wrapper/index.d.ts +2 -0
- package/dist/templates/Default/Wrapper/index.d.ts.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +12 -6
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/index.css +3 -1
- package/dist/templates/Default/index.d.ts +1 -0
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +19 -15
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/utilities/formatMetadata.d.ts.map +1 -1
- package/dist/utilities/formatMetadata.js +0 -5
- package/dist/utilities/formatMetadata.js.map +1 -1
- package/dist/utilities/getFilesFromClipboard.d.ts +10 -0
- package/dist/utilities/getFilesFromClipboard.d.ts.map +1 -0
- package/dist/utilities/getFilesFromClipboard.js +49 -0
- package/dist/utilities/getFilesFromClipboard.js.map +1 -0
- package/dist/utilities/slugify.d.ts.map +1 -1
- package/dist/utilities/slugify.js +1 -0
- package/dist/utilities/slugify.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js +3 -2
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/WidgetEditControl.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/WidgetEditControl.js +7 -7
- package/dist/views/Dashboard/Default/ModularDashboard/WidgetEditControl.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js +104 -66
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.css +33 -140
- package/dist/views/Edit/SetDocumentTitle/index.d.ts.map +1 -1
- package/dist/views/Edit/SetDocumentTitle/index.js +4 -1
- package/dist/views/Edit/SetDocumentTitle/index.js.map +1 -1
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +3 -2
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/HierarchyList/DocumentListSelection/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/DocumentListSelection/index.js +100 -105
- package/dist/views/HierarchyList/DocumentListSelection/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.css +216 -0
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.d.ts +20 -0
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.js +182 -0
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.css +38 -0
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.d.ts +15 -0
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.js +85 -0
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.css +98 -0
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.d.ts +27 -0
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.js +84 -0
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.d.ts +19 -0
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.js +100 -0
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.d.ts +53 -0
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.js +145 -0
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.d.ts +8 -0
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.js +21 -0
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/index.css +115 -0
- package/dist/views/HierarchyList/HierarchyCards/index.d.ts +80 -0
- package/dist/views/HierarchyList/HierarchyCards/index.d.ts.map +1 -0
- package/dist/views/HierarchyList/HierarchyCards/index.js +457 -0
- package/dist/views/HierarchyList/HierarchyCards/index.js.map +1 -0
- package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts +6 -1
- package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyListHeader/index.js +10 -8
- package/dist/views/HierarchyList/HierarchyListHeader/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.js +11 -10
- package/dist/views/HierarchyList/HierarchyTable/ChildNameCell.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js +3 -6
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/index.css +51 -0
- package/dist/views/HierarchyList/HierarchyTable/index.d.ts +13 -1
- package/dist/views/HierarchyList/HierarchyTable/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/index.js +156 -38
- package/dist/views/HierarchyList/HierarchyTable/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts +6 -0
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.js.map +1 -1
- package/dist/views/HierarchyList/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/index.js +103 -20
- package/dist/views/HierarchyList/index.js.map +1 -1
- package/dist/views/List/ListHeader/index.d.ts +1 -10
- package/dist/views/List/ListHeader/index.d.ts.map +1 -1
- package/dist/views/List/ListHeader/index.js +1 -3
- package/dist/views/List/ListHeader/index.js.map +1 -1
- package/dist/views/List/ListSelection/index.d.ts.map +1 -1
- package/dist/views/List/ListSelection/index.js +138 -122
- package/dist/views/List/ListSelection/index.js.map +1 -1
- package/dist/views/List/handleHierarchy.d.ts +6 -1
- package/dist/views/List/handleHierarchy.d.ts.map +1 -1
- package/dist/views/List/handleHierarchy.js +34 -3
- package/dist/views/List/handleHierarchy.js.map +1 -1
- package/dist/views/List/index.client.d.ts.map +1 -1
- package/dist/views/List/index.client.js +128 -18
- package/dist/views/List/index.client.js.map +1 -1
- package/dist/views/List/index.css +5 -0
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +27 -16
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/Root/getCustomCollectionViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomCollectionViewByRoute.js.map +1 -1
- package/dist/views/Root/getCustomGlobalViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomGlobalViewByRoute.js.map +1 -1
- package/dist/views/Root/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByKey.js.map +1 -1
- package/dist/views/Root/getRouteData.d.ts.map +1 -1
- package/dist/views/Root/getRouteData.js +8 -2
- package/dist/views/Root/getRouteData.js.map +1 -1
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +1 -0
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Version/generateVersionViewMetadata.js.map +1 -1
- package/dist/views/Versions/generateVersionsViewMetadata.js.map +1 -1
- package/package.json +4 -4
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.css +0 -36
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts +0 -13
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts.map +0 -1
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js +0 -141
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { getTranslation } from '@payloadcms/translations';
|
|
5
5
|
import { formatAdminURL } from 'payload/shared';
|
|
6
6
|
import * as qs from 'qs-esm';
|
|
7
|
-
import React, { Fragment, useCallback, useEffect, useMemo } from 'react';
|
|
7
|
+
import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
8
|
import { CreateDocumentButton } from '../../elements/CreateDocumentButton/index.js';
|
|
9
9
|
import { ListControlsBar } from '../../elements/ListControlsBar/index.js';
|
|
10
10
|
import { useListDrawerContext } from '../../elements/ListDrawer/Provider.js';
|
|
@@ -12,9 +12,11 @@ import { RenderCustomComponent } from '../../elements/RenderCustomComponent/inde
|
|
|
12
12
|
import { ListSearchFilter } from '../../elements/Search/ListSearchFilter/index.js';
|
|
13
13
|
import { useStepNav } from '../../elements/StepNav/index.js';
|
|
14
14
|
import { ViewDescription } from '../../elements/ViewDescription/index.js';
|
|
15
|
+
import { ViewModeToggle } from '../../elements/ViewModeToggle/index.js';
|
|
15
16
|
import { useConfig } from '../../providers/Config/index.js';
|
|
16
17
|
import { DocumentSelectionProvider } from '../../providers/DocumentSelection/index.js';
|
|
17
18
|
import { useHierarchy } from '../../providers/Hierarchy/index.js';
|
|
19
|
+
import { usePreferences } from '../../providers/Preferences/index.js';
|
|
18
20
|
import { useRouteCache } from '../../providers/RouteCache/index.js';
|
|
19
21
|
import { useRouter, useSearchParams } from '../../providers/RouterAdapter/index.js';
|
|
20
22
|
import { useRouteTransition } from '../../providers/RouteTransition/index.js';
|
|
@@ -35,6 +37,7 @@ export function HierarchyListView(props) {
|
|
|
35
37
|
hierarchyData,
|
|
36
38
|
HierarchyIcon,
|
|
37
39
|
HierarchySmallIcon,
|
|
40
|
+
listPreferences,
|
|
38
41
|
viewType
|
|
39
42
|
} = props;
|
|
40
43
|
const router = useRouter();
|
|
@@ -61,7 +64,15 @@ export function HierarchyListView(props) {
|
|
|
61
64
|
const {
|
|
62
65
|
labels
|
|
63
66
|
} = collectionConfig;
|
|
64
|
-
|
|
67
|
+
// In scoped mode the viewed collection (Media) is not the collection that owns the tree
|
|
68
|
+
// (Folders), so every hierarchy-shaped lookup below has to go through the latter.
|
|
69
|
+
const hierarchySlug = hierarchyData?.hierarchySlug ?? collectionSlug;
|
|
70
|
+
const scopedCollectionSlug = hierarchyData?.scopedCollectionSlug;
|
|
71
|
+
const isScoped = Boolean(scopedCollectionSlug);
|
|
72
|
+
const hierarchyCollectionConfig = getEntityConfig({
|
|
73
|
+
collectionSlug: hierarchySlug
|
|
74
|
+
});
|
|
75
|
+
const hierarchyConfig = hierarchyCollectionConfig?.hierarchy && typeof hierarchyCollectionConfig.hierarchy === 'object' ? hierarchyCollectionConfig.hierarchy : undefined;
|
|
65
76
|
const parentFieldName = hierarchyConfig?.parentFieldName;
|
|
66
77
|
const {
|
|
67
78
|
i18n,
|
|
@@ -78,11 +89,27 @@ export function HierarchyListView(props) {
|
|
|
78
89
|
const {
|
|
79
90
|
clearRouteCache
|
|
80
91
|
} = useRouteCache();
|
|
92
|
+
const {
|
|
93
|
+
setPreference
|
|
94
|
+
} = usePreferences();
|
|
95
|
+
const [viewMode, setViewMode] = useState(listPreferences?.documentViewMode ?? 'table');
|
|
96
|
+
const handleViewModeChange = useCallback(nextViewMode => {
|
|
97
|
+
setViewMode(nextViewMode);
|
|
98
|
+
// merge: true, otherwise this write clobbers sibling list preferences
|
|
99
|
+
// stored on the same key (columns, sort, limit, preset, groupBy).
|
|
100
|
+
// A failed write only costs the persisted choice, so it must not surface as an
|
|
101
|
+
// unhandled rejection.
|
|
102
|
+
void setPreference(`collection-${collectionSlug}`, {
|
|
103
|
+
documentViewMode: nextViewMode
|
|
104
|
+
}, true).catch(() => {
|
|
105
|
+
// Intentionally ignored: the view still switched, only persistence failed.
|
|
106
|
+
});
|
|
107
|
+
}, [collectionSlug, setPreference]);
|
|
81
108
|
// Callback for when a new document is created
|
|
82
109
|
const handleSave = useCallback(() => {
|
|
83
110
|
clearRouteCache();
|
|
84
|
-
refreshTree(
|
|
85
|
-
}, [clearRouteCache,
|
|
111
|
+
refreshTree(hierarchySlug);
|
|
112
|
+
}, [clearRouteCache, hierarchySlug, refreshTree]);
|
|
86
113
|
// Get search from URL params
|
|
87
114
|
const searchFromURL = searchParams.get('search') || '';
|
|
88
115
|
// Update URL when search changes (debouncing is handled by ListSearchFilter)
|
|
@@ -110,9 +137,30 @@ export function HierarchyListView(props) {
|
|
|
110
137
|
const currentItemTitle = hierarchyData?.breadcrumbs && hierarchyData.breadcrumbs.length > 0 ? hierarchyData.breadcrumbs[hierarchyData.breadcrumbs.length - 1].title : undefined;
|
|
111
138
|
useEffect(() => {
|
|
112
139
|
if (!isInDrawer) {
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
const
|
|
140
|
+
// The trail runs all the way to the current folder, which also titles the page - it is the
|
|
141
|
+
// page you are on, so it renders as an unlinked crumb.
|
|
142
|
+
const breadcrumbs = hierarchyData?.breadcrumbs || [];
|
|
143
|
+
// Dropping on the trail is the only way to move items *out* of a folder, since the tree has no
|
|
144
|
+
// root row: the base crumb moves them to root, an ancestor crumb moves them up.
|
|
145
|
+
const rootDropTarget = parentFieldName ? {
|
|
146
|
+
type: 'hierarchy-folder',
|
|
147
|
+
ancestorIds: [],
|
|
148
|
+
folderId: null,
|
|
149
|
+
hierarchySlug,
|
|
150
|
+
parentFieldName,
|
|
151
|
+
title: t('hierarchy:noParent')
|
|
152
|
+
} : undefined;
|
|
153
|
+
// A scoped browse is its own destination ("Media by Folder"), distinct from the collection's
|
|
154
|
+
// plain list, so its crumb links to the browse root rather than to /collections/media.
|
|
155
|
+
const baseLabel = isScoped ? {
|
|
156
|
+
dropTarget: rootDropTarget,
|
|
157
|
+
label: `${collectionLabel} ${t('general:by')} ${getTranslation(hierarchyCollectionConfig?.labels?.singular, i18n)}`,
|
|
158
|
+
url: formatAdminURL({
|
|
159
|
+
adminRoute,
|
|
160
|
+
path: `/collections/${collectionSlug}/hierarchy`
|
|
161
|
+
})
|
|
162
|
+
} : {
|
|
163
|
+
dropTarget: rootDropTarget,
|
|
116
164
|
label: collectionLabel,
|
|
117
165
|
url: formatAdminURL({
|
|
118
166
|
adminRoute,
|
|
@@ -120,21 +168,39 @@ export function HierarchyListView(props) {
|
|
|
120
168
|
})
|
|
121
169
|
};
|
|
122
170
|
let navItems = [baseLabel];
|
|
123
|
-
if (
|
|
171
|
+
if (breadcrumbs.length > 0) {
|
|
124
172
|
const queryParam = parentFieldName || 'parent';
|
|
125
|
-
|
|
173
|
+
// Ancestor crumbs have to stay inside whichever view the user is browsing.
|
|
174
|
+
const basePath = isScoped ? `/collections/${collectionSlug}/hierarchy` : `/collections/${collectionSlug}`;
|
|
175
|
+
const lastIndex = breadcrumbs.length - 1;
|
|
176
|
+
const hierarchyBreadcrumbs = breadcrumbs.map((crumb, index) => ({
|
|
177
|
+
// The last crumb is the folder already open, so dropping on it would be a no-op. Ancestor
|
|
178
|
+
// folders carry no collectionSpecific value here, so type acceptance falls to the server.
|
|
179
|
+
dropTarget: index === lastIndex || !parentFieldName ? undefined : {
|
|
180
|
+
type: 'hierarchy-folder',
|
|
181
|
+
ancestorIds: breadcrumbs.slice(0, index).map(ancestor => ancestor.id),
|
|
182
|
+
folderId: crumb.id,
|
|
183
|
+
hierarchySlug,
|
|
184
|
+
parentFieldName,
|
|
185
|
+
title: crumb.title
|
|
186
|
+
},
|
|
126
187
|
label: crumb.title,
|
|
127
|
-
url
|
|
188
|
+
// StepNav renders a url-less item as plain text, which is what makes the current folder
|
|
189
|
+
// read as the trail's end rather than as another link back to itself.
|
|
190
|
+
url: index === lastIndex ? undefined : formatAdminURL({
|
|
128
191
|
adminRoute,
|
|
129
|
-
path:
|
|
192
|
+
path: `${basePath}?${queryParam}=${crumb.id}`
|
|
130
193
|
})
|
|
131
194
|
}));
|
|
132
195
|
navItems = [...navItems, ...hierarchyBreadcrumbs];
|
|
133
196
|
}
|
|
134
197
|
setStepNav(navItems);
|
|
135
198
|
}
|
|
136
|
-
}, [adminRoute, setStepNav, isInDrawer, collectionSlug, hierarchyData, collectionLabel, parentFieldName]);
|
|
199
|
+
}, [adminRoute, setStepNav, isInDrawer, collectionSlug, hierarchyData, hierarchyCollectionConfig, hierarchySlug, collectionLabel, i18n, isScoped, parentFieldName, t]);
|
|
137
200
|
const parentId = hierarchyData?.parentId ?? null;
|
|
201
|
+
// The breadcrumb trail is exactly the chain a folder may not be dropped into: its own ancestors
|
|
202
|
+
// plus the folder currently open.
|
|
203
|
+
const ancestorIds = useMemo(() => (hierarchyData?.breadcrumbs ?? []).map(crumb_0 => crumb_0.id), [hierarchyData?.breadcrumbs]);
|
|
138
204
|
// Build collections array for create button
|
|
139
205
|
// Filter by allowedCollections when set (from parent's collectionSpecific field)
|
|
140
206
|
const {
|
|
@@ -153,12 +219,16 @@ export function HierarchyListView(props) {
|
|
|
153
219
|
}
|
|
154
220
|
}
|
|
155
221
|
collections.push({
|
|
156
|
-
collectionSlug,
|
|
222
|
+
collectionSlug: hierarchySlug,
|
|
157
223
|
initialData: Object.keys(hierarchyInitialData).length > 0 ? hierarchyInitialData : {}
|
|
158
224
|
});
|
|
159
225
|
// Add related collections (for creating documents that reference this hierarchy)
|
|
160
226
|
// Filter by allowedCollections when set
|
|
161
227
|
for (const [slug, relatedConfig] of Object.entries(hierarchyConfig?.relatedCollections || {})) {
|
|
228
|
+
// A scoped browse only ever creates folders or documents of the collection being browsed.
|
|
229
|
+
if (isScoped && slug !== scopedCollectionSlug) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
162
232
|
// Skip if not in allowed list (when allowedCollections has restrictions)
|
|
163
233
|
// Empty array means "no restrictions" (folder accepts all types)
|
|
164
234
|
if (allowedCollections && allowedCollections.length > 0 && !allowedCollections.some(c => c.slug === slug)) {
|
|
@@ -236,14 +306,20 @@ export function HierarchyListView(props) {
|
|
|
236
306
|
label: related.label
|
|
237
307
|
}));
|
|
238
308
|
}, [hierarchyData?.relatedDocumentsByCollection, selectedTypes]);
|
|
239
|
-
|
|
240
|
-
|
|
309
|
+
// Memoized on the underlying docs: DocumentSelectionProvider resets every selection whenever
|
|
310
|
+
// this reference changes, so an unmemoized literal would clear the user's selection on any
|
|
311
|
+
// re-render of this component (e.g. toggling the view mode) rather than only on navigation.
|
|
312
|
+
const collectionData = useMemo(() => hierarchyData ? {
|
|
313
|
+
[hierarchySlug]: {
|
|
241
314
|
docs: hierarchyData.childrenData.docs
|
|
242
315
|
},
|
|
243
316
|
...Object.fromEntries(Object.entries(hierarchyData.relatedDocumentsByCollection || {}).map(([slug_3, related_0]) => [slug_3, {
|
|
244
317
|
docs: related_0.result.docs
|
|
245
318
|
}]))
|
|
246
|
-
} : {}
|
|
319
|
+
} : {},
|
|
320
|
+
// hierarchyData is a server prop: stable across client re-renders, new only on
|
|
321
|
+
// navigation/search — which is precisely when clearing the selection is intended.
|
|
322
|
+
[hierarchySlug, hierarchyData]);
|
|
247
323
|
return /*#__PURE__*/_jsx(Fragment, {
|
|
248
324
|
children: /*#__PURE__*/_jsxs("div", {
|
|
249
325
|
className: `${baseClass} ${baseClass}--${collectionSlug}`,
|
|
@@ -270,6 +346,7 @@ export function HierarchyListView(props) {
|
|
|
270
346
|
}) : null]
|
|
271
347
|
}),
|
|
272
348
|
HierarchyIcon: HierarchyIcon,
|
|
349
|
+
hierarchySlug: hierarchySlug,
|
|
273
350
|
i18n: i18n,
|
|
274
351
|
viewType: viewType
|
|
275
352
|
}), /*#__PURE__*/_jsxs(ListControlsBar, {
|
|
@@ -282,12 +359,15 @@ export function HierarchyListView(props) {
|
|
|
282
359
|
}),
|
|
283
360
|
onSearchChange: handleSearchChange,
|
|
284
361
|
searchQueryParam: searchFromURL
|
|
285
|
-
}), /*#__PURE__*/_jsx(TypeFilter, {
|
|
362
|
+
}), !isScoped && /*#__PURE__*/_jsx(TypeFilter, {
|
|
286
363
|
i18n: i18n,
|
|
287
364
|
onChange: handleTypeFilterChange,
|
|
288
365
|
options: typeOptions,
|
|
289
366
|
selectedValues: selectedTypes
|
|
290
367
|
}, `type-filter-${hierarchyData.parent ? hierarchyData.parent.id : 'root'}`)]
|
|
368
|
+
}), /*#__PURE__*/_jsx(ViewModeToggle, {
|
|
369
|
+
onChange: handleViewModeChange,
|
|
370
|
+
viewMode: viewMode
|
|
291
371
|
}), hasCreatePermission && collections.length > 0 && /*#__PURE__*/_jsx(CreateDocumentButton, {
|
|
292
372
|
buttonStyle: "primary",
|
|
293
373
|
collections: collections,
|
|
@@ -295,18 +375,21 @@ export function HierarchyListView(props) {
|
|
|
295
375
|
onSave: handleSave
|
|
296
376
|
})]
|
|
297
377
|
}), /*#__PURE__*/_jsx(HierarchyTable, {
|
|
378
|
+
ancestorIds: ancestorIds,
|
|
298
379
|
baseFilter: baseFilter,
|
|
380
|
+
browseCollectionSlug: collectionSlug,
|
|
299
381
|
childrenData: filteredChildrenData,
|
|
300
382
|
collections: collections,
|
|
301
|
-
collectionSlug:
|
|
383
|
+
collectionSlug: hierarchySlug,
|
|
302
384
|
hasCreatePermission: hasCreatePermission,
|
|
303
385
|
HierarchyIcon: HierarchySmallIcon ?? HierarchyIcon,
|
|
304
|
-
hierarchyLabel:
|
|
386
|
+
hierarchyLabel: getTranslation(hierarchyCollectionConfig?.labels?.plural, i18n),
|
|
305
387
|
parentFieldName: parentFieldName,
|
|
306
388
|
parentId: parentId,
|
|
307
389
|
relatedGroups: filteredRelatedGroups,
|
|
308
390
|
search: searchFromURL,
|
|
309
|
-
useAsTitle:
|
|
391
|
+
useAsTitle: hierarchyCollectionConfig?.admin?.useAsTitle || 'id',
|
|
392
|
+
viewMode: viewMode
|
|
310
393
|
}, `${collectionSlug}-${parentId}-${searchFromURL}-${JSON.stringify(baseFilter)}-${filteredChildrenData?.totalDocs}-${Object.entries(hierarchyData?.relatedDocumentsByCollection || {}).map(([slug_4, r]) => `${slug_4}:${r.result.totalDocs}`).join(',')}`)]
|
|
311
394
|
})
|
|
312
395
|
}), AfterList]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getTranslation","formatAdminURL","qs","React","Fragment","useCallback","useEffect","useMemo","CreateDocumentButton","ListControlsBar","useListDrawerContext","RenderCustomComponent","ListSearchFilter","useStepNav","ViewDescription","useConfig","DocumentSelectionProvider","useHierarchy","useRouteCache","useRouter","useSearchParams","useRouteTransition","useTranslation","HierarchyListHeader","HierarchyTable","TypeFilter","baseClass","HierarchyListView","props","AfterList","baseFilter","BeforeList","collectionSlug","Description","hasCreatePermission","hasCreatePermissionFromProps","hierarchyData","HierarchyIcon","HierarchySmallIcon","viewType","router","searchParams","startRouteTransition","allowCreate","isInDrawer","undefined","config","routes","admin","adminRoute","getEntityConfig","collectionConfig","labels","hierarchyConfig","hierarchy","parentFieldName","i18n","t","collectionLabel","plural","setStepNav","parent","refreshTree","clearRouteCache","handleSave","searchFromURL","get","handleSearchChange","value","currentParams","forEach","v","k","search","queryString","stringify","addQueryPrefix","newUrl","window","location","pathname","replace","currentItemTitle","breadcrumbs","length","title","ancestorBreadcrumbs","slice","baseLabel","label","url","path","navItems","queryParam","hierarchyBreadcrumbs","map","crumb","id","parentId","allowedCollections","collections","hierarchyInitialData","collectionSpecificFieldName","collectionSpecific","fieldName","parentCollectionSpecificValues","push","initialData","Object","keys","slug","relatedConfig","entries","relatedCollections","some","c","fieldValue","hasMany","typeOptions","options","typeFilterFromURL","selectedTypes","split","opt","handleTypeFilterChange","values","allSelected","typeFilter","join","filteredChildrenData","childrenData","filteredRelatedGroups","relatedDocumentsByCollection","filter","includes","related","data","result","collectionData","docs","fromEntries","_jsx","_jsxs","className","description","CustomComponent","Fallback","useAsTitle","onSearchChange","searchQueryParam","onChange","selectedValues","buttonStyle","drawerSlug","onSave","hierarchyLabel","relatedGroups","JSON","totalDocs","r"],"sources":["../../../src/views/HierarchyList/index.tsx"],"sourcesContent":["'use client'\n\nimport type { ListViewClientProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { Fragment, useCallback, useEffect, useMemo } from 'react'\n\nimport type { CollectionOption } from '../../elements/CreateDocumentButton/index.js'\nimport type { StepNavItem } from '../../elements/StepNav/index.js'\n\nimport { CreateDocumentButton } from '../../elements/CreateDocumentButton/index.js'\nimport { ListControlsBar } from '../../elements/ListControlsBar/index.js'\nimport { useListDrawerContext } from '../../elements/ListDrawer/Provider.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { ListSearchFilter } from '../../elements/Search/ListSearchFilter/index.js'\nimport { useStepNav } from '../../elements/StepNav/index.js'\nimport { ViewDescription } from '../../elements/ViewDescription/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { DocumentSelectionProvider } from '../../providers/DocumentSelection/index.js'\nimport { useHierarchy } from '../../providers/Hierarchy/index.js'\nimport { useRouteCache } from '../../providers/RouteCache/index.js'\nimport { useRouter, useSearchParams } from '../../providers/RouterAdapter/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { HierarchyListHeader } from './HierarchyListHeader/index.js'\nimport { HierarchyTable } from './HierarchyTable/index.js'\nimport { TypeFilter } from './TypeFilter/index.js'\nimport './index.css'\n\nconst baseClass = 'hierarchy-list'\n\nexport function HierarchyListView(props: ListViewClientProps) {\n const {\n AfterList,\n baseFilter,\n BeforeList,\n collectionSlug,\n Description,\n hasCreatePermission: hasCreatePermissionFromProps,\n hierarchyData,\n HierarchyIcon,\n HierarchySmallIcon,\n viewType,\n } = props\n\n const router = useRouter()\n const searchParams = useSearchParams()\n const { startRouteTransition } = useRouteTransition()\n\n const { allowCreate, isInDrawer } = useListDrawerContext()\n\n const hasCreatePermission =\n allowCreate !== undefined\n ? allowCreate && hasCreatePermissionFromProps\n : hasCreatePermissionFromProps\n\n const {\n config: {\n routes: { admin: adminRoute },\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n const { labels } = collectionConfig\n\n const hierarchyConfig =\n collectionConfig?.hierarchy && typeof collectionConfig.hierarchy === 'object'\n ? collectionConfig.hierarchy\n : undefined\n const parentFieldName = hierarchyConfig?.parentFieldName\n\n const { i18n, t } = useTranslation()\n const collectionLabel = getTranslation(labels?.plural, i18n)\n\n const { setStepNav } = useStepNav()\n const { parent, refreshTree } = useHierarchy()\n const { clearRouteCache } = useRouteCache()\n\n // Callback for when a new document is created\n const handleSave = useCallback(() => {\n clearRouteCache()\n refreshTree(collectionSlug)\n }, [clearRouteCache, collectionSlug, refreshTree])\n\n // Get search from URL params\n const searchFromURL = searchParams.get('search') || ''\n\n // Update URL when search changes (debouncing is handled by ListSearchFilter)\n // This triggers a server refetch via Next.js router\n const handleSearchChange = useCallback(\n (value: string) => {\n // Build new URL with updated search param\n const currentParams: Record<string, string> = {}\n searchParams.forEach((v, k) => {\n currentParams[k] = v\n })\n\n if (value) {\n currentParams.search = value\n } else {\n delete currentParams.search\n }\n\n const queryString = qs.stringify(currentParams, { addQueryPrefix: true })\n const newUrl = `${window.location.pathname}${queryString}`\n\n if (window.location.search !== queryString) {\n startRouteTransition(() => router.replace(newUrl))\n }\n },\n [router, searchParams, startRouteTransition],\n )\n\n // Get current item title from breadcrumbs (last item is the current one)\n const currentItemTitle =\n hierarchyData?.breadcrumbs && hierarchyData.breadcrumbs.length > 0\n ? hierarchyData.breadcrumbs[hierarchyData.breadcrumbs.length - 1].title\n : undefined\n\n useEffect(() => {\n if (!isInDrawer) {\n // Breadcrumbs exclude the last item (current item) since it's shown in the header\n const ancestorBreadcrumbs = hierarchyData?.breadcrumbs?.slice(0, -1) || []\n\n const baseLabel: StepNavItem = {\n label: collectionLabel,\n url: formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}`,\n }),\n }\n\n let navItems = [baseLabel]\n\n if (ancestorBreadcrumbs.length > 0) {\n const queryParam = parentFieldName || 'parent'\n const hierarchyBreadcrumbs: StepNavItem[] = ancestorBreadcrumbs.map((crumb) => ({\n label: crumb.title,\n url: formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}?${queryParam}=${crumb.id}`,\n }),\n }))\n navItems = [...navItems, ...hierarchyBreadcrumbs]\n }\n\n setStepNav(navItems)\n }\n }, [\n adminRoute,\n setStepNav,\n isInDrawer,\n collectionSlug,\n hierarchyData,\n collectionLabel,\n parentFieldName,\n ])\n\n const parentId = hierarchyData?.parentId ?? null\n\n // Build collections array for create button\n // Filter by allowedCollections when set (from parent's collectionSpecific field)\n const { allowedCollections } = hierarchyData || {}\n\n const collections: CollectionOption[] = []\n\n // Add hierarchy collection (always allowed for creating child hierarchy items)\n // Include parent's collectionSpecific values so new folders inherit the restriction\n const hierarchyInitialData: Record<string, unknown> = {}\n if (parentId !== null) {\n hierarchyInitialData[parentFieldName] = parentId\n\n const collectionSpecificFieldName =\n hierarchyConfig?.collectionSpecific && typeof hierarchyConfig.collectionSpecific === 'object'\n ? hierarchyConfig.collectionSpecific.fieldName\n : undefined\n const parentCollectionSpecificValues = collectionSpecificFieldName\n ? (parent?.[collectionSpecificFieldName] as string[] | undefined)\n : undefined\n if (\n collectionSpecificFieldName &&\n parentCollectionSpecificValues &&\n parentCollectionSpecificValues.length > 0\n ) {\n hierarchyInitialData[collectionSpecificFieldName] = parentCollectionSpecificValues\n }\n }\n\n collections.push({\n collectionSlug,\n initialData: Object.keys(hierarchyInitialData).length > 0 ? hierarchyInitialData : {},\n })\n\n // Add related collections (for creating documents that reference this hierarchy)\n // Filter by allowedCollections when set\n for (const [slug, relatedConfig] of Object.entries(hierarchyConfig?.relatedCollections || {})) {\n // Skip if not in allowed list (when allowedCollections has restrictions)\n // Empty array means \"no restrictions\" (folder accepts all types)\n if (\n allowedCollections &&\n allowedCollections.length > 0 &&\n !allowedCollections.some((c) => c.slug === slug)\n ) {\n continue\n }\n\n // Use array for hasMany fields, single value for hasMany: false\n const fieldValue = relatedConfig.hasMany ? [parentId] : parentId\n\n collections.push({\n collectionSlug: slug,\n initialData: parentId !== null ? { [relatedConfig.fieldName]: fieldValue } : {},\n })\n }\n\n // Build type filter options from hierarchy collection + related collections\n // Filter by allowedCollections when set\n const typeOptions = useMemo(() => {\n const options: { label: string; value: string }[] = []\n\n // Add related collections (filtered by allowedCollections when set)\n for (const [slug] of Object.entries(hierarchyConfig?.relatedCollections || {})) {\n // Skip if not in allowed list (when allowedCollections has restrictions)\n // Empty array means \"no restrictions\" (folder accepts all types)\n if (\n allowedCollections &&\n allowedCollections.length > 0 &&\n !allowedCollections.some((c) => c.slug === slug)\n ) {\n continue\n }\n\n const config = getEntityConfig({ collectionSlug: slug })\n options.push({\n label: getTranslation(config.labels?.plural, i18n),\n value: slug,\n })\n }\n\n return options\n }, [allowedCollections, getEntityConfig, hierarchyConfig?.relatedCollections, i18n])\n\n const typeFilterFromURL = searchParams.get('typeFilter')\n const selectedTypes = useMemo(\n () => (typeFilterFromURL ? typeFilterFromURL.split(',') : typeOptions.map((opt) => opt.value)),\n [typeFilterFromURL, typeOptions],\n )\n\n // Update URL when type filter changes\n const handleTypeFilterChange = useCallback(\n (values: string[]) => {\n // Build new URL with updated typeFilter param\n const currentParams: Record<string, string> = {}\n searchParams.forEach((v, k) => {\n currentParams[k] = v\n })\n\n // Only add typeFilter if not all types are selected\n const allSelected = values.length === typeOptions.length\n if (!allSelected && values.length > 0) {\n currentParams.typeFilter = values.join(',')\n } else {\n delete currentParams.typeFilter\n }\n\n const queryString = qs.stringify(currentParams, { addQueryPrefix: true })\n const newUrl = `${window.location.pathname}${queryString}`\n\n if (window.location.search !== queryString) {\n startRouteTransition(() => router.replace(newUrl))\n }\n },\n [router, searchParams, startRouteTransition, typeOptions.length],\n )\n\n // Filter children based on selected types (client-side for immediate feedback)\n // Server already filters, but this handles the hierarchy collection toggle\n const filteredChildrenData = useMemo(() => {\n if (!hierarchyData?.childrenData) {\n return undefined\n }\n return hierarchyData.childrenData\n }, [hierarchyData?.childrenData])\n\n // Filter related groups based on selected types\n const filteredRelatedGroups = useMemo(() => {\n return Object.entries(hierarchyData?.relatedDocumentsByCollection || {})\n .filter(([slug]) => selectedTypes.includes(slug))\n .map(([slug, related]) => ({\n collectionSlug: slug,\n data: related.result,\n fieldName: related.fieldName,\n hasMany: related.hasMany,\n label: related.label,\n }))\n }, [hierarchyData?.relatedDocumentsByCollection, selectedTypes])\n\n const collectionData = hierarchyData\n ? {\n [collectionSlug]: { docs: hierarchyData.childrenData.docs },\n ...Object.fromEntries(\n Object.entries(hierarchyData.relatedDocumentsByCollection || {}).map(\n ([slug, related]) => [slug, { docs: related.result.docs }],\n ),\n ),\n }\n : {}\n\n return (\n <Fragment>\n <div className={`${baseClass} ${baseClass}--${collectionSlug}`}>\n {BeforeList}\n <DocumentSelectionProvider collectionData={collectionData}>\n <div className={`${baseClass}__wrap`}>\n <HierarchyListHeader\n collectionConfig={collectionConfig}\n currentItemTitle={currentItemTitle}\n Description={\n <React.Fragment>\n {hierarchyData.allowedCollections &&\n hierarchyData.allowedCollections.length > 0 && (\n <div className={`${baseClass}__allowed-types`}>\n {t('general:accepts')}:{' '}\n {hierarchyData.allowedCollections.map((c) => c.label).join(', ')}\n </div>\n )}\n {Description || collectionConfig?.admin?.description ? (\n <div className={`${baseClass}__sub-header`}>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={\n <ViewDescription\n collectionSlug={collectionSlug}\n description={collectionConfig?.admin?.description}\n />\n }\n />\n </div>\n ) : null}\n </React.Fragment>\n }\n HierarchyIcon={HierarchyIcon}\n i18n={i18n}\n viewType={viewType}\n />\n\n <ListControlsBar className={`${baseClass}__controls`}>\n <div className={`${baseClass}__controls-left`}>\n <ListSearchFilter\n label={t('general:searchBy', {\n label: getTranslation(collectionConfig?.admin?.useAsTitle || 'id', i18n),\n })}\n onSearchChange={handleSearchChange}\n searchQueryParam={searchFromURL}\n />\n <TypeFilter\n i18n={i18n}\n key={`type-filter-${hierarchyData.parent ? hierarchyData.parent.id : 'root'}`}\n onChange={handleTypeFilterChange}\n options={typeOptions}\n selectedValues={selectedTypes}\n />\n </div>\n {hasCreatePermission && collections.length > 0 && (\n <CreateDocumentButton\n buttonStyle=\"primary\"\n collections={collections}\n drawerSlug={`hierarchy-create-${collectionSlug}`}\n onSave={handleSave}\n />\n )}\n </ListControlsBar>\n\n <HierarchyTable\n baseFilter={baseFilter}\n childrenData={filteredChildrenData}\n collections={collections}\n collectionSlug={collectionSlug}\n hasCreatePermission={hasCreatePermission}\n HierarchyIcon={HierarchySmallIcon ?? HierarchyIcon}\n hierarchyLabel={collectionLabel}\n key={`${collectionSlug}-${parentId}-${searchFromURL}-${JSON.stringify(baseFilter)}-${filteredChildrenData?.totalDocs}-${Object.entries(\n hierarchyData?.relatedDocumentsByCollection || {},\n )\n .map(([slug, r]) => `${slug}:${r.result.totalDocs}`)\n .join(',')}`}\n parentFieldName={parentFieldName}\n parentId={parentId}\n relatedGroups={filteredRelatedGroups}\n search={searchFromURL}\n useAsTitle={collectionConfig?.admin?.useAsTitle || 'id'}\n />\n </div>\n </DocumentSelectionProvider>\n {AfterList}\n </div>\n </Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ;AAKjE,SAASC,oBAAoB,QAAQ;AACrC,SAASC,eAAe,QAAQ;AAChC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACj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M,UAAA,EAAYA,UAAA;YACZoG,YAAA,EAAcD,oBAAA;YACd7B,WAAA,EAAaA,WAAA;YACbpE,cAAA,EAAgBA,cAAA;YAChBE,mBAAA,EAAqBA,mBAAA;YACrBG,aAAA,EAAeC,kBAAA,IAAsBD,aAAA;YACrCsH,cAAA,EAAgBjG,eAAA;YAMhBH,eAAA,EAAiBA,eAAA;YACjB2C,QAAA,EAAUA,QAAA;YACV0D,aAAA,EAAezB,qBAAA;YACf1D,MAAA,EAAQR,aAAA;YACRkF,UAAA,EAAYhG,gBAAA,EAAkBH,KAAA,EAAOmG,UAAA,IAAc;aAT9C,GAAGnH,cAAA,IAAkBkE,QAAA,IAAYjC,aAAA,IAAiB4F,IAAA,CAAKlF,SAAS,CAAC7C,UAAA,KAAemG,oBAAA,EAAsB6B,SAAA,IAAalD,MAAA,CAAOI,OAAO,CACpI5E,aAAA,EAAegG,4BAAA,IAAgC,CAAC,GAE/CrC,GAAG,CAAC,CAAC,CAACe,MAAA,EAAMiD,CAAA,CAAE,KAAK,GAAGjD,MAAA,IAAQiD,CAAA,CAAEtB,MAAM,CAACqB,SAAS,EAAE,EAClD9B,IAAI,CAAC,MAAM;;UASnBnG,SAAA;;;AAIT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","formatAdminURL","qs","React","Fragment","useCallback","useEffect","useMemo","useState","CreateDocumentButton","ListControlsBar","useListDrawerContext","RenderCustomComponent","ListSearchFilter","useStepNav","ViewDescription","ViewModeToggle","useConfig","DocumentSelectionProvider","useHierarchy","usePreferences","useRouteCache","useRouter","useSearchParams","useRouteTransition","useTranslation","HierarchyListHeader","HierarchyTable","TypeFilter","baseClass","HierarchyListView","props","AfterList","baseFilter","BeforeList","collectionSlug","Description","hasCreatePermission","hasCreatePermissionFromProps","hierarchyData","HierarchyIcon","HierarchySmallIcon","listPreferences","viewType","router","searchParams","startRouteTransition","allowCreate","isInDrawer","undefined","config","routes","admin","adminRoute","getEntityConfig","collectionConfig","labels","hierarchySlug","scopedCollectionSlug","isScoped","Boolean","hierarchyCollectionConfig","hierarchyConfig","hierarchy","parentFieldName","i18n","t","collectionLabel","plural","setStepNav","parent","refreshTree","clearRouteCache","setPreference","viewMode","setViewMode","documentViewMode","handleViewModeChange","nextViewMode","catch","handleSave","searchFromURL","get","handleSearchChange","value","currentParams","forEach","v","k","search","queryString","stringify","addQueryPrefix","newUrl","window","location","pathname","replace","currentItemTitle","breadcrumbs","length","title","rootDropTarget","type","ancestorIds","folderId","baseLabel","dropTarget","label","singular","url","path","navItems","queryParam","basePath","lastIndex","hierarchyBreadcrumbs","map","crumb","index","slice","ancestor","id","parentId","allowedCollections","collections","hierarchyInitialData","collectionSpecificFieldName","collectionSpecific","fieldName","parentCollectionSpecificValues","push","initialData","Object","keys","slug","relatedConfig","entries","relatedCollections","some","c","fieldValue","hasMany","typeOptions","options","typeFilterFromURL","selectedTypes","split","opt","handleTypeFilterChange","values","allSelected","typeFilter","join","filteredChildrenData","childrenData","filteredRelatedGroups","relatedDocumentsByCollection","filter","includes","related","data","result","collectionData","docs","fromEntries","_jsx","_jsxs","className","description","CustomComponent","Fallback","useAsTitle","onSearchChange","searchQueryParam","onChange","selectedValues","buttonStyle","drawerSlug","onSave","browseCollectionSlug","hierarchyLabel","relatedGroups","JSON","totalDocs","r"],"sources":["../../../src/views/HierarchyList/index.tsx"],"sourcesContent":["'use client'\n\nimport type { ListViewClientProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'\n\nimport type { CollectionOption } from '../../elements/CreateDocumentButton/index.js'\nimport type { StepNavItem } from '../../elements/StepNav/index.js'\nimport type { DocumentViewMode } from '../../elements/ViewModeToggle/index.js'\nimport type { HierarchyDropData } from '../../providers/HierarchyDnd/types.js'\n\nimport { CreateDocumentButton } from '../../elements/CreateDocumentButton/index.js'\nimport { ListControlsBar } from '../../elements/ListControlsBar/index.js'\nimport { useListDrawerContext } from '../../elements/ListDrawer/Provider.js'\nimport { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'\nimport { ListSearchFilter } from '../../elements/Search/ListSearchFilter/index.js'\nimport { useStepNav } from '../../elements/StepNav/index.js'\nimport { ViewDescription } from '../../elements/ViewDescription/index.js'\nimport { ViewModeToggle } from '../../elements/ViewModeToggle/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { DocumentSelectionProvider } from '../../providers/DocumentSelection/index.js'\nimport { useHierarchy } from '../../providers/Hierarchy/index.js'\nimport { usePreferences } from '../../providers/Preferences/index.js'\nimport { useRouteCache } from '../../providers/RouteCache/index.js'\nimport { useRouter, useSearchParams } from '../../providers/RouterAdapter/index.js'\nimport { useRouteTransition } from '../../providers/RouteTransition/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { HierarchyListHeader } from './HierarchyListHeader/index.js'\nimport { HierarchyTable } from './HierarchyTable/index.js'\nimport { TypeFilter } from './TypeFilter/index.js'\nimport './index.css'\n\nconst baseClass = 'hierarchy-list'\n\nexport function HierarchyListView(props: ListViewClientProps) {\n const {\n AfterList,\n baseFilter,\n BeforeList,\n collectionSlug,\n Description,\n hasCreatePermission: hasCreatePermissionFromProps,\n hierarchyData,\n HierarchyIcon,\n HierarchySmallIcon,\n listPreferences,\n viewType,\n } = props\n\n const router = useRouter()\n const searchParams = useSearchParams()\n const { startRouteTransition } = useRouteTransition()\n\n const { allowCreate, isInDrawer } = useListDrawerContext()\n\n const hasCreatePermission =\n allowCreate !== undefined\n ? allowCreate && hasCreatePermissionFromProps\n : hasCreatePermissionFromProps\n\n const {\n config: {\n routes: { admin: adminRoute },\n },\n getEntityConfig,\n } = useConfig()\n\n const collectionConfig = getEntityConfig({ collectionSlug })\n const { labels } = collectionConfig\n\n // In scoped mode the viewed collection (Media) is not the collection that owns the tree\n // (Folders), so every hierarchy-shaped lookup below has to go through the latter.\n const hierarchySlug = hierarchyData?.hierarchySlug ?? collectionSlug\n const scopedCollectionSlug = hierarchyData?.scopedCollectionSlug\n const isScoped = Boolean(scopedCollectionSlug)\n const hierarchyCollectionConfig = getEntityConfig({ collectionSlug: hierarchySlug })\n\n const hierarchyConfig =\n hierarchyCollectionConfig?.hierarchy && typeof hierarchyCollectionConfig.hierarchy === 'object'\n ? hierarchyCollectionConfig.hierarchy\n : undefined\n const parentFieldName = hierarchyConfig?.parentFieldName\n\n const { i18n, t } = useTranslation()\n const collectionLabel = getTranslation(labels?.plural, i18n)\n\n const { setStepNav } = useStepNav()\n const { parent, refreshTree } = useHierarchy()\n const { clearRouteCache } = useRouteCache()\n const { setPreference } = usePreferences()\n\n const [viewMode, setViewMode] = useState<DocumentViewMode>(\n listPreferences?.documentViewMode ?? 'table',\n )\n\n const handleViewModeChange = useCallback(\n (nextViewMode: DocumentViewMode) => {\n setViewMode(nextViewMode)\n\n // merge: true, otherwise this write clobbers sibling list preferences\n // stored on the same key (columns, sort, limit, preset, groupBy).\n // A failed write only costs the persisted choice, so it must not surface as an\n // unhandled rejection.\n void setPreference(\n `collection-${collectionSlug}`,\n { documentViewMode: nextViewMode },\n true,\n ).catch(() => {\n // Intentionally ignored: the view still switched, only persistence failed.\n })\n },\n [collectionSlug, setPreference],\n )\n\n // Callback for when a new document is created\n const handleSave = useCallback(() => {\n clearRouteCache()\n refreshTree(hierarchySlug)\n }, [clearRouteCache, hierarchySlug, refreshTree])\n\n // Get search from URL params\n const searchFromURL = searchParams.get('search') || ''\n\n // Update URL when search changes (debouncing is handled by ListSearchFilter)\n // This triggers a server refetch via Next.js router\n const handleSearchChange = useCallback(\n (value: string) => {\n // Build new URL with updated search param\n const currentParams: Record<string, string> = {}\n searchParams.forEach((v, k) => {\n currentParams[k] = v\n })\n\n if (value) {\n currentParams.search = value\n } else {\n delete currentParams.search\n }\n\n const queryString = qs.stringify(currentParams, { addQueryPrefix: true })\n const newUrl = `${window.location.pathname}${queryString}`\n\n if (window.location.search !== queryString) {\n startRouteTransition(() => router.replace(newUrl))\n }\n },\n [router, searchParams, startRouteTransition],\n )\n\n // Get current item title from breadcrumbs (last item is the current one)\n const currentItemTitle =\n hierarchyData?.breadcrumbs && hierarchyData.breadcrumbs.length > 0\n ? hierarchyData.breadcrumbs[hierarchyData.breadcrumbs.length - 1].title\n : undefined\n\n useEffect(() => {\n if (!isInDrawer) {\n // The trail runs all the way to the current folder, which also titles the page - it is the\n // page you are on, so it renders as an unlinked crumb.\n const breadcrumbs = hierarchyData?.breadcrumbs || []\n\n // Dropping on the trail is the only way to move items *out* of a folder, since the tree has no\n // root row: the base crumb moves them to root, an ancestor crumb moves them up.\n const rootDropTarget: HierarchyDropData | undefined = parentFieldName\n ? {\n type: 'hierarchy-folder',\n ancestorIds: [],\n folderId: null,\n hierarchySlug,\n parentFieldName,\n title: t('hierarchy:noParent'),\n }\n : undefined\n\n // A scoped browse is its own destination (\"Media by Folder\"), distinct from the collection's\n // plain list, so its crumb links to the browse root rather than to /collections/media.\n const baseLabel: StepNavItem = isScoped\n ? {\n dropTarget: rootDropTarget,\n label: `${collectionLabel} ${t('general:by')} ${getTranslation(\n hierarchyCollectionConfig?.labels?.singular,\n i18n,\n )}`,\n url: formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/hierarchy`,\n }),\n }\n : {\n dropTarget: rootDropTarget,\n label: collectionLabel,\n url: formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}`,\n }),\n }\n\n let navItems = [baseLabel]\n\n if (breadcrumbs.length > 0) {\n const queryParam = parentFieldName || 'parent'\n // Ancestor crumbs have to stay inside whichever view the user is browsing.\n const basePath: `/${string}` = isScoped\n ? `/collections/${collectionSlug}/hierarchy`\n : `/collections/${collectionSlug}`\n const lastIndex = breadcrumbs.length - 1\n const hierarchyBreadcrumbs: StepNavItem[] = breadcrumbs.map((crumb, index) => ({\n // The last crumb is the folder already open, so dropping on it would be a no-op. Ancestor\n // folders carry no collectionSpecific value here, so type acceptance falls to the server.\n dropTarget:\n index === lastIndex || !parentFieldName\n ? undefined\n : {\n type: 'hierarchy-folder',\n ancestorIds: breadcrumbs.slice(0, index).map((ancestor) => ancestor.id),\n folderId: crumb.id,\n hierarchySlug,\n parentFieldName,\n title: crumb.title,\n },\n label: crumb.title,\n // StepNav renders a url-less item as plain text, which is what makes the current folder\n // read as the trail's end rather than as another link back to itself.\n url:\n index === lastIndex\n ? undefined\n : formatAdminURL({\n adminRoute,\n path: `${basePath}?${queryParam}=${crumb.id}`,\n }),\n }))\n navItems = [...navItems, ...hierarchyBreadcrumbs]\n }\n\n setStepNav(navItems)\n }\n }, [\n adminRoute,\n setStepNav,\n isInDrawer,\n collectionSlug,\n hierarchyData,\n hierarchyCollectionConfig,\n hierarchySlug,\n collectionLabel,\n i18n,\n isScoped,\n parentFieldName,\n t,\n ])\n\n const parentId = hierarchyData?.parentId ?? null\n\n // The breadcrumb trail is exactly the chain a folder may not be dropped into: its own ancestors\n // plus the folder currently open.\n const ancestorIds = useMemo(\n () => (hierarchyData?.breadcrumbs ?? []).map((crumb) => crumb.id),\n [hierarchyData?.breadcrumbs],\n )\n\n // Build collections array for create button\n // Filter by allowedCollections when set (from parent's collectionSpecific field)\n const { allowedCollections } = hierarchyData || {}\n\n const collections: CollectionOption[] = []\n\n // Add hierarchy collection (always allowed for creating child hierarchy items)\n // Include parent's collectionSpecific values so new folders inherit the restriction\n const hierarchyInitialData: Record<string, unknown> = {}\n if (parentId !== null) {\n hierarchyInitialData[parentFieldName] = parentId\n\n const collectionSpecificFieldName =\n hierarchyConfig?.collectionSpecific && typeof hierarchyConfig.collectionSpecific === 'object'\n ? hierarchyConfig.collectionSpecific.fieldName\n : undefined\n const parentCollectionSpecificValues = collectionSpecificFieldName\n ? (parent?.[collectionSpecificFieldName] as string[] | undefined)\n : undefined\n if (\n collectionSpecificFieldName &&\n parentCollectionSpecificValues &&\n parentCollectionSpecificValues.length > 0\n ) {\n hierarchyInitialData[collectionSpecificFieldName] = parentCollectionSpecificValues\n }\n }\n\n collections.push({\n collectionSlug: hierarchySlug,\n initialData: Object.keys(hierarchyInitialData).length > 0 ? hierarchyInitialData : {},\n })\n\n // Add related collections (for creating documents that reference this hierarchy)\n // Filter by allowedCollections when set\n for (const [slug, relatedConfig] of Object.entries(hierarchyConfig?.relatedCollections || {})) {\n // A scoped browse only ever creates folders or documents of the collection being browsed.\n if (isScoped && slug !== scopedCollectionSlug) {\n continue\n }\n\n // Skip if not in allowed list (when allowedCollections has restrictions)\n // Empty array means \"no restrictions\" (folder accepts all types)\n if (\n allowedCollections &&\n allowedCollections.length > 0 &&\n !allowedCollections.some((c) => c.slug === slug)\n ) {\n continue\n }\n\n // Use array for hasMany fields, single value for hasMany: false\n const fieldValue = relatedConfig.hasMany ? [parentId] : parentId\n\n collections.push({\n collectionSlug: slug,\n initialData: parentId !== null ? { [relatedConfig.fieldName]: fieldValue } : {},\n })\n }\n\n // Build type filter options from hierarchy collection + related collections\n // Filter by allowedCollections when set\n const typeOptions = useMemo(() => {\n const options: { label: string; value: string }[] = []\n\n // Add related collections (filtered by allowedCollections when set)\n for (const [slug] of Object.entries(hierarchyConfig?.relatedCollections || {})) {\n // Skip if not in allowed list (when allowedCollections has restrictions)\n // Empty array means \"no restrictions\" (folder accepts all types)\n if (\n allowedCollections &&\n allowedCollections.length > 0 &&\n !allowedCollections.some((c) => c.slug === slug)\n ) {\n continue\n }\n\n const config = getEntityConfig({ collectionSlug: slug })\n options.push({\n label: getTranslation(config.labels?.plural, i18n),\n value: slug,\n })\n }\n\n return options\n }, [allowedCollections, getEntityConfig, hierarchyConfig?.relatedCollections, i18n])\n\n const typeFilterFromURL = searchParams.get('typeFilter')\n const selectedTypes = useMemo(\n () => (typeFilterFromURL ? typeFilterFromURL.split(',') : typeOptions.map((opt) => opt.value)),\n [typeFilterFromURL, typeOptions],\n )\n\n // Update URL when type filter changes\n const handleTypeFilterChange = useCallback(\n (values: string[]) => {\n // Build new URL with updated typeFilter param\n const currentParams: Record<string, string> = {}\n searchParams.forEach((v, k) => {\n currentParams[k] = v\n })\n\n // Only add typeFilter if not all types are selected\n const allSelected = values.length === typeOptions.length\n if (!allSelected && values.length > 0) {\n currentParams.typeFilter = values.join(',')\n } else {\n delete currentParams.typeFilter\n }\n\n const queryString = qs.stringify(currentParams, { addQueryPrefix: true })\n const newUrl = `${window.location.pathname}${queryString}`\n\n if (window.location.search !== queryString) {\n startRouteTransition(() => router.replace(newUrl))\n }\n },\n [router, searchParams, startRouteTransition, typeOptions.length],\n )\n\n // Filter children based on selected types (client-side for immediate feedback)\n // Server already filters, but this handles the hierarchy collection toggle\n const filteredChildrenData = useMemo(() => {\n if (!hierarchyData?.childrenData) {\n return undefined\n }\n return hierarchyData.childrenData\n }, [hierarchyData?.childrenData])\n\n // Filter related groups based on selected types\n const filteredRelatedGroups = useMemo(() => {\n return Object.entries(hierarchyData?.relatedDocumentsByCollection || {})\n .filter(([slug]) => selectedTypes.includes(slug))\n .map(([slug, related]) => ({\n collectionSlug: slug,\n data: related.result,\n fieldName: related.fieldName,\n hasMany: related.hasMany,\n label: related.label,\n }))\n }, [hierarchyData?.relatedDocumentsByCollection, selectedTypes])\n\n // Memoized on the underlying docs: DocumentSelectionProvider resets every selection whenever\n // this reference changes, so an unmemoized literal would clear the user's selection on any\n // re-render of this component (e.g. toggling the view mode) rather than only on navigation.\n const collectionData = useMemo(\n () =>\n hierarchyData\n ? {\n [hierarchySlug]: { docs: hierarchyData.childrenData.docs },\n ...Object.fromEntries(\n Object.entries(hierarchyData.relatedDocumentsByCollection || {}).map(\n ([slug, related]) => [slug, { docs: related.result.docs }],\n ),\n ),\n }\n : {},\n // hierarchyData is a server prop: stable across client re-renders, new only on\n // navigation/search — which is precisely when clearing the selection is intended.\n [hierarchySlug, hierarchyData],\n )\n\n return (\n <Fragment>\n <div className={`${baseClass} ${baseClass}--${collectionSlug}`}>\n {BeforeList}\n <DocumentSelectionProvider collectionData={collectionData}>\n <div className={`${baseClass}__wrap`}>\n <HierarchyListHeader\n collectionConfig={collectionConfig}\n currentItemTitle={currentItemTitle}\n Description={\n <React.Fragment>\n {hierarchyData.allowedCollections &&\n hierarchyData.allowedCollections.length > 0 && (\n <div className={`${baseClass}__allowed-types`}>\n {t('general:accepts')}:{' '}\n {hierarchyData.allowedCollections.map((c) => c.label).join(', ')}\n </div>\n )}\n {Description || collectionConfig?.admin?.description ? (\n <div className={`${baseClass}__sub-header`}>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={\n <ViewDescription\n collectionSlug={collectionSlug}\n description={collectionConfig?.admin?.description}\n />\n }\n />\n </div>\n ) : null}\n </React.Fragment>\n }\n HierarchyIcon={HierarchyIcon}\n hierarchySlug={hierarchySlug}\n i18n={i18n}\n viewType={viewType}\n />\n\n <ListControlsBar className={`${baseClass}__controls`}>\n <div className={`${baseClass}__controls-left`}>\n <ListSearchFilter\n label={t('general:searchBy', {\n label: getTranslation(collectionConfig?.admin?.useAsTitle || 'id', i18n),\n })}\n onSearchChange={handleSearchChange}\n searchQueryParam={searchFromURL}\n />\n {/* A scoped browse has exactly one document type, so the filter would be noise. */}\n {!isScoped && (\n <TypeFilter\n i18n={i18n}\n key={`type-filter-${hierarchyData.parent ? hierarchyData.parent.id : 'root'}`}\n onChange={handleTypeFilterChange}\n options={typeOptions}\n selectedValues={selectedTypes}\n />\n )}\n </div>\n <ViewModeToggle onChange={handleViewModeChange} viewMode={viewMode} />\n {hasCreatePermission && collections.length > 0 && (\n <CreateDocumentButton\n buttonStyle=\"primary\"\n collections={collections}\n drawerSlug={`hierarchy-create-${collectionSlug}`}\n onSave={handleSave}\n />\n )}\n </ListControlsBar>\n\n <HierarchyTable\n ancestorIds={ancestorIds}\n baseFilter={baseFilter}\n browseCollectionSlug={collectionSlug}\n childrenData={filteredChildrenData}\n collections={collections}\n collectionSlug={hierarchySlug}\n hasCreatePermission={hasCreatePermission}\n HierarchyIcon={HierarchySmallIcon ?? HierarchyIcon}\n hierarchyLabel={getTranslation(hierarchyCollectionConfig?.labels?.plural, i18n)}\n key={`${collectionSlug}-${parentId}-${searchFromURL}-${JSON.stringify(baseFilter)}-${filteredChildrenData?.totalDocs}-${Object.entries(\n hierarchyData?.relatedDocumentsByCollection || {},\n )\n .map(([slug, r]) => `${slug}:${r.result.totalDocs}`)\n .join(',')}`}\n parentFieldName={parentFieldName}\n parentId={parentId}\n relatedGroups={filteredRelatedGroups}\n search={searchFromURL}\n useAsTitle={hierarchyCollectionConfig?.admin?.useAsTitle || 'id'}\n viewMode={viewMode}\n />\n </div>\n </DocumentSelectionProvider>\n {AfterList}\n </div>\n </Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,cAAc,QAAQ;AAC/B,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAO3E,SAASC,oBAAoB,QAAQ;AACrC,SAASC,eAAe,QAAQ;AAChC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,UAAU,QAAQ;AAC3B,SAASC,eAAe,QAAQ;AAChC,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,YAAY,QAAQ;AAC7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAC9B,SAASC,SAAS,EAAEC,eAAe,QAAQ;AAC3C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,cAAc,QAAQ;AAC/B,SAASC,UAAU,QAAQ;AAC3B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,SAASC,kBAAkBC,KAA0B;EAC1D,MAAM;IACJC,SAAS;IACTC,UAAU;IACVC,UAAU;IACVC,cAAc;IACdC,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aAAA,EAAesH,4BAAA,IAAgC,CAAC,GAE/CxC,GAAG,CAAC,CAAC,CAACkB,MAAA,EAAMkD,CAAA,CAAE,KAAK,GAAGlD,MAAA,IAAQkD,CAAA,CAAEvB,MAAM,CAACsB,SAAS,EAAE,EAClD/B,IAAI,CAAC,MAAM;;UAUnBzH,SAAA;;;AAIT","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { I18nClient
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
2
|
import type { ClientCollectionConfig, ViewTypes } from 'payload';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import './index.css';
|
|
@@ -17,16 +17,7 @@ export type ListHeaderProps = {
|
|
|
17
17
|
isTrashEnabled?: boolean;
|
|
18
18
|
newDocumentURL: string;
|
|
19
19
|
onBulkUploadSuccess?: () => void;
|
|
20
|
-
/** @deprecated This prop will be removed in the next major version.
|
|
21
|
-
*
|
|
22
|
-
* Opening of the bulk upload modal is handled internally.
|
|
23
|
-
*
|
|
24
|
-
* Prefer `onBulkUploadSuccess` usage to handle the success of the bulk upload.
|
|
25
|
-
*/
|
|
26
|
-
openBulkUpload: () => void;
|
|
27
20
|
smallBreak: boolean;
|
|
28
|
-
/** @deprecated This prop will be removed in the next major version. */
|
|
29
|
-
t?: TFunction;
|
|
30
21
|
TitleActions?: React.ReactNode[];
|
|
31
22
|
viewType?: ViewTypes;
|
|
32
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/List/ListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/List/ListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGhE,OAAO,KAAK,MAAM,OAAO,CAAA;AAezB,OAAO,aAAa,CAAA;AAIpB,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,sBAAsB,CAAA;IACxC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,IAAI,EAAE,UAAU,CAAA;IAChB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAA;IAChC,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+F1D,CAAA"}
|
|
@@ -26,7 +26,6 @@ export const CollectionListHeader = ({
|
|
|
26
26
|
isBulkUploadEnabled,
|
|
27
27
|
isTrashEnabled,
|
|
28
28
|
onBulkUploadSuccess,
|
|
29
|
-
openBulkUpload,
|
|
30
29
|
smallBreak,
|
|
31
30
|
viewType
|
|
32
31
|
}) => {
|
|
@@ -84,8 +83,7 @@ export const CollectionListHeader = ({
|
|
|
84
83
|
collectionSlug: collectionConfig.slug,
|
|
85
84
|
hasCreatePermission: hasCreatePermission,
|
|
86
85
|
isBulkUploadEnabled: isBulkUploadEnabled,
|
|
87
|
-
onBulkUploadSuccess: onBulkUploadSuccess
|
|
88
|
-
openBulkUpload: openBulkUpload
|
|
86
|
+
onBulkUploadSuccess: onBulkUploadSuccess
|
|
89
87
|
}, "list-header-bulk-upload"), hasDeletePermission && isTrashEnabled && viewType === 'trash' && /*#__PURE__*/_jsx(ListEmptyTrashButton, {
|
|
90
88
|
collectionConfig: collectionConfig,
|
|
91
89
|
hasDeletePermission: hasDeletePermission
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getTranslation","React","CloseModalButton","DefaultListViewTabs","useListDrawerContext","DrawerRelationshipSelect","ListDrawerCreateNewDocButton","ListHeader","ListBulkUploadButton","ListEmptyTrashButton","useConfig","useListQuery","ListSelection","drawerBaseClass","CollectionListHeader","className","collectionConfig","Description","disableBulkDelete","disableBulkEdit","hasCreatePermission","hasDeletePermission","hasTrashPermission","i18n","isBulkUploadEnabled","isTrashEnabled","onBulkUploadSuccess","
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","React","CloseModalButton","DefaultListViewTabs","useListDrawerContext","DrawerRelationshipSelect","ListDrawerCreateNewDocButton","ListHeader","ListBulkUploadButton","ListEmptyTrashButton","useConfig","useListQuery","ListSelection","drawerBaseClass","CollectionListHeader","className","collectionConfig","Description","disableBulkDelete","disableBulkEdit","hasCreatePermission","hasDeletePermission","hasTrashPermission","i18n","isBulkUploadEnabled","isTrashEnabled","onBulkUploadSuccess","smallBreak","viewType","config","getEntityConfig","drawerSlug","isInDrawer","selectedOption","isTrashRoute","isGroupingBy","_jsx","Actions","AfterListHeaderContent","_jsxs","_Fragment","BeforeTitle","slug","title","collectionSlug","value","labels","plural","TitleActions","filter","Boolean","label","showSelectAllAcrossPages"],"sources":["../../../../src/views/List/ListHeader/index.tsx"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientCollectionConfig, ViewTypes } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { CloseModalButton } from '../../../elements/CloseModalButton/index.js'\nimport { DefaultListViewTabs } from '../../../elements/DefaultListViewTabs/index.js'\nimport { useListDrawerContext } from '../../../elements/ListDrawer/Provider.js'\nimport { DrawerRelationshipSelect } from '../../../elements/ListHeader/DrawerRelationshipSelect/index.js'\nimport { ListDrawerCreateNewDocButton } from '../../../elements/ListHeader/DrawerTitleActions/index.js'\nimport { ListHeader } from '../../../elements/ListHeader/index.js'\nimport {\n ListBulkUploadButton,\n ListEmptyTrashButton,\n} from '../../../elements/ListHeader/TitleActions/index.js'\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useListQuery } from '../../../providers/ListQuery/index.js'\nimport { ListSelection } from '../ListSelection/index.js'\nimport './index.css'\n\nconst drawerBaseClass = 'list-drawer'\n\nexport type ListHeaderProps = {\n Actions?: React.ReactNode[]\n className?: string\n collectionConfig: ClientCollectionConfig\n Description?: React.ReactNode\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n i18n: I18nClient\n isBulkUploadEnabled: boolean\n isTrashEnabled?: boolean\n newDocumentURL: string\n onBulkUploadSuccess?: () => void\n smallBreak: boolean\n TitleActions?: React.ReactNode[]\n viewType?: ViewTypes\n}\n\nexport const CollectionListHeader: React.FC<ListHeaderProps> = ({\n className,\n collectionConfig,\n Description,\n disableBulkDelete,\n disableBulkEdit,\n hasCreatePermission,\n hasDeletePermission,\n hasTrashPermission,\n i18n,\n isBulkUploadEnabled,\n isTrashEnabled,\n onBulkUploadSuccess,\n smallBreak,\n viewType,\n}) => {\n const { config, getEntityConfig } = useConfig()\n const { drawerSlug, isInDrawer, selectedOption } = useListDrawerContext()\n const isTrashRoute = viewType === 'trash'\n const { isGroupingBy } = useListQuery()\n\n if (isInDrawer) {\n return (\n <ListHeader\n Actions={[]}\n AfterListHeaderContent={\n <>\n {Description}\n {<DrawerRelationshipSelect />}\n </>\n }\n BeforeTitle={\n <CloseModalButton className={`${drawerBaseClass}__header-close`} slug={drawerSlug} />\n }\n className={`${drawerBaseClass}__header`}\n title={getTranslation(\n getEntityConfig({ collectionSlug: selectedOption.value })?.labels?.plural,\n i18n,\n )}\n TitleActions={[\n <ListDrawerCreateNewDocButton\n hasCreatePermission={hasCreatePermission}\n key=\"list-drawer-create-new-doc\"\n />,\n ].filter(Boolean)}\n />\n )\n }\n\n return (\n <ListHeader\n Actions={[\n !smallBreak && !isGroupingBy && (\n <ListSelection\n collectionConfig={collectionConfig}\n disableBulkDelete={disableBulkDelete}\n disableBulkEdit={disableBulkEdit}\n hasDeletePermission={hasDeletePermission}\n hasTrashPermission={hasTrashPermission}\n key=\"list-selection\"\n label={getTranslation(collectionConfig?.labels?.plural, i18n)}\n showSelectAllAcrossPages={!isGroupingBy}\n viewType={viewType}\n />\n ),\n <DefaultListViewTabs\n collectionConfig={collectionConfig}\n config={config}\n key=\"default-list-actions\"\n viewType={viewType}\n />,\n ].filter(Boolean)}\n AfterListHeaderContent={Description}\n className={className}\n title={getTranslation(collectionConfig?.labels?.plural, i18n)}\n TitleActions={[\n hasCreatePermission && isBulkUploadEnabled && !isTrashRoute && (\n <ListBulkUploadButton\n collectionSlug={collectionConfig.slug}\n hasCreatePermission={hasCreatePermission}\n isBulkUploadEnabled={isBulkUploadEnabled}\n key=\"list-header-bulk-upload\"\n onBulkUploadSuccess={onBulkUploadSuccess}\n />\n ),\n hasDeletePermission && isTrashEnabled && viewType === 'trash' && (\n <ListEmptyTrashButton\n collectionConfig={collectionConfig}\n hasDeletePermission={hasDeletePermission}\n key=\"list-header-empty-trash\"\n />\n ),\n ].filter(Boolean)}\n />\n )\n}\n"],"mappings":";AAGA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,wBAAwB,QAAQ;AACzC,SAASC,4BAA4B,QAAQ;AAC7C,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AC7B,UAAA;IACC8B,OAAA,EAAS,CACP,CAACV,UAAA,IAAc,CAACQ,YAAA,iBACdC,IAAA,CAACxB,aAAA;MACCI,gBAAA,EAAkBA,gBAAA;MAClBE,iBAAA,EAAmBA,iBAAA;MACnBC,eAAA,EAAiBA,eAAA;MACjBE,mBAAA,EAAqBA,mBAAA;MACrBC,kBAAA,EAAoBA,kBAAA;MAEpB6B,KAAA,EAAOnD,cAAA,CAAegB,gBAAA,EAAkB8B,MAAA,EAAQC,MAAA,EAAQxB,IAAA;MACxD6B,wBAAA,EAA0B,CAACjB,YAAA;MAC3BP,QAAA,EAAUA;OAHN,mB,aAMRQ,IAAA,CAACjC,mBAAA;MACCa,gBAAA,EAAkBA,gBAAA;MAClBa,MAAA,EAAQA,MAAA;MAERD,QAAA,EAAUA;OADN,wBAGP,CAACqB,MAAM,CAACC,OAAA;IACTZ,sBAAA,EAAwBrB,WAAA;IACxBF,SAAA,EAAWA,SAAA;IACX4B,KAAA,EAAO3C,cAAA,CAAegB,gBAAA,EAAkB8B,MAAA,EAAQC,MAAA,EAAQxB,IAAA;IACxDyB,YAAA,EAAc,CACZ5B,mBAAA,IAAuBI,mBAAA,IAAuB,CAACU,YAAA,iBAC7CE,IAAA,CAAC5B,oBAAA;MACCoC,cAAA,EAAgB5B,gBAAA,CAAiB0B,IAAI;MACrCtB,mBAAA,EAAqBA,mBAAA;MACrBI,mBAAA,EAAqBA,mBAAA;MAErBE,mBAAA,EAAqBA;OADjB,4BAIRL,mBAAA,IAAuBI,cAAA,IAAkBG,QAAA,KAAa,wBACpDQ,IAAA,CAAC3B,oBAAA;MACCO,gBAAA,EAAkBA,gBAAA;MAClBK,mBAAA,EAAqBA;OACjB,2BAGT,CAAC4B,MAAM,CAACC,OAAA;;AAGf","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/List/ListSelection/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGvE,OAAO,KAAgC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/List/ListSelection/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGvE,OAAO,KAAgC,MAAM,OAAO,CAAA;AAkBpD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwJtD,CAAA"}
|