@ones-editor/editor 0.0.7-beta.56 → 0.0.7-beta.57
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/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25962,7 +25962,14 @@ var __publicField = (obj, key, value) => {
|
|
|
25962
25962
|
}
|
|
25963
25963
|
localUpdateBlockData(containerId, blockIndex, delta, newRange) {
|
|
25964
25964
|
assert(logger$2B, !this.editor.readonly, "editor is readonly");
|
|
25965
|
-
this.editor.getBlockByIndex(containerId, blockIndex);
|
|
25965
|
+
const block = this.editor.getBlockByIndex(containerId, blockIndex);
|
|
25966
|
+
if (!this.editor.isBlockWritable(block)) {
|
|
25967
|
+
const deletedKeys = Array.from(delta.delete).filter((key) => key !== "comments");
|
|
25968
|
+
const insertedKeys = Object.keys(delta.insert).filter((key) => key !== "comments");
|
|
25969
|
+
if (deletedKeys.length > 0 || insertedKeys.length > 0) {
|
|
25970
|
+
assert(logger$2B, false, `block is not writable, comment supported only, ${JSON.stringify(delta)}}`);
|
|
25971
|
+
}
|
|
25972
|
+
}
|
|
25966
25973
|
const oldData = cloneDeep__default.default(this.getBlockData(containerId, blockIndex));
|
|
25967
25974
|
const newData = cloneDeep__default.default(applyBlockDataDelta(oldData, delta));
|
|
25968
25975
|
this.localEvents.forEach((event) => event.onBeforeUpdateBlockData(containerId, oldData.id, oldData, newData, newRange));
|
|
@@ -53120,7 +53127,9 @@ ${codeText}
|
|
|
53120
53127
|
enable(block) {
|
|
53121
53128
|
if (isImageBlock(block)) {
|
|
53122
53129
|
const object = ImageObject.getImageObject(this.editor, block);
|
|
53123
|
-
|
|
53130
|
+
if (this.editor.isBlockWritable(block)) {
|
|
53131
|
+
object.tryEnableResizer();
|
|
53132
|
+
}
|
|
53124
53133
|
}
|
|
53125
53134
|
}
|
|
53126
53135
|
}
|