MCPcopy Create free account
hub / github.com/editablejs/editable / Dragging

Function Dragging

packages/plugins/table/src/components/dragging.tsx:5–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { TableLocale } from '../locale'
4
5export const Dragging = () => {
6 const editor = useEditableStatic()
7 const point = useTableDragPoint()
8 const count = useTableDragCount()
9 const { format } = useLocaleFormat<TableLocale>('table')
10
11 if (!point) return null
12 const [x, y] = Editable.toRelativePosition(editor, point.x, point.y)
13 return (
14 <div
15 tw="absolute left-0 top-0 pointer-events-none py-2 px-4 bg-blue-500 text-white opacity-80 z-10"
16 style={{
17 transform: `translate(${x}px, ${y}px)`,
18 }}
19 >
20 <div tw="text-center text-sm">
21 {format(TableDrag.getDragType() === 'col' ? 'moveCols' : 'moveRows', { count })}
22 </div>
23 </div>
24 )
25}

Callers

nothing calls this directly

Calls 4

useEditableStaticFunction · 0.90
useTableDragPointFunction · 0.90
useTableDragCountFunction · 0.90
useLocaleFormatFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…