UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 220 B
import{$isAtNodeEnd as o}from"@lexical/selection";function e(e){const r=e.anchor,c=e.focus,t=e.anchor.getNode(),n=e.focus.getNode();if(t===n)return t;return e.isBackward()?o(c)?t:n:o(r)?t:n}export{e as getSelectedNode};