mirror of
https://github.com/docmost/docmost.git
synced 2026-08-29 10:05:03 +08:00
feat(base): add drop-edge indicator component for pragmatic-dnd
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
import type { Edge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
||||||
|
import classes from "@/features/base/styles/grid.module.css";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
edge: Edge;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function BaseDropEdgeIndicator({ edge }: Props) {
|
||||||
|
return <div className={classes.dropEdgeLine} data-edge={edge} aria-hidden />;
|
||||||
|
}
|
||||||
@@ -614,3 +614,41 @@
|
|||||||
background: rgba(255, 255, 255, 0.08);
|
background: rgba(255, 255, 255, 0.08);
|
||||||
color: var(--mantine-color-white);
|
color: var(--mantine-color-white);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropEdgeLine {
|
||||||
|
position: absolute;
|
||||||
|
background: light-dark(
|
||||||
|
var(--mantine-color-blue-5),
|
||||||
|
var(--mantine-color-blue-4)
|
||||||
|
);
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropEdgeLine[data-edge="left"] {
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropEdgeLine[data-edge="right"] {
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropEdgeLine[data-edge="top"] {
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropEdgeLine[data-edge="bottom"] {
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 2px;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user