@portabletext/editor 1.36.2 → 1.36.3
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/editor-provider.cjs +13 -13
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/editor-provider.js +13 -13
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/package.json +1 -1
- package/src/behaviors/{behavior.foundational.ts → behavior.default.raise-soft-break.ts} +1 -3
- package/src/behaviors/behavior.default.ts +2 -0
- package/src/editor/editor-machine.ts +0 -2
package/package.json
CHANGED
|
@@ -6,10 +6,8 @@ import {defineBehavior, raise} from './behavior.types'
|
|
|
6
6
|
* than an `insertLineBreak` input event. This Behavior makes sure we catch
|
|
7
7
|
* that `key.down` event beforehand and raise an `insert.soft break` manually.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
export const raiseInsertSoftBreak = defineBehavior({
|
|
10
10
|
on: 'key.down',
|
|
11
11
|
guard: ({event}) => keyIs.lineBreak(event.keyboardEvent),
|
|
12
12
|
actions: [() => [raise({type: 'insert.soft break'})]],
|
|
13
13
|
})
|
|
14
|
-
|
|
15
|
-
export const foundationalBehaviors = [raiseSoftBreak]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as selectors from '../selectors'
|
|
2
|
+
import {raiseInsertSoftBreak} from './behavior.default.raise-soft-break'
|
|
2
3
|
import {defineBehavior, raise} from './behavior.types'
|
|
3
4
|
|
|
4
5
|
const toggleAnnotationOff = defineBehavior({
|
|
@@ -200,4 +201,5 @@ export const defaultBehaviors = [
|
|
|
200
201
|
raiseInsertBlocks,
|
|
201
202
|
raiseSerializationSuccessOrFailure,
|
|
202
203
|
raiseDataTransferSet,
|
|
204
|
+
raiseInsertSoftBreak,
|
|
203
205
|
]
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import {performAction} from '../behavior-actions/behavior.actions'
|
|
13
13
|
import {coreBehaviors} from '../behaviors/behavior.core'
|
|
14
14
|
import {defaultBehaviors} from '../behaviors/behavior.default'
|
|
15
|
-
import {foundationalBehaviors} from '../behaviors/behavior.foundational'
|
|
16
15
|
import {
|
|
17
16
|
isCustomBehaviorEvent,
|
|
18
17
|
type Behavior,
|
|
@@ -331,7 +330,6 @@ export const editorMachine = setup({
|
|
|
331
330
|
: undefined
|
|
332
331
|
|
|
333
332
|
const eventBehaviors = [
|
|
334
|
-
...foundationalBehaviors,
|
|
335
333
|
...context.behaviors.values(),
|
|
336
334
|
...defaultBehaviors,
|
|
337
335
|
].filter(
|