feat: Implement tag drag-and-drop functionality

This commit is contained in:
2025-12-08 23:49:50 +01:00
parent 757913cf00
commit c38d88c209
9 changed files with 54 additions and 77 deletions
@@ -184,13 +184,6 @@ export const useDocumentsContextValues = (props: DocumentsPanelInnerProps) => {
},
},
tags: {
onDrag: {
start: (e: any, d: any, t: any) => latestHandlersRef.current.tagDragHandlers.onTagDragStart(e, d, t),
end: (e: any) => latestHandlersRef.current.tagDragHandlers.onTagDragEnd(e),
over: (e: any, d: any) => latestHandlersRef.current.tagDragHandlers.onTagDragOver(e, d),
leave: (e: any, d: any) => latestHandlersRef.current.tagDragHandlers.onTagDragLeave(e, d.id),
drop: (e: any, d: any) => latestHandlersRef.current.tagDragHandlers.onTagDrop(e, d),
},
onAttach: (d: any, t: any) => latestPropsRef.current.onDocumentTagAttach?.(d, t),
onDetach: (d: any, t: any) => latestPropsRef.current.onDocumentTagDetach?.(d, t),
onClick: (t: any) => latestHandlersRef.current.toggleTagFilter(t),
@@ -199,12 +192,13 @@ export const useDocumentsContextValues = (props: DocumentsPanelInnerProps) => {
onClick: (c: any) => latestHandlersRef.current.toggleCorrespondentFilter(c),
},
onEntryPointer: (entry: any, e: any) => latestPropsRef.current.onEntryPointer?.(entry, e),
}), []); // Stable forever!
}), []);
return {
assetContextValue,
viewStateContextValue,
commandContextValue,
tagDragHandlers,
scrollRef,
hasDocumentEntries,
isSearchLoading,