@portabletext/editor 1.39.0 → 1.39.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 +4 -1
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/editor-provider.cjs +37 -52
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-cjs/selector.get-text-before.cjs +0 -1
- package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
- package/lib/_chunks-cjs/selector.is-at-the-start-of-block.cjs +0 -3
- package/lib/_chunks-cjs/selector.is-at-the-start-of-block.cjs.map +1 -1
- package/lib/_chunks-cjs/selector.is-overlapping-selection.cjs +0 -4
- package/lib/_chunks-cjs/selector.is-overlapping-selection.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js +5 -2
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/editor-provider.js +41 -56
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/_chunks-es/selector.get-text-before.js +1 -2
- package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js +1 -4
- package/lib/_chunks-es/selector.is-at-the-start-of-block.js.map +1 -1
- package/lib/_chunks-es/selector.is-overlapping-selection.js +1 -5
- package/lib/_chunks-es/selector.is-overlapping-selection.js.map +1 -1
- package/lib/behaviors/index.d.cts +1134 -801
- package/lib/behaviors/index.d.ts +1134 -801
- package/lib/index.cjs +0 -6
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +902 -627
- package/lib/index.d.ts +902 -627
- package/lib/index.js +0 -6
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.cjs +0 -1
- package/lib/plugins/index.cjs.map +1 -1
- package/lib/plugins/index.d.cts +902 -627
- package/lib/plugins/index.d.ts +902 -627
- package/lib/plugins/index.js +1 -2
- package/lib/plugins/index.js.map +1 -1
- package/lib/selectors/index.d.cts +902 -627
- package/lib/selectors/index.d.ts +902 -627
- package/lib/utils/index.d.cts +902 -627
- package/lib/utils/index.d.ts +902 -627
- package/package.json +5 -5
- package/src/behaviors/behavior.default.ts +23 -4
- package/src/behaviors/behavior.types.ts +62 -26
- package/src/editor/editor-machine.ts +7 -1
- package/src/editor/plugins/create-with-event-listeners.ts +18 -3
package/lib/index.js
CHANGED
|
@@ -65,19 +65,16 @@ function getEventPositionSelection({
|
|
|
65
65
|
if (!selection)
|
|
66
66
|
return selection;
|
|
67
67
|
const collapsedSelection = isSelectionCollapsed({
|
|
68
|
-
...snapshot,
|
|
69
68
|
context: {
|
|
70
69
|
...snapshot.context,
|
|
71
70
|
selection
|
|
72
71
|
}
|
|
73
72
|
}), focusTextBlock = getFocusTextBlock({
|
|
74
|
-
...snapshot,
|
|
75
73
|
context: {
|
|
76
74
|
...snapshot.context,
|
|
77
75
|
selection
|
|
78
76
|
}
|
|
79
77
|
}), focusSpan = getFocusSpan({
|
|
80
|
-
...snapshot,
|
|
81
78
|
context: {
|
|
82
79
|
...snapshot.context,
|
|
83
80
|
selection
|
|
@@ -301,7 +298,6 @@ const EMPTY_ANNOTATIONS = [], inlineBlockStyle = {
|
|
|
301
298
|
event
|
|
302
299
|
}) => {
|
|
303
300
|
const dropFocusBlock = getFocusBlock({
|
|
304
|
-
...snapshot,
|
|
305
301
|
context: {
|
|
306
302
|
...snapshot.context,
|
|
307
303
|
selection: event.position.selection
|
|
@@ -311,13 +307,11 @@ const EMPTY_ANNOTATIONS = [], inlineBlockStyle = {
|
|
|
311
307
|
return !1;
|
|
312
308
|
const dragOrigin = snapshot.beta.internalDrag?.origin;
|
|
313
309
|
return !dragOrigin || getSelectedBlocks({
|
|
314
|
-
...snapshot,
|
|
315
310
|
context: {
|
|
316
311
|
...snapshot.context,
|
|
317
312
|
selection: dragOrigin.selection
|
|
318
313
|
}
|
|
319
314
|
}).some((draggedBlock) => draggedBlock.node._key === element._key) ? !1 : isSelectingEntireBlocks({
|
|
320
|
-
...snapshot,
|
|
321
315
|
context: {
|
|
322
316
|
...snapshot.context,
|
|
323
317
|
selection: dragOrigin.selection
|