@puckeditor/core 0.24.2-canary.c290d2e2 → 0.24.2-canary.f052f2dd

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.
@@ -4294,6 +4294,15 @@ var getZoneId = (candidate) => {
4294
4294
  }
4295
4295
  return id;
4296
4296
  };
4297
+ var getPointerTargetElement = (target) => {
4298
+ if (!target) return null;
4299
+ const node = target;
4300
+ if (node.nodeType === Node.DOCUMENT_NODE) {
4301
+ return node.documentElement;
4302
+ }
4303
+ if (!node.ownerDocument) return null;
4304
+ return target;
4305
+ };
4297
4306
  var BUFFER = 6;
4298
4307
  var getPointerCollisions = (position, manager) => {
4299
4308
  const candidates = [];
@@ -4407,7 +4416,10 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
4407
4416
  }
4408
4417
  this.registerEffect(() => {
4409
4418
  const handleMove = (event) => {
4410
- const target = event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target;
4419
+ const target = getPointerTargetElement(
4420
+ event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target
4421
+ );
4422
+ if (!target) return;
4411
4423
  const position = new GlobalPosition(target, {
4412
4424
  x: event.clientX,
4413
4425
  y: event.clientY
package/dist/index.js CHANGED
@@ -9079,6 +9079,15 @@ var getZoneId2 = (candidate) => {
9079
9079
  }
9080
9080
  return id;
9081
9081
  };
9082
+ var getPointerTargetElement = (target) => {
9083
+ if (!target) return null;
9084
+ const node = target;
9085
+ if (node.nodeType === Node.DOCUMENT_NODE) {
9086
+ return node.documentElement;
9087
+ }
9088
+ if (!node.ownerDocument) return null;
9089
+ return target;
9090
+ };
9082
9091
  var BUFFER = 6;
9083
9092
  var getPointerCollisions = (position, manager) => {
9084
9093
  const candidates = [];
@@ -9192,7 +9201,10 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
9192
9201
  }
9193
9202
  this.registerEffect(() => {
9194
9203
  const handleMove = (event) => {
9195
- const target = event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target;
9204
+ const target = getPointerTargetElement(
9205
+ event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target
9206
+ );
9207
+ if (!target) return;
9196
9208
  const position = new GlobalPosition(target, {
9197
9209
  x: event.clientX,
9198
9210
  y: event.clientY
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-GFP46DDM.mjs";
23
+ } from "./chunk-BOTVSRN7.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
@@ -9079,6 +9079,15 @@ var getZoneId2 = (candidate) => {
9079
9079
  }
9080
9080
  return id;
9081
9081
  };
9082
+ var getPointerTargetElement = (target) => {
9083
+ if (!target) return null;
9084
+ const node = target;
9085
+ if (node.nodeType === Node.DOCUMENT_NODE) {
9086
+ return node.documentElement;
9087
+ }
9088
+ if (!node.ownerDocument) return null;
9089
+ return target;
9090
+ };
9082
9091
  var BUFFER = 6;
9083
9092
  var getPointerCollisions = (position, manager) => {
9084
9093
  const candidates = [];
@@ -9192,7 +9201,10 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
9192
9201
  }
9193
9202
  this.registerEffect(() => {
9194
9203
  const handleMove = (event) => {
9195
- const target = event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target;
9204
+ const target = getPointerTargetElement(
9205
+ event instanceof BubbledPointerEvent ? event.originalTarget || event.target : event.target
9206
+ );
9207
+ if (!target) return;
9196
9208
  const position = new GlobalPosition(target, {
9197
9209
  x: event.clientX,
9198
9210
  y: event.clientY
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-GFP46DDM.mjs";
23
+ } from "./chunk-BOTVSRN7.mjs";
24
24
  import "./chunk-UIJZMSVU.mjs";
25
25
  import {
26
26
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/core",
3
- "version": "0.24.2-canary.c290d2e2",
3
+ "version": "0.24.2-canary.f052f2dd",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": {