@ones-editor/editor 3.1.2-beta.ONES22301271.1 → 3.1.2-beta.ONES22301271.2

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
@@ -27250,9 +27250,16 @@ var __publicField = (obj, key, value) => {
27250
27250
  const logger$3I = getLogger("delete-block");
27251
27251
  function getAllChildContainers(editor, blockData, containerIds) {
27252
27252
  if (blockData.children) {
27253
- containerIds.push(...blockData.children);
27254
27253
  blockData.children.forEach((childContainerId) => {
27255
- const childBlocks = editor.getChildContainerData(childContainerId);
27254
+ if (containerIds.has(childContainerId)) {
27255
+ return;
27256
+ }
27257
+ const childBlocks = editor.doc.findContainerBlocks(childContainerId);
27258
+ if (!Array.isArray(childBlocks)) {
27259
+ logger$3I.warn(`skip invalid child container while deleting: parentBlock=${blockData.id}, container=${childContainerId}`);
27260
+ return;
27261
+ }
27262
+ containerIds.add(childContainerId);
27256
27263
  childBlocks.forEach((childBlock) => {
27257
27264
  getAllChildContainers(editor, childBlock, containerIds);
27258
27265
  });
@@ -27284,31 +27291,31 @@ var __publicField = (obj, key, value) => {
27284
27291
  }
27285
27292
  }
27286
27293
  const blockData = editorDeleteBlockWithoutChildren(editor, block, newRange);
27287
- const childContainerIds = [];
27294
+ const childContainerIds = /* @__PURE__ */ new Set();
27288
27295
  getAllChildContainers(editor, blockData, childContainerIds);
27289
- if (childContainerIds.length > 0) {
27290
- editor.doc.localDeleteChildContainers(childContainerIds);
27296
+ if (childContainerIds.size > 0) {
27297
+ editor.doc.localDeleteChildContainers(Array.from(childContainerIds));
27291
27298
  }
27292
27299
  return blockData;
27293
27300
  });
27294
27301
  }
27295
27302
  function editorDeleteChildContainer(editor, containerId) {
27296
- const containerIds = [containerId];
27303
+ const containerIds = /* @__PURE__ */ new Set([containerId]);
27297
27304
  const childBlocks = editor.doc.getContainerBlocks(containerId);
27298
27305
  childBlocks.forEach((childBlock) => {
27299
27306
  getAllChildContainers(editor, childBlock, containerIds);
27300
27307
  });
27301
- editor.doc.localDeleteChildContainers(containerIds);
27308
+ editor.doc.localDeleteChildContainers(Array.from(containerIds));
27302
27309
  }
27303
27310
  function editorDeleteChildContainers(editor, childContainerIds) {
27304
- const containerIds = [...childContainerIds];
27311
+ const containerIds = new Set(childContainerIds);
27305
27312
  childContainerIds.forEach((containerId) => {
27306
27313
  const childBlocks = editor.doc.getContainerBlocks(containerId);
27307
27314
  childBlocks.forEach((childBlock) => {
27308
27315
  getAllChildContainers(editor, childBlock, containerIds);
27309
27316
  });
27310
27317
  });
27311
- editor.doc.localDeleteChildContainers(containerIds);
27318
+ editor.doc.localDeleteChildContainers(Array.from(containerIds));
27312
27319
  }
27313
27320
  const logger$3H = getLogger("merge-text-block");
27314
27321
  function editorMergeTextBlock(editor, block1, block2) {
@@ -97093,7 +97100,7 @@ ${JSON.stringify(error2, null, 2)}`);
97093
97100
  }
97094
97101
  }
97095
97102
  });
97096
- editor.version = "3.1.2-beta.ONES22301271.1";
97103
+ editor.version = "3.1.2-beta.ONES22301271.2";
97097
97104
  return editor;
97098
97105
  }
97099
97106
  function isDoc(doc2) {
@@ -97229,7 +97236,7 @@ ${JSON.stringify(error2, null, 2)}`);
97229
97236
  OnesEditorDropTarget.register(editor);
97230
97237
  OnesEditorTocProvider.register(editor);
97231
97238
  OnesEditorExclusiveBlock.register(editor);
97232
- editor.version = "3.1.2-beta.ONES22301271.1";
97239
+ editor.version = "3.1.2-beta.ONES22301271.2";
97233
97240
  return editor;
97234
97241
  } catch (error2) {
97235
97242
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.1.2-beta.ONES22301271.1",
3
+ "version": "3.1.2-beta.ONES22301271.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {