Skip to content
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

notes on the future queries API #2876

Closed
ianstormtaylor opened this issue Jun 12, 2019 · 1 comment
Closed

notes on the future queries API #2876

ianstormtaylor opened this issue Jun 12, 2019 · 1 comment

Comments

@ianstormtaylor
Copy link
Owner

ianstormtaylor commented Jun 12, 2019

Just like for #2873 and #2759, just putting this here as notes for the future. Iterating on a set of queries that will live on editor.* for common use cases.

Schema

isAtomic(object)
isBoundary(node)
isBlock(node)
isInline(node)
isVoid(node)

Creators

createPoint(properties)
createRange(properties)

Points

// Checking point relative to a path.
isAtStart(point, path, { includeZeroWidth: false })
isAtEnd(point, path, { includeZeroWidth: false })
isAtEdge(point, path, { includeZeroWidth: false })

// For moving the point.
getNextPoint(point, { unit: 'offset', includeZeroWidth: false, includeVoid: true })
getPreviousPoint(point, { unit: 'offset', includeZeroWidth: false, includeVoid: true })

// Insertion calculations...
getInsertPoint(point)
getInsertMarks(point)

Paths

getStartOfPath(path)
getEndOfPath(path)
getRangeOfPath(path)

Range

getActiveMarks(range)
getFragment(range)
@ianstormtaylor
Copy link
Owner Author

Fixed by #3093.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant