()
| 13 | interface SelectionProps {} |
| 14 | |
| 15 | const SelectionComponent: React.FC<SelectionProps> = () => { |
| 16 | const selection = useSelectionDrawingSelection() |
| 17 | const rects = useSelectionDrawingRects() |
| 18 | const enabled = useSelectionDrawingEnabled() |
| 19 | const style = useSelectionDrawingStyle() |
| 20 | const [focused] = useFocused() |
| 21 | if (!enabled || !selection || Range.isCollapsed(selection)) return null |
| 22 | |
| 23 | return ( |
| 24 | <> |
| 25 | {rects.map((rect, index) => { |
| 26 | return ( |
| 27 | <ShadowBlock |
| 28 | key={`sel-${index}`} |
| 29 | rect={Object.assign({}, rect.toJSON(), { |
| 30 | color: isTouchDevice || focused ? style.focusColor : style.blurColor, |
| 31 | })} |
| 32 | /> |
| 33 | ) |
| 34 | })} |
| 35 | </> |
| 36 | ) |
| 37 | } |
| 38 | |
| 39 | export { SelectionComponent } |
nothing calls this directly
no test coverage detected