feat: bulk issue deletion, colours to labels
This commit is contained in:
parent
71cd84e65c
commit
2b7282c6e8
31 changed files with 726 additions and 581 deletions
17
apps/app/components/lexical/helpers/node.ts
Normal file
17
apps/app/components/lexical/helpers/node.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { $isAtNodeEnd } from "@lexical/selection";
|
||||
|
||||
export const getSelectedNode = (selection: any) => {
|
||||
const anchor = selection.anchor;
|
||||
const focus = selection.focus;
|
||||
const anchorNode = selection.anchor.getNode();
|
||||
const focusNode = selection.focus.getNode();
|
||||
if (anchorNode === focusNode) {
|
||||
return anchorNode;
|
||||
}
|
||||
const isBackward = selection.isBackward();
|
||||
if (isBackward) {
|
||||
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
||||
} else {
|
||||
return $isAtNodeEnd(anchor) ? focusNode : anchorNode;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue