@cardenelabs/cdl 0.21.1 → 0.21.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ CDL (Chainome Diagram Language) の主要変更履歴。
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.21.2] - 2026-08-30
9
+
10
+ ### Fixed
11
+
12
+ - **雲の字を絵の芯に合わせた** (#588)
13
+
14
+ 雲は 5 つの円で描き、箱の上へ 0.11 はみ出し下は 0.15 手前で終わる = **絵の芯が箱の芯より
15
+ 上にある**。 字を箱の芯に合わせていたので、絵に対して下へ寄って見えていた
16
+ (実測で上 71.5 / 下 27.9、差 43.6)。 直して 49 / 51.5 になる。
17
+
18
+ 円の中心と半径を `layout/spec.ts` の表に移し、描き手と字を置く側が同じ表から引く。
19
+ 絵の芯もその表から出すので、円を動かせば字も追随する。
20
+
21
+ ひし形 (`decision`) は箱と絵の芯が同じなので動かない。
22
+
8
23
  ## [0.21.1] - 2026-08-29
9
24
 
10
25
  ### Fixed
@@ -1080,7 +1095,8 @@ Initial OSS release.
1080
1095
  使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
1081
1096
  行き止まりになる。
1082
1097
 
1083
- [Unreleased]: https://github.com/cardene777/cdl/compare/v0.21.1...HEAD
1098
+ [Unreleased]: https://github.com/cardene777/cdl/compare/v0.21.2...HEAD
1099
+ [0.21.2]: https://github.com/cardene777/cdl/compare/v0.21.1...v0.21.2
1084
1100
  [0.21.1]: https://github.com/cardene777/cdl/compare/v0.21.0...v0.21.1
1085
1101
  [0.21.0]: https://github.com/cardene777/cdl/compare/v0.20.1...v0.21.0
1086
1102
  [0.20.1]: https://github.com/cardene777/cdl/compare/v0.20.0...v0.20.1
package/dist/index.cjs CHANGED
@@ -12026,6 +12026,18 @@ function \u4E2D\u8EAB\u304B\u3089\u51FA\u3059\u9AD8\u3055(kind, \u6E80\u8F09h, \
12026
12026
  return Math.max(MIN_BOX_H, \u6E80\u8F09h - \u5F15\u304F);
12027
12027
  }
12028
12028
  var MIN_BOX_H = 44;
12029
+ var CLOUD_CIRCLES = [
12030
+ { cx: -0.8, cy: -0.05 + 0.08, r: 0.32 },
12031
+ { cx: -0.4, cy: -0.05 - 0.05, r: 0.4 },
12032
+ { cx: 0, cy: -0.05 - 0.1, r: 0.46 },
12033
+ { cx: 0.4, cy: -0.05 - 0.05, r: 0.4 },
12034
+ { cx: 0.8, cy: -0.05 + 0.08, r: 0.32 }
12035
+ ];
12036
+ var CLOUD_ART_CENTER_RISE = (() => {
12037
+ const \u4E0A = Math.min(...CLOUD_CIRCLES.map((c) => c.cy - c.r));
12038
+ const \u4E0B = Math.max(...CLOUD_CIRCLES.map((c) => c.cy + c.r));
12039
+ return -(\u4E0A + \u4E0B) / 2;
12040
+ })();
12029
12041
 
12030
12042
  // src/layout/footer-shape.ts
12031
12043
  var SHAPE_DRAW_UP_EXTENT = {
@@ -22504,21 +22516,12 @@ function GenericNode({
22504
22516
  if (shape === "cloud") {
22505
22517
  const cx = w / 2;
22506
22518
  const cy = h / 2;
22507
- const cloudCenterY = cy - h * 0.05;
22508
- const usableW = w * 0.85;
22509
- const halfW = usableW / 2;
22510
- const circles = [
22511
- { cx: cx - halfW * 0.8, cy: cloudCenterY + h * 0.08, r: h * 0.32 },
22512
- // 左端
22513
- { cx: cx - halfW * 0.4, cy: cloudCenterY - h * 0.05, r: h * 0.4 },
22514
- // 左
22515
- { cx, cy: cloudCenterY - h * 0.1, r: h * 0.46 },
22516
- // 中央 (最大)
22517
- { cx: cx + halfW * 0.4, cy: cloudCenterY - h * 0.05, r: h * 0.4 },
22518
- // 右
22519
- { cx: cx + halfW * 0.8, cy: cloudCenterY + h * 0.08, r: h * 0.32 }
22520
- // 右端
22521
- ];
22519
+ const halfW = w * 0.85 / 2;
22520
+ const circles = CLOUD_CIRCLES.map((c) => ({
22521
+ cx: cx + halfW * c.cx,
22522
+ cy: cy + h * c.cy,
22523
+ r: h * c.r
22524
+ }));
22522
22525
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
22523
22526
  circles.map((c, i) => /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: c.cx, cy: c.cy, r: c.r, fill: "var(--cdl-node-fill, #ffffff)" }, `fill-${i}`)),
22524
22527
  circles.map((c, i) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -22557,11 +22560,12 @@ function GenericNode({
22557
22560
  const textX = centered ? w / 2 : 20;
22558
22561
  const cylinderShift = genericTextShift(node.kind);
22559
22562
  const \u7E70\u308A\u4E0A\u3052 = node.eyebrow || centered ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052(node.kind, hasRows);
22560
- const eyebrowY = centered ? h / 2 - 26 : 32 + cylinderShift;
22561
- const titleY = genericTitleBaselineY(node.kind, h, hasRows) - \u7E70\u308A\u4E0A\u3052;
22562
- const subtitleY = centered ? h / 2 + 28 : 96 + cylinderShift - \u7E70\u308A\u4E0A\u3052;
22563
+ const \u7D75\u306E\u82AF = centered && STYLES[node.kind]?.shape === "cloud" ? h * CLOUD_ART_CENTER_RISE : 0;
22564
+ const eyebrowY = centered ? h / 2 - 26 - \u7D75\u306E\u82AF : 32 + cylinderShift;
22565
+ const titleY = genericTitleBaselineY(node.kind, h, hasRows) - \u7E70\u308A\u4E0A\u3052 - \u7D75\u306E\u82AF;
22566
+ const subtitleY = centered ? h / 2 + 28 - \u7D75\u306E\u82AF : 96 + cylinderShift - \u7E70\u308A\u4E0A\u3052;
22563
22567
  const iconX = centered ? w / 2 + 40 : w - 48;
22564
- const iconY = centered ? h / 2 - 44 : 18 + cylinderShift;
22568
+ const iconY = centered ? h / 2 - 44 - \u7D75\u306E\u82AF : 18 + cylinderShift;
22565
22569
  const dominantBaseline = centered ? "middle" : void 0;
22566
22570
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x} ${y})`, "data-cdl-role": "node-body", children: [
22567
22571
  shapeEl,