@kaitify/core 0.0.2-beta.12 → 0.0.2-beta.14

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.
@@ -35232,6 +35232,10 @@ const updateSelection = (editor, node, textNodes, newNodes) => {
35232
35232
  editor.selection.start.offset = offset - index;
35233
35233
  break;
35234
35234
  }
35235
+ if (offset >= index && i == newTextNodes.length - 1) {
35236
+ editor.selection.start.node = newTextNodes[i];
35237
+ editor.selection.start.offset = newTextNodes[i].textContent.length;
35238
+ }
35235
35239
  i++;
35236
35240
  index = newIndex;
35237
35241
  }
@@ -35249,6 +35253,10 @@ const updateSelection = (editor, node, textNodes, newNodes) => {
35249
35253
  editor.selection.end.offset = offset - index;
35250
35254
  break;
35251
35255
  }
35256
+ if (offset >= index && i == newTextNodes.length - 1) {
35257
+ editor.selection.end.node = newTextNodes[i];
35258
+ editor.selection.end.offset = newTextNodes[i].textContent.length;
35259
+ }
35252
35260
  i++;
35253
35261
  index = newIndex;
35254
35262
  }
@@ -36046,7 +36054,7 @@ const TableExtension = () => Extension.create({
36046
36054
  if (isHideCell(node)) {
36047
36055
  node.void = true;
36048
36056
  }
36049
- if (!node.hasChildren()) {
36057
+ if (!node.hasChildren() || node.children.every((child) => child.isEmpty())) {
36050
36058
  const placeholderNode = KNode.createPlaceholder();
36051
36059
  node.children = [placeholderNode];
36052
36060
  placeholderNode.parent = node;
@@ -37331,7 +37339,9 @@ class Editor {
37331
37339
  const tag = dom.nodeName.toLocaleLowerCase();
37332
37340
  const namespace = dom.namespaceURI;
37333
37341
  if (this.emptyRenderTags.includes(tag)) {
37334
- return KNode.createZeroWidthText();
37342
+ return KNode.create({
37343
+ type: "text"
37344
+ });
37335
37345
  }
37336
37346
  if (tag == this.textRenderTag && dom.childNodes.length && Array.from(dom.childNodes).every((childNode) => childNode.nodeType == 3)) {
37337
37347
  return KNode.create({