|
|
@@ -1,7 +1,22 @@
|
|
|
import React from 'react';
|
|
|
|
|
|
+import { FlowDragLayer, usePlayground } from '@flowgram.ai/fixed-layout-editor';
|
|
|
+
|
|
|
import { UIDragNodeContainer } from './styles';
|
|
|
|
|
|
-export default function DraggingAdder(): JSX.Element {
|
|
|
+export default function DraggingAdder(props: any): JSX.Element {
|
|
|
+ const playground = usePlayground();
|
|
|
+ const layer = playground.getLayer(FlowDragLayer);
|
|
|
+ if (!layer) return <></>;
|
|
|
+ if (
|
|
|
+ layer.options.canDrop &&
|
|
|
+ !layer.options.canDrop({
|
|
|
+ dragNodes: layer.dragEntities || [],
|
|
|
+ dropNode: props.from,
|
|
|
+ isBranch: false,
|
|
|
+ })
|
|
|
+ ) {
|
|
|
+ return <></>;
|
|
|
+ }
|
|
|
return <UIDragNodeContainer />;
|
|
|
}
|