mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 21:21:21 +02:00
Adapt benchmarks
This commit is contained in:
@@ -3,8 +3,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -36,10 +36,10 @@ nodes:
|
|||||||
type: paragraph
|
type: paragraph
|
||||||
nodes:
|
nodes:
|
||||||
- kind: block
|
- kind: block
|
||||||
key: _cursor_
|
|
||||||
type: paragraph
|
type: paragraph
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
@@ -3,8 +3,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -19,9 +19,9 @@ nodes:
|
|||||||
- text: '!'
|
- text: '!'
|
||||||
- kind: block
|
- kind: block
|
||||||
type: paragraph
|
type: paragraph
|
||||||
key: _cursor_
|
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
@@ -3,8 +3,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -20,9 +20,9 @@ nodes:
|
|||||||
- text: '!'
|
- text: '!'
|
||||||
- kind: block
|
- kind: block
|
||||||
type: paragraph
|
type: paragraph
|
||||||
key: _cursor_
|
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
run(state) {
|
run(state) {
|
||||||
return state.document.normalize()
|
return state.transform().normalize().apply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
run(state) {
|
run(state) {
|
||||||
return state.document.normalize()
|
return state.transform().normalize().apply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
run(state) {
|
run(state) {
|
||||||
return state.document.normalize()
|
return state.transform().normalize().apply()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,8 +7,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -19,9 +19,9 @@ nodes:
|
|||||||
- text: '!'
|
- text: '!'
|
||||||
- kind: block
|
- kind: block
|
||||||
type: paragraph
|
type: paragraph
|
||||||
key: _cursor_
|
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
@@ -3,8 +3,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -36,10 +36,10 @@ nodes:
|
|||||||
type: paragraph
|
type: paragraph
|
||||||
nodes:
|
nodes:
|
||||||
- kind: block
|
- kind: block
|
||||||
key: _cursor_
|
|
||||||
type: paragraph
|
type: paragraph
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
@@ -3,8 +3,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -19,9 +19,9 @@ nodes:
|
|||||||
- text: '!'
|
- text: '!'
|
||||||
- kind: block
|
- kind: block
|
||||||
type: paragraph
|
type: paragraph
|
||||||
key: _cursor_
|
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
@@ -3,8 +3,12 @@ module.exports = {
|
|||||||
setup(state) {
|
setup(state) {
|
||||||
// Move cursor
|
// Move cursor
|
||||||
return state.transform()
|
return state.transform()
|
||||||
.collapseToStartOf({ key: '_cursor_' })
|
.moveTo({
|
||||||
.moveForward(10) // Move inside the text
|
anchorKey: '_cursor_',
|
||||||
|
anchorOffset: 10,
|
||||||
|
focusKey: '_cursor_',
|
||||||
|
focusOffset: 10
|
||||||
|
})
|
||||||
.apply()
|
.apply()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -20,9 +20,9 @@ nodes:
|
|||||||
- text: '!'
|
- text: '!'
|
||||||
- kind: block
|
- kind: block
|
||||||
type: paragraph
|
type: paragraph
|
||||||
key: _cursor_
|
|
||||||
nodes:
|
nodes:
|
||||||
- kind: text
|
- kind: text
|
||||||
|
key: _cursor_
|
||||||
ranges:
|
ranges:
|
||||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||||
- text: 'bold'
|
- text: 'bold'
|
||||||
|
Reference in New Issue
Block a user