A hyperscript helper for creating Slate documents with JSX-like syntax.
90
A utility for generating test fixtures for a rich text editor, with support for various cursor positions and text selections.
@generates
/**
* Creates a test fixture for an editor with a cursor at the start of text.
*
* @returns {Object} An editor object with selection at text start
*/
function createEditorWithCursorAtStart() {
// IMPLEMENTATION HERE
}
/**
* Creates a test fixture for an editor with a cursor in the middle of text.
*
* @returns {Object} An editor object with selection in middle of text
*/
function createEditorWithCursorInMiddle() {
// IMPLEMENTATION HERE
}
/**
* Creates a test fixture for an editor with a cursor at the end of text.
*
* @returns {Object} An editor object with selection at text end
*/
function createEditorWithCursorAtEnd() {
// IMPLEMENTATION HERE
}
/**
* Creates a test fixture for an editor with a range selection.
*
* @returns {Object} An editor object with a range selection
*/
function createEditorWithRangeSelection() {
// IMPLEMENTATION HERE
}
module.exports = {
createEditorWithCursorAtStart,
createEditorWithCursorInMiddle,
createEditorWithCursorAtEnd,
createEditorWithRangeSelection
};Provides hyperscript helpers for creating Slate documents with inline selection markers.
Install with Tessl CLI
npx tessl i tessl/npm-slate-hyperscriptdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10