@cardenelabs/cdl 0.20.0 → 0.20.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardenelabs/cdl",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
5
5
  "license": "MIT",
6
6
  "author": "cardene777",
@@ -8,7 +8,6 @@ import {
8
8
  SUBTITLE_ROW_SHIFT,
9
9
  中身から出す高さ,
10
10
  目印なしの繰り上げ,
11
- 段を積む箱か,
12
11
  } from "./spec";
13
12
  import { DEFAULT_NODE_GAP, HEADER_RESERVE, LANE_TOP_PAD, NODE_SIZE, STACK_GAP } from "./tokens";
14
13
 
@@ -245,10 +244,14 @@ export function layoutNodes(diag: CdlDiagram, lanes: LaidLane[]): LaidNode[] {
245
244
  * 並びの重心が 1 本に通る。 見た目検査の `row-alignment` もこの前提で書かれている。
246
245
  */
247
246
  //
248
- // 段を積む箱 (#589) も同じ扱いにする。 書いた段の数から高さを出しているので、段の高さへ
249
- // 伸ばすとその値が捨てられる = 名前だけの箱が 3 段の箱と同じ高さに戻る。
250
- const 自前の高さ =
251
- n.rowMarks !== undefined || 段を積む箱か(n.kind, (n.rows?.length ?? 0) > 0);
247
+ // **段を積む箱 (#589) はここに入れない**。 書いた段の数から高さを出すが、その値は段の
248
+ // 高さ (行内の最大) を通してから使う。
249
+ //
250
+ // 自前の高さで並べると、同じ縦列の中で箱ごとに高さが変わり、隣り合う箱の端どうしの
251
+ // 間隔が揃わなくなる (実測 = `pattern-rollback` で最小 100 に対し最大 187、
252
+ // `column-gap-uniform` が error)。 縦列が 1 本の図 (流れ図) では行に箱が 1 つしか無いので
253
+ // 段の高さ = その箱の高さになり、縮む効果はそのまま残る。
254
+ const 自前の高さ = n.rowMarks !== undefined;
252
255
  const h = n.h ?? (自前の高さ ? 箱の高さ(n, size.h) : 段の高さ);
253
256
  const cy = 段の芯;
254
257
  // n.w 明示時は尊重、 未指定で rows[] を持つ node は内容長に合わせて auto 拡張。