@ones-editor/editor 2.6.4 → 2.6.5
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/dist/index.js
CHANGED
|
@@ -27182,6 +27182,7 @@ var __publicField = (obj, key, value) => {
|
|
|
27182
27182
|
}
|
|
27183
27183
|
const logger$3z = getLogger("insert-doc");
|
|
27184
27184
|
function editorInsertDoc(editor, block, offset, insertedDoc, cloneDocResult) {
|
|
27185
|
+
var _a;
|
|
27185
27186
|
if (isComplexKindBlock(editor, block)) {
|
|
27186
27187
|
logger$3z.warn("failed to insert doc into a complex block");
|
|
27187
27188
|
return;
|
|
@@ -27190,9 +27191,13 @@ var __publicField = (obj, key, value) => {
|
|
|
27190
27191
|
const container = getParentContainer(block);
|
|
27191
27192
|
const blockIndex = getBlockIndex(block);
|
|
27192
27193
|
const containerId = getContainerId(container);
|
|
27194
|
+
if (doc2.blocks.root.length === 1 && isTextKindBlockType(editor, doc2.blocks.root[0].type)) {
|
|
27195
|
+
editor.insertTextToBlock(block, offset, (_a = doc2.blocks.root[0].text) != null ? _a : []);
|
|
27196
|
+
return;
|
|
27197
|
+
}
|
|
27193
27198
|
editor.doc.beginBatchUpdate();
|
|
27194
27199
|
editor.undoManager.runInGroup(() => {
|
|
27195
|
-
var
|
|
27200
|
+
var _a2, _b, _c;
|
|
27196
27201
|
const childContainers = [];
|
|
27197
27202
|
Object.entries(doc2.blocks).forEach(([containerId2, blocks2]) => {
|
|
27198
27203
|
if (containerId2 === "root")
|
|
@@ -27257,7 +27262,7 @@ var __publicField = (obj, key, value) => {
|
|
|
27257
27262
|
if (blocks.length === 1) {
|
|
27258
27263
|
const newBlock2 = blocks[0];
|
|
27259
27264
|
if (isTextKindBlockType(editor, newBlock2.type)) {
|
|
27260
|
-
editor.insertTextToBlock(block, offset, (
|
|
27265
|
+
editor.insertTextToBlock(block, offset, (_a2 = newBlock2.text) != null ? _a2 : []);
|
|
27261
27266
|
return;
|
|
27262
27267
|
}
|
|
27263
27268
|
editor.breakTextBlock(block, offset);
|
|
@@ -92473,7 +92478,7 @@ ${data2.plantumlText}
|
|
|
92473
92478
|
}
|
|
92474
92479
|
}
|
|
92475
92480
|
});
|
|
92476
|
-
editor.version = "2.6.
|
|
92481
|
+
editor.version = "2.6.5";
|
|
92477
92482
|
return editor;
|
|
92478
92483
|
}
|
|
92479
92484
|
function isDoc(doc2) {
|
|
@@ -92586,7 +92591,7 @@ ${data2.plantumlText}
|
|
|
92586
92591
|
}
|
|
92587
92592
|
});
|
|
92588
92593
|
OnesEditorToolbar.register(editor);
|
|
92589
|
-
editor.version = "2.6.
|
|
92594
|
+
editor.version = "2.6.5";
|
|
92590
92595
|
return editor;
|
|
92591
92596
|
}
|
|
92592
92597
|
async function showDocVersions(editor, options, serverUrl) {
|