@puckeditor/core 0.24.1 → 0.24.2-canary.1153e358

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/bin/cli.mjs CHANGED
@@ -8,7 +8,7 @@ import path from "node:path";
8
8
 
9
9
  const require = createRequire(import.meta.url);
10
10
  const pkgPath = require.resolve("@puckeditor/cli/package.json");
11
- const { bin } = require(pkgPath);
11
+ const { bin } = require("@puckeditor/cli/package.json");
12
12
  const binPath = path.join(
13
13
  path.dirname(pkgPath),
14
14
  typeof bin === "string" ? bin : bin.puck
@@ -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
@@ -9169,7 +9181,7 @@ import { useEffect as useEffect26, useInsertionEffect } from "react";
9169
9181
 
9170
9182
  // puck-runtime-css:puck-runtime-css
9171
9183
  init_react_import();
9172
- var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
9184
+ var defaultUiStyles = `@import "https://cdn.puck.run/editor/inter.css";
9173
9185
 
9174
9186
  /* styles/color.css */
9175
9187
  @layer puck-tokens {
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
- @import "https://rsms.me/inter/inter.css";
1
+ @import "https://cdn.puck.run/editor/inter.css";
2
2
 
3
3
  /* styles/color.css */
4
4
  @layer puck-tokens {
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
@@ -13829,7 +13841,7 @@ var import_react87 = require("react");
13829
13841
 
13830
13842
  // puck-runtime-css:puck-runtime-css
13831
13843
  init_react_import();
13832
- var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
13844
+ var defaultUiStyles = `@import "https://cdn.puck.run/editor/inter.css";
13833
13845
 
13834
13846
  /* styles/color.css */
13835
13847
  @layer puck-tokens {
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-T2XFCN6B.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
@@ -13829,7 +13841,7 @@ var import_react87 = require("react");
13829
13841
 
13830
13842
  // puck-runtime-css:puck-runtime-css
13831
13843
  init_react_import();
13832
- var defaultUiStyles = `@import "https://rsms.me/inter/inter.css";
13844
+ var defaultUiStyles = `@import "https://cdn.puck.run/editor/inter.css";
13833
13845
 
13834
13846
  /* styles/color.css */
13835
13847
  @layer puck-tokens {
@@ -20,7 +20,7 @@ import {
20
20
  setDeep,
21
21
  useGetPuck,
22
22
  usePuck
23
- } from "./chunk-T2XFCN6B.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.1",
3
+ "version": "0.24.2-canary.1153e358",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": {