@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.js CHANGED
@@ -5160,7 +5160,34 @@ var NodeView = class {
5160
5160
  y = handleBox.y - domBox.y + offsetY;
5161
5161
  }
5162
5162
  const clonedNode = this.dom.cloneNode(true);
5163
- (_g = event.dataTransfer) == null ? void 0 : _g.setDragImage(clonedNode, x, y);
5163
+ try {
5164
+ const domBox = this.dom.getBoundingClientRect();
5165
+ clonedNode.style.width = `${Math.round(domBox.width)}px`;
5166
+ clonedNode.style.height = `${Math.round(domBox.height)}px`;
5167
+ clonedNode.style.boxSizing = "border-box";
5168
+ clonedNode.style.pointerEvents = "none";
5169
+ } catch {
5170
+ }
5171
+ let dragImageWrapper = null;
5172
+ try {
5173
+ dragImageWrapper = document.createElement("div");
5174
+ dragImageWrapper.style.position = "absolute";
5175
+ dragImageWrapper.style.top = "-9999px";
5176
+ dragImageWrapper.style.left = "-9999px";
5177
+ dragImageWrapper.style.pointerEvents = "none";
5178
+ dragImageWrapper.appendChild(clonedNode);
5179
+ document.body.appendChild(dragImageWrapper);
5180
+ (_g = event.dataTransfer) == null ? void 0 : _g.setDragImage(clonedNode, x, y);
5181
+ } finally {
5182
+ if (dragImageWrapper) {
5183
+ setTimeout(() => {
5184
+ try {
5185
+ dragImageWrapper == null ? void 0 : dragImageWrapper.remove();
5186
+ } catch {
5187
+ }
5188
+ }, 0);
5189
+ }
5190
+ }
5164
5191
  const pos = this.getPos();
5165
5192
  if (typeof pos !== "number") {
5166
5193
  return;