refactor: Introduce dedicated Document and Asset types and migrate codebase from DocumentLike.
This commit is contained in:
@@ -173,6 +173,7 @@ interface DesktopWorkspaceViewProps extends Omit<DocumentsViewProps, 'entries' |
|
||||
markLayoutDirty: () => void;
|
||||
onSelect?: (descriptor: unknown, event?: unknown) => void;
|
||||
onPromoteSelection?: (docId: Identifier, event?: unknown) => void;
|
||||
selectionOrderRef: React.MutableRefObject<string[]>;
|
||||
}
|
||||
|
||||
const defaultGetDocumentAsset: GetAsset = () => null;
|
||||
@@ -194,6 +195,7 @@ const DesktopWorkspace: React.FC<DocumentsViewProps> = ({
|
||||
clearSelection,
|
||||
handleEntrySelection,
|
||||
promoteSelectionOrder,
|
||||
selectionOrderRef,
|
||||
configureSelectionEnvironment,
|
||||
} = useWorkspaceSelectionContext();
|
||||
const items = useMemo<DeskDocument[]>(
|
||||
@@ -814,6 +816,7 @@ const DesktopWorkspace: React.FC<DocumentsViewProps> = ({
|
||||
recalcVisibleDocIds,
|
||||
dragSettings,
|
||||
markLayoutDirty,
|
||||
selectionOrderRef,
|
||||
};
|
||||
return <DesktopWorkspaceView {...viewProps} />;
|
||||
};
|
||||
@@ -850,13 +853,14 @@ function DesktopWorkspaceView({
|
||||
resolveBaseMetrics,
|
||||
bringToFront,
|
||||
setDraggingId,
|
||||
canvasSize,
|
||||
canvasSize: _canvasSize,
|
||||
openOverlayForDoc,
|
||||
recalcVisibleDocIds,
|
||||
dragSettings,
|
||||
onDocumentActivate,
|
||||
markLayoutDirty,
|
||||
onSelect,
|
||||
selectionOrderRef,
|
||||
}: DesktopWorkspaceViewProps) {
|
||||
const handleDeskDocumentActivate = useCallback(
|
||||
(docId: Identifier) => {
|
||||
@@ -883,19 +887,18 @@ function DesktopWorkspaceView({
|
||||
engine,
|
||||
layoutRef,
|
||||
dragTransformsRef,
|
||||
itemRefs,
|
||||
documentLookup,
|
||||
ensureDocumentSize,
|
||||
resolveBaseMetrics,
|
||||
bringToFront,
|
||||
setDraggingId,
|
||||
canvasSize,
|
||||
openOverlayForDoc,
|
||||
recalcVisibleDocIds,
|
||||
settings: dragSettings,
|
||||
containerRef,
|
||||
onDocumentActivate: handleDeskDocumentActivate,
|
||||
markLayoutDirty,
|
||||
selectionOrderRef,
|
||||
selectedDocumentIds,
|
||||
}) as {
|
||||
handlePointerDown: (event: React.PointerEvent<HTMLElement>, docId: Identifier | null, options: PointerDownOptions) => void;
|
||||
|
||||
Reference in New Issue
Block a user