workspace panel drag
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { createContext, useContext } from 'react';
|
||||
|
||||
import type { DropPosition } from './layout-utils';
|
||||
|
||||
type WorkspaceContextValue = {
|
||||
workspaceId: string | null;
|
||||
cwd: string;
|
||||
swapSourceId: string | null;
|
||||
setSwapSourceId: (id: string | null) => void;
|
||||
onSwap: (sourceId: string, targetId: string) => void;
|
||||
dragSourceId: string | null;
|
||||
setDragSourceId: (id: string | null) => void;
|
||||
onMove: (sourceId: string, targetId: string, position: DropPosition) => void;
|
||||
};
|
||||
|
||||
const noop = () => {};
|
||||
@@ -16,6 +21,9 @@ const WorkspaceContext = createContext<WorkspaceContextValue>({
|
||||
swapSourceId: null,
|
||||
setSwapSourceId: noop,
|
||||
onSwap: noop,
|
||||
dragSourceId: null,
|
||||
setDragSourceId: noop,
|
||||
onMove: noop,
|
||||
});
|
||||
|
||||
export const WorkspaceProvider = WorkspaceContext.Provider;
|
||||
|
||||
Reference in New Issue
Block a user