@portabletext/editor 2.13.3 → 2.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-cjs/{selector.is-selection-expanded.cjs → selector.get-selection-text.cjs} +25 -25
- package/lib/_chunks-cjs/selector.get-selection-text.cjs.map +1 -0
- package/lib/_chunks-cjs/selector.get-text-before.cjs +4 -4
- package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
- package/lib/_chunks-cjs/{selector.is-selecting-entire-blocks.cjs → selector.is-active-style.cjs} +408 -399
- package/lib/_chunks-cjs/selector.is-active-style.cjs.map +1 -0
- package/lib/_chunks-cjs/util.child-selection-point-to-block-offset.cjs +3 -3
- package/lib/_chunks-cjs/util.child-selection-point-to-block-offset.cjs.map +1 -1
- package/lib/_chunks-cjs/{util.slice-blocks.cjs → util.get-text-block-text.cjs} +25 -26
- package/lib/_chunks-cjs/util.get-text-block-text.cjs.map +1 -0
- package/lib/_chunks-cjs/{util.is-selection-collapsed.cjs → util.is-empty-text-block.cjs} +9 -9
- package/lib/_chunks-cjs/util.is-empty-text-block.cjs.map +1 -0
- package/lib/_chunks-cjs/util.merge-text-blocks.cjs +2 -2
- package/lib/_chunks-cjs/util.merge-text-blocks.cjs.map +1 -1
- package/lib/_chunks-cjs/util.slice-text-block.cjs +5 -5
- package/lib/_chunks-cjs/util.slice-text-block.cjs.map +1 -1
- package/lib/_chunks-dts/behavior.types.action.d.cts +271 -271
- package/lib/_chunks-dts/behavior.types.action.d.ts +322 -322
- package/lib/_chunks-es/{selector.is-selection-expanded.js → selector.get-selection-text.js} +20 -20
- package/lib/_chunks-es/selector.get-selection-text.js.map +1 -0
- package/lib/_chunks-es/selector.get-text-before.js +2 -2
- package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
- package/lib/_chunks-es/{selector.is-selecting-entire-blocks.js → selector.is-active-style.js} +385 -376
- package/lib/_chunks-es/selector.is-active-style.js.map +1 -0
- package/lib/_chunks-es/util.child-selection-point-to-block-offset.js +1 -1
- package/lib/_chunks-es/util.child-selection-point-to-block-offset.js.map +1 -1
- package/lib/_chunks-es/{util.slice-blocks.js → util.get-text-block-text.js} +25 -26
- package/lib/_chunks-es/util.get-text-block-text.js.map +1 -0
- package/lib/_chunks-es/{util.is-selection-collapsed.js → util.is-empty-text-block.js} +8 -8
- package/lib/_chunks-es/util.is-empty-text-block.js.map +1 -0
- package/lib/_chunks-es/util.merge-text-blocks.js +1 -1
- package/lib/_chunks-es/util.merge-text-blocks.js.map +1 -1
- package/lib/_chunks-es/util.slice-text-block.js +1 -1
- package/lib/_chunks-es/util.slice-text-block.js.map +1 -1
- package/lib/index.cjs +225 -225
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +18 -18
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.cjs +21 -21
- package/lib/plugins/index.cjs.map +1 -1
- package/lib/plugins/index.d.cts +4 -4
- package/lib/plugins/index.d.ts +4 -4
- package/lib/plugins/index.js +3 -3
- package/lib/plugins/index.js.map +1 -1
- package/lib/selectors/index.cjs +52 -52
- package/lib/selectors/index.cjs.map +1 -1
- package/lib/selectors/index.js +5 -5
- package/lib/selectors/index.js.map +1 -1
- package/lib/utils/index.cjs +14 -14
- package/lib/utils/index.cjs.map +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +3 -3
- package/lib/utils/index.js.map +1 -1
- package/package.json +14 -14
- package/src/behaviors/behavior.abstract.annotation.ts +3 -3
- package/src/behaviors/behavior.abstract.decorator.ts +2 -2
- package/src/behaviors/behavior.abstract.delete.ts +25 -16
- package/src/behaviors/behavior.abstract.deserialize.ts +4 -3
- package/src/behaviors/behavior.abstract.insert.ts +6 -7
- package/src/behaviors/behavior.abstract.keyboard.ts +7 -8
- package/src/behaviors/behavior.abstract.list-item.ts +2 -1
- package/src/behaviors/behavior.abstract.move.ts +2 -1
- package/src/behaviors/behavior.abstract.select.ts +4 -2
- package/src/behaviors/behavior.abstract.split.ts +33 -24
- package/src/behaviors/behavior.abstract.style.ts +2 -1
- package/src/behaviors/behavior.abstract.ts +8 -7
- package/src/behaviors/behavior.core.annotations.ts +8 -7
- package/src/behaviors/behavior.core.block-element.ts +7 -5
- package/src/behaviors/behavior.core.block-objects.ts +25 -27
- package/src/behaviors/behavior.core.dnd.ts +10 -8
- package/src/behaviors/behavior.core.insert-break.ts +45 -36
- package/src/behaviors/behavior.core.lists.ts +31 -25
- package/src/behaviors/behavior.decorator-pair.ts +26 -23
- package/src/behaviors/behavior.markdown.ts +26 -21
- package/src/converters/converter.portable-text.ts +3 -3
- package/src/converters/converter.text-html.serialize.test.ts +1 -1
- package/src/converters/converter.text-html.ts +3 -3
- package/src/converters/converter.text-plain.test.ts +1 -1
- package/src/converters/converter.text-plain.ts +3 -3
- package/src/editor/Editable.tsx +2 -2
- package/src/editor/components/render-span.tsx +3 -5
- package/src/editor/create-editor.ts +2 -2
- package/src/editor/create-slate-editor.tsx +1 -4
- package/src/editor/editor-dom.ts +2 -2
- package/src/editor/plugins/createWithEditableAPI.ts +5 -10
- package/src/editor/plugins/createWithMaxBlocks.ts +2 -2
- package/src/editor/plugins/createWithObjectKeys.ts +2 -2
- package/src/editor/plugins/createWithPatches.ts +3 -10
- package/src/editor/plugins/createWithPlaceholderBlock.ts +2 -2
- package/src/editor/plugins/createWithPortableTextMarkModel.ts +2 -2
- package/src/editor/plugins/createWithSchemaTypes.ts +1 -1
- package/src/editor/plugins/createWithUndoRedo.ts +6 -6
- package/src/editor/plugins/slate-plugin.update-selection.ts +1 -1
- package/src/editor/sync-machine.ts +2 -5
- package/src/{internal-utils → editor}/weakMaps.ts +1 -1
- package/src/editor/with-undo-step.ts +1 -1
- package/src/index.ts +1 -1
- package/src/internal-utils/applyPatch.ts +2 -2
- package/src/internal-utils/build-index-maps.test.ts +1 -1
- package/src/internal-utils/create-test-snapshot.ts +1 -1
- package/src/internal-utils/event-position.ts +11 -9
- package/src/internal-utils/operation-to-patches.test.ts +1 -1
- package/src/internal-utils/portable-text-node.ts +1 -1
- package/src/internal-utils/selection-block-keys.ts +1 -1
- package/src/internal-utils/selection-focus-text.ts +1 -1
- package/src/internal-utils/to-slate-range.ts +4 -4
- package/src/operations/behavior.operation.annotation.add.ts +1 -1
- package/src/operations/behavior.operation.block.set.ts +1 -1
- package/src/operations/behavior.operation.block.unset.ts +2 -2
- package/src/operations/behavior.operation.decorator.add.ts +11 -9
- package/src/operations/behavior.operation.delete.ts +1 -1
- package/src/operations/behavior.operation.insert.block.ts +2 -2
- package/src/operations/behavior.operation.insert.child.ts +1 -1
- package/src/operations/behavior.operation.move.block.ts +1 -1
- package/src/plugins/plugin.behavior.tsx +1 -1
- package/src/plugins/plugin.decorator-shortcut.ts +3 -3
- package/src/plugins/plugin.internal.auto-close-brackets.ts +2 -1
- package/src/plugins/plugin.one-line.tsx +11 -11
- package/src/priority/priority.types.ts +1 -1
- package/src/{internal-utils → selectors}/drag-selection.test.ts +1 -1
- package/src/{internal-utils → selectors}/drag-selection.ts +26 -19
- package/src/selectors/selector.get-anchor-block.ts +1 -1
- package/src/selectors/selector.get-anchor-child.ts +1 -1
- package/src/selectors/selector.get-block-offsets.ts +3 -3
- package/src/selectors/selector.get-caret-word-selection.test.ts +1 -1
- package/src/selectors/selector.get-focus-block.ts +1 -1
- package/src/selectors/selector.get-focus-child.ts +1 -1
- package/src/selectors/selector.get-focus-list-block.ts +1 -1
- package/src/selectors/selector.get-list-state.test.ts +1 -1
- package/src/selectors/selector.get-mark-state.ts +1 -1
- package/src/selectors/selector.get-next-inline-object.ts +1 -1
- package/src/selectors/selector.get-next-span.ts +1 -1
- package/src/selectors/selector.get-previous-inline-object.ts +1 -1
- package/src/selectors/selector.get-previous-span.ts +1 -1
- package/src/selectors/selector.get-selected-blocks.ts +1 -1
- package/src/selectors/selector.get-selected-spans.test.ts +1 -1
- package/src/selectors/selector.get-selected-spans.ts +2 -2
- package/src/selectors/selector.get-selected-text-blocks.ts +3 -2
- package/src/selectors/selector.get-selected-value.test.ts +87 -1
- package/src/selectors/selector.get-selected-value.ts +4 -6
- package/src/selectors/selector.get-selection-end-point.ts +1 -1
- package/src/selectors/selector.get-selection-start-point.ts +1 -1
- package/src/selectors/selector.get-selection-text.test.ts +1 -1
- package/src/selectors/selector.get-selection.ts +1 -1
- package/src/selectors/selector.get-text-before.ts +1 -1
- package/src/selectors/selector.get-trimmed-selection.test.ts +1 -1
- package/src/selectors/selector.get-trimmed-selection.ts +5 -7
- package/src/selectors/selector.is-active-decorator.test.ts +2 -1
- package/src/selectors/selector.is-at-the-end-of-block.ts +4 -3
- package/src/selectors/selector.is-at-the-start-of-block.ts +4 -3
- package/src/selectors/selector.is-overlapping-selection.test.ts +1 -1
- package/src/selectors/selector.is-overlapping-selection.ts +1 -1
- package/src/selectors/selector.is-point-after-selection.ts +3 -3
- package/src/selectors/selector.is-point-before-selection.ts +3 -3
- package/src/selectors/selector.is-selecting-entire-blocks.ts +7 -5
- package/src/test/gherkin-parameter-types.ts +3 -3
- package/src/test/vitest/step-definitions.tsx +19 -9
- package/src/types/paths.ts +4 -1
- package/src/utils/util.at-the-beginning-of-block.ts +1 -1
- package/src/utils/util.block-offset.ts +4 -4
- package/src/utils/util.block-offsets-to-selection.ts +1 -1
- package/src/utils/util.child-selection-point-to-block-offset.ts +3 -3
- package/src/utils/util.get-selection-end-point.ts +1 -1
- package/src/utils/util.get-selection-start-point.ts +1 -1
- package/src/utils/util.merge-text-blocks.ts +2 -2
- package/src/utils/util.selection-point-to-block-offset.ts +1 -1
- package/src/{selection/selection-point.ts → utils/util.selection-point.ts} +1 -1
- package/src/utils/util.slice-blocks.ts +6 -6
- package/src/utils/util.slice-text-block.test.ts +3 -1
- package/src/utils/util.slice-text-block.ts +3 -3
- package/src/utils/util.split-text-block.ts +1 -1
- package/lib/_chunks-cjs/selector.is-selecting-entire-blocks.cjs.map +0 -1
- package/lib/_chunks-cjs/selector.is-selection-expanded.cjs.map +0 -1
- package/lib/_chunks-cjs/util.is-selection-collapsed.cjs.map +0 -1
- package/lib/_chunks-cjs/util.slice-blocks.cjs.map +0 -1
- package/lib/_chunks-es/selector.is-selecting-entire-blocks.js.map +0 -1
- package/lib/_chunks-es/selector.is-selection-expanded.js.map +0 -1
- package/lib/_chunks-es/util.is-selection-collapsed.js.map +0 -1
- package/lib/_chunks-es/util.slice-blocks.js.map +0 -1
- /package/src/{internal-utils → editor}/withChanges.ts +0 -0
- /package/src/{internal-utils → editor}/withUndoRedo.ts +0 -0
- /package/src/{internal-utils → editor}/withoutPatching.ts +0 -0
- /package/src/{internal-utils → utils}/asserters.ts +0 -0
- /package/src/{editor → utils}/key-generator.ts +0 -0
- /package/src/{internal-utils → utils}/parse-blocks.test.ts +0 -0
- /package/src/{internal-utils → utils}/parse-blocks.ts +0 -0
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import {isTextBlock} from '@portabletext/schema'
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import {getFocusBlockObject} from '../selectors/selector.get-focus-block-object'
|
|
3
|
+
import {getFocusInlineObject} from '../selectors/selector.get-focus-inline-object'
|
|
4
|
+
import {getFocusTextBlock} from '../selectors/selector.get-focus-text-block'
|
|
5
|
+
import {getSelectedValue} from '../selectors/selector.get-selected-value'
|
|
6
|
+
import {getSelectionEndBlock} from '../selectors/selector.get-selection-end-block'
|
|
7
|
+
import {getSelectionStartBlock} from '../selectors/selector.get-selection-start-block'
|
|
8
|
+
import {parseBlock} from '../utils/parse-blocks'
|
|
9
|
+
import {getBlockEndPoint} from '../utils/util.get-block-end-point'
|
|
10
|
+
import {getBlockStartPoint} from '../utils/util.get-block-start-point'
|
|
11
|
+
import {getSelectionEndPoint} from '../utils/util.get-selection-end-point'
|
|
12
|
+
import {getSelectionStartPoint} from '../utils/util.get-selection-start-point'
|
|
13
|
+
import {isSelectionCollapsed} from '../utils/util.is-selection-collapsed'
|
|
5
14
|
import {sliceTextBlock} from '../utils/util.slice-text-block'
|
|
6
15
|
import {raise} from './behavior.types.action'
|
|
7
16
|
import {defineBehavior} from './behavior.types.behavior'
|
|
@@ -13,8 +22,8 @@ export const abstractSplitBehaviors = [
|
|
|
13
22
|
defineBehavior({
|
|
14
23
|
on: 'split',
|
|
15
24
|
guard: ({snapshot}) =>
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
isSelectionCollapsed(snapshot.context.selection) &&
|
|
26
|
+
getFocusInlineObject(snapshot),
|
|
18
27
|
actions: [],
|
|
19
28
|
}),
|
|
20
29
|
|
|
@@ -24,8 +33,8 @@ export const abstractSplitBehaviors = [
|
|
|
24
33
|
defineBehavior({
|
|
25
34
|
on: 'split',
|
|
26
35
|
guard: ({snapshot}) =>
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
isSelectionCollapsed(snapshot.context.selection) &&
|
|
37
|
+
getFocusBlockObject(snapshot),
|
|
29
38
|
actions: [],
|
|
30
39
|
}),
|
|
31
40
|
|
|
@@ -34,12 +43,12 @@ export const abstractSplitBehaviors = [
|
|
|
34
43
|
guard: ({snapshot}) => {
|
|
35
44
|
const selection = snapshot.context.selection
|
|
36
45
|
|
|
37
|
-
if (!selection ||
|
|
46
|
+
if (!selection || isSelectionCollapsed(selection)) {
|
|
38
47
|
return false
|
|
39
48
|
}
|
|
40
49
|
|
|
41
|
-
const selectionStartBlock =
|
|
42
|
-
const selectionEndBlock =
|
|
50
|
+
const selectionStartBlock = getSelectionStartBlock(snapshot)
|
|
51
|
+
const selectionEndBlock = getSelectionEndBlock(snapshot)
|
|
43
52
|
|
|
44
53
|
if (!selectionStartBlock || !selectionEndBlock) {
|
|
45
54
|
return false
|
|
@@ -62,12 +71,12 @@ export const abstractSplitBehaviors = [
|
|
|
62
71
|
guard: ({snapshot}) => {
|
|
63
72
|
const selection = snapshot.context.selection
|
|
64
73
|
|
|
65
|
-
if (!selection ||
|
|
74
|
+
if (!selection || isSelectionCollapsed(selection)) {
|
|
66
75
|
return false
|
|
67
76
|
}
|
|
68
77
|
|
|
69
|
-
const selectionStartBlock =
|
|
70
|
-
const selectionEndBlock =
|
|
78
|
+
const selectionStartBlock = getSelectionStartBlock(snapshot)
|
|
79
|
+
const selectionEndBlock = getSelectionEndBlock(snapshot)
|
|
71
80
|
|
|
72
81
|
if (!selectionStartBlock || !selectionEndBlock) {
|
|
73
82
|
return false
|
|
@@ -77,18 +86,18 @@ export const abstractSplitBehaviors = [
|
|
|
77
86
|
return false
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
const startPoint =
|
|
81
|
-
const startBlockEndPoint =
|
|
89
|
+
const startPoint = getSelectionStartPoint(selection)
|
|
90
|
+
const startBlockEndPoint = getBlockEndPoint({
|
|
82
91
|
context: snapshot.context,
|
|
83
92
|
block: selectionStartBlock,
|
|
84
93
|
})
|
|
85
|
-
const endPoint =
|
|
86
|
-
const endBlockStartPoint =
|
|
94
|
+
const endPoint = getSelectionEndPoint(selection)
|
|
95
|
+
const endBlockStartPoint = getBlockStartPoint({
|
|
87
96
|
context: snapshot.context,
|
|
88
97
|
block: selectionEndBlock,
|
|
89
98
|
})
|
|
90
99
|
|
|
91
|
-
const selectedValue =
|
|
100
|
+
const selectedValue = getSelectedValue(snapshot)
|
|
92
101
|
|
|
93
102
|
const blocksInBetween = selectedValue.filter(
|
|
94
103
|
(block) =>
|
|
@@ -135,7 +144,7 @@ export const abstractSplitBehaviors = [
|
|
|
135
144
|
guard: ({snapshot}) => {
|
|
136
145
|
const selection = snapshot.context.selection
|
|
137
146
|
|
|
138
|
-
if (!selection ||
|
|
147
|
+
if (!selection || isSelectionCollapsed(selection)) {
|
|
139
148
|
return false
|
|
140
149
|
}
|
|
141
150
|
|
|
@@ -154,19 +163,19 @@ export const abstractSplitBehaviors = [
|
|
|
154
163
|
guard: ({snapshot}) => {
|
|
155
164
|
const selection = snapshot.context.selection
|
|
156
165
|
|
|
157
|
-
if (!selection || !
|
|
166
|
+
if (!selection || !isSelectionCollapsed(selection)) {
|
|
158
167
|
return false
|
|
159
168
|
}
|
|
160
169
|
|
|
161
|
-
const selectionStartPoint =
|
|
170
|
+
const selectionStartPoint = getSelectionStartPoint(selection)
|
|
162
171
|
|
|
163
|
-
const focusTextBlock =
|
|
172
|
+
const focusTextBlock = getFocusTextBlock(snapshot)
|
|
164
173
|
|
|
165
174
|
if (!focusTextBlock) {
|
|
166
175
|
return false
|
|
167
176
|
}
|
|
168
177
|
|
|
169
|
-
const blockEndPoint =
|
|
178
|
+
const blockEndPoint = getBlockEndPoint({
|
|
170
179
|
context: snapshot.context,
|
|
171
180
|
block: focusTextBlock,
|
|
172
181
|
})
|
|
@@ -202,7 +211,7 @@ export const abstractSplitBehaviors = [
|
|
|
202
211
|
},
|
|
203
212
|
actions: [
|
|
204
213
|
(_, {newTextBlock, newTextBlockSelection}) =>
|
|
205
|
-
|
|
214
|
+
isSelectionCollapsed(newTextBlockSelection)
|
|
206
215
|
? [
|
|
207
216
|
raise({
|
|
208
217
|
type: 'insert.block',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {getSelectedTextBlocks
|
|
1
|
+
import {getSelectedTextBlocks} from '../selectors/selector.get-selected-text-blocks'
|
|
2
|
+
import {isActiveStyle} from '../selectors/selector.is-active-style'
|
|
2
3
|
import {raise} from './behavior.types.action'
|
|
3
4
|
import {defineBehavior} from './behavior.types.behavior'
|
|
4
5
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {getFocusSpan} from '../selectors/selector.get-focus-span'
|
|
2
|
+
import {isSelectionCollapsed} from '../selectors/selector.is-selection-collapsed'
|
|
3
|
+
import {isSelectionExpanded} from '../selectors/selector.is-selection-expanded'
|
|
2
4
|
import {abstractAnnotationBehaviors} from './behavior.abstract.annotation'
|
|
3
5
|
import {abstractDecoratorBehaviors} from './behavior.abstract.decorator'
|
|
4
6
|
import {abstractDeleteBehaviors} from './behavior.abstract.delete'
|
|
@@ -18,8 +20,8 @@ export const abstractBehaviors = [
|
|
|
18
20
|
defineBehavior({
|
|
19
21
|
on: 'clipboard.copy',
|
|
20
22
|
guard: ({snapshot}) => {
|
|
21
|
-
const focusSpan =
|
|
22
|
-
const selectionCollapsed =
|
|
23
|
+
const focusSpan = getFocusSpan(snapshot)
|
|
24
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
23
25
|
|
|
24
26
|
return focusSpan && selectionCollapsed
|
|
25
27
|
},
|
|
@@ -39,8 +41,8 @@ export const abstractBehaviors = [
|
|
|
39
41
|
defineBehavior({
|
|
40
42
|
on: 'clipboard.cut',
|
|
41
43
|
guard: ({snapshot}) => {
|
|
42
|
-
const focusSpan =
|
|
43
|
-
const selectionCollapsed =
|
|
44
|
+
const focusSpan = getFocusSpan(snapshot)
|
|
45
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
44
46
|
|
|
45
47
|
return focusSpan && selectionCollapsed
|
|
46
48
|
},
|
|
@@ -83,8 +85,7 @@ export const abstractBehaviors = [
|
|
|
83
85
|
defineBehavior({
|
|
84
86
|
on: 'clipboard.paste',
|
|
85
87
|
guard: ({snapshot}) => {
|
|
86
|
-
return snapshot.context.selection &&
|
|
87
|
-
selectors.isSelectionExpanded(snapshot)
|
|
88
|
+
return snapshot.context.selection && isSelectionExpanded(snapshot)
|
|
88
89
|
? {selection: snapshot.context.selection}
|
|
89
90
|
: false
|
|
90
91
|
},
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {getCaretWordSelection} from '../selectors/selector.get-caret-word-selection'
|
|
2
|
+
import {isActiveAnnotation} from '../selectors/selector.is-active-annotation'
|
|
3
|
+
import {isSelectionCollapsed} from '../selectors/selector.is-selection-collapsed'
|
|
4
|
+
import {isSelectionExpanded} from '../selectors/selector.is-selection-expanded'
|
|
2
5
|
import {raise} from './behavior.types.action'
|
|
3
6
|
import {defineBehavior} from './behavior.types.behavior'
|
|
4
7
|
|
|
5
8
|
const addAnnotationOnCollapsedSelection = defineBehavior({
|
|
6
9
|
on: 'annotation.add',
|
|
7
10
|
guard: ({snapshot}) => {
|
|
8
|
-
if (!
|
|
11
|
+
if (!isSelectionCollapsed(snapshot)) {
|
|
9
12
|
return false
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
const caretWordSelection =
|
|
15
|
+
const caretWordSelection = getCaretWordSelection(snapshot)
|
|
13
16
|
|
|
14
17
|
if (
|
|
15
18
|
!caretWordSelection ||
|
|
16
|
-
!
|
|
19
|
+
!isSelectionExpanded({
|
|
17
20
|
...snapshot,
|
|
18
21
|
context: {
|
|
19
22
|
...snapshot.context,
|
|
@@ -43,9 +46,7 @@ const preventOverlappingAnnotations = defineBehavior({
|
|
|
43
46
|
on: 'annotation.add',
|
|
44
47
|
// When the annotation is active in the selection
|
|
45
48
|
guard: ({snapshot, event}) =>
|
|
46
|
-
|
|
47
|
-
snapshot,
|
|
48
|
-
),
|
|
49
|
+
isActiveAnnotation(event.annotation.name, {mode: 'partial'})(snapshot),
|
|
49
50
|
// Then the existing annotation is removed
|
|
50
51
|
actions: [
|
|
51
52
|
({event}) => [
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {getDragSelection} from '../internal-utils/drag-selection'
|
|
2
1
|
import type {EventPositionBlock} from '../internal-utils/event-position'
|
|
3
2
|
import {corePriority} from '../priority/priority.core'
|
|
4
3
|
import {createEditorPriority} from '../priority/priority.types'
|
|
5
|
-
import
|
|
4
|
+
import {getDragSelection} from '../selectors/drag-selection'
|
|
5
|
+
import {getFocusBlock} from '../selectors/selector.get-focus-block'
|
|
6
|
+
import {getSelectedBlocks} from '../selectors/selector.get-selected-blocks'
|
|
7
|
+
import {isSelectingEntireBlocks} from '../selectors/selector.is-selecting-entire-blocks'
|
|
6
8
|
import {forward} from './behavior.types.action'
|
|
7
9
|
import {defineBehavior} from './behavior.types.behavior'
|
|
8
10
|
|
|
@@ -20,7 +22,7 @@ export function createCoreBlockElementBehaviorsConfig({
|
|
|
20
22
|
behavior: defineBehavior({
|
|
21
23
|
on: 'drag.dragover',
|
|
22
24
|
guard: ({snapshot, event}) => {
|
|
23
|
-
const dropFocusBlock =
|
|
25
|
+
const dropFocusBlock = getFocusBlock({
|
|
24
26
|
...snapshot,
|
|
25
27
|
context: {
|
|
26
28
|
...snapshot.context,
|
|
@@ -43,7 +45,7 @@ export function createCoreBlockElementBehaviorsConfig({
|
|
|
43
45
|
snapshot,
|
|
44
46
|
})
|
|
45
47
|
|
|
46
|
-
const draggedBlocks =
|
|
48
|
+
const draggedBlocks = getSelectedBlocks({
|
|
47
49
|
...snapshot,
|
|
48
50
|
context: {
|
|
49
51
|
...snapshot.context,
|
|
@@ -57,7 +59,7 @@ export function createCoreBlockElementBehaviorsConfig({
|
|
|
57
59
|
return false
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
const draggingEntireBlocks =
|
|
62
|
+
const draggingEntireBlocks = isSelectingEntireBlocks({
|
|
61
63
|
...snapshot,
|
|
62
64
|
context: {
|
|
63
65
|
...snapshot.context,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {isTextBlock} from '@portabletext/schema'
|
|
2
2
|
import {defaultKeyboardShortcuts} from '../keyboard-shortcuts/default-keyboard-shortcuts'
|
|
3
|
-
import
|
|
3
|
+
import {getFocusBlockObject} from '../selectors/selector.get-focus-block-object'
|
|
4
|
+
import {getFocusTextBlock} from '../selectors/selector.get-focus-text-block'
|
|
5
|
+
import {getNextBlock} from '../selectors/selector.get-next-block'
|
|
6
|
+
import {getPreviousBlock} from '../selectors/selector.get-previous-block'
|
|
7
|
+
import {isSelectionCollapsed} from '../selectors/selector.is-selection-collapsed'
|
|
4
8
|
import {isEmptyTextBlock} from '../utils/util.is-empty-text-block'
|
|
5
9
|
import {raise} from './behavior.types.action'
|
|
6
10
|
import {defineBehavior} from './behavior.types.behavior'
|
|
@@ -16,14 +20,14 @@ const arrowDownOnLonelyBlockObject = defineBehavior({
|
|
|
16
20
|
return false
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
const collapsedSelection =
|
|
23
|
+
const collapsedSelection = isSelectionCollapsed(snapshot)
|
|
20
24
|
|
|
21
25
|
if (!collapsedSelection) {
|
|
22
26
|
return false
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
const focusBlockObject =
|
|
26
|
-
const nextBlock =
|
|
29
|
+
const focusBlockObject = getFocusBlockObject(snapshot)
|
|
30
|
+
const nextBlock = getNextBlock(snapshot)
|
|
27
31
|
|
|
28
32
|
return focusBlockObject && !nextBlock
|
|
29
33
|
},
|
|
@@ -49,14 +53,14 @@ const arrowUpOnLonelyBlockObject = defineBehavior({
|
|
|
49
53
|
return false
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
const collapsedSelection =
|
|
56
|
+
const collapsedSelection = isSelectionCollapsed(snapshot)
|
|
53
57
|
|
|
54
58
|
if (!collapsedSelection) {
|
|
55
59
|
return false
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
const focusBlockObject =
|
|
59
|
-
const previousBlock =
|
|
62
|
+
const focusBlockObject = getFocusBlockObject(snapshot)
|
|
63
|
+
const previousBlock = getPreviousBlock(snapshot)
|
|
60
64
|
|
|
61
65
|
return focusBlockObject && !previousBlock
|
|
62
66
|
},
|
|
@@ -76,8 +80,8 @@ const arrowUpOnLonelyBlockObject = defineBehavior({
|
|
|
76
80
|
const breakingBlockObject = defineBehavior({
|
|
77
81
|
on: 'insert.break',
|
|
78
82
|
guard: ({snapshot}) => {
|
|
79
|
-
const focusBlockObject =
|
|
80
|
-
const collapsedSelection =
|
|
83
|
+
const focusBlockObject = getFocusBlockObject(snapshot)
|
|
84
|
+
const collapsedSelection = isSelectionCollapsed(snapshot)
|
|
81
85
|
|
|
82
86
|
return collapsedSelection && focusBlockObject !== undefined
|
|
83
87
|
},
|
|
@@ -101,21 +105,18 @@ const clickingAboveLonelyBlockObject = defineBehavior({
|
|
|
101
105
|
return false
|
|
102
106
|
}
|
|
103
107
|
|
|
104
|
-
if (
|
|
105
|
-
snapshot.context.selection &&
|
|
106
|
-
!selectors.isSelectionCollapsed(snapshot)
|
|
107
|
-
) {
|
|
108
|
+
if (snapshot.context.selection && !isSelectionCollapsed(snapshot)) {
|
|
108
109
|
return false
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
const focusBlockObject =
|
|
112
|
+
const focusBlockObject = getFocusBlockObject({
|
|
112
113
|
...snapshot,
|
|
113
114
|
context: {
|
|
114
115
|
...snapshot.context,
|
|
115
116
|
selection: event.position.selection,
|
|
116
117
|
},
|
|
117
118
|
})
|
|
118
|
-
const previousBlock =
|
|
119
|
+
const previousBlock = getPreviousBlock({
|
|
119
120
|
...snapshot,
|
|
120
121
|
context: {
|
|
121
122
|
...snapshot.context,
|
|
@@ -155,21 +156,18 @@ const clickingBelowLonelyBlockObject = defineBehavior({
|
|
|
155
156
|
return false
|
|
156
157
|
}
|
|
157
158
|
|
|
158
|
-
if (
|
|
159
|
-
snapshot.context.selection &&
|
|
160
|
-
!selectors.isSelectionCollapsed(snapshot)
|
|
161
|
-
) {
|
|
159
|
+
if (snapshot.context.selection && !isSelectionCollapsed(snapshot)) {
|
|
162
160
|
return false
|
|
163
161
|
}
|
|
164
162
|
|
|
165
|
-
const focusBlockObject =
|
|
163
|
+
const focusBlockObject = getFocusBlockObject({
|
|
166
164
|
...snapshot,
|
|
167
165
|
context: {
|
|
168
166
|
...snapshot.context,
|
|
169
167
|
selection: event.position.selection,
|
|
170
168
|
},
|
|
171
169
|
})
|
|
172
|
-
const nextBlock =
|
|
170
|
+
const nextBlock = getNextBlock({
|
|
173
171
|
...snapshot,
|
|
174
172
|
context: {
|
|
175
173
|
...snapshot.context,
|
|
@@ -205,9 +203,9 @@ const clickingBelowLonelyBlockObject = defineBehavior({
|
|
|
205
203
|
const deletingEmptyTextBlockAfterBlockObject = defineBehavior({
|
|
206
204
|
on: 'delete.backward',
|
|
207
205
|
guard: ({snapshot}) => {
|
|
208
|
-
const focusTextBlock =
|
|
209
|
-
const selectionCollapsed =
|
|
210
|
-
const previousBlock =
|
|
206
|
+
const focusTextBlock = getFocusTextBlock(snapshot)
|
|
207
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
208
|
+
const previousBlock = getPreviousBlock(snapshot)
|
|
211
209
|
|
|
212
210
|
if (!focusTextBlock || !selectionCollapsed || !previousBlock) {
|
|
213
211
|
return false
|
|
@@ -242,9 +240,9 @@ const deletingEmptyTextBlockAfterBlockObject = defineBehavior({
|
|
|
242
240
|
const deletingEmptyTextBlockBeforeBlockObject = defineBehavior({
|
|
243
241
|
on: 'delete.forward',
|
|
244
242
|
guard: ({snapshot}) => {
|
|
245
|
-
const focusTextBlock =
|
|
246
|
-
const selectionCollapsed =
|
|
247
|
-
const nextBlock =
|
|
243
|
+
const focusTextBlock = getFocusTextBlock(snapshot)
|
|
244
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
245
|
+
const nextBlock = getNextBlock(snapshot)
|
|
248
246
|
|
|
249
247
|
if (!focusTextBlock || !selectionCollapsed || !nextBlock) {
|
|
250
248
|
return false
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {getCompoundClientRect} from '../internal-utils/compound-client-rect'
|
|
2
|
-
import {getDragSelection} from '../
|
|
3
|
-
import
|
|
2
|
+
import {getDragSelection} from '../selectors/drag-selection'
|
|
3
|
+
import {getSelectedBlocks} from '../selectors/selector.get-selected-blocks'
|
|
4
|
+
import {isOverlappingSelection} from '../selectors/selector.is-overlapping-selection'
|
|
5
|
+
import {isSelectingEntireBlocks} from '../selectors/selector.is-selecting-entire-blocks'
|
|
4
6
|
import {effect, forward, raise} from './behavior.types.action'
|
|
5
7
|
import {defineBehavior} from './behavior.types.behavior'
|
|
6
8
|
|
|
@@ -18,7 +20,7 @@ export const coreDndBehaviors = [
|
|
|
18
20
|
snapshot,
|
|
19
21
|
eventSelection: event.position.selection,
|
|
20
22
|
})
|
|
21
|
-
const selectingEntireBlocks =
|
|
23
|
+
const selectingEntireBlocks = isSelectingEntireBlocks({
|
|
22
24
|
...snapshot,
|
|
23
25
|
context: {
|
|
24
26
|
...snapshot.context,
|
|
@@ -180,7 +182,7 @@ export const coreDndBehaviors = [
|
|
|
180
182
|
guard: ({snapshot, event}) => {
|
|
181
183
|
const dragOrigin = event.dragOrigin
|
|
182
184
|
const draggingOverDragOrigin = dragOrigin
|
|
183
|
-
?
|
|
185
|
+
? isOverlappingSelection(event.position.selection)({
|
|
184
186
|
...snapshot,
|
|
185
187
|
context: {
|
|
186
188
|
...snapshot.context,
|
|
@@ -204,7 +206,7 @@ export const coreDndBehaviors = [
|
|
|
204
206
|
const dragOrigin = event.dragOrigin
|
|
205
207
|
const dropPosition = event.position.selection
|
|
206
208
|
const droppingOnDragOrigin = dragOrigin
|
|
207
|
-
?
|
|
209
|
+
? isOverlappingSelection(dropPosition)({
|
|
208
210
|
...snapshot,
|
|
209
211
|
context: {
|
|
210
212
|
...snapshot.context,
|
|
@@ -272,7 +274,7 @@ export const coreDndBehaviors = [
|
|
|
272
274
|
})
|
|
273
275
|
const dropPosition = event.originEvent.position.selection
|
|
274
276
|
const droppingOnDragOrigin = dragOrigin
|
|
275
|
-
?
|
|
277
|
+
? isOverlappingSelection(dropPosition)({
|
|
276
278
|
...snapshot,
|
|
277
279
|
context: {
|
|
278
280
|
...snapshot.context,
|
|
@@ -281,7 +283,7 @@ export const coreDndBehaviors = [
|
|
|
281
283
|
})
|
|
282
284
|
: false
|
|
283
285
|
|
|
284
|
-
const draggingEntireBlocks =
|
|
286
|
+
const draggingEntireBlocks = isSelectingEntireBlocks({
|
|
285
287
|
...snapshot,
|
|
286
288
|
context: {
|
|
287
289
|
...snapshot.context,
|
|
@@ -289,7 +291,7 @@ export const coreDndBehaviors = [
|
|
|
289
291
|
},
|
|
290
292
|
})
|
|
291
293
|
|
|
292
|
-
const draggedBlocks =
|
|
294
|
+
const draggedBlocks = getSelectedBlocks({
|
|
293
295
|
...snapshot,
|
|
294
296
|
context: {
|
|
295
297
|
...snapshot.context,
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import {getFirstBlock} from '../selectors/selector.get-first-block'
|
|
2
|
+
import {getFocusInlineObject} from '../selectors/selector.get-focus-inline-object'
|
|
3
|
+
import {getFocusSpan} from '../selectors/selector.get-focus-span'
|
|
4
|
+
import {getFocusTextBlock} from '../selectors/selector.get-focus-text-block'
|
|
5
|
+
import {getLastBlock} from '../selectors/selector.get-last-block'
|
|
6
|
+
import {getSelectedBlocks} from '../selectors/selector.get-selected-blocks'
|
|
7
|
+
import {getSelectionEndBlock} from '../selectors/selector.get-selection-end-block'
|
|
8
|
+
import {getSelectionStartBlock} from '../selectors/selector.get-selection-start-block'
|
|
9
|
+
import {isAtTheEndOfBlock} from '../selectors/selector.is-at-the-end-of-block'
|
|
10
|
+
import {isAtTheStartOfBlock} from '../selectors/selector.is-at-the-start-of-block'
|
|
11
|
+
import {isSelectionCollapsed} from '../selectors/selector.is-selection-collapsed'
|
|
12
|
+
import {isSelectionExpanded} from '../selectors/selector.is-selection-expanded'
|
|
13
|
+
import {getBlockEndPoint} from '../utils/util.get-block-end-point'
|
|
14
|
+
import {getBlockStartPoint} from '../utils/util.get-block-start-point'
|
|
15
|
+
import {getSelectionEndPoint} from '../utils/util.get-selection-end-point'
|
|
16
|
+
import {getSelectionStartPoint} from '../utils/util.get-selection-start-point'
|
|
17
|
+
import {isEqualSelectionPoints} from '../utils/util.is-equal-selection-points'
|
|
3
18
|
import {raise} from './behavior.types.action'
|
|
4
19
|
import {defineBehavior} from './behavior.types.behavior'
|
|
5
20
|
|
|
6
21
|
const breakingAtTheEndOfTextBlock = defineBehavior({
|
|
7
22
|
on: 'insert.break',
|
|
8
23
|
guard: ({snapshot}) => {
|
|
9
|
-
const focusTextBlock =
|
|
10
|
-
const selectionCollapsed =
|
|
24
|
+
const focusTextBlock = getFocusTextBlock(snapshot)
|
|
25
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
11
26
|
|
|
12
27
|
if (!snapshot.context.selection || !focusTextBlock || !selectionCollapsed) {
|
|
13
28
|
return false
|
|
14
29
|
}
|
|
15
30
|
|
|
16
|
-
const atTheEndOfBlock =
|
|
17
|
-
selectors.isAtTheEndOfBlock(focusTextBlock)(snapshot)
|
|
31
|
+
const atTheEndOfBlock = isAtTheEndOfBlock(focusTextBlock)(snapshot)
|
|
18
32
|
|
|
19
33
|
const focusListItem = focusTextBlock.node.listItem
|
|
20
34
|
const focusLevel = focusTextBlock.node.level
|
|
@@ -52,14 +66,14 @@ const breakingAtTheEndOfTextBlock = defineBehavior({
|
|
|
52
66
|
const breakingAtTheStartOfTextBlock = defineBehavior({
|
|
53
67
|
on: 'insert.break',
|
|
54
68
|
guard: ({snapshot}) => {
|
|
55
|
-
const focusTextBlock =
|
|
56
|
-
const selectionCollapsed =
|
|
69
|
+
const focusTextBlock = getFocusTextBlock(snapshot)
|
|
70
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
57
71
|
|
|
58
72
|
if (!snapshot.context.selection || !focusTextBlock || !selectionCollapsed) {
|
|
59
73
|
return false
|
|
60
74
|
}
|
|
61
75
|
|
|
62
|
-
const focusSpan =
|
|
76
|
+
const focusSpan = getFocusSpan(snapshot)
|
|
63
77
|
|
|
64
78
|
const focusDecorators = focusSpan?.node.marks?.filter(
|
|
65
79
|
(mark) =>
|
|
@@ -77,8 +91,7 @@ const breakingAtTheStartOfTextBlock = defineBehavior({
|
|
|
77
91
|
const focusListItem = focusTextBlock.node.listItem
|
|
78
92
|
const focusLevel = focusTextBlock.node.level
|
|
79
93
|
|
|
80
|
-
const atTheStartOfBlock =
|
|
81
|
-
selectors.isAtTheStartOfBlock(focusTextBlock)(snapshot)
|
|
94
|
+
const atTheStartOfBlock = isAtTheStartOfBlock(focusTextBlock)(snapshot)
|
|
82
95
|
|
|
83
96
|
if (atTheStartOfBlock) {
|
|
84
97
|
return {focusAnnotations, focusDecorators, focusListItem, focusLevel}
|
|
@@ -120,35 +133,33 @@ const breakingEntireDocument = defineBehavior({
|
|
|
120
133
|
return false
|
|
121
134
|
}
|
|
122
135
|
|
|
123
|
-
if (!
|
|
136
|
+
if (!isSelectionExpanded(snapshot)) {
|
|
124
137
|
return false
|
|
125
138
|
}
|
|
126
139
|
|
|
127
|
-
const firstBlock =
|
|
128
|
-
const lastBlock =
|
|
140
|
+
const firstBlock = getFirstBlock(snapshot)
|
|
141
|
+
const lastBlock = getLastBlock(snapshot)
|
|
129
142
|
|
|
130
143
|
if (!firstBlock || !lastBlock) {
|
|
131
144
|
return false
|
|
132
145
|
}
|
|
133
146
|
|
|
134
|
-
const firstBlockStartPoint =
|
|
147
|
+
const firstBlockStartPoint = getBlockStartPoint({
|
|
135
148
|
context: snapshot.context,
|
|
136
149
|
block: firstBlock,
|
|
137
150
|
})
|
|
138
|
-
const selectionStartPoint =
|
|
151
|
+
const selectionStartPoint = getSelectionStartPoint(
|
|
139
152
|
snapshot.context.selection,
|
|
140
153
|
)
|
|
141
|
-
const lastBlockEndPoint =
|
|
154
|
+
const lastBlockEndPoint = getBlockEndPoint({
|
|
142
155
|
context: snapshot.context,
|
|
143
156
|
block: lastBlock,
|
|
144
157
|
})
|
|
145
|
-
const selectionEndPoint =
|
|
146
|
-
snapshot.context.selection,
|
|
147
|
-
)
|
|
158
|
+
const selectionEndPoint = getSelectionEndPoint(snapshot.context.selection)
|
|
148
159
|
|
|
149
160
|
if (
|
|
150
|
-
|
|
151
|
-
|
|
161
|
+
isEqualSelectionPoints(firstBlockStartPoint, selectionStartPoint) &&
|
|
162
|
+
isEqualSelectionPoints(lastBlockEndPoint, selectionEndPoint)
|
|
152
163
|
) {
|
|
153
164
|
return {selection: snapshot.context.selection}
|
|
154
165
|
}
|
|
@@ -172,36 +183,34 @@ const breakingEntireBlocks = defineBehavior({
|
|
|
172
183
|
return false
|
|
173
184
|
}
|
|
174
185
|
|
|
175
|
-
if (!
|
|
186
|
+
if (!isSelectionExpanded(snapshot)) {
|
|
176
187
|
return false
|
|
177
188
|
}
|
|
178
189
|
|
|
179
|
-
const selectedBlocks =
|
|
180
|
-
const selectionStartBlock =
|
|
181
|
-
const selectionEndBlock =
|
|
190
|
+
const selectedBlocks = getSelectedBlocks(snapshot)
|
|
191
|
+
const selectionStartBlock = getSelectionStartBlock(snapshot)
|
|
192
|
+
const selectionEndBlock = getSelectionEndBlock(snapshot)
|
|
182
193
|
|
|
183
194
|
if (!selectionStartBlock || !selectionEndBlock) {
|
|
184
195
|
return false
|
|
185
196
|
}
|
|
186
197
|
|
|
187
|
-
const startBlockStartPoint =
|
|
198
|
+
const startBlockStartPoint = getBlockStartPoint({
|
|
188
199
|
context: snapshot.context,
|
|
189
200
|
block: selectionStartBlock,
|
|
190
201
|
})
|
|
191
|
-
const selectionStartPoint =
|
|
202
|
+
const selectionStartPoint = getSelectionStartPoint(
|
|
192
203
|
snapshot.context.selection,
|
|
193
204
|
)
|
|
194
|
-
const endBlockEndPoint =
|
|
205
|
+
const endBlockEndPoint = getBlockEndPoint({
|
|
195
206
|
context: snapshot.context,
|
|
196
207
|
block: selectionEndBlock,
|
|
197
208
|
})
|
|
198
|
-
const selectionEndPoint =
|
|
199
|
-
snapshot.context.selection,
|
|
200
|
-
)
|
|
209
|
+
const selectionEndPoint = getSelectionEndPoint(snapshot.context.selection)
|
|
201
210
|
|
|
202
211
|
if (
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
isEqualSelectionPoints(selectionStartPoint, startBlockStartPoint) &&
|
|
213
|
+
isEqualSelectionPoints(selectionEndPoint, endBlockEndPoint)
|
|
205
214
|
) {
|
|
206
215
|
return {selectedBlocks}
|
|
207
216
|
}
|
|
@@ -238,8 +247,8 @@ const breakingEntireBlocks = defineBehavior({
|
|
|
238
247
|
const breakingInlineObject = defineBehavior({
|
|
239
248
|
on: 'insert.break',
|
|
240
249
|
guard: ({snapshot}) => {
|
|
241
|
-
const selectionCollapsed =
|
|
242
|
-
const focusInlineObject =
|
|
250
|
+
const selectionCollapsed = isSelectionCollapsed(snapshot)
|
|
251
|
+
const focusInlineObject = getFocusInlineObject(snapshot)
|
|
243
252
|
|
|
244
253
|
return selectionCollapsed && focusInlineObject
|
|
245
254
|
},
|