@blocknote/core 0.24.0 → 0.24.1

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/blocknote.js CHANGED
@@ -10034,7 +10034,9 @@ const mt = () => {
10034
10034
  (h) => h[1].user === s
10035
10035
  );
10036
10036
  if (!l)
10037
- throw new Error("Could not find client state for user");
10037
+ throw new Error(
10038
+ "Could not find client state for user, " + JSON.stringify(s)
10039
+ );
10038
10040
  const d = l[0];
10039
10041
  let c = n.get(d);
10040
10042
  if (!c) {
@@ -11214,26 +11216,30 @@ class na {
11214
11216
  }
11215
11217
  });
11216
11218
  p(this, "onDrop", (t) => {
11217
- var i;
11218
- if (this.pmView.dragging === null || (this.editor._tiptapEditor.commands.blur(), !this.isDragOrigin && this.pmView.dom.contains(t.target) ? this.pmView.dispatch(
11219
+ var n, r;
11220
+ if (this.pmView.dragging === null)
11221
+ return;
11222
+ this.editor._tiptapEditor.commands.blur();
11223
+ const o = t.target instanceof Node && ((n = t.target instanceof HTMLElement ? t.target : t.target.parentElement) == null ? void 0 : n.closest(".bn-editor")) || null;
11224
+ if (o && (!this.isDragOrigin && this.pmView.dom === o ? this.pmView.dispatch(
11219
11225
  this.pmView.state.tr.setSelection(
11220
11226
  U.create(
11221
11227
  this.pmView.state.tr.doc,
11222
11228
  this.pmView.state.tr.selection.to
11223
11229
  )
11224
11230
  )
11225
- ) : this.isDragOrigin && !this.pmView.dom.contains(t.target) && setTimeout(
11231
+ ) : this.isDragOrigin && this.pmView.dom !== o && setTimeout(
11226
11232
  () => this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),
11227
11233
  0
11228
- ), setTimeout(() => this.pmView.dragging = null, 0), this.sideMenuDetection === "editor" || t.synthetic || !((i = t.dataTransfer) != null && i.types.includes("blocknote/html"))))
11234
+ ), setTimeout(() => this.pmView.dragging = null, 0)), this.sideMenuDetection === "editor" || t.synthetic || !((r = t.dataTransfer) != null && r.types.includes("blocknote/html")))
11229
11235
  return;
11230
- const o = this.pmView.posAtCoords({
11236
+ const i = this.pmView.posAtCoords({
11231
11237
  left: t.clientX,
11232
11238
  top: t.clientY
11233
11239
  });
11234
- if (!o || o.inside === -1) {
11235
- const n = this.createSyntheticEvent(t);
11236
- this.pmView.dom.dispatchEvent(n);
11240
+ if (!i || i.inside === -1) {
11241
+ const a = this.createSyntheticEvent(t);
11242
+ this.pmView.dom.dispatchEvent(a);
11237
11243
  }
11238
11244
  });
11239
11245
  /**