@portabletext/editor 1.34.1 → 1.35.1
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/behavior.core.cjs +57 -118
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/behavior.markdown.cjs +27 -67
- package/lib/_chunks-cjs/behavior.markdown.cjs.map +1 -1
- package/lib/_chunks-cjs/{plugin.event-listener.cjs → editor-provider.cjs} +101 -87
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -0
- package/lib/_chunks-cjs/selector.get-text-before.cjs +5 -7
- package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
- package/lib/_chunks-cjs/selector.is-active-style.cjs +22 -36
- package/lib/_chunks-cjs/selector.is-active-style.cjs.map +1 -1
- package/lib/_chunks-cjs/selector.is-at-the-start-of-block.cjs +68 -153
- package/lib/_chunks-cjs/selector.is-at-the-start-of-block.cjs.map +1 -1
- package/lib/_chunks-cjs/util.block-offsets-to-selection.cjs.map +1 -1
- package/lib/_chunks-cjs/util.slice-blocks.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js +57 -118
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/behavior.markdown.js +27 -67
- package/lib/_chunks-es/behavior.markdown.js.map +1 -1
- package/lib/_chunks-es/{plugin.event-listener.js → editor-provider.js} +102 -88
- package/lib/_chunks-es/editor-provider.js.map +1 -0
- package/lib/_chunks-es/selector.get-text-before.js +5 -7
- package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
- package/lib/_chunks-es/selector.is-active-style.js +22 -36
- package/lib/_chunks-es/selector.is-active-style.js.map +1 -1
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js +68 -153
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js.map +1 -1
- package/lib/_chunks-es/util.block-offsets-to-selection.js.map +1 -1
- package/lib/_chunks-es/util.slice-blocks.js.map +1 -1
- package/lib/behaviors/index.cjs +18 -48
- package/lib/behaviors/index.cjs.map +1 -1
- package/lib/behaviors/index.d.cts +19392 -214
- package/lib/behaviors/index.d.ts +19392 -214
- package/lib/behaviors/index.js +18 -48
- package/lib/behaviors/index.js.map +1 -1
- package/lib/index.cjs +81 -51
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +334 -59
- package/lib/index.d.ts +334 -59
- package/lib/index.js +35 -4
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.cjs +200 -189
- package/lib/plugins/index.cjs.map +1 -1
- package/lib/plugins/index.d.cts +344 -25
- package/lib/plugins/index.d.ts +344 -25
- package/lib/plugins/index.js +198 -187
- package/lib/plugins/index.js.map +1 -1
- package/lib/selectors/index.cjs +22 -50
- package/lib/selectors/index.cjs.map +1 -1
- package/lib/selectors/index.d.cts +19485 -174
- package/lib/selectors/index.d.ts +19485 -174
- package/lib/selectors/index.js +22 -50
- package/lib/selectors/index.js.map +1 -1
- package/lib/utils/index.cjs.map +1 -1
- package/lib/utils/index.d.cts +19518 -7
- package/lib/utils/index.d.ts +19518 -7
- package/lib/utils/index.js.map +1 -1
- package/package.json +7 -7
- package/src/behavior-actions/behavior.action.decorator.add.ts +1 -0
- package/src/behavior-actions/behavior.action.delete.text.ts +1 -0
- package/src/behaviors/behavior.code-editor.ts +6 -6
- package/src/behaviors/behavior.core.annotations.ts +5 -4
- package/src/behaviors/behavior.core.block-objects.ts +17 -17
- package/src/behaviors/behavior.core.decorators.ts +12 -8
- package/src/behaviors/behavior.core.insert-break.ts +27 -29
- package/src/behaviors/behavior.core.lists.ts +19 -19
- package/src/behaviors/behavior.decorator-pair.ts +201 -0
- package/src/behaviors/behavior.default.ts +35 -30
- package/src/behaviors/behavior.emoji-picker.ts +12 -12
- package/src/behaviors/behavior.links.ts +7 -7
- package/src/behaviors/behavior.markdown.ts +41 -42
- package/src/behaviors/behavior.types.ts +14 -17
- package/src/behaviors/index.ts +0 -1
- package/src/converters/converter.json.ts +6 -6
- package/src/converters/converter.portable-text.deserialize.test.ts +27 -29
- package/src/converters/converter.portable-text.ts +13 -7
- package/src/converters/converter.text-html.deserialize.test.ts +16 -18
- package/src/converters/converter.text-html.serialize.test.ts +56 -57
- package/src/converters/converter.text-html.ts +14 -10
- package/src/converters/converter.text-plain.test.ts +17 -17
- package/src/converters/converter.text-plain.ts +15 -11
- package/src/converters/converter.types.ts +5 -5
- package/src/editor/Editable.tsx +26 -0
- package/src/editor/editor-machine.ts +170 -142
- package/src/editor/editor-selector.ts +3 -0
- package/src/editor/editor-snapshot.ts +13 -0
- package/src/editor-event-listener.tsx +30 -0
- package/src/index.ts +3 -3
- package/src/internal-utils/create-test-snapshot.ts +23 -0
- package/src/internal-utils/get-text-to-emphasize.ts +29 -7
- package/src/plugins/plugin.decorator-shortcut.ts +235 -0
- package/src/plugins/plugin.markdown.tsx +56 -8
- package/src/plugins/plugin.one-line.tsx +17 -17
- package/src/selectors/selector.get-active-annotations.test.ts +4 -13
- package/src/selectors/selector.get-active-list-item.ts +4 -4
- package/src/selectors/selector.get-active-style.ts +6 -6
- package/src/selectors/selector.get-anchor-block.ts +5 -5
- package/src/selectors/selector.get-anchor-child.ts +5 -5
- package/src/selectors/selector.get-anchor-span.ts +2 -2
- package/src/selectors/selector.get-anchor-text-block.ts +2 -2
- package/src/selectors/selector.get-block-offsets.ts +8 -7
- package/src/selectors/selector.get-caret-word-selection.test.ts +3 -7
- package/src/selectors/selector.get-caret-word-selection.ts +19 -16
- package/src/selectors/selector.get-next-inline-object.ts +4 -4
- package/src/selectors/selector.get-previous-inline-object.ts +4 -4
- package/src/selectors/selector.get-selected-slice.ts +7 -4
- package/src/selectors/selector.get-selected-spans.test.ts +5 -9
- package/src/selectors/selector.get-selected-spans.ts +9 -9
- package/src/selectors/selector.get-selection-end-point.ts +5 -5
- package/src/selectors/selector.get-selection-start-point.ts +5 -5
- package/src/selectors/selector.get-selection-text.test.ts +5 -7
- package/src/selectors/selector.get-selection-text.ts +2 -2
- package/src/selectors/selector.get-selection.ts +2 -2
- package/src/selectors/selector.get-text-before.ts +8 -8
- package/src/selectors/selector.get-trimmed-selection.test.ts +3 -5
- package/src/selectors/selector.get-trimmed-selection.ts +15 -13
- package/src/selectors/selector.get-value.ts +4 -4
- package/src/selectors/selector.is-active-decorator.test.ts +5 -9
- package/src/selectors/selector.is-at-the-end-of-block.ts +6 -3
- package/src/selectors/selector.is-at-the-start-of-block.ts +3 -3
- package/src/selectors/selector.is-overlapping-selection.ts +8 -6
- package/src/selectors/selector.is-selection-collapsed.ts +6 -5
- package/src/selectors/selector.is-selection-expanded.ts +2 -2
- package/src/selectors/selectors.ts +59 -59
- package/src/types/block-offset.ts +9 -0
- package/src/utils/index.ts +0 -1
- package/src/utils/util.block-offset.ts +1 -1
- package/src/utils/util.block-offsets-to-selection.ts +1 -1
- package/src/utils/util.child-selection-point-to-block-offset.ts +1 -1
- package/lib/_chunks-cjs/plugin.event-listener.cjs.map +0 -1
- package/lib/_chunks-es/plugin.event-listener.js.map +0 -1
- package/src/behaviors/behavior.markdown-emphasis.ts +0 -437
|
@@ -17,15 +17,15 @@ import type {EditorSelector} from '../editor/editor-selector'
|
|
|
17
17
|
*/
|
|
18
18
|
export const getFocusBlock: EditorSelector<
|
|
19
19
|
{node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
20
|
-
> = (
|
|
21
|
-
const key = context.selection
|
|
22
|
-
? isKeySegment(context.selection.focus.path[0])
|
|
23
|
-
? context.selection.focus.path[0]._key
|
|
20
|
+
> = (snapshot) => {
|
|
21
|
+
const key = snapshot.context.selection
|
|
22
|
+
? isKeySegment(snapshot.context.selection.focus.path[0])
|
|
23
|
+
? snapshot.context.selection.focus.path[0]._key
|
|
24
24
|
: undefined
|
|
25
25
|
: undefined
|
|
26
26
|
|
|
27
27
|
const node = key
|
|
28
|
-
? context.value.find((block) => block._key === key)
|
|
28
|
+
? snapshot.context.value.find((block) => block._key === key)
|
|
29
29
|
: undefined
|
|
30
30
|
|
|
31
31
|
return node && key ? {node, path: [{_key: key}]} : undefined
|
|
@@ -36,9 +36,9 @@ export const getFocusBlock: EditorSelector<
|
|
|
36
36
|
*/
|
|
37
37
|
export const getFocusListBlock: EditorSelector<
|
|
38
38
|
{node: PortableTextListBlock; path: [KeyedSegment]} | undefined
|
|
39
|
-
> = (
|
|
40
|
-
const guards = createGuards(context)
|
|
41
|
-
const focusBlock = getFocusBlock(
|
|
39
|
+
> = (snapshot) => {
|
|
40
|
+
const guards = createGuards(snapshot.context)
|
|
41
|
+
const focusBlock = getFocusBlock(snapshot)
|
|
42
42
|
|
|
43
43
|
return focusBlock && guards.isListBlock(focusBlock.node)
|
|
44
44
|
? {node: focusBlock.node, path: focusBlock.path}
|
|
@@ -50,8 +50,8 @@ export const getFocusListBlock: EditorSelector<
|
|
|
50
50
|
*/
|
|
51
51
|
export const getFocusTextBlock: EditorSelector<
|
|
52
52
|
{node: PortableTextTextBlock; path: [KeyedSegment]} | undefined
|
|
53
|
-
> = (
|
|
54
|
-
const focusBlock = getFocusBlock(
|
|
53
|
+
> = (snapshot) => {
|
|
54
|
+
const focusBlock = getFocusBlock(snapshot)
|
|
55
55
|
|
|
56
56
|
return focusBlock && isPortableTextTextBlock(focusBlock.node)
|
|
57
57
|
? {node: focusBlock.node, path: focusBlock.path}
|
|
@@ -63,8 +63,8 @@ export const getFocusTextBlock: EditorSelector<
|
|
|
63
63
|
*/
|
|
64
64
|
export const getFocusBlockObject: EditorSelector<
|
|
65
65
|
{node: PortableTextObject; path: [KeyedSegment]} | undefined
|
|
66
|
-
> = (
|
|
67
|
-
const focusBlock = getFocusBlock(
|
|
66
|
+
> = (snapshot) => {
|
|
67
|
+
const focusBlock = getFocusBlock(snapshot)
|
|
68
68
|
|
|
69
69
|
return focusBlock && !isPortableTextTextBlock(focusBlock.node)
|
|
70
70
|
? {node: focusBlock.node, path: focusBlock.path}
|
|
@@ -80,16 +80,16 @@ export const getFocusChild: EditorSelector<
|
|
|
80
80
|
path: [KeyedSegment, 'children', KeyedSegment]
|
|
81
81
|
}
|
|
82
82
|
| undefined
|
|
83
|
-
> = (
|
|
84
|
-
const focusBlock = getFocusTextBlock(
|
|
83
|
+
> = (snapshot) => {
|
|
84
|
+
const focusBlock = getFocusTextBlock(snapshot)
|
|
85
85
|
|
|
86
86
|
if (!focusBlock) {
|
|
87
87
|
return undefined
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
const key = context.selection
|
|
91
|
-
? isKeySegment(context.selection.focus.path[2])
|
|
92
|
-
? context.selection.focus.path[2]._key
|
|
90
|
+
const key = snapshot.context.selection
|
|
91
|
+
? isKeySegment(snapshot.context.selection.focus.path[2])
|
|
92
|
+
? snapshot.context.selection.focus.path[2]._key
|
|
93
93
|
: undefined
|
|
94
94
|
: undefined
|
|
95
95
|
|
|
@@ -108,8 +108,8 @@ export const getFocusChild: EditorSelector<
|
|
|
108
108
|
export const getFocusSpan: EditorSelector<
|
|
109
109
|
| {node: PortableTextSpan; path: [KeyedSegment, 'children', KeyedSegment]}
|
|
110
110
|
| undefined
|
|
111
|
-
> = (
|
|
112
|
-
const focusChild = getFocusChild(
|
|
111
|
+
> = (snapshot) => {
|
|
112
|
+
const focusChild = getFocusChild(snapshot)
|
|
113
113
|
|
|
114
114
|
return focusChild && isPortableTextSpan(focusChild.node)
|
|
115
115
|
? {node: focusChild.node, path: focusChild.path}
|
|
@@ -121,8 +121,8 @@ export const getFocusSpan: EditorSelector<
|
|
|
121
121
|
*/
|
|
122
122
|
export const getFirstBlock: EditorSelector<
|
|
123
123
|
{node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
124
|
-
> = (
|
|
125
|
-
const node = context.value[0]
|
|
124
|
+
> = (snapshot) => {
|
|
125
|
+
const node = snapshot.context.value[0]
|
|
126
126
|
|
|
127
127
|
return node ? {node, path: [{_key: node._key}]} : undefined
|
|
128
128
|
}
|
|
@@ -132,9 +132,9 @@ export const getFirstBlock: EditorSelector<
|
|
|
132
132
|
*/
|
|
133
133
|
export const getLastBlock: EditorSelector<
|
|
134
134
|
{node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
135
|
-
> = (
|
|
136
|
-
const node = context.value[context.value.length - 1]
|
|
137
|
-
? context.value[context.value.length - 1]
|
|
135
|
+
> = (snapshot) => {
|
|
136
|
+
const node = snapshot.context.value[snapshot.context.value.length - 1]
|
|
137
|
+
? snapshot.context.value[snapshot.context.value.length - 1]
|
|
138
138
|
: undefined
|
|
139
139
|
|
|
140
140
|
return node ? {node, path: [{_key: node._key}]} : undefined
|
|
@@ -145,33 +145,33 @@ export const getLastBlock: EditorSelector<
|
|
|
145
145
|
*/
|
|
146
146
|
export const getSelectedBlocks: EditorSelector<
|
|
147
147
|
Array<{node: PortableTextBlock; path: [KeyedSegment]}>
|
|
148
|
-
> = (
|
|
149
|
-
if (!context.selection) {
|
|
148
|
+
> = (snapshot) => {
|
|
149
|
+
if (!snapshot.context.selection) {
|
|
150
150
|
return []
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
const selectedBlocks: Array<{node: PortableTextBlock; path: [KeyedSegment]}> =
|
|
154
154
|
[]
|
|
155
|
-
const startKey = context.selection.backward
|
|
156
|
-
? isKeySegment(context.selection.focus.path[0])
|
|
157
|
-
? context.selection.focus.path[0]._key
|
|
155
|
+
const startKey = snapshot.context.selection.backward
|
|
156
|
+
? isKeySegment(snapshot.context.selection.focus.path[0])
|
|
157
|
+
? snapshot.context.selection.focus.path[0]._key
|
|
158
158
|
: undefined
|
|
159
|
-
: isKeySegment(context.selection.anchor.path[0])
|
|
160
|
-
? context.selection.anchor.path[0]._key
|
|
159
|
+
: isKeySegment(snapshot.context.selection.anchor.path[0])
|
|
160
|
+
? snapshot.context.selection.anchor.path[0]._key
|
|
161
161
|
: undefined
|
|
162
|
-
const endKey = context.selection.backward
|
|
163
|
-
? isKeySegment(context.selection.anchor.path[0])
|
|
164
|
-
? context.selection.anchor.path[0]._key
|
|
162
|
+
const endKey = snapshot.context.selection.backward
|
|
163
|
+
? isKeySegment(snapshot.context.selection.anchor.path[0])
|
|
164
|
+
? snapshot.context.selection.anchor.path[0]._key
|
|
165
165
|
: undefined
|
|
166
|
-
: isKeySegment(context.selection.focus.path[0])
|
|
167
|
-
? context.selection.focus.path[0]._key
|
|
166
|
+
: isKeySegment(snapshot.context.selection.focus.path[0])
|
|
167
|
+
? snapshot.context.selection.focus.path[0]._key
|
|
168
168
|
: undefined
|
|
169
169
|
|
|
170
170
|
if (!startKey || !endKey) {
|
|
171
171
|
return selectedBlocks
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
for (const block of context.value) {
|
|
174
|
+
for (const block of snapshot.context.value) {
|
|
175
175
|
if (block._key === startKey) {
|
|
176
176
|
selectedBlocks.push({node: block, path: [{_key: block._key}]})
|
|
177
177
|
|
|
@@ -203,21 +203,21 @@ export const getSelectionStartBlock: EditorSelector<
|
|
|
203
203
|
path: [KeyedSegment]
|
|
204
204
|
}
|
|
205
205
|
| undefined
|
|
206
|
-
> = (
|
|
207
|
-
if (!context.selection) {
|
|
206
|
+
> = (snapshot) => {
|
|
207
|
+
if (!snapshot.context.selection) {
|
|
208
208
|
return undefined
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
const key = context.selection.backward
|
|
212
|
-
? isKeySegment(context.selection.focus.path[0])
|
|
213
|
-
? context.selection.focus.path[0]._key
|
|
211
|
+
const key = snapshot.context.selection.backward
|
|
212
|
+
? isKeySegment(snapshot.context.selection.focus.path[0])
|
|
213
|
+
? snapshot.context.selection.focus.path[0]._key
|
|
214
214
|
: undefined
|
|
215
|
-
: isKeySegment(context.selection.anchor.path[0])
|
|
216
|
-
? context.selection.anchor.path[0]._key
|
|
215
|
+
: isKeySegment(snapshot.context.selection.anchor.path[0])
|
|
216
|
+
? snapshot.context.selection.anchor.path[0]._key
|
|
217
217
|
: undefined
|
|
218
218
|
|
|
219
219
|
const node = key
|
|
220
|
-
? context.value.find((block) => block._key === key)
|
|
220
|
+
? snapshot.context.value.find((block) => block._key === key)
|
|
221
221
|
: undefined
|
|
222
222
|
|
|
223
223
|
return node && key ? {node, path: [{_key: key}]} : undefined
|
|
@@ -232,21 +232,21 @@ export const getSelectionEndBlock: EditorSelector<
|
|
|
232
232
|
path: [KeyedSegment]
|
|
233
233
|
}
|
|
234
234
|
| undefined
|
|
235
|
-
> = (
|
|
236
|
-
if (!context.selection) {
|
|
235
|
+
> = (snapshot) => {
|
|
236
|
+
if (!snapshot.context.selection) {
|
|
237
237
|
return undefined
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
const key = context.selection.backward
|
|
241
|
-
? isKeySegment(context.selection.anchor.path[0])
|
|
242
|
-
? context.selection.anchor.path[0]._key
|
|
240
|
+
const key = snapshot.context.selection.backward
|
|
241
|
+
? isKeySegment(snapshot.context.selection.anchor.path[0])
|
|
242
|
+
? snapshot.context.selection.anchor.path[0]._key
|
|
243
243
|
: undefined
|
|
244
|
-
: isKeySegment(context.selection.focus.path[0])
|
|
245
|
-
? context.selection.focus.path[0]._key
|
|
244
|
+
: isKeySegment(snapshot.context.selection.focus.path[0])
|
|
245
|
+
? snapshot.context.selection.focus.path[0]._key
|
|
246
246
|
: undefined
|
|
247
247
|
|
|
248
248
|
const node = key
|
|
249
|
-
? context.value.find((block) => block._key === key)
|
|
249
|
+
? snapshot.context.value.find((block) => block._key === key)
|
|
250
250
|
: undefined
|
|
251
251
|
|
|
252
252
|
return node && key ? {node, path: [{_key: key}]} : undefined
|
|
@@ -257,9 +257,9 @@ export const getSelectionEndBlock: EditorSelector<
|
|
|
257
257
|
*/
|
|
258
258
|
export const getPreviousBlock: EditorSelector<
|
|
259
259
|
{node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
260
|
-
> = (
|
|
260
|
+
> = (snapshot) => {
|
|
261
261
|
let previousBlock: {node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
262
|
-
const selectionStartBlock = getSelectionStartBlock(
|
|
262
|
+
const selectionStartBlock = getSelectionStartBlock(snapshot)
|
|
263
263
|
|
|
264
264
|
if (!selectionStartBlock) {
|
|
265
265
|
return undefined
|
|
@@ -267,7 +267,7 @@ export const getPreviousBlock: EditorSelector<
|
|
|
267
267
|
|
|
268
268
|
let foundSelectionStartBlock = false
|
|
269
269
|
|
|
270
|
-
for (const block of context.value) {
|
|
270
|
+
for (const block of snapshot.context.value) {
|
|
271
271
|
if (block._key === selectionStartBlock.node._key) {
|
|
272
272
|
foundSelectionStartBlock = true
|
|
273
273
|
break
|
|
@@ -288,9 +288,9 @@ export const getPreviousBlock: EditorSelector<
|
|
|
288
288
|
*/
|
|
289
289
|
export const getNextBlock: EditorSelector<
|
|
290
290
|
{node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
291
|
-
> = (
|
|
291
|
+
> = (snapshot) => {
|
|
292
292
|
let nextBlock: {node: PortableTextBlock; path: [KeyedSegment]} | undefined
|
|
293
|
-
const selectionEndBlock = getSelectionEndBlock(
|
|
293
|
+
const selectionEndBlock = getSelectionEndBlock(snapshot)
|
|
294
294
|
|
|
295
295
|
if (!selectionEndBlock) {
|
|
296
296
|
return undefined
|
|
@@ -298,7 +298,7 @@ export const getNextBlock: EditorSelector<
|
|
|
298
298
|
|
|
299
299
|
let foundSelectionEndBlock = false
|
|
300
300
|
|
|
301
|
-
for (const block of context.value) {
|
|
301
|
+
for (const block of snapshot.context.value) {
|
|
302
302
|
if (block._key === selectionEndBlock.node._key) {
|
|
303
303
|
foundSelectionEndBlock = true
|
|
304
304
|
continue
|
package/src/utils/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type KeyedSegment,
|
|
5
5
|
type PortableTextBlock,
|
|
6
6
|
} from '@sanity/types'
|
|
7
|
-
import type {BlockOffset} from '../
|
|
7
|
+
import type {BlockOffset} from '../types/block-offset'
|
|
8
8
|
import type {EditorSelectionPoint} from '../types/editor'
|
|
9
9
|
import {isKeyedSegment} from './util.is-keyed-segment'
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {PortableTextBlock} from '@sanity/types'
|
|
2
|
-
import type {BlockOffset} from '../behaviors'
|
|
3
2
|
import type {EditorSelection} from '../selectors'
|
|
3
|
+
import type {BlockOffset} from '../types/block-offset'
|
|
4
4
|
import {blockOffsetToSpanSelectionPoint} from './util.block-offset'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
isPortableTextTextBlock,
|
|
4
4
|
type PortableTextBlock,
|
|
5
5
|
} from '@sanity/types'
|
|
6
|
-
import type {BlockOffset} from '../
|
|
6
|
+
import type {BlockOffset} from '../types/block-offset'
|
|
7
7
|
import type {EditorSelectionPoint} from '../types/editor'
|
|
8
8
|
import {isKeyedSegment} from './util.is-keyed-segment'
|
|
9
9
|
|