@ones-editor/editor 0.0.7-beta.29 → 0.0.7-beta.30

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
@@ -22922,9 +22922,17 @@ var __publicField = (obj, key, value) => {
22922
22922
  const blockIndex2 = getBlockIndex(block);
22923
22923
  let lastBlock22;
22924
22924
  blocks.forEach((b, index2) => {
22925
- const newBlock2 = editor.insertBlock(containerId, blockIndex2 + index2, b, void 0, { noFocus: true });
22926
- if (index2 === blocks.length - 1) {
22927
- lastBlock22 = newBlock2;
22925
+ var _a2;
22926
+ const currentBlock = getBlockByIndex(getContainerById(editor, containerId), blockIndex2 + index2);
22927
+ if (currentBlock && isTextKindBlock(editor, currentBlock) && isEmptyTextBlock(editor, currentBlock)) {
22928
+ editor.doc.localUpdateBlockText(containerId, blockIndex2, [
22929
+ ...(_a2 = b.text) != null ? _a2 : []
22930
+ ]);
22931
+ } else {
22932
+ const newBlock2 = editor.insertBlock(containerId, blockIndex2 + index2, b, void 0, { noFocus: true });
22933
+ if (index2 === blocks.length - 1) {
22934
+ lastBlock22 = newBlock2;
22935
+ }
22928
22936
  }
22929
22937
  });
22930
22938
  if (lastBlock22) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.7-beta.29",
3
+ "version": "0.0.7-beta.30",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",