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