@payloadcms/ui 4.0.0-internal.af6aad0 → 4.0.0-internal.b8e7c89
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 +4 -0
- package/dist/elements/AddNewRelation/index.js +2 -2
- package/dist/elements/AddNewRelation/index.js.map +1 -1
- package/dist/elements/AppHeader/index.css +0 -4
- package/dist/elements/AppHeader/index.d.ts +8 -1
- package/dist/elements/AppHeader/index.d.ts.map +1 -1
- package/dist/elements/AppHeader/index.js +14 -5
- package/dist/elements/AppHeader/index.js.map +1 -1
- package/dist/elements/Autosave/index.d.ts.map +1 -1
- package/dist/elements/Autosave/index.js +2 -3
- package/dist/elements/Autosave/index.js.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
- package/dist/elements/BulkUpload/FormsManager/index.js +2 -3
- package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
- package/dist/elements/Button/index.css +0 -23
- 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/CopyLocaleData/index.d.ts.map +1 -1
- package/dist/elements/CopyLocaleData/index.js +8 -9
- package/dist/elements/CopyLocaleData/index.js.map +1 -1
- package/dist/elements/DefaultListViewTabs/index.css +0 -1
- package/dist/elements/DefaultListViewTabs/index.d.ts.map +1 -1
- package/dist/elements/DefaultListViewTabs/index.js +62 -84
- package/dist/elements/DefaultListViewTabs/index.js.map +1 -1
- package/dist/elements/DeleteMany/index.d.ts.map +1 -1
- package/dist/elements/DeleteMany/index.js +2 -3
- package/dist/elements/DeleteMany/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/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/DuplicateDocument/index.d.ts.map +1 -1
- package/dist/elements/DuplicateDocument/index.js +2 -3
- package/dist/elements/DuplicateDocument/index.js.map +1 -1
- package/dist/elements/EditMany/DrawerContent.d.ts.map +1 -1
- package/dist/elements/EditMany/DrawerContent.js +2 -3
- package/dist/elements/EditMany/DrawerContent.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.css +4 -22
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js +49 -68
- package/dist/elements/Hierarchy/ColumnBrowser/Column/index.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.css +15 -100
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/ColumnItem/index.js +137 -97
- 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 +23 -51
- package/dist/elements/Hierarchy/ColumnBrowser/index.js.map +1 -1
- package/dist/elements/Hierarchy/ColumnBrowser/types.d.ts +3 -26
- 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/DocHeaderButton/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.js +1 -6
- package/dist/elements/Hierarchy/DocHeaderButton/index.js.map +1 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.js +3 -1
- package/dist/elements/Hierarchy/DocHeaderButton/index.server.js.map +1 -1
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.css +36 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts +13 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts.map +1 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js +141 -0
- package/dist/elements/Hierarchy/Field/SelectedHierarchies.js.map +1 -0
- package/dist/elements/Hierarchy/Field/index.client.d.ts +0 -5
- package/dist/elements/Hierarchy/Field/index.client.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Field/index.client.js +95 -120
- package/dist/elements/Hierarchy/Field/index.client.js.map +1 -1
- package/dist/elements/Hierarchy/Field/index.css +34 -3
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts +4 -18
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js +24 -88
- package/dist/elements/Hierarchy/Modal/fetchAncestorPath.js.map +1 -1
- package/dist/elements/Hierarchy/Modal/index.css +53 -4
- package/dist/elements/Hierarchy/Modal/index.d.ts +2 -5
- package/dist/elements/Hierarchy/Modal/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Modal/index.js +99 -136
- package/dist/elements/Hierarchy/Modal/index.js.map +1 -1
- package/dist/elements/Hierarchy/Modal/types.d.ts +0 -15
- 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 +3 -7
- package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/MoveMany/index.js +171 -45
- package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -1
- package/dist/elements/Hierarchy/Search/index.css +9 -2
- package/dist/elements/Hierarchy/Search/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Search/index.js +73 -6
- package/dist/elements/Hierarchy/Search/index.js.map +1 -1
- package/dist/elements/Hierarchy/Search/types.d.ts +6 -2
- 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/Search/useHierarchySearch.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Search/useHierarchySearch.js +2 -3
- package/dist/elements/Hierarchy/Search/useHierarchySearch.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts +4 -0
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/HierarchySidebarTab.js +186 -101
- 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 +21 -1
- 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 +29 -59
- 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 +10 -54
- package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/index.css +9 -8
- package/dist/elements/Hierarchy/Tree/index.d.ts.map +1 -1
- package/dist/elements/Hierarchy/Tree/index.js +47 -29
- package/dist/elements/Hierarchy/Tree/index.js.map +1 -1
- package/dist/elements/Hierarchy/Tree/types.d.ts +1 -9
- 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 +1 -11
- package/dist/elements/Hierarchy/Tree/useChildren.js.map +1 -1
- package/dist/elements/ListControls/index.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +2 -3
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/ListControls/types.d.ts +0 -4
- package/dist/elements/ListControls/types.d.ts.map +1 -1
- package/dist/elements/ListControls/types.js.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListEmptyTrashButton.d.ts.map +1 -1
- package/dist/elements/ListHeader/TitleActions/ListEmptyTrashButton.js +2 -3
- package/dist/elements/ListHeader/TitleActions/ListEmptyTrashButton.js.map +1 -1
- package/dist/elements/LivePreview/Window/index.js +1 -1
- package/dist/elements/LivePreview/Window/index.js.map +1 -1
- package/dist/elements/Localizer/index.js +1 -1
- package/dist/elements/Localizer/index.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 +0 -1
- package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +18 -12
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.css +2 -1
- package/dist/elements/Nav/context.d.ts +1 -0
- package/dist/elements/Nav/context.d.ts.map +1 -1
- package/dist/elements/Nav/context.js +67 -92
- package/dist/elements/Nav/context.js.map +1 -1
- package/dist/elements/Nav/index.css +42 -47
- package/dist/elements/Nav/index.d.ts +0 -4
- package/dist/elements/Nav/index.d.ts.map +1 -1
- package/dist/elements/Nav/index.js +1 -16
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/elements/NavGroup/index.css +15 -29
- package/dist/elements/Popup/PopupButtonList/index.css +16 -32
- package/dist/elements/Popup/index.css +0 -6
- package/dist/elements/Popup/index.d.ts +0 -10
- package/dist/elements/Popup/index.d.ts.map +1 -1
- package/dist/elements/Popup/index.js +5 -12
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.js +8 -30
- package/dist/elements/PublishButton/ScheduleDrawer/index.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/types.d.ts +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/types.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/types.js.map +1 -1
- package/dist/elements/PublishButton/index.d.ts.map +1 -1
- package/dist/elements/PublishButton/index.js +5 -6
- package/dist/elements/PublishButton/index.js.map +1 -1
- package/dist/elements/PublishMany/DrawerContent.d.ts.map +1 -1
- package/dist/elements/PublishMany/DrawerContent.js +2 -3
- package/dist/elements/PublishMany/DrawerContent.js.map +1 -1
- package/dist/elements/ReactSelect/types.d.ts +0 -5
- package/dist/elements/ReactSelect/types.d.ts.map +1 -1
- package/dist/elements/ReactSelect/types.js.map +1 -1
- package/dist/elements/RestoreMany/index.d.ts.map +1 -1
- package/dist/elements/RestoreMany/index.js +2 -3
- package/dist/elements/RestoreMany/index.js.map +1 -1
- package/dist/elements/SaveDraftButton/index.d.ts.map +1 -1
- package/dist/elements/SaveDraftButton/index.js +2 -3
- package/dist/elements/SaveDraftButton/index.js.map +1 -1
- package/dist/elements/SelectAll/index.d.ts.map +1 -1
- package/dist/elements/SelectAll/index.js +2 -1
- 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 +2 -1
- package/dist/elements/SelectRow/index.js.map +1 -1
- package/dist/elements/SidebarRow/index.css +5 -1
- package/dist/elements/SidebarToggle/index.css +1 -3
- package/dist/elements/Status/index.d.ts.map +1 -1
- package/dist/elements/Status/index.js +2 -3
- package/dist/elements/Status/index.js.map +1 -1
- package/dist/elements/StepNav/index.d.ts.map +1 -1
- package/dist/elements/StepNav/index.js +10 -14
- package/dist/elements/StepNav/index.js.map +1 -1
- package/dist/elements/StepNav/types.d.ts +0 -6
- 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 +7 -5
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.d.ts.map +1 -1
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js +3 -14
- package/dist/elements/Table/DefaultCell/fields/Hierarchy/index.js.map +1 -1
- package/dist/elements/Table/OrderableTable.d.ts.map +1 -1
- package/dist/elements/Table/OrderableTable.js +2 -3
- package/dist/elements/Table/OrderableTable.js.map +1 -1
- package/dist/elements/Table/RelationshipProvider/index.d.ts.map +1 -1
- package/dist/elements/Table/RelationshipProvider/index.js +2 -3
- package/dist/elements/Table/RelationshipProvider/index.js.map +1 -1
- package/dist/elements/UnpublishButton/index.d.ts.map +1 -1
- package/dist/elements/UnpublishButton/index.js +3 -4
- package/dist/elements/UnpublishButton/index.js.map +1 -1
- package/dist/elements/UnpublishMany/DrawerContent.d.ts.map +1 -1
- package/dist/elements/UnpublishMany/DrawerContent.js +2 -3
- package/dist/elements/UnpublishMany/DrawerContent.js.map +1 -1
- package/dist/elements/UserMenu/LanguageMenu/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/LanguageMenu/index.js +39 -83
- 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 +21 -57
- 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 +39 -83
- package/dist/elements/UserMenu/ThemeMenu/index.js.map +1 -1
- package/dist/elements/UserMenu/index.css +2 -32
- package/dist/elements/UserMenu/index.d.ts +0 -1
- package/dist/elements/UserMenu/index.d.ts.map +1 -1
- package/dist/elements/UserMenu/index.js +51 -77
- package/dist/elements/UserMenu/index.js.map +1 -1
- package/dist/elements/WhereBuilder/Condition/Relationship/index.js +1 -1
- package/dist/elements/WhereBuilder/Condition/Relationship/index.js.map +1 -1
- package/dist/exports/client/index.d.ts +0 -4
- 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/index.d.ts.map +1 -1
- package/dist/fields/Array/index.js +2 -3
- package/dist/fields/Array/index.js.map +1 -1
- package/dist/fields/Blocks/index.d.ts.map +1 -1
- package/dist/fields/Blocks/index.js +2 -3
- 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 +152 -134
- package/dist/fields/Checkbox/Input.js.map +1 -1
- package/dist/fields/Checkbox/index.css +155 -168
- package/dist/fields/FieldLabel/index.d.ts.map +1 -1
- package/dist/fields/FieldLabel/index.js +4 -5
- package/dist/fields/FieldLabel/index.js.map +1 -1
- package/dist/fields/Relationship/Input.d.ts.map +1 -1
- package/dist/fields/Relationship/Input.js +8 -27
- 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 +0 -2
- package/dist/fields/Relationship/optionsReducer.js.map +1 -1
- package/dist/fields/Relationship/types.d.ts +0 -24
- package/dist/fields/Relationship/types.d.ts.map +1 -1
- package/dist/fields/Relationship/types.js.map +1 -1
- package/dist/fields/Slug/index.d.ts.map +1 -1
- package/dist/fields/Slug/index.js +2 -3
- package/dist/fields/Slug/index.js.map +1 -1
- package/dist/fields/Upload/Input.d.ts.map +1 -1
- package/dist/fields/Upload/Input.js +2 -3
- package/dist/fields/Upload/Input.js.map +1 -1
- package/dist/fields/Upload/Input.spec.js +2 -1
- package/dist/fields/Upload/Input.spec.js.map +1 -1
- package/dist/fields/shared/index.d.ts +1 -1
- package/dist/fields/shared/index.d.ts.map +1 -1
- package/dist/fields/shared/index.js.map +1 -1
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +2 -3
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/forms/NullifyField/index.d.ts.map +1 -1
- package/dist/forms/NullifyField/index.js +2 -3
- package/dist/forms/NullifyField/index.js.map +1 -1
- package/dist/hooks/usePayloadAPI.d.ts.map +1 -1
- package/dist/hooks/usePayloadAPI.js +2 -3
- package/dist/hooks/usePayloadAPI.js.map +1 -1
- package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
- package/dist/providers/DocumentInfo/index.js +2 -3
- package/dist/providers/DocumentInfo/index.js.map +1 -1
- package/dist/providers/Hierarchy/index.d.ts.map +1 -1
- package/dist/providers/Hierarchy/index.js +24 -53
- package/dist/providers/Hierarchy/index.js.map +1 -1
- package/dist/providers/Hierarchy/types.d.ts +0 -2
- package/dist/providers/Hierarchy/types.d.ts.map +1 -1
- package/dist/providers/Hierarchy/types.js.map +1 -1
- package/dist/providers/LivePreview/index.d.ts.map +1 -1
- package/dist/providers/LivePreview/index.js +13 -6
- package/dist/providers/LivePreview/index.js.map +1 -1
- package/dist/providers/Locale/index.d.ts +1 -5
- package/dist/providers/Locale/index.d.ts.map +1 -1
- package/dist/providers/Locale/index.js +61 -139
- package/dist/providers/Locale/index.js.map +1 -1
- package/dist/providers/Selection/index.d.ts.map +1 -1
- package/dist/providers/Selection/index.js +2 -3
- package/dist/providers/Selection/index.js.map +1 -1
- package/dist/providers/ServerFunctions/index.d.ts +5 -1
- package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
- package/dist/providers/ServerFunctions/index.js +15 -0
- package/dist/providers/ServerFunctions/index.js.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.d.ts.map +1 -1
- package/dist/providers/TableColumns/buildColumnState/index.js +0 -1
- package/dist/providers/TableColumns/buildColumnState/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/templates/Default/Wrapper/index.css +1 -2
- package/dist/templates/Default/Wrapper/index.d.ts +0 -2
- package/dist/templates/Default/Wrapper/index.d.ts.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +6 -12
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/index.css +1 -3
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +15 -17
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/utilities/formatAbsoluteURL.d.ts +1 -1
- package/dist/utilities/formatAbsoluteURL.d.ts.map +1 -1
- package/dist/utilities/formatAbsoluteURL.js +18 -8
- package/dist/utilities/formatAbsoluteURL.js.map +1 -1
- package/dist/utilities/formatAbsoluteURL.spec.js +27 -0
- package/dist/utilities/formatAbsoluteURL.spec.js.map +1 -0
- package/dist/utilities/getHasScheduledPublish.d.ts +2 -3
- package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -1
- package/dist/utilities/getHasScheduledPublish.js +2 -5
- package/dist/utilities/getHasScheduledPublish.js.map +1 -1
- package/dist/utilities/isAbsoluteURL.d.ts +3 -0
- package/dist/utilities/isAbsoluteURL.d.ts.map +1 -0
- package/dist/utilities/isAbsoluteURL.js +15 -0
- package/dist/utilities/isAbsoluteURL.js.map +1 -0
- package/dist/utilities/isAbsoluteURL.spec.js +11 -0
- package/dist/utilities/isAbsoluteURL.spec.js.map +1 -0
- package/dist/utilities/isHttpURL.d.ts +3 -0
- package/dist/utilities/isHttpURL.d.ts.map +1 -0
- package/dist/utilities/isHttpURL.js +12 -0
- package/dist/utilities/isHttpURL.js.map +1 -0
- package/dist/utilities/isHttpURL.spec.js +25 -0
- package/dist/utilities/isHttpURL.spec.js.map +1 -0
- package/dist/utilities/schedulePublishHandler.d.ts +8 -1
- package/dist/utilities/schedulePublishHandler.d.ts.map +1 -1
- package/dist/utilities/schedulePublishHandler.js +68 -4
- package/dist/utilities/schedulePublishHandler.js.map +1 -1
- package/dist/utilities/serverFunctionRegistry.d.ts.map +1 -1
- package/dist/utilities/serverFunctionRegistry.js +2 -1
- package/dist/utilities/serverFunctionRegistry.js.map +1 -1
- package/dist/utilities/slugify.d.ts.map +1 -1
- package/dist/utilities/slugify.js +2 -0
- package/dist/utilities/slugify.js.map +1 -1
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js +2 -3
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +1 -2
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/HierarchyList/DocumentListSelection/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/DocumentListSelection/index.js +105 -100
- package/dist/views/HierarchyList/DocumentListSelection/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts +1 -6
- package/dist/views/HierarchyList/HierarchyListHeader/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyListHeader/index.js +8 -10
- 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 +10 -11
- 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 +6 -3
- package/dist/views/HierarchyList/HierarchyTable/SlotTable.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/index.css +0 -51
- package/dist/views/HierarchyList/HierarchyTable/index.d.ts +1 -13
- package/dist/views/HierarchyList/HierarchyTable/index.d.ts.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/index.js +38 -156
- package/dist/views/HierarchyList/HierarchyTable/index.js.map +1 -1
- package/dist/views/HierarchyList/HierarchyTable/types.d.ts +0 -6
- 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 +20 -103
- package/dist/views/HierarchyList/index.js.map +1 -1
- package/dist/views/List/ListSelection/index.d.ts.map +1 -1
- package/dist/views/List/ListSelection/index.js +122 -138
- package/dist/views/List/ListSelection/index.js.map +1 -1
- package/dist/views/List/handleHierarchy.d.ts +1 -6
- package/dist/views/List/handleHierarchy.d.ts.map +1 -1
- package/dist/views/List/handleHierarchy.js +3 -34
- 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 +5 -129
- package/dist/views/List/index.client.js.map +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +16 -27
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/Root/getRouteData.d.ts.map +1 -1
- package/dist/views/Root/getRouteData.js +2 -8
- package/dist/views/Root/getRouteData.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +10 -13
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +12 -13
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts +1 -0
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +56 -50
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +41 -27
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.spec.js +258 -0
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.spec.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +10 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +33 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +56 -2
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts +8 -2
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +17 -19
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +3 -13
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +1 -1
- package/dist/views/Versions/VersionPillLabel/VersionPillLabel.d.ts.map +1 -1
- package/dist/views/Versions/VersionPillLabel/VersionPillLabel.js +2 -3
- package/dist/views/Versions/VersionPillLabel/VersionPillLabel.js.map +1 -1
- package/package.json +6 -5
- package/dist/elements/Hierarchy/CreateNewButton/index.css +0 -9
- package/dist/elements/Hierarchy/CreateNewButton/index.d.ts +0 -9
- package/dist/elements/Hierarchy/CreateNewButton/index.d.ts.map +0 -1
- package/dist/elements/Hierarchy/CreateNewButton/index.js +0 -111
- package/dist/elements/Hierarchy/CreateNewButton/index.js.map +0 -1
- package/dist/elements/Hierarchy/Modal/Footer/index.css +0 -45
- package/dist/elements/Hierarchy/Modal/Footer/index.d.ts +0 -28
- package/dist/elements/Hierarchy/Modal/Footer/index.d.ts.map +0 -1
- package/dist/elements/Hierarchy/Modal/Footer/index.js +0 -166
- package/dist/elements/Hierarchy/Modal/Footer/index.js.map +0 -1
- package/dist/elements/Hierarchy/getFolderHierarchySlug.d.ts +0 -22
- package/dist/elements/Hierarchy/getFolderHierarchySlug.d.ts.map +0 -1
- package/dist/elements/Hierarchy/getFolderHierarchySlug.js +0 -17
- package/dist/elements/Hierarchy/getFolderHierarchySlug.js.map +0 -1
- package/dist/elements/Hierarchy/move/moveDocuments.d.ts +0 -34
- package/dist/elements/Hierarchy/move/moveDocuments.d.ts.map +0 -1
- package/dist/elements/Hierarchy/move/moveDocuments.js +0 -94
- package/dist/elements/Hierarchy/move/moveDocuments.js.map +0 -1
- package/dist/elements/SegmentedControl/index.css +0 -58
- package/dist/elements/SegmentedControl/index.d.ts +0 -19
- package/dist/elements/SegmentedControl/index.d.ts.map +0 -1
- package/dist/elements/SegmentedControl/index.js +0 -104
- package/dist/elements/SegmentedControl/index.js.map +0 -1
- package/dist/elements/StepNav/DropTarget/index.css +0 -20
- package/dist/elements/StepNav/DropTarget/index.d.ts +0 -16
- package/dist/elements/StepNav/DropTarget/index.d.ts.map +0 -1
- package/dist/elements/StepNav/DropTarget/index.js +0 -71
- package/dist/elements/StepNav/DropTarget/index.js.map +0 -1
- package/dist/elements/UserMenu/HoverSubmenuGroup.d.ts +0 -18
- package/dist/elements/UserMenu/HoverSubmenuGroup.d.ts.map +0 -1
- package/dist/elements/UserMenu/HoverSubmenuGroup.js +0 -38
- package/dist/elements/UserMenu/HoverSubmenuGroup.js.map +0 -1
- package/dist/elements/UserMenu/useHoverSubmenu.d.ts +0 -21
- package/dist/elements/UserMenu/useHoverSubmenu.d.ts.map +0 -1
- package/dist/elements/UserMenu/useHoverSubmenu.js +0 -260
- package/dist/elements/UserMenu/useHoverSubmenu.js.map +0 -1
- package/dist/elements/ViewModeToggle/index.d.ts +0 -8
- package/dist/elements/ViewModeToggle/index.d.ts.map +0 -1
- package/dist/elements/ViewModeToggle/index.js +0 -29
- package/dist/elements/ViewModeToggle/index.js.map +0 -1
- package/dist/icons/CollapseLayers/index.css +0 -5
- package/dist/icons/CollapseLayers/index.d.ts +0 -7
- package/dist/icons/CollapseLayers/index.d.ts.map +0 -1
- package/dist/icons/CollapseLayers/index.js +0 -23
- package/dist/icons/CollapseLayers/index.js.map +0 -1
- package/dist/icons/Table/index.css +0 -5
- package/dist/icons/Table/index.d.ts +0 -7
- package/dist/icons/Table/index.d.ts.map +0 -1
- package/dist/icons/Table/index.js +0 -25
- package/dist/icons/Table/index.js.map +0 -1
- package/dist/providers/HierarchyDnd/index.css +0 -51
- package/dist/providers/HierarchyDnd/index.d.ts +0 -21
- package/dist/providers/HierarchyDnd/index.d.ts.map +0 -1
- package/dist/providers/HierarchyDnd/index.js +0 -163
- package/dist/providers/HierarchyDnd/index.js.map +0 -1
- package/dist/providers/HierarchyDnd/types.d.ts +0 -56
- package/dist/providers/HierarchyDnd/types.d.ts.map +0 -1
- package/dist/providers/HierarchyDnd/types.js +0 -21
- package/dist/providers/HierarchyDnd/types.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.css +0 -216
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.d.ts +0 -20
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.js +0 -182
- package/dist/views/HierarchyList/HierarchyCards/DocumentCard/index.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.css +0 -38
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.d.ts +0 -15
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.js +0 -85
- package/dist/views/HierarchyList/HierarchyCards/DragPreviewItem/index.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.css +0 -98
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.d.ts +0 -27
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.js +0 -84
- package/dist/views/HierarchyList/HierarchyCards/FolderCard/index.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.d.ts +0 -19
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.js +0 -100
- package/dist/views/HierarchyList/HierarchyCards/HierarchyCard/index.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.d.ts +0 -53
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.js +0 -145
- package/dist/views/HierarchyList/HierarchyCards/PlaneItem/index.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.d.ts +0 -8
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.js +0 -21
- package/dist/views/HierarchyList/HierarchyCards/getThumbnailSrc.js.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/index.css +0 -115
- package/dist/views/HierarchyList/HierarchyCards/index.d.ts +0 -80
- package/dist/views/HierarchyList/HierarchyCards/index.d.ts.map +0 -1
- package/dist/views/HierarchyList/HierarchyCards/index.js +0 -457
- package/dist/views/HierarchyList/HierarchyCards/index.js.map +0 -1
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, pointerWithin, useSensor, useSensors } from '@dnd-kit/core';
|
|
5
|
-
import { snapCenterToCursor } from '@dnd-kit/modifiers';
|
|
6
|
-
import React, { createContext, use, useCallback, useId, useMemo, useState } from 'react';
|
|
7
|
-
import { moveDocuments } from '../../elements/Hierarchy/move/moveDocuments.js';
|
|
8
|
-
import { useConfig } from '../Config/index.js';
|
|
9
|
-
import { useHierarchy } from '../Hierarchy/index.js';
|
|
10
|
-
import { useLocale } from '../Locale/index.js';
|
|
11
|
-
import { useRouteCache } from '../RouteCache/index.js';
|
|
12
|
-
import { useTranslation } from '../Translation/index.js';
|
|
13
|
-
import { canDropItems } from './types.js';
|
|
14
|
-
import './index.css';
|
|
15
|
-
const baseClass = 'hierarchy-dnd';
|
|
16
|
-
/**
|
|
17
|
-
* The overlay would otherwise be positioned against the dragged card's own rect, which puts a 40px
|
|
18
|
-
* stack at the top-left corner of a ~216px card - so it only sits under the cursor if you happened to
|
|
19
|
-
* grab that corner. Snapping the stack's centre to the pointer keeps it with the cursor wherever the
|
|
20
|
-
* card was picked up. Purely cosmetic: `pointerWithin` collision is computed from the pointer, not
|
|
21
|
-
* from the overlay.
|
|
22
|
-
*/
|
|
23
|
-
const OVERLAY_MODIFIERS = [snapCenterToCursor];
|
|
24
|
-
/** How many thumbnails the stack shows; the count pill carries the rest. */
|
|
25
|
-
const MAX_PREVIEW_CARDS = 3;
|
|
26
|
-
const Context = /*#__PURE__*/createContext({
|
|
27
|
-
activeDrag: null,
|
|
28
|
-
canDrop: () => false
|
|
29
|
-
});
|
|
30
|
-
export const useHierarchyDnd = () => use(Context);
|
|
31
|
-
/**
|
|
32
|
-
* Hosts the drag context for moving documents and folders between folders.
|
|
33
|
-
*
|
|
34
|
-
* Mounted high enough to span both the nav and the view - the sidebar tree is a drop target - which
|
|
35
|
-
* is why it is rendered conditionally on the hierarchy view rather than always: it would otherwise
|
|
36
|
-
* wrap the array/blocks drag contexts on document views.
|
|
37
|
-
*/
|
|
38
|
-
export const HierarchyDndProvider = ({
|
|
39
|
-
children
|
|
40
|
-
}) => {
|
|
41
|
-
const [activeDrag, setActiveDrag] = useState(null);
|
|
42
|
-
/*
|
|
43
|
-
* Without an explicit id, dnd-kit names the `aria-describedby` it puts on every draggable from a
|
|
44
|
-
* module-level counter, which does not line up between the server render and hydration - the
|
|
45
|
-
* card's attribute then mismatches and React discards the whole tree's hydration.
|
|
46
|
-
* See https://github.com/clauderic/dnd-kit/issues/926.
|
|
47
|
-
*/
|
|
48
|
-
const dndContextID = useId();
|
|
49
|
-
const {
|
|
50
|
-
config: {
|
|
51
|
-
routes: {
|
|
52
|
-
api: apiRoute
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} = useConfig();
|
|
56
|
-
const {
|
|
57
|
-
code: locale
|
|
58
|
-
} = useLocale();
|
|
59
|
-
const {
|
|
60
|
-
i18n,
|
|
61
|
-
t
|
|
62
|
-
} = useTranslation();
|
|
63
|
-
const {
|
|
64
|
-
clearRouteCache
|
|
65
|
-
} = useRouteCache();
|
|
66
|
-
const {
|
|
67
|
-
refreshTree
|
|
68
|
-
} = useHierarchy();
|
|
69
|
-
// A short distance threshold leaves plain clicks (which select) and the marquee intact; a drag
|
|
70
|
-
// only begins once the pointer has actually travelled.
|
|
71
|
-
const sensors = useSensors(useSensor(PointerSensor, {
|
|
72
|
-
activationConstraint: {
|
|
73
|
-
distance: 4
|
|
74
|
-
}
|
|
75
|
-
}), useSensor(KeyboardSensor));
|
|
76
|
-
const canDrop = useCallback(dropTarget => activeDrag ? canDropItems({
|
|
77
|
-
dropTarget,
|
|
78
|
-
items: activeDrag.items
|
|
79
|
-
}) : false, [activeDrag]);
|
|
80
|
-
const handleDragStart = useCallback(event => {
|
|
81
|
-
setActiveDrag(event.active.data.current ?? null);
|
|
82
|
-
}, []);
|
|
83
|
-
const handleDragEnd = useCallback(event_0 => {
|
|
84
|
-
const drag = event_0.active.data.current;
|
|
85
|
-
const drop = event_0.over?.data.current;
|
|
86
|
-
setActiveDrag(null);
|
|
87
|
-
if (!drag || !drop || drop.type !== 'hierarchy-folder') {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
// Validity is re-derived from the event rather than read off `canDrop`, whose `activeDrag` has
|
|
91
|
-
// just been cleared above.
|
|
92
|
-
if (!canDropItems({
|
|
93
|
-
dropTarget: drop,
|
|
94
|
-
items: drag.items
|
|
95
|
-
})) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const selections = {};
|
|
99
|
-
for (const item of drag.items) {
|
|
100
|
-
selections[item.collectionSlug] ??= {
|
|
101
|
-
ids: []
|
|
102
|
-
};
|
|
103
|
-
selections[item.collectionSlug].ids.push(item.id);
|
|
104
|
-
}
|
|
105
|
-
void moveDocuments({
|
|
106
|
-
apiRoute,
|
|
107
|
-
destination: {
|
|
108
|
-
id: drop.folderId,
|
|
109
|
-
title: drop.title
|
|
110
|
-
},
|
|
111
|
-
i18n,
|
|
112
|
-
label: drag.items.length === 1 ? drag.items[0].title : t('general:documents'),
|
|
113
|
-
locale,
|
|
114
|
-
parentFieldName: drop.parentFieldName,
|
|
115
|
-
selections,
|
|
116
|
-
t
|
|
117
|
-
}).then(({
|
|
118
|
-
totalMoved
|
|
119
|
-
}) => {
|
|
120
|
-
if (totalMoved > 0) {
|
|
121
|
-
drag.onMoveSuccess?.();
|
|
122
|
-
refreshTree(drop.hierarchySlug);
|
|
123
|
-
clearRouteCache();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}, [apiRoute, clearRouteCache, i18n, locale, refreshTree, t]);
|
|
127
|
-
const handleDragCancel = useCallback(() => setActiveDrag(null), []);
|
|
128
|
-
const contextValue = useMemo(() => ({
|
|
129
|
-
activeDrag,
|
|
130
|
-
canDrop
|
|
131
|
-
}), [activeDrag, canDrop]);
|
|
132
|
-
const previewCards = activeDrag?.preview.slice(0, MAX_PREVIEW_CARDS) ?? [];
|
|
133
|
-
const draggedCount = activeDrag?.items.length ?? 0;
|
|
134
|
-
return /*#__PURE__*/_jsx(Context, {
|
|
135
|
-
value: contextValue,
|
|
136
|
-
children: /*#__PURE__*/_jsxs(DndContext, {
|
|
137
|
-
collisionDetection: pointerWithin,
|
|
138
|
-
id: dndContextID,
|
|
139
|
-
onDragCancel: handleDragCancel,
|
|
140
|
-
onDragEnd: handleDragEnd,
|
|
141
|
-
onDragStart: handleDragStart,
|
|
142
|
-
sensors: sensors,
|
|
143
|
-
children: [children, /*#__PURE__*/_jsx(DragOverlay, {
|
|
144
|
-
dropAnimation: null,
|
|
145
|
-
modifiers: OVERLAY_MODIFIERS,
|
|
146
|
-
children: activeDrag ? /*#__PURE__*/_jsxs("div", {
|
|
147
|
-
className: `${baseClass}__preview`,
|
|
148
|
-
children: [previewCards.map((card, index) => /*#__PURE__*/_jsx("div", {
|
|
149
|
-
className: `${baseClass}__preview-card`,
|
|
150
|
-
style: {
|
|
151
|
-
'--preview-index': index
|
|
152
|
-
},
|
|
153
|
-
children: card
|
|
154
|
-
}, index)), draggedCount > 1 && /*#__PURE__*/_jsx("span", {
|
|
155
|
-
className: `${baseClass}__preview-count`,
|
|
156
|
-
children: draggedCount
|
|
157
|
-
})]
|
|
158
|
-
}) : null
|
|
159
|
-
})]
|
|
160
|
-
})
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DndContext","DragOverlay","KeyboardSensor","PointerSensor","pointerWithin","useSensor","useSensors","snapCenterToCursor","React","createContext","use","useCallback","useId","useMemo","useState","moveDocuments","useConfig","useHierarchy","useLocale","useRouteCache","useTranslation","canDropItems","baseClass","OVERLAY_MODIFIERS","MAX_PREVIEW_CARDS","Context","activeDrag","canDrop","useHierarchyDnd","HierarchyDndProvider","children","setActiveDrag","dndContextID","config","routes","api","apiRoute","code","locale","i18n","t","clearRouteCache","refreshTree","sensors","activationConstraint","distance","dropTarget","items","handleDragStart","event","active","data","current","handleDragEnd","drag","drop","over","type","selections","item","collectionSlug","ids","push","id","destination","folderId","title","label","length","parentFieldName","then","totalMoved","onMoveSuccess","hierarchySlug","handleDragCancel","contextValue","previewCards","preview","slice","draggedCount","_jsx","value","_jsxs","collisionDetection","onDragCancel","onDragEnd","onDragStart","dropAnimation","modifiers","className","map","card","index","style"],"sources":["../../../src/providers/HierarchyDnd/index.tsx"],"sourcesContent":["'use client'\n\nimport type { DragEndEvent, DragStartEvent } from '@dnd-kit/core'\n\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n pointerWithin,\n useSensor,\n useSensors,\n} from '@dnd-kit/core'\nimport { snapCenterToCursor } from '@dnd-kit/modifiers'\nimport React, { createContext, use, useCallback, useId, useMemo, useState } from 'react'\n\nimport type { HierarchyDragData, HierarchyDropData } from './types.js'\n\nimport { moveDocuments } from '../../elements/Hierarchy/move/moveDocuments.js'\nimport { useConfig } from '../Config/index.js'\nimport { useHierarchy } from '../Hierarchy/index.js'\nimport { useLocale } from '../Locale/index.js'\nimport { useRouteCache } from '../RouteCache/index.js'\nimport { useTranslation } from '../Translation/index.js'\nimport { canDropItems } from './types.js'\nimport './index.css'\n\nconst baseClass = 'hierarchy-dnd'\n\n/**\n * The overlay would otherwise be positioned against the dragged card's own rect, which puts a 40px\n * stack at the top-left corner of a ~216px card - so it only sits under the cursor if you happened to\n * grab that corner. Snapping the stack's centre to the pointer keeps it with the cursor wherever the\n * card was picked up. Purely cosmetic: `pointerWithin` collision is computed from the pointer, not\n * from the overlay.\n */\nconst OVERLAY_MODIFIERS = [snapCenterToCursor]\n\n/** How many thumbnails the stack shows; the count pill carries the rest. */\nconst MAX_PREVIEW_CARDS = 3\n\ntype HierarchyDndContextValue = {\n /** The drag in flight, or null. Drop targets read this to validate and style themselves. */\n activeDrag: HierarchyDragData | null\n canDrop: (dropTarget: HierarchyDropData) => boolean\n}\n\nconst Context = createContext<HierarchyDndContextValue>({\n activeDrag: null,\n canDrop: () => false,\n})\n\nexport const useHierarchyDnd = (): HierarchyDndContextValue => use(Context)\n\n/**\n * Hosts the drag context for moving documents and folders between folders.\n *\n * Mounted high enough to span both the nav and the view - the sidebar tree is a drop target - which\n * is why it is rendered conditionally on the hierarchy view rather than always: it would otherwise\n * wrap the array/blocks drag contexts on document views.\n */\nexport const HierarchyDndProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const [activeDrag, setActiveDrag] = useState<HierarchyDragData | null>(null)\n\n /*\n * Without an explicit id, dnd-kit names the `aria-describedby` it puts on every draggable from a\n * module-level counter, which does not line up between the server render and hydration - the\n * card's attribute then mismatches and React discards the whole tree's hydration.\n * See https://github.com/clauderic/dnd-kit/issues/926.\n */\n const dndContextID = useId()\n\n const {\n config: {\n routes: { api: apiRoute },\n },\n } = useConfig()\n const { code: locale } = useLocale()\n const { i18n, t } = useTranslation()\n const { clearRouteCache } = useRouteCache()\n const { refreshTree } = useHierarchy()\n\n // A short distance threshold leaves plain clicks (which select) and the marquee intact; a drag\n // only begins once the pointer has actually travelled.\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor),\n )\n\n const canDrop = useCallback(\n (dropTarget: HierarchyDropData): boolean =>\n activeDrag ? canDropItems({ dropTarget, items: activeDrag.items }) : false,\n [activeDrag],\n )\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n setActiveDrag((event.active.data.current as HierarchyDragData | undefined) ?? null)\n }, [])\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const drag = event.active.data.current as HierarchyDragData | undefined\n const drop = event.over?.data.current as HierarchyDropData | undefined\n\n setActiveDrag(null)\n\n if (!drag || !drop || drop.type !== 'hierarchy-folder') {\n return\n }\n\n // Validity is re-derived from the event rather than read off `canDrop`, whose `activeDrag` has\n // just been cleared above.\n if (!canDropItems({ dropTarget: drop, items: drag.items })) {\n return\n }\n\n const selections: Record<string, { ids: (number | string)[] }> = {}\n\n for (const item of drag.items) {\n selections[item.collectionSlug] ??= { ids: [] }\n selections[item.collectionSlug].ids.push(item.id)\n }\n\n void moveDocuments({\n apiRoute,\n destination: { id: drop.folderId, title: drop.title },\n i18n,\n label: drag.items.length === 1 ? drag.items[0].title : t('general:documents'),\n locale,\n parentFieldName: drop.parentFieldName,\n selections,\n t,\n }).then(({ totalMoved }) => {\n if (totalMoved > 0) {\n drag.onMoveSuccess?.()\n refreshTree(drop.hierarchySlug)\n clearRouteCache()\n }\n })\n },\n [apiRoute, clearRouteCache, i18n, locale, refreshTree, t],\n )\n\n const handleDragCancel = useCallback(() => setActiveDrag(null), [])\n\n const contextValue = useMemo<HierarchyDndContextValue>(\n () => ({ activeDrag, canDrop }),\n [activeDrag, canDrop],\n )\n\n const previewCards = activeDrag?.preview.slice(0, MAX_PREVIEW_CARDS) ?? []\n const draggedCount = activeDrag?.items.length ?? 0\n\n return (\n <Context value={contextValue}>\n <DndContext\n collisionDetection={pointerWithin}\n id={dndContextID}\n onDragCancel={handleDragCancel}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n sensors={sensors}\n >\n {children}\n <DragOverlay dropAnimation={null} modifiers={OVERLAY_MODIFIERS}>\n {activeDrag ? (\n <div className={`${baseClass}__preview`}>\n {previewCards.map((card, index) => (\n <div\n className={`${baseClass}__preview-card`}\n key={index}\n style={{ '--preview-index': index } as React.CSSProperties}\n >\n {card}\n </div>\n ))}\n {draggedCount > 1 && (\n <span className={`${baseClass}__preview-count`}>{draggedCount}</span>\n )}\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n </Context>\n )\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export type HierarchyDragItem = {
|
|
3
|
-
collectionSlug: string;
|
|
4
|
-
id: number | string;
|
|
5
|
-
title: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Attached to every draggable card. Rides on dnd-kit's `active.data`, which is how the drag context
|
|
9
|
-
* - mounted above the view - gets at state that only exists below it: the current selection's
|
|
10
|
-
* contents, its card renders, and how to clear it afterwards.
|
|
11
|
-
*/
|
|
12
|
-
export type HierarchyDragData = {
|
|
13
|
-
items: HierarchyDragItem[];
|
|
14
|
-
/**
|
|
15
|
-
* Called after a successful move, by the surface that started the drag. The selection provider
|
|
16
|
-
* lives below the drag context, so the context can't clear the selection itself.
|
|
17
|
-
*/
|
|
18
|
-
onMoveSuccess?: () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Ghosted card renders shown fanned under the cursor. Only the first few are used; the rest of
|
|
21
|
-
* the count collapses into a "+N" badge.
|
|
22
|
-
*/
|
|
23
|
-
preview: React.ReactNode[];
|
|
24
|
-
type: 'hierarchy-items';
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Attached to every drop target - folder cards, tree nodes, breadcrumbs.
|
|
28
|
-
*/
|
|
29
|
-
export type HierarchyDropData = {
|
|
30
|
-
/**
|
|
31
|
-
* Collection slugs this destination accepts. Undefined or empty means unrestricted.
|
|
32
|
-
*/
|
|
33
|
-
allowedCollections?: string[];
|
|
34
|
-
/**
|
|
35
|
-
* Ids of the destination's ancestors, so a folder can't be dropped into its own subtree.
|
|
36
|
-
*/
|
|
37
|
-
ancestorIds: (number | string)[];
|
|
38
|
-
/** Destination hierarchy item, or null for root. */
|
|
39
|
-
folderId: null | number | string;
|
|
40
|
-
hierarchySlug: string;
|
|
41
|
-
parentFieldName: string;
|
|
42
|
-
title: string;
|
|
43
|
-
type: 'hierarchy-folder';
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Whether `dropTarget` can accept `items`: the destination has to accept every dragged collection,
|
|
47
|
-
* and a folder can never land inside itself or its own descendants.
|
|
48
|
-
*
|
|
49
|
-
* Shared by the live `canDrop` (which styles hover states) and the drop handler (which re-derives
|
|
50
|
-
* validity from the event, because the active drag has already been cleared by then).
|
|
51
|
-
*/
|
|
52
|
-
export declare const canDropItems: ({ dropTarget, items, }: {
|
|
53
|
-
dropTarget: HierarchyDropData;
|
|
54
|
-
items: HierarchyDragItem[];
|
|
55
|
-
}) => boolean;
|
|
56
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/HierarchyDnd/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,iBAAiB,EAAE,CAAA;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B;;;OAGG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC1B,IAAI,EAAE,iBAAiB,CAAA;CACxB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B;;OAEG;IACH,WAAW,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAChC,oDAAoD;IACpD,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;IAChC,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,2BAGtB;IACD,UAAU,EAAE,iBAAiB,CAAA;IAC7B,KAAK,EAAE,iBAAiB,EAAE,CAAA;CAC3B,KAAG,OAmBA,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Whether `dropTarget` can accept `items`: the destination has to accept every dragged collection,
|
|
3
|
-
* and a folder can never land inside itself or its own descendants.
|
|
4
|
-
*
|
|
5
|
-
* Shared by the live `canDrop` (which styles hover states) and the drop handler (which re-derives
|
|
6
|
-
* validity from the event, because the active drag has already been cleared by then).
|
|
7
|
-
*/export const canDropItems = ({
|
|
8
|
-
dropTarget,
|
|
9
|
-
items
|
|
10
|
-
}) => items.every(item => {
|
|
11
|
-
if (dropTarget.allowedCollections?.length && !dropTarget.allowedCollections.includes(item.collectionSlug)) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
if (item.collectionSlug === dropTarget.hierarchySlug) {
|
|
15
|
-
// Ids are compared as strings because a folder id can arrive as either across the
|
|
16
|
-
// config/query/DOM boundaries.
|
|
17
|
-
return String(item.id) !== String(dropTarget.folderId) && !dropTarget.ancestorIds.some(id => String(id) === String(item.id));
|
|
18
|
-
}
|
|
19
|
-
return true;
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["canDropItems","dropTarget","items","every","item","allowedCollections","length","includes","collectionSlug","hierarchySlug","String","id","folderId","ancestorIds","some"],"sources":["../../../src/providers/HierarchyDnd/types.ts"],"sourcesContent":["import type React from 'react'\n\nexport type HierarchyDragItem = {\n collectionSlug: string\n id: number | string\n title: string\n}\n\n/**\n * Attached to every draggable card. Rides on dnd-kit's `active.data`, which is how the drag context\n * - mounted above the view - gets at state that only exists below it: the current selection's\n * contents, its card renders, and how to clear it afterwards.\n */\nexport type HierarchyDragData = {\n items: HierarchyDragItem[]\n /**\n * Called after a successful move, by the surface that started the drag. The selection provider\n * lives below the drag context, so the context can't clear the selection itself.\n */\n onMoveSuccess?: () => void\n /**\n * Ghosted card renders shown fanned under the cursor. Only the first few are used; the rest of\n * the count collapses into a \"+N\" badge.\n */\n preview: React.ReactNode[]\n type: 'hierarchy-items'\n}\n\n/**\n * Attached to every drop target - folder cards, tree nodes, breadcrumbs.\n */\nexport type HierarchyDropData = {\n /**\n * Collection slugs this destination accepts. Undefined or empty means unrestricted.\n */\n allowedCollections?: string[]\n /**\n * Ids of the destination's ancestors, so a folder can't be dropped into its own subtree.\n */\n ancestorIds: (number | string)[]\n /** Destination hierarchy item, or null for root. */\n folderId: null | number | string\n hierarchySlug: string\n parentFieldName: string\n title: string\n type: 'hierarchy-folder'\n}\n\n/**\n * Whether `dropTarget` can accept `items`: the destination has to accept every dragged collection,\n * and a folder can never land inside itself or its own descendants.\n *\n * Shared by the live `canDrop` (which styles hover states) and the drop handler (which re-derives\n * validity from the event, because the active drag has already been cleared by then).\n */\nexport const canDropItems = ({\n dropTarget,\n items,\n}: {\n dropTarget: HierarchyDropData\n items: HierarchyDragItem[]\n}): boolean =>\n items.every((item) => {\n if (\n dropTarget.allowedCollections?.length &&\n !dropTarget.allowedCollections.includes(item.collectionSlug)\n ) {\n return false\n }\n\n if (item.collectionSlug === dropTarget.hierarchySlug) {\n // Ids are compared as strings because a folder id can arrive as either across the\n // config/query/DOM boundaries.\n return (\n String(item.id) !== String(dropTarget.folderId) &&\n !dropTarget.ancestorIds.some((id) => String(id) === String(item.id))\n )\n }\n\n return true\n })\n"],"mappings":"AAgDA;;;;;;GAOA,OAAO,MAAMA,YAAA,GAAeA,CAAC;EAC3BC,UAAU;EACVC;AAAK,CAIN,KACCA,KAAA,CAAMC,KAAK,CAAEC,IAAA;EACX,IACEH,UAAA,CAAWI,kBAAkB,EAAEC,MAAA,IAC/B,CAACL,UAAA,CAAWI,kBAAkB,CAACE,QAAQ,CAACH,IAAA,CAAKI,cAAc,GAC3D;IACA,OAAO;EACT;EAEA,IAAIJ,IAAA,CAAKI,cAAc,KAAKP,UAAA,CAAWQ,aAAa,EAAE;IACpD;IACA;IACA,OACEC,MAAA,CAAON,IAAA,CAAKO,EAAE,MAAMD,MAAA,CAAOT,UAAA,CAAWW,QAAQ,KAC9C,CAACX,UAAA,CAAWY,WAAW,CAACC,IAAI,CAAEH,EAAA,IAAOD,MAAA,CAAOC,EAAA,MAAQD,MAAA,CAAON,IAAA,CAAKO,EAAE;EAEtE;EAEA,OAAO;AACT","ignoreList":[]}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
@layer payload-default {
|
|
2
|
-
/*
|
|
3
|
-
* Every state ring is a spread-only box-shadow rather than a border, so the selected state can
|
|
4
|
-
* double the stroke width without taking layout space - a widening border would grow the card's
|
|
5
|
-
* auto height and shift the whole grid row below it. The ring is drawn outside the card box, so
|
|
6
|
-
* it also never crops the thumbnail it surrounds.
|
|
7
|
-
*/
|
|
8
|
-
.hierarchy-document-card {
|
|
9
|
-
position: relative;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
background: var(--color-bg);
|
|
13
|
-
border-radius: var(--radius-large);
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
box-shadow: 0 0 0 var(--stroke-width-small) var(--color-border);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/*
|
|
19
|
-
* :not(--selected) so the hover ring cannot win over the accent ring on a selected card - both
|
|
20
|
-
* rules live in the same layer and file, and the hover selector would otherwise have the higher
|
|
21
|
-
* specificity.
|
|
22
|
-
*/
|
|
23
|
-
.hierarchy-document-card:not(.hierarchy-document-card--selected):hover {
|
|
24
|
-
box-shadow: 0 0 0 var(--stroke-width-small) var(--special-border-translucent-strong);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.hierarchy-document-card--selected {
|
|
28
|
-
box-shadow: 0 0 0 var(--stroke-width-medium) var(--color-border-selected);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Thumbnail */
|
|
32
|
-
|
|
33
|
-
.hierarchy-document-card__thumbnail-wrap {
|
|
34
|
-
position: relative;
|
|
35
|
-
width: 100%;
|
|
36
|
-
aspect-ratio: 4 / 3;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
background: var(--color-bg-secondary);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.hierarchy-document-card__thumbnail {
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Type badge, overlaid on the thumbnail */
|
|
47
|
-
|
|
48
|
-
.hierarchy-document-card__type {
|
|
49
|
-
position: absolute;
|
|
50
|
-
inset-block-start: var(--spacer-2-5);
|
|
51
|
-
inset-inline-start: var(--spacer-2-5);
|
|
52
|
-
display: inline-flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
/* Leaves room for the lock indicator in the opposite corner */
|
|
55
|
-
max-width: calc(100% - var(--spacer-6));
|
|
56
|
-
padding-inline: var(--spacer-1);
|
|
57
|
-
padding-block: var(--spacer-0);
|
|
58
|
-
border-radius: var(--radius-medium);
|
|
59
|
-
background: var(--color-bg);
|
|
60
|
-
color: black;
|
|
61
|
-
border: var(--stroke-width-small) solid var(--color-border);
|
|
62
|
-
font-family: var(--text-body-medium-font-family);
|
|
63
|
-
font-size: var(--text-body-medium-font-size);
|
|
64
|
-
font-weight: var(--text-body-medium-font-weight);
|
|
65
|
-
line-height: var(--text-body-medium-line-height);
|
|
66
|
-
letter-spacing: var(--text-body-medium-letter-spacing);
|
|
67
|
-
white-space: nowrap;
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
text-overflow: ellipsis;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Content */
|
|
73
|
-
|
|
74
|
-
.hierarchy-document-card__content {
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
gap: var(--spacer-1);
|
|
78
|
-
padding-inline: var(--spacer-3);
|
|
79
|
-
padding-block-start: var(--spacer-2-5);
|
|
80
|
-
padding-block-end: var(--spacer-3);
|
|
81
|
-
min-width: 0;
|
|
82
|
-
border-block-start: var(--stroke-width-small) solid var(--color-border);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.hierarchy-document-card__link {
|
|
86
|
-
display: block;
|
|
87
|
-
min-width: 0;
|
|
88
|
-
color: inherit;
|
|
89
|
-
text-decoration: none;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* Stretches the title link across the card so the whole surface navigates */
|
|
93
|
-
.hierarchy-document-card__link::after {
|
|
94
|
-
content: '';
|
|
95
|
-
position: absolute;
|
|
96
|
-
inset: 0;
|
|
97
|
-
z-index: 1;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/*
|
|
101
|
-
* The stretched overlay above is intentionally hit-testable, but left alone it also swallows
|
|
102
|
-
* hover on the title - suppressing the truncated-title tooltip, because a native `title`
|
|
103
|
-
* tooltip only resolves against ancestors of the hit element and the attribute sits on this
|
|
104
|
-
* span. Lifting just the title restores it; the title still navigates because it lives inside
|
|
105
|
-
* the anchor. The metadata rows are deliberately NOT lifted, so the whole card stays navigable.
|
|
106
|
-
*/
|
|
107
|
-
.hierarchy-document-card__title {
|
|
108
|
-
position: relative;
|
|
109
|
-
z-index: 2;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/*
|
|
113
|
-
* Custom property rows may contain their own controls, so they alone are lifted above the
|
|
114
|
-
* overlay. Clicks here will not navigate.
|
|
115
|
-
*/
|
|
116
|
-
.hierarchy-document-card__extra {
|
|
117
|
-
position: relative;
|
|
118
|
-
z-index: 2;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.hierarchy-document-card__title {
|
|
122
|
-
display: block;
|
|
123
|
-
overflow: hidden;
|
|
124
|
-
white-space: nowrap;
|
|
125
|
-
text-overflow: ellipsis;
|
|
126
|
-
color: var(--color-text);
|
|
127
|
-
font-family: var(--text-body-medium-strong-font-family);
|
|
128
|
-
font-size: var(--text-body-medium-strong-font-size);
|
|
129
|
-
font-weight: var(--text-body-medium-strong-font-weight);
|
|
130
|
-
line-height: var(--text-body-medium-strong-line-height);
|
|
131
|
-
letter-spacing: var(--text-body-medium-strong-letter-spacing);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* Properties */
|
|
135
|
-
|
|
136
|
-
.hierarchy-document-card__properties {
|
|
137
|
-
display: flex;
|
|
138
|
-
flex-direction: column;
|
|
139
|
-
gap: var(--spacer-1);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.hierarchy-document-card__property {
|
|
143
|
-
display: flex;
|
|
144
|
-
align-items: center;
|
|
145
|
-
gap: var(--spacer-0-5, 2px);
|
|
146
|
-
min-width: 0;
|
|
147
|
-
font-family: var(--text-body-medium-font-family);
|
|
148
|
-
font-size: var(--text-body-medium-font-size);
|
|
149
|
-
font-weight: var(--text-body-medium-font-weight);
|
|
150
|
-
line-height: var(--text-body-medium-line-height);
|
|
151
|
-
letter-spacing: var(--text-body-medium-letter-spacing);
|
|
152
|
-
color: var(--color-text-secondary);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.hierarchy-document-card__property-label {
|
|
156
|
-
color: var(--color-text-secondary);
|
|
157
|
-
white-space: nowrap;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.hierarchy-document-card__property-value {
|
|
161
|
-
min-width: 0;
|
|
162
|
-
overflow: hidden;
|
|
163
|
-
white-space: nowrap;
|
|
164
|
-
text-overflow: ellipsis;
|
|
165
|
-
color: var(--color-text-secondary);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/* Status pill - mirrors the token pairs used by the table status cell */
|
|
169
|
-
|
|
170
|
-
.hierarchy-document-card__status {
|
|
171
|
-
display: inline-flex;
|
|
172
|
-
/* The pill is a direct child of the stretch-aligned properties column, so it shrink-wraps here */
|
|
173
|
-
align-self: flex-start;
|
|
174
|
-
align-items: center;
|
|
175
|
-
justify-content: center;
|
|
176
|
-
padding-inline: var(--spacer-1);
|
|
177
|
-
padding-block: var(--spacer-0);
|
|
178
|
-
border-radius: var(--radius-medium);
|
|
179
|
-
white-space: nowrap;
|
|
180
|
-
font-family: var(--text-body-medium-font-family);
|
|
181
|
-
font-size: var(--text-body-medium-font-size);
|
|
182
|
-
font-weight: var(--text-body-medium-font-weight);
|
|
183
|
-
line-height: var(--text-body-medium-line-height);
|
|
184
|
-
letter-spacing: var(--text-body-medium-letter-spacing);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.hierarchy-document-card__status--published {
|
|
188
|
-
background: var(--color-bg-selected);
|
|
189
|
-
color: var(--color-text-brand);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.hierarchy-document-card__status--draft {
|
|
193
|
-
background: var(--color-bg-tertiary);
|
|
194
|
-
color: var(--color-text);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.hierarchy-document-card__status--changed {
|
|
198
|
-
background: var(--color-bg-warning-tertiary);
|
|
199
|
-
color: var(--color-text-warning);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.hierarchy-document-card__status--previously-published {
|
|
203
|
-
background: var(--color-bg-tertiary);
|
|
204
|
-
color: var(--color-text);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/* Lock indicator */
|
|
208
|
-
|
|
209
|
-
.hierarchy-document-card__corner-slot {
|
|
210
|
-
position: absolute;
|
|
211
|
-
inset-block-start: var(--spacer-2);
|
|
212
|
-
inset-inline-end: var(--spacer-2);
|
|
213
|
-
/* Above both the stretched link and the raised text, so selecting never navigates */
|
|
214
|
-
z-index: 3;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { User } from 'payload';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './index.css';
|
|
4
|
-
export type DocumentCardProps = {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
collectionSlug: string;
|
|
7
|
-
doc: Record<string, unknown>;
|
|
8
|
-
href: string;
|
|
9
|
-
isSelected?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* The user currently editing this document. When set, a lock indicator is shown and the card
|
|
12
|
-
* cannot be selected.
|
|
13
|
-
*/
|
|
14
|
-
lockedUser?: User;
|
|
15
|
-
showType?: boolean;
|
|
16
|
-
typeLabel?: string;
|
|
17
|
-
updatedAt?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare const DocumentCard: React.FC<DocumentCardProps>;
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/HierarchyList/HierarchyCards/DocumentCard/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,OAAO,KAAkB,MAAM,OAAO,CAAA;AAStC,OAAO,aAAa,CAAA;AAsBpB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwHpD,CAAA"}
|