@portabletext/editor 1.11.0 → 1.11.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/index.esm.js +26 -20
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +26 -20
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +26 -20
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/editor/plugins/createWithMaxBlocks.ts +1 -0
- package/src/editor/plugins/createWithPlaceholderBlock.ts +1 -0
- package/src/editor/plugins/createWithUndoRedo.ts +1 -0
package/lib/index.esm.js
CHANGED
|
@@ -2559,8 +2559,10 @@ function createWithUndoRedo(options) {
|
|
|
2559
2559
|
apply: apply2
|
|
2560
2560
|
} = editor;
|
|
2561
2561
|
return editor.apply = (op) => {
|
|
2562
|
-
if (editorActor.getSnapshot().context.readOnly)
|
|
2562
|
+
if (editorActor.getSnapshot().context.readOnly) {
|
|
2563
|
+
apply2(op);
|
|
2563
2564
|
return;
|
|
2565
|
+
}
|
|
2564
2566
|
if (isChangingRemotely(editor)) {
|
|
2565
2567
|
apply2(op);
|
|
2566
2568
|
return;
|
|
@@ -3419,8 +3421,10 @@ function createWithMaxBlocks(editorActor) {
|
|
|
3419
3421
|
apply: apply2
|
|
3420
3422
|
} = editor;
|
|
3421
3423
|
return editor.apply = (operation) => {
|
|
3422
|
-
if (editorActor.getSnapshot().context.readOnly)
|
|
3424
|
+
if (editorActor.getSnapshot().context.readOnly) {
|
|
3425
|
+
apply2(operation);
|
|
3423
3426
|
return;
|
|
3427
|
+
}
|
|
3424
3428
|
if (isChangingRemotely(editor)) {
|
|
3425
3429
|
apply2(operation);
|
|
3426
3430
|
return;
|
|
@@ -3867,26 +3871,28 @@ function createWithPlaceholderBlock(editorActor) {
|
|
|
3867
3871
|
apply: apply2
|
|
3868
3872
|
} = editor;
|
|
3869
3873
|
return editor.apply = (op) => {
|
|
3870
|
-
if (
|
|
3871
|
-
if (isChangingRemotely(editor)) {
|
|
3872
|
-
apply2(op);
|
|
3873
|
-
return;
|
|
3874
|
-
}
|
|
3875
|
-
if (isUndoing(editor) || isRedoing(editor)) {
|
|
3876
|
-
apply2(op);
|
|
3877
|
-
return;
|
|
3878
|
-
}
|
|
3879
|
-
if (op.type === "remove_node") {
|
|
3880
|
-
const node = op.node;
|
|
3881
|
-
if (op.path[0] === 0 && Editor.isVoid(editor, node)) {
|
|
3882
|
-
const nextPath = Path.next(op.path);
|
|
3883
|
-
editor.children[nextPath[0]] || (debug$d("Adding placeholder block"), Editor.insertNode(editor, editor.pteCreateTextBlock({
|
|
3884
|
-
decorators: []
|
|
3885
|
-
})));
|
|
3886
|
-
}
|
|
3887
|
-
}
|
|
3874
|
+
if (editorActor.getSnapshot().context.readOnly) {
|
|
3888
3875
|
apply2(op);
|
|
3876
|
+
return;
|
|
3889
3877
|
}
|
|
3878
|
+
if (isChangingRemotely(editor)) {
|
|
3879
|
+
apply2(op);
|
|
3880
|
+
return;
|
|
3881
|
+
}
|
|
3882
|
+
if (isUndoing(editor) || isRedoing(editor)) {
|
|
3883
|
+
apply2(op);
|
|
3884
|
+
return;
|
|
3885
|
+
}
|
|
3886
|
+
if (op.type === "remove_node") {
|
|
3887
|
+
const node = op.node;
|
|
3888
|
+
if (op.path[0] === 0 && Editor.isVoid(editor, node)) {
|
|
3889
|
+
const nextPath = Path.next(op.path);
|
|
3890
|
+
editor.children[nextPath[0]] || (debug$d("Adding placeholder block"), Editor.insertNode(editor, editor.pteCreateTextBlock({
|
|
3891
|
+
decorators: []
|
|
3892
|
+
})));
|
|
3893
|
+
}
|
|
3894
|
+
}
|
|
3895
|
+
apply2(op);
|
|
3890
3896
|
}, editor;
|
|
3891
3897
|
};
|
|
3892
3898
|
}
|