@portabletext/editor 1.46.0 → 1.47.0
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 +32 -1
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/editor-provider.js +32 -1
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/behaviors/index.d.cts +520 -0
- package/lib/behaviors/index.d.ts +520 -0
- package/lib/index.d.cts +10 -0
- package/lib/index.d.ts +10 -0
- package/lib/plugins/index.d.cts +10 -0
- package/lib/plugins/index.d.ts +10 -0
- package/lib/selectors/index.d.cts +10 -0
- package/lib/selectors/index.d.ts +10 -0
- package/lib/utils/index.d.cts +10 -0
- package/lib/utils/index.d.ts +10 -0
- package/package.json +3 -3
- package/src/behavior-actions/behavior.action.move.backward.ts +12 -0
- package/src/behavior-actions/behavior.action.move.forward.ts +11 -0
- package/src/behavior-actions/behavior.actions.ts +18 -0
- package/src/behaviors/behavior.types.event.ts +10 -0
|
@@ -4010,7 +4010,15 @@ function insertBlock({
|
|
|
4010
4010
|
}
|
|
4011
4011
|
}
|
|
4012
4012
|
}
|
|
4013
|
-
const
|
|
4013
|
+
const moveBackwardActionImplementation = ({
|
|
4014
|
+
action
|
|
4015
|
+
}) => {
|
|
4016
|
+
Transforms.move(action.editor, {
|
|
4017
|
+
unit: "character",
|
|
4018
|
+
distance: action.distance,
|
|
4019
|
+
reverse: !0
|
|
4020
|
+
});
|
|
4021
|
+
}, moveBlockActionImplementation = ({
|
|
4014
4022
|
action
|
|
4015
4023
|
}) => {
|
|
4016
4024
|
const at = [toSlatePath(action.at, action.editor)[0]], to = [toSlatePath(action.to, action.editor)[0]];
|
|
@@ -4019,6 +4027,13 @@ const moveBlockActionImplementation = ({
|
|
|
4019
4027
|
to,
|
|
4020
4028
|
mode: "highest"
|
|
4021
4029
|
});
|
|
4030
|
+
}, moveForwardActionImplementation = ({
|
|
4031
|
+
action
|
|
4032
|
+
}) => {
|
|
4033
|
+
Transforms.move(action.editor, {
|
|
4034
|
+
unit: "character",
|
|
4035
|
+
distance: action.distance
|
|
4036
|
+
});
|
|
4022
4037
|
}, noopActionImplementation = () => {
|
|
4023
4038
|
}, selectActionImplementation = ({
|
|
4024
4039
|
action
|
|
@@ -4108,7 +4123,9 @@ const moveBlockActionImplementation = ({
|
|
|
4108
4123
|
"insert.span": insertSpanActionImplementation,
|
|
4109
4124
|
"insert.text": insertTextActionImplementation,
|
|
4110
4125
|
effect: effectActionImplementation,
|
|
4126
|
+
"move.backward": moveBackwardActionImplementation,
|
|
4111
4127
|
"move.block": moveBlockActionImplementation,
|
|
4128
|
+
"move.forward": moveForwardActionImplementation,
|
|
4112
4129
|
noop: noopActionImplementation,
|
|
4113
4130
|
select: selectActionImplementation,
|
|
4114
4131
|
"split.block": splitBlockActionImplementation
|
|
@@ -4251,6 +4268,13 @@ function performAction({
|
|
|
4251
4268
|
});
|
|
4252
4269
|
break;
|
|
4253
4270
|
}
|
|
4271
|
+
case "move.backward": {
|
|
4272
|
+
behaviorActionImplementations["move.backward"]({
|
|
4273
|
+
context,
|
|
4274
|
+
action
|
|
4275
|
+
});
|
|
4276
|
+
break;
|
|
4277
|
+
}
|
|
4254
4278
|
case "move.block": {
|
|
4255
4279
|
behaviorActionImplementations["move.block"]({
|
|
4256
4280
|
context,
|
|
@@ -4258,6 +4282,13 @@ function performAction({
|
|
|
4258
4282
|
});
|
|
4259
4283
|
break;
|
|
4260
4284
|
}
|
|
4285
|
+
case "move.forward": {
|
|
4286
|
+
behaviorActionImplementations["move.forward"]({
|
|
4287
|
+
context,
|
|
4288
|
+
action
|
|
4289
|
+
});
|
|
4290
|
+
break;
|
|
4291
|
+
}
|
|
4261
4292
|
case "noop":
|
|
4262
4293
|
break;
|
|
4263
4294
|
case "split.block": {
|