()
| 15 | } |
| 16 | |
| 17 | const TableSelection: React.FC<TableSelectionProps> = () => { |
| 18 | const editor = useEditableStatic() |
| 19 | const rect = useGridSelectionRect() |
| 20 | |
| 21 | useIsomorphicLayoutEffect(() => { |
| 22 | if (rect) { |
| 23 | SelectionDrawing.setEnabled(editor, false) |
| 24 | } else { |
| 25 | SelectionDrawing.setEnabled(editor, true) |
| 26 | } |
| 27 | |
| 28 | return () => { |
| 29 | SelectionDrawing.setEnabled(editor, true) |
| 30 | } |
| 31 | }, [editor, rect]) |
| 32 | |
| 33 | if (!rect) return null |
| 34 | const { top, left, width, height } = rect |
| 35 | return <SelectionStyles style={{ left, top, width, height }} /> |
| 36 | } |
| 37 | |
| 38 | export { TableSelection } |
nothing calls this directly
no test coverage detected
searching dependent graphs…