@kaitify/core 0.0.2-beta.13 → 0.0.2-beta.15

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.
@@ -2787,9 +2787,10 @@ const handlerForPasteDrop = async function(dataTransfer) {
2787
2787
  const html = dataTransfer.getData("text/html");
2788
2788
  const text2 = dataTransfer.getData("text/plain");
2789
2789
  const files = dataTransfer.files;
2790
+ debugger;
2790
2791
  if (files.length && this.priorityPasteFiles) {
2791
2792
  await handlerForPasteFiles.apply(this, [files]);
2792
- } else if (html && this.allowPasteHtml) {
2793
+ } else if (html && this.allowPasteHtml && !this.selection.start.node.isInCodeBlockStyle()) {
2793
2794
  const nodes = this.htmlParseNode(html).filter((item) => {
2794
2795
  return !item.isEmpty();
2795
2796
  });
@@ -35232,6 +35233,10 @@ const updateSelection = (editor, node, textNodes, newNodes) => {
35232
35233
  editor.selection.start.offset = offset - index;
35233
35234
  break;
35234
35235
  }
35236
+ if (offset >= index && i == newTextNodes.length - 1) {
35237
+ editor.selection.start.node = newTextNodes[i];
35238
+ editor.selection.start.offset = newTextNodes[i].textContent.length;
35239
+ }
35235
35240
  i++;
35236
35241
  index = newIndex;
35237
35242
  }
@@ -35249,6 +35254,10 @@ const updateSelection = (editor, node, textNodes, newNodes) => {
35249
35254
  editor.selection.end.offset = offset - index;
35250
35255
  break;
35251
35256
  }
35257
+ if (offset >= index && i == newTextNodes.length - 1) {
35258
+ editor.selection.end.node = newTextNodes[i];
35259
+ editor.selection.end.offset = newTextNodes[i].textContent.length;
35260
+ }
35252
35261
  i++;
35253
35262
  index = newIndex;
35254
35263
  }