1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-20 05:11:53 +02:00

fix lots of tests with inline behavior

This commit is contained in:
Ian Storm Taylor 2016-12-02 13:09:24 -08:00
parent 9c81ed9c47
commit 8096761a97
160 changed files with 800 additions and 183 deletions

View File

@ -1003,13 +1003,7 @@ const Node = {
return this
.getTexts()
.find((text, i, texts) => {
const next = texts.get(i + 1)
length += text.length
// If the next text is an empty string, return false, because we want
// the furthest text node at the offset, and it will also match.
if (next && next.length == 0) return false
return length > offset
})
},

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: default
nodes:
- kind: text
text: ""
- kind: inline
type: link
data:
@ -11,3 +13,5 @@ nodes:
- kind: text
ranges:
- text: word
- kind: text
text: ""

View File

@ -1,10 +1,20 @@
<div contenteditable="true">
<div style="position:relative;">
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
<a href="https://google.com">
<span>
<span>word</span>
</span>
</a>
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
</div>
</div>

View File

@ -3,9 +3,13 @@ nodes:
- kind: block
type: default
nodes:
- kind: text
text: ""
- kind: inline
type: default
nodes:
- kind: text
ranges:
- text: word
- kind: text
text: ""

View File

@ -1,10 +1,20 @@
<div contenteditable="true">
<div style="position:relative;">
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
<span style="position:relative;">
<span>
<span>word</span>
</span>
</span>
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
</div>
</div>

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: default
nodes:
- kind: text
text: ""
- kind: inline
type: link
data:
@ -11,6 +13,8 @@ nodes:
- kind: text
ranges:
- text: another
- kind: text
text: ""
- kind: inline
type: link
data:
@ -19,3 +23,5 @@ nodes:
- kind: text
ranges:
- text: word
- kind: text
text: ""

View File

@ -1,15 +1,30 @@
<div contenteditable="true">
<div style="position:relative;">
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
<a href="https://google.com">
<span>
<span>another</span>
</span>
</a>
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
<a href="https://google.com">
<span>
<span>word</span>
</span>
</a>
<span>
<span>
<span class="slate-zero-width-space">&#x200B;</span>
</span>
</span>
</div>
</div>

View File

@ -4,10 +4,12 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data: {}
nodes:
- characters: []
- type: hashtag
isVoid: false
data: {}
@ -19,3 +21,5 @@ nodes:
marks: []
- text: e
marks: []
- characters: []
- characters: []

View File

@ -4,6 +4,7 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data:
@ -16,3 +17,4 @@ nodes:
marks: []
- text: e
marks: []
- characters: []

View File

@ -4,14 +4,16 @@ nodes:
isVoid: false
data: {}
nodes:
- type: link
isVoid: false
data: {}
nodes:
- characters:
- text: o
marks: []
- text: n
marks: []
- text: e
marks: []
- characters: []
- type: link
isVoid: false
data: {}
nodes:
- characters:
- text: o
marks: []
- text: n
marks: []
- text: e
marks: []
- characters: []

View File

@ -4,10 +4,12 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data: {}
nodes:
- characters: []
- type: hashtag
isVoid: false
data: {}
@ -19,3 +21,5 @@ nodes:
marks: []
- text: e
marks: []
- characters: []
- characters: []

View File

@ -4,6 +4,7 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data:
@ -16,3 +17,4 @@ nodes:
marks: []
- text: e
marks: []
- characters: []

View File

@ -4,6 +4,7 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data: {}
@ -15,3 +16,4 @@ nodes:
marks: []
- text: e
marks: []
- characters: []

View File

@ -4,10 +4,12 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data: {}
nodes:
- characters: []
- type: hashtag
isVoid: false
data: {}
@ -19,3 +21,5 @@ nodes:
marks: []
- text: e
marks: []
- characters: []
- characters: []

View File

@ -4,6 +4,7 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data:
@ -16,3 +17,4 @@ nodes:
marks: []
- text: e
marks: []
- characters: []

View File

@ -4,6 +4,7 @@ nodes:
isVoid: false
data: {}
nodes:
- characters: []
- type: link
isVoid: false
data: {}
@ -15,3 +16,4 @@ nodes:
marks: []
- text: e
marks: []
- characters: []

View File

@ -3,11 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: ""
- kind: inline
type: hashtag
nodes:
- kind: text
text: one
- kind: text
text: ""
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
data:
@ -10,3 +12,5 @@ nodes:
nodes:
- kind: text
text: one
- kind: text
text: ""

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: one
- kind: text
text: ""

View File

@ -8,11 +8,21 @@ document:
data: {}
isVoid: false
nodes:
- kind: text
ranges:
- kind: range
text: ""
marks: []
- kind: inline
type: link
data: {}
isVoid: false
nodes:
- kind: text
ranges:
- kind: range
text: ""
marks: []
- kind: inline
type: hashtag
data: {}
@ -23,3 +33,13 @@ document:
- kind: range
text: one
marks: []
- kind: text
ranges:
- kind: range
text: ""
marks: []
- kind: text
ranges:
- kind: range
text: ""
marks: []

View File

@ -8,6 +8,11 @@ document:
data: {}
isVoid: false
nodes:
- kind: text
ranges:
- kind: range
text: ""
marks: []
- kind: inline
type: link
isVoid: false
@ -19,3 +24,8 @@ document:
- kind: range
text: one
marks: []
- kind: text
ranges:
- kind: range
text: ""
marks: []

View File

@ -8,6 +8,11 @@ document:
data: {}
isVoid: false
nodes:
- kind: text
ranges:
- kind: range
text: ""
marks: []
- kind: inline
type: link
data: {}
@ -18,3 +23,8 @@ document:
- kind: range
text: one
marks: []
- kind: text
ranges:
- kind: range
text: ""
marks: []

View File

@ -4,12 +4,12 @@ import assert from 'assert'
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const last = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: last.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,13 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: other
- kind: text
text: ""

View File

@ -4,12 +4,12 @@ import assert from 'assert'
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: second.key,
focusKey: fifth.key,
focusOffset: 2
})
@ -19,7 +19,7 @@ export default function (state) {
.splitBlock()
.apply()
const updated = next.document.getTexts().get(1)
const updated = next.document.getTexts().get(4)
assert.deepEqual(
next.selection.toJS(),

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: one
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: two
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: one
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: two
nodes:
- kind: text
text: other
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: second.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -12,9 +14,13 @@ nodes:
- text: rd
marks:
- type: bold
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -24,3 +30,5 @@ nodes:
marks:
- type: bold
- text: other
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const last = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: last.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,13 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: other
- kind: text
text: ""

View File

@ -10,3 +10,5 @@ nodes:
nodes:
- kind: text
text: two
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusOffset: first.length
focusKey: second.key,
focusOffset: second.length
})
return state

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -10,3 +10,5 @@ nodes:
nodes:
- kind: text
text: two
- kind: text
text: ""

View File

@ -10,3 +10,5 @@ nodes:
nodes:
- kind: text
text: two
- kind: text
text: ""

View File

@ -10,12 +10,12 @@ export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorOffset: first.length,
focusKey: first.key,
focusOffset: first.length
anchorKey: second.key,
anchorOffset: second.length,
focusKey: second.key,
focusOffset: second.length
})
return state

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:

View File

@ -10,11 +10,11 @@ export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: first.key,
focusKey: second.key,
focusOffset: 2
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,18 +3,26 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: inline
type: hashtag
nodes:
- kind: text
text: fragment
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: rd
- kind: text
text: ""

View File

@ -10,11 +10,11 @@ export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: first.key,
focusKey: second.key,
focusOffset: 2
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -15,3 +17,5 @@ nodes:
nodes:
- kind: text
text: rd
- kind: text
text: ""

View File

@ -10,11 +10,11 @@ export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -10,3 +10,5 @@ nodes:
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: first.key,
focusKey: second.key,
focusOffset: 2
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -13,3 +15,5 @@ nodes:
isVoid: true
- kind: text
text: rd
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: second.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -11,9 +13,13 @@ nodes:
- text: word
marks:
- type: bold
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -22,3 +28,5 @@ nodes:
- text: another
marks:
- type: bold
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -12,9 +14,13 @@ nodes:
marks:
- type: bold
- text: rd
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
@ -24,3 +30,5 @@ nodes:
- text: other
marks:
- type: bold
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: second.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: code
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: code
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: second.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: code
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: code
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -4,11 +4,11 @@ import { Data } from '../../../../../..'
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
data:
@ -10,3 +12,5 @@ nodes:
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const third = texts.get(2)
const range = selection.merge({
anchorKey: first.key,
anchorKey: third.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: third.key,
focusOffset: 0
})

View File

@ -3,11 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: hashtag
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: text
text: ""

View File

@ -3,11 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: hashtag
nodes:
- kind: text
text: ""
- kind: inline
type: code
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: code
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: code
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: code
data:
@ -10,3 +12,5 @@ nodes:
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -4,11 +4,11 @@ import { Data } from '../../../../../..'
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,6 +3,8 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: code
data:
@ -10,3 +12,5 @@ nodes:
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.last()
const second = texts.get(1)
const fifth = texts.get(4)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: second.key,
focusKey: fifth.key,
focusOffset: 2
})

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: one
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: two
nodes:
- kind: text
text: another
- kind: text
text: ""

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: one
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: two
nodes:
- kind: text
text: other
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: first.key,
focusKey: second.key,
focusOffset: 2
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,16 +3,24 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: rd
- kind: text
text: ""

View File

@ -2,12 +2,12 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorOffset: first.length,
focusKey: first.key,
focusOffset: first.length
anchorKey: second.key,
anchorOffset: second.length,
focusKey: second.key,
focusOffset: second.length
})
return state

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 2,
focusKey: first.key,
focusKey: second.key,
focusOffset: 2
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,13 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: wo
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: rd
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const second = texts.get(1)
const range = selection.merge({
anchorKey: first.key,
anchorKey: second.key,
anchorOffset: 0,
focusKey: first.key,
focusKey: second.key,
focusOffset: 0
})

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -3,8 +3,12 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""

View File

@ -2,11 +2,11 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const third = texts.get(2)
const range = selection.merge({
anchorKey: first.key,
anchorKey: third.key,
anchorOffset: 2,
focusKey: first.key,
focusKey: third.key,
focusOffset: 2
})

View File

@ -3,11 +3,19 @@ nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: ""
- kind: inline
type: link
nodes:
- kind: text
text: word
- kind: text
text: ""
- kind: text
text: ""

Some files were not shown because too many files have changed in this diff Show More