mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-15 12:44:38 +01:00
* rename Range to Leaf * rename Selection to Range * add findDOMRange, findNode, findRange helpers * refactor to remove findDropPoint util * revert findDOMNode to throwing errors * export new helpers, fix linter * update docs * update examples
106 lines
2.2 KiB
JSON
106 lines
2.2 KiB
JSON
{
|
|
"document": {
|
|
"nodes": [
|
|
{
|
|
"kind": "block",
|
|
"type": "paragraph",
|
|
"nodes": [
|
|
{
|
|
"kind": "text",
|
|
"leaves": [
|
|
{
|
|
"text": "This is editable "
|
|
},
|
|
{
|
|
"text": "rich",
|
|
"marks": [
|
|
{
|
|
"type": "bold"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"text": " text, "
|
|
},
|
|
{
|
|
"text": "much",
|
|
"marks": [
|
|
{
|
|
"type": "italic"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"text": " better than a "
|
|
},
|
|
{
|
|
"text": "<textarea>",
|
|
"marks": [
|
|
{
|
|
"type": "code"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"text": "!"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"kind": "block",
|
|
"type": "paragraph",
|
|
"nodes": [
|
|
{
|
|
"kind": "text",
|
|
"leaves": [
|
|
{
|
|
"text": "Since it's rich text, you can do things like turn a selection of text "
|
|
},
|
|
{
|
|
"text": "bold",
|
|
"marks": [
|
|
{
|
|
"type": "bold"
|
|
}
|
|
]
|
|
},{
|
|
"text": ", or add a semantically rendered block quote in the middle of the page, like this:"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"kind": "block",
|
|
"type": "block-quote",
|
|
"nodes": [
|
|
{
|
|
"kind": "text",
|
|
"leaves": [
|
|
{
|
|
"text": "A wise quote."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"kind": "block",
|
|
"type": "paragraph",
|
|
"nodes": [
|
|
{
|
|
"kind": "text",
|
|
"leaves": [
|
|
{
|
|
"text": "Try it out for yourself!"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|