@cardenelabs/cdl 0.65.0 → 0.66.0

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/react.js CHANGED
@@ -7378,6 +7378,10 @@ function verticalCornerDir(from, to) {
7378
7378
  function cornerRadiusFor(\u534A\u5F84, ...\u8D70\u308A) {
7379
7379
  return Math.min(\u534A\u5F84, ...\u8D70\u308A.map((v) => Math.abs(v)));
7380
7380
  }
7381
+ function runCrossesBox(\u8D70\u308A, \u7BB1) {
7382
+ if (\u8D70\u308A.y <= \u7BB1.cy - \u7BB1.h / 2 || \u8D70\u308A.y >= \u7BB1.cy + \u7BB1.h / 2) return false;
7383
+ return \u7BB1.cx + \u7BB1.w / 2 > Math.min(\u8D70\u308A.x1, \u8D70\u308A.x2) && \u7BB1.cx - \u7BB1.w / 2 < Math.max(\u8D70\u308A.x1, \u8D70\u308A.x2);
7384
+ }
7381
7385
  var VERTICAL_DETOUR_EXIT = 45;
7382
7386
  function nearestBoxDistance(anchorX, dir, verticalTop, verticalBottom, boxes) {
7383
7387
  let nearest = Infinity;
@@ -8370,18 +8374,28 @@ function routePath(from, to, fromSide, toSide, obstacles = [], detourSide, _from
8370
8374
  const labelIntersect = oTop < labelBottom && oBottom > labelTop;
8371
8375
  return segIntersect || labelIntersect;
8372
8376
  };
8377
+ const \u6A2A\u306E\u8D70\u308A\u304C\u585E\u304C\u308B = (mx) => labelObstacles.some((o) => {
8378
+ if (o.id === from.id || o.id === to.id) return false;
8379
+ return runCrossesBox({ y: A.y, x1: A.x, x2: mx }, o) || runCrossesBox({ y: B.y, x1: mx, x2: B.x }, o);
8380
+ });
8373
8381
  let iter = 0;
8374
8382
  while (iter < 12) {
8375
8383
  const band = labelBand(midX2);
8376
- const hit = labelObstacles.find((o) => intersects(o, band));
8384
+ const hit = labelObstacles.find((o) => intersects(o, band)) ?? labelObstacles.find(
8385
+ (o) => o.id !== from.id && o.id !== to.id && (runCrossesBox({ y: A.y, x1: A.x, x2: midX2 }, o) || runCrossesBox({ y: B.y, x1: midX2, x2: B.x }, o))
8386
+ );
8377
8387
  if (!hit) break;
8378
8388
  const hitLeft = hit.cx - hit.w / 2;
8379
8389
  const hitRight = hit.cx + hit.w / 2;
8380
8390
  const retreatRight = hitRight + labelHalfW + CLEARANCE_NODE_LABEL + 4;
8381
8391
  const retreatLeft = hitLeft - labelHalfW - CLEARANCE_NODE_LABEL - 4;
8392
+ const \u53F3\u304C\u585E\u304C\u308B = \u6A2A\u306E\u8D70\u308A\u304C\u585E\u304C\u308B(retreatRight);
8393
+ const \u5DE6\u304C\u585E\u304C\u308B = \u6A2A\u306E\u8D70\u308A\u304C\u585E\u304C\u308B(retreatLeft);
8382
8394
  const dRight = Math.abs(retreatRight - midX2);
8383
8395
  const dLeft = Math.abs(retreatLeft - midX2);
8384
- midX2 = dRight <= dLeft ? retreatRight : retreatLeft;
8396
+ const \u6B21 = \u53F3\u304C\u585E\u304C\u308B === \u5DE6\u304C\u585E\u304C\u308B ? dRight <= dLeft ? retreatRight : retreatLeft : \u53F3\u304C\u585E\u304C\u308B ? retreatLeft : retreatRight;
8397
+ if (\u6B21 === midX2) break;
8398
+ midX2 = \u6B21;
8385
8399
  iter++;
8386
8400
  }
8387
8401
  }