@tiptap/core 3.2.0 → 3.2.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.cjs CHANGED
@@ -5276,7 +5276,34 @@ var NodeView = class {
5276
5276
  y = handleBox.y - domBox.y + offsetY;
5277
5277
  }
5278
5278
  const clonedNode = this.dom.cloneNode(true);
5279
- (_g = event.dataTransfer) == null ? void 0 : _g.setDragImage(clonedNode, x, y);
5279
+ try {
5280
+ const domBox = this.dom.getBoundingClientRect();
5281
+ clonedNode.style.width = `${Math.round(domBox.width)}px`;
5282
+ clonedNode.style.height = `${Math.round(domBox.height)}px`;
5283
+ clonedNode.style.boxSizing = "border-box";
5284
+ clonedNode.style.pointerEvents = "none";
5285
+ } catch {
5286
+ }
5287
+ let dragImageWrapper = null;
5288
+ try {
5289
+ dragImageWrapper = document.createElement("div");
5290
+ dragImageWrapper.style.position = "absolute";
5291
+ dragImageWrapper.style.top = "-9999px";
5292
+ dragImageWrapper.style.left = "-9999px";
5293
+ dragImageWrapper.style.pointerEvents = "none";
5294
+ dragImageWrapper.appendChild(clonedNode);
5295
+ document.body.appendChild(dragImageWrapper);
5296
+ (_g = event.dataTransfer) == null ? void 0 : _g.setDragImage(clonedNode, x, y);
5297
+ } finally {
5298
+ if (dragImageWrapper) {
5299
+ setTimeout(() => {
5300
+ try {
5301
+ dragImageWrapper == null ? void 0 : dragImageWrapper.remove();
5302
+ } catch {
5303
+ }
5304
+ }, 0);
5305
+ }
5306
+ }
5280
5307
  const pos = this.getPos();
5281
5308
  if (typeof pos !== "number") {
5282
5309
  return;