@archie/devtools 0.0.20 → 0.0.21

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.
@@ -4927,15 +4927,17 @@ function buildNodeSelector(nodeId) {
4927
4927
  var LARGE_NODE_NEST_BLOCK_MIN_WIDTH = 520;
4928
4928
  var LARGE_NODE_NEST_BLOCK_MIN_HEIGHT = 260;
4929
4929
  var LARGE_NODE_NEST_BLOCK_MIN_AREA = 18e4;
4930
- function resolveGrabFeedbackTarget(target, scannedByNodeId) {
4931
- if (!(target instanceof Element)) return null;
4932
- if (target.closest("[data-design-mode-ui]")) return null;
4930
+ function shouldShowGrabFeedback(target, scannedByNodeId) {
4931
+ if (!(target instanceof Element)) return false;
4932
+ if (target.closest("[data-design-mode-ui]")) return false;
4933
+ if (!target.closest("#root")) return false;
4933
4934
  const host = target.closest(`[${DND_NODE_ID_ATTR}]`);
4934
- if (!host) return null;
4935
+ if (!host) {
4936
+ return true;
4937
+ }
4935
4938
  const nodeId = host.getAttribute(DND_NODE_ID_ATTR);
4936
4939
  const scanned = nodeId ? scannedByNodeId.get(nodeId) : null;
4937
- if (!scanned || scanned.draggable !== false) return null;
4938
- return scanned;
4940
+ return !scanned || scanned.draggable === false;
4939
4941
  }
4940
4942
  function isEligibleForDrag(sc) {
4941
4943
  if (sc.draggable === false) return false;
@@ -8750,11 +8752,12 @@ function DesignModeOverlay() {
8750
8752
  (0, import_react17.useEffect)(() => {
8751
8753
  if (!enabled) return;
8752
8754
  const onPointerDown = (e) => {
8753
- const scanned = resolveGrabFeedbackTarget(
8755
+ if (!shouldShowGrabFeedback(
8754
8756
  e.target,
8755
8757
  refs.nodeMapRef.current
8756
- );
8757
- if (!scanned) return;
8758
+ )) {
8759
+ return;
8760
+ }
8758
8761
  setGrabFeedback({ x: e.clientX, y: e.clientY, at: Date.now() });
8759
8762
  };
8760
8763
  document.addEventListener("pointerdown", onPointerDown, true);
@@ -4892,15 +4892,17 @@ function buildNodeSelector(nodeId) {
4892
4892
  var LARGE_NODE_NEST_BLOCK_MIN_WIDTH = 520;
4893
4893
  var LARGE_NODE_NEST_BLOCK_MIN_HEIGHT = 260;
4894
4894
  var LARGE_NODE_NEST_BLOCK_MIN_AREA = 18e4;
4895
- function resolveGrabFeedbackTarget(target, scannedByNodeId) {
4896
- if (!(target instanceof Element)) return null;
4897
- if (target.closest("[data-design-mode-ui]")) return null;
4895
+ function shouldShowGrabFeedback(target, scannedByNodeId) {
4896
+ if (!(target instanceof Element)) return false;
4897
+ if (target.closest("[data-design-mode-ui]")) return false;
4898
+ if (!target.closest("#root")) return false;
4898
4899
  const host = target.closest(`[${DND_NODE_ID_ATTR}]`);
4899
- if (!host) return null;
4900
+ if (!host) {
4901
+ return true;
4902
+ }
4900
4903
  const nodeId = host.getAttribute(DND_NODE_ID_ATTR);
4901
4904
  const scanned = nodeId ? scannedByNodeId.get(nodeId) : null;
4902
- if (!scanned || scanned.draggable !== false) return null;
4903
- return scanned;
4905
+ return !scanned || scanned.draggable === false;
4904
4906
  }
4905
4907
  function isEligibleForDrag(sc) {
4906
4908
  if (sc.draggable === false) return false;
@@ -8715,11 +8717,12 @@ function DesignModeOverlay() {
8715
8717
  useEffect12(() => {
8716
8718
  if (!enabled) return;
8717
8719
  const onPointerDown = (e) => {
8718
- const scanned = resolveGrabFeedbackTarget(
8720
+ if (!shouldShowGrabFeedback(
8719
8721
  e.target,
8720
8722
  refs.nodeMapRef.current
8721
- );
8722
- if (!scanned) return;
8723
+ )) {
8724
+ return;
8725
+ }
8723
8726
  setGrabFeedback({ x: e.clientX, y: e.clientY, at: Date.now() });
8724
8727
  };
8725
8728
  document.addEventListener("pointerdown", onPointerDown, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archie/devtools",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "DevTools for Archie generated applications - Route synchronization and editor communication",
5
5
  "repository": {
6
6
  "type": "git",