1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

update benchmarks

This commit is contained in:
Ian Storm Taylor 2018-07-26 08:19:53 -07:00
parent 695f83bd40
commit 014e37b319
5 changed files with 71 additions and 12 deletions

View File

@ -0,0 +1,33 @@
/** @jsx h */
/* eslint-disable react/jsx-key */
const h = require('../../helpers/h')
module.exports.default = function(change) {
change.addMark('bold')
}
const value = (
<value>
<document>
{Array.from(Array(10)).map((v, i) => (
<quote>
<paragraph>
<paragraph>
This is editable {i == 0 ? <anchor /> : ''}rich{i == 0 ? (
<focus />
) : (
''
)}{' '}
text, <i>much</i> better than a textarea!
</paragraph>
</paragraph>
</quote>
))}
</document>
</value>
)
module.exports.input = function() {
return value.change()
}

View File

@ -14,9 +14,9 @@ const value = (
<quote>
<paragraph>
<paragraph>
{i == 0 ? <cursor /> : ''}
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i == 0 ? <cursor /> : ''}
</paragraph>
</paragraph>
</quote>

View File

@ -3,30 +3,26 @@
const h = require('../../helpers/h')
module.exports.default = function({ change, block }) {
change.insertNodeByKey(block.key, 0, <paragraph>Hello world</paragraph>)
module.exports.default = function(change) {
change.insertNodeByKey('a', 0, <paragraph>Hello world</paragraph>)
}
const value = (
<value>
<document>
{Array.from(Array(10)).map((v, i) => (
<quote>
<quote key="a">
<paragraph>
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i == 0 ? <cursor /> : ''}
</paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i == 0 ? <cursor /> : ''}
</paragraph>
</quote>
))}
</document>
</value>
)
const block = value.document.getBlocks().last()
module.exports.input = function() {
const change = value.change()
return { change, block }
return value.change()
}

View File

@ -0,0 +1,30 @@
/** @jsx h */
/* eslint-disable react/jsx-key */
const h = require('../../helpers/h')
module.exports.default = function(change) {
change.setBlocks('quote')
}
const value = (
<value>
<document>
{Array.from(Array(10)).map((v, i) => (
<quote>
<paragraph>
<paragraph>
This is editable <b>rich</b> text, <i>much</i> better than a
textarea!
{i == 0 ? <cursor /> : ''}
</paragraph>
</paragraph>
</quote>
))}
</document>
</value>
)
module.exports.input = function() {
return value.change()
}