@cardenelabs/cdl 0.30.2 → 0.30.3

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.cjs CHANGED
@@ -8828,11 +8828,66 @@ function \u672B\u5C3E\u3092\u8FBA\u306B\u6CBF\u3063\u3066\u305A\u3089\u3059(e, \
8828
8828
  parts.push(`L ${s.x2} ${s.y2}`);
8829
8829
  }
8830
8830
  const \u6298\u308C1\u306F\u76F4\u524D\u306E\u6298\u308C = Math.abs(\u6298\u308C1.x - last.x1) <= 0.5 && Math.abs(\u6298\u308C1.y - last.y1) <= 0.5;
8831
+ if (\u6298\u308C1\u306F\u76F4\u524D\u306E\u6298\u308C) {
8832
+ const \u6298\u308A\u8FD4\u3055\u306A\u3044 = \u76F4\u524D\u306E\u6298\u308C\u3054\u3068\u305A\u3089\u3059(segs, \u6A2A, d, nodes, e);
8833
+ if (\u6298\u308A\u8FD4\u3055\u306A\u3044) return \u6298\u308A\u8FD4\u3055\u306A\u3044;
8834
+ }
8831
8835
  if (!\u6298\u308C1\u306F\u76F4\u524D\u306E\u6298\u308C) parts.push(`L ${round1(\u6298\u308C1.x)} ${round1(\u6298\u308C1.y)}`);
8832
8836
  parts.push(`L ${round1(\u6298\u308C2.x)} ${round1(\u6298\u308C2.y)}`);
8833
8837
  parts.push(`L ${round1(\u7D42\u70B9.x)} ${round1(\u7D42\u70B9.y)}`);
8834
8838
  return parts.join(" ");
8835
8839
  }
8840
+ function \u76F4\u524D\u306E\u6298\u308C\u3054\u3068\u305A\u3089\u3059(segs, \u6A2A, d, nodes, e) {
8841
+ const \u5E73\u884C\u304B = (s) => \u6A2A ? Math.abs(s.x2 - s.x1) < 0.5 && Math.abs(s.y2 - s.y1) > 0.5 : Math.abs(s.y2 - s.y1) < 0.5 && Math.abs(s.x2 - s.x1) > 0.5;
8842
+ let \u5438\u53CE = -1;
8843
+ for (let i = segs.length - 2; i >= 0; i -= 1) {
8844
+ if (\u5E73\u884C\u304B(segs[i])) {
8845
+ \u5438\u53CE = i;
8846
+ break;
8847
+ }
8848
+ }
8849
+ if (\u5438\u53CE < 0) return null;
8850
+ const \u5143\u306E\u9577\u3055 = \u6A2A ? Math.abs(segs[\u5438\u53CE].y2 - segs[\u5438\u53CE].y1) : Math.abs(segs[\u5438\u53CE].x2 - segs[\u5438\u53CE].x1);
8851
+ const \u5411\u304D = \u6A2A ? Math.sign(segs[\u5438\u53CE].y2 - segs[\u5438\u53CE].y1) : Math.sign(segs[\u5438\u53CE].x2 - segs[\u5438\u53CE].x1);
8852
+ const \u5F8C\u306E\u9577\u3055 = \u5143\u306E\u9577\u3055 + \u5411\u304D * d;
8853
+ if (\u5F8C\u306E\u9577\u3055 < ENDPOINT_FAN_RUNUP) return null;
8854
+ const \u305A\u3089\u3059 = (p) => \u6A2A ? { ...p, y: p.y + d } : { ...p, x: p.x + d };
8855
+ const \u65B0segs = segs.map((s, i) => {
8856
+ if (i <= \u5438\u53CE) return s;
8857
+ return {
8858
+ ...s,
8859
+ x1: \u305A\u3089\u3059({ x: s.x1, y: s.y1 }).x,
8860
+ y1: \u305A\u3089\u3059({ x: s.x1, y: s.y1 }).y,
8861
+ x2: \u305A\u3089\u3059({ x: s.x2, y: s.y2 }).x,
8862
+ y2: \u305A\u3089\u3059({ x: s.x2, y: s.y2 }).y,
8863
+ ...s.ctrl ? { ctrl: s.ctrl.map((c) => \u305A\u3089\u3059(c)) } : {}
8864
+ };
8865
+ });
8866
+ \u65B0segs[\u5438\u53CE] = {
8867
+ ...segs[\u5438\u53CE],
8868
+ x2: \u6A2A ? segs[\u5438\u53CE].x2 : segs[\u5438\u53CE].x2 + d,
8869
+ y2: \u6A2A ? segs[\u5438\u53CE].y2 + d : segs[\u5438\u53CE].y2
8870
+ };
8871
+ if (nodes.some(
8872
+ (n) => n.id !== e.from && n.id !== e.to && segmentsCrossRect(
8873
+ \u65B0segs.slice(\u5438\u53CE).map((s) => ({ x1: s.x1, y1: s.y1, x2: s.x2, y2: s.y2 })),
8874
+ nodeRect(n)
8875
+ )
8876
+ )) {
8877
+ return null;
8878
+ }
8879
+ const head = \u65B0segs[0];
8880
+ const parts = [`M ${round1(head.x1)} ${round1(head.y1)}`];
8881
+ for (const s of \u65B0segs) {
8882
+ if (s.cmd === "Q") {
8883
+ const c = s.ctrl?.[0];
8884
+ parts.push(c ? `Q ${round1(c.x)} ${round1(c.y)}, ${round1(s.x2)} ${round1(s.y2)}` : `L ${round1(s.x2)} ${round1(s.y2)}`);
8885
+ continue;
8886
+ }
8887
+ parts.push(`L ${round1(s.x2)} ${round1(s.y2)}`);
8888
+ }
8889
+ return parts.join(" ");
8890
+ }
8836
8891
 
8837
8892
  // src/layout/lanes.ts
8838
8893
  var LANE_POSITION_EPSILON = 1e-9;