@ones-editor/editor 0.0.7-beta.42 → 0.0.7-beta.43
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 +17 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23290,7 +23290,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23290
23290
|
const containerId = getContainerId(container);
|
|
23291
23291
|
editor.doc.beginBatchUpdate();
|
|
23292
23292
|
editor.undoManager.runInGroup(() => {
|
|
23293
|
-
var _a, _b, _c;
|
|
23293
|
+
var _a, _b, _c, _d;
|
|
23294
23294
|
const childContainers = [];
|
|
23295
23295
|
Object.entries(doc2.blocks).forEach(([containerId2, blocks2]) => {
|
|
23296
23296
|
if (containerId2 === "root")
|
|
@@ -23320,12 +23320,19 @@ var __publicField = (obj, key, value) => {
|
|
|
23320
23320
|
const isTitleBlock2 = containerId === "root" && editor.getBlockByIndex(containerId, 0) === block;
|
|
23321
23321
|
const blockIndex2 = getBlockIndex(block);
|
|
23322
23322
|
let lastBlock22;
|
|
23323
|
-
blocks.
|
|
23324
|
-
|
|
23325
|
-
|
|
23323
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
23324
|
+
if (i === 0) {
|
|
23325
|
+
const currentBlock = editor.getBlockByIndex(containerId, blockIndex2);
|
|
23326
|
+
if (currentBlock && isTextKindBlock(editor, currentBlock) && isEmptyTextBlock(editor, currentBlock) && blocks[i].type === "text") {
|
|
23327
|
+
editor.insertTextToBlock(block, 0, (_a = blocks[i].text) != null ? _a : []);
|
|
23328
|
+
continue;
|
|
23329
|
+
}
|
|
23330
|
+
}
|
|
23331
|
+
const newBlock2 = editor.insertBlock(containerId, blockIndex2 + i, blocks[i], void 0, { noFocus: true });
|
|
23332
|
+
if (i === blocks.length - 1) {
|
|
23326
23333
|
lastBlock22 = newBlock2;
|
|
23327
23334
|
}
|
|
23328
|
-
}
|
|
23335
|
+
}
|
|
23329
23336
|
if (lastBlock22) {
|
|
23330
23337
|
editor.selection.selectBlock(lastBlock22, getBlockTextLength$4(editor, lastBlock22));
|
|
23331
23338
|
}
|
|
@@ -23337,7 +23344,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23337
23344
|
if (blocks.length === 1) {
|
|
23338
23345
|
const newBlock2 = blocks[0];
|
|
23339
23346
|
if (isTextKindBlockType(editor, newBlock2.type)) {
|
|
23340
|
-
editor.insertTextToBlock(block, offset, (
|
|
23347
|
+
editor.insertTextToBlock(block, offset, (_b = newBlock2.text) != null ? _b : []);
|
|
23341
23348
|
return;
|
|
23342
23349
|
}
|
|
23343
23350
|
editor.breakTextBlock(block, offset);
|
|
@@ -23360,7 +23367,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23360
23367
|
if (!atTextEnd) {
|
|
23361
23368
|
editor.selection.selectBlock(newBlock, 0);
|
|
23362
23369
|
if (isTextKindBlockType(editor, lastBlock2.type)) {
|
|
23363
|
-
editor.insertTextToBlock(newBlock, 0, (
|
|
23370
|
+
editor.insertTextToBlock(newBlock, 0, (_c = lastBlock2.text) != null ? _c : []);
|
|
23364
23371
|
} else {
|
|
23365
23372
|
editor.insertBlock(containerId, breakIndex, lastBlock2);
|
|
23366
23373
|
}
|
|
@@ -23375,7 +23382,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23375
23382
|
editor.insertBlock(containerId, breakIndex, firstBlock);
|
|
23376
23383
|
insertOtherBlockIndex += 1;
|
|
23377
23384
|
} else {
|
|
23378
|
-
editor.insertTextToBlock(block, offset, (
|
|
23385
|
+
editor.insertTextToBlock(block, offset, (_d = firstBlock.text) != null ? _d : []);
|
|
23379
23386
|
}
|
|
23380
23387
|
} else {
|
|
23381
23388
|
editor.insertBlock(containerId, breakIndex, firstBlock);
|
|
@@ -37584,9 +37591,6 @@ var __publicField = (obj, key, value) => {
|
|
|
37584
37591
|
this._rows.push(new DocTableRow(this.colCount));
|
|
37585
37592
|
}
|
|
37586
37593
|
this.fillGrid();
|
|
37587
|
-
if (tableData.colsWidth) {
|
|
37588
|
-
assert(logger$22, this.colCount === tableData.colsWidth.length, "invalid col count");
|
|
37589
|
-
}
|
|
37590
37594
|
}
|
|
37591
37595
|
get rowCount() {
|
|
37592
37596
|
return this._data.rows;
|
|
@@ -47311,14 +47315,14 @@ $$${mathData.mathjaxText}$$
|
|
|
47311
47315
|
return lines2.join("\n");
|
|
47312
47316
|
};
|
|
47313
47317
|
const lines = [];
|
|
47314
|
-
lines.push(
|
|
47318
|
+
lines.push('<table style="border-collapse: collapse;">');
|
|
47315
47319
|
for (let row = 0; row < grid.rowCount; row++) {
|
|
47316
47320
|
let rowText = "<tr>";
|
|
47317
47321
|
for (let col = 0; col < grid.colCount; col++) {
|
|
47318
47322
|
const cell = grid.getCell({ row, col });
|
|
47319
47323
|
if (!cell.virtual) {
|
|
47320
47324
|
const cellText = getContainerHtml(cell.containerId);
|
|
47321
|
-
rowText += `<td colSpan="${cell.colSpan}" rowSpan="${cell.rowSpan}">${cellText}</td>`;
|
|
47325
|
+
rowText += `<td colSpan="${cell.colSpan}" rowSpan="${cell.rowSpan}" style="border: 1px solid rgb(171, 171, 171); min-width: 20px">${cellText}</td>`;
|
|
47322
47326
|
}
|
|
47323
47327
|
}
|
|
47324
47328
|
rowText += "</tr>";
|