-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$insertNodes: Selection-agnostic node insertion with Grid/Node selection support #2638
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
useEffect(() => { | ||
hasModifier.current = false; | ||
const handler = (e: KeyboardEvent) => { | ||
// debugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops
@@ -84,3 +84,65 @@ export function $normalizeTextNode(textNode: TextNode): void { | |||
} | |||
} | |||
} | |||
|
|||
export function $normalizeSelection(selection: RangeSelection): RangeSelection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a whole separate module in core for this? What else will go in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what do you mean by a new module? It has $canSimpleTextNodesBeMerged
, $mergeTextNodes
and $normalizeTextNode
. It just felt like a good fit for another normalization function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh lol I never knew we had a LexicalNormalization module so I assumed you created it. #til
This looks awesome! Planning to step through this logic a bit more later, maybe a comment or two on the normalization logic would be good? |
Also stop using that podcast tweet as test data lol |
Node selection
Screen.Recording.2022-07-13.at.3.37.18.pm.mov
Grid selection
Screen.Recording.2022-07-13.at.3.38.46.pm.mov