Merge pull request #742 from mathuo/741-remove-depreciated-method

chore: remove depricated method
This commit is contained in:
mathuo 2024-10-27 19:54:18 +00:00 committed by GitHub
commit 3f3ed52007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,6 @@ import {
PROPERTY_KEYS, PROPERTY_KEYS,
DockviewComponentOptions, DockviewComponentOptions,
DockviewFrameworkOptions, DockviewFrameworkOptions,
DockviewDndOverlayEvent,
DockviewReadyEvent, DockviewReadyEvent,
createDockview, createDockview,
} from 'dockview-core'; } from 'dockview-core';
@ -56,10 +55,6 @@ export interface IDockviewReactProps extends DockviewOptions {
onReady: (event: DockviewReadyEvent) => void; onReady: (event: DockviewReadyEvent) => void;
onDidDrop?: (event: DockviewDidDropEvent) => void; onDidDrop?: (event: DockviewDidDropEvent) => void;
onWillDrop?: (event: DockviewWillDropEvent) => void; onWillDrop?: (event: DockviewWillDropEvent) => void;
/**
* @deprecated use `api.onUnhandledDragOverEvent` instead. This will be removed in the next release.
*/
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
} }
function extractCoreOptions(props: IDockviewReactProps): DockviewOptions { function extractCoreOptions(props: IDockviewReactProps): DockviewOptions {
@ -203,26 +198,6 @@ export const DockviewReact = React.forwardRef(
}; };
}, [props.onDidDrop]); }, [props.onDidDrop]);
React.useEffect(() => {
if (!dockviewRef.current) {
return () => {
// noop
};
}
const disposable = dockviewRef.current.onUnhandledDragOverEvent(
(event) => {
if (props.showDndOverlay?.(event)) {
event.accept();
}
}
);
return () => {
disposable.dispose();
};
}, [props.showDndOverlay]);
React.useEffect(() => { React.useEffect(() => {
if (!dockviewRef.current) { if (!dockviewRef.current) {
return () => { return () => {