-
Notifications
You must be signed in to change notification settings - Fork 6
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
Paragraph selector #999
Paragraph selector #999
Conversation
@@ -0,0 +1,89 @@ | |||
import { lift, setBlockType, wrapIn } from "prosemirror-commands"; |
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.
pretty much lifted from legacy
@@ -0,0 +1,32 @@ | |||
import type { MarkType } from "prosemirror-model"; |
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.
also lifted from legacy—this pattern of creating toggles is much more flexible than what I originally had when it was only bold/italics
@@ -0,0 +1,48 @@ | |||
import type { Mark, MarkType, Node, NodeType, Schema } from "prosemirror-model"; |
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.
lifted from legacy
@@ -0,0 +1,27 @@ | |||
import type { EditorState } from "prosemirror-state"; |
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.
lifted from legacy
const activeType = paragraphTypeItems.filter((item) => { | ||
const { isActive } = item.command(view)(view.state); | ||
return isActive; | ||
})[0]; |
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.
Could be simplified like so:
paragraphTypeItems.find((item) => item.command(view)(view.state).isActive)
Co-authored-by: Eric McDaniel <[email protected]>
Issue(s) Resolved
Paragraph, heading, and blockquote part of #938
High-level Explanation of PR
Adds a paragraph/heading selector, as well as the ability to add blockquotes
Test Plan
Run storybook in the context editor folder, and play around with making paragraphs/headings/blockquotes.
Screenshots (if applicable)
Screen.Recording.2025-02-26.at.3.46.10.PM.mov
Screen.Recording.2025-02-26.at.3.48.18.PM.mov
Notes
The blockquote heading doesn't look great because it overlaps with the paragraph heading. not sure what should be done here? haven't looked into that code too much yet to see how we'd tweak the positioning
