1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-18 13:11:17 +02:00

Adapt benchmarks

This commit is contained in:
Soreine
2016-10-28 11:45:14 +02:00
parent 164ecc6d76
commit 2f3dda35aa
17 changed files with 52 additions and 24 deletions

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -36,10 +36,10 @@ nodes:
type: paragraph
nodes:
- kind: block
key: _cursor_
type: paragraph
nodes:
- kind: text
key: _cursor_
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -19,9 +19,9 @@ nodes:
- text: '!'
- kind: block
type: paragraph
key: _cursor_
nodes:
- kind: text
key: _cursor_
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -20,9 +20,9 @@ nodes:
- text: '!'
- kind: block
type: paragraph
nodes:
- kind: text
key: _cursor_
nodes:
- kind: text
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'

View File

@@ -1,6 +1,6 @@
module.exports = {
run(state) {
return state.document.normalize()
return state.transform().normalize().apply()
}
}

View File

@@ -1,6 +1,6 @@
module.exports = {
run(state) {
return state.document.normalize()
return state.transform().normalize().apply()
}
}

View File

@@ -1,6 +1,6 @@
module.exports = {
run(state) {
return state.document.normalize()
return state.transform().normalize().apply()
}
}

View File

@@ -7,8 +7,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -19,9 +19,9 @@ nodes:
- text: '!'
- kind: block
type: paragraph
key: _cursor_
nodes:
- kind: text
key: _cursor_
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -36,10 +36,10 @@ nodes:
type: paragraph
nodes:
- kind: block
key: _cursor_
type: paragraph
nodes:
- kind: text
key: _cursor_
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -19,9 +19,9 @@ nodes:
- text: '!'
- kind: block
type: paragraph
key: _cursor_
nodes:
- kind: text
key: _cursor_
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'

View File

@@ -3,8 +3,12 @@ module.exports = {
setup(state) {
// Move cursor
return state.transform()
.collapseToStartOf({ key: '_cursor_' })
.moveForward(10) // Move inside the text
.moveTo({
anchorKey: '_cursor_',
anchorOffset: 10,
focusKey: '_cursor_',
focusOffset: 10
})
.apply()
},

View File

@@ -20,9 +20,9 @@ nodes:
- text: '!'
- kind: block
type: paragraph
nodes:
- kind: text
key: _cursor_
nodes:
- kind: text
ranges:
- text: 'Since it''s rich text, you can do things like turn a selection of text '
- text: 'bold'