@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
|
@@ -3984,7 +3984,15 @@ function insertBlock({
|
|
|
3984
3984
|
}
|
|
3985
3985
|
}
|
|
3986
3986
|
}
|
|
3987
|
-
const
|
|
3987
|
+
const moveBackwardActionImplementation = ({
|
|
3988
|
+
action
|
|
3989
|
+
}) => {
|
|
3990
|
+
slate.Transforms.move(action.editor, {
|
|
3991
|
+
unit: "character",
|
|
3992
|
+
distance: action.distance,
|
|
3993
|
+
reverse: !0
|
|
3994
|
+
});
|
|
3995
|
+
}, moveBlockActionImplementation = ({
|
|
3988
3996
|
action
|
|
3989
3997
|
}) => {
|
|
3990
3998
|
const at = [toSlatePath(action.at, action.editor)[0]], to = [toSlatePath(action.to, action.editor)[0]];
|
|
@@ -3993,6 +4001,13 @@ const moveBlockActionImplementation = ({
|
|
|
3993
4001
|
to,
|
|
3994
4002
|
mode: "highest"
|
|
3995
4003
|
});
|
|
4004
|
+
}, moveForwardActionImplementation = ({
|
|
4005
|
+
action
|
|
4006
|
+
}) => {
|
|
4007
|
+
slate.Transforms.move(action.editor, {
|
|
4008
|
+
unit: "character",
|
|
4009
|
+
distance: action.distance
|
|
4010
|
+
});
|
|
3996
4011
|
}, noopActionImplementation = () => {
|
|
3997
4012
|
}, selectActionImplementation = ({
|
|
3998
4013
|
action
|
|
@@ -4082,7 +4097,9 @@ const moveBlockActionImplementation = ({
|
|
|
4082
4097
|
"insert.span": insertSpanActionImplementation,
|
|
4083
4098
|
"insert.text": insertTextActionImplementation,
|
|
4084
4099
|
effect: effectActionImplementation,
|
|
4100
|
+
"move.backward": moveBackwardActionImplementation,
|
|
4085
4101
|
"move.block": moveBlockActionImplementation,
|
|
4102
|
+
"move.forward": moveForwardActionImplementation,
|
|
4086
4103
|
noop: noopActionImplementation,
|
|
4087
4104
|
select: selectActionImplementation,
|
|
4088
4105
|
"split.block": splitBlockActionImplementation
|
|
@@ -4225,6 +4242,13 @@ function performAction({
|
|
|
4225
4242
|
});
|
|
4226
4243
|
break;
|
|
4227
4244
|
}
|
|
4245
|
+
case "move.backward": {
|
|
4246
|
+
behaviorActionImplementations["move.backward"]({
|
|
4247
|
+
context,
|
|
4248
|
+
action
|
|
4249
|
+
});
|
|
4250
|
+
break;
|
|
4251
|
+
}
|
|
4228
4252
|
case "move.block": {
|
|
4229
4253
|
behaviorActionImplementations["move.block"]({
|
|
4230
4254
|
context,
|
|
@@ -4232,6 +4256,13 @@ function performAction({
|
|
|
4232
4256
|
});
|
|
4233
4257
|
break;
|
|
4234
4258
|
}
|
|
4259
|
+
case "move.forward": {
|
|
4260
|
+
behaviorActionImplementations["move.forward"]({
|
|
4261
|
+
context,
|
|
4262
|
+
action
|
|
4263
|
+
});
|
|
4264
|
+
break;
|
|
4265
|
+
}
|
|
4235
4266
|
case "noop":
|
|
4236
4267
|
break;
|
|
4237
4268
|
case "split.block": {
|