@cardenelabs/cdl 0.18.1 → 0.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardenelabs/cdl",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
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",
@@ -27,10 +27,12 @@ function autoStorageHeight(
27
27
  if (n.kind !== "storage") return n.h ?? defaultH;
28
28
  if (n.h != null) return n.h;
29
29
  // rows なし storage は title + divider のみで render されるため、 default h=240 では空白過大。
30
- // title block (130px) + bottom padding (20px) = 150px に縮める。
30
+ //
31
+ // 上下の余白を揃える (#586)。 実測で 150 のとき上 21 / 下 55.9 と下だけ 35 空いていた。
32
+ // 字の高さ 73.2 に上の余白 21 を上下ぶん足して 115 にする。
31
33
  const 印あり = n.rowMarks !== undefined;
32
34
  const 呼び名の分 = 印あり && n.subtitle ? SUBTITLE_ROW_SHIFT : 0;
33
- if (!n.rows || n.rows.length === 0) return 150 + 呼び名の分;
35
+ if (!n.rows || n.rows.length === 0) return 115 + 呼び名の分;
34
36
  const 必要 = requiredRowsHeight("storage", n.rows.length) ?? defaultH;
35
37
  // 行頭の印を持つ箱は **中身の足し算だけ** で高さを決める (#578)。 下限を残すと、行が
36
38
  // 1 つしか無い箱が 4 行の箱と同じ高さになり、下が空いたまま並ぶ。
@@ -17,35 +17,35 @@ export const TOKENS = {
17
17
 
18
18
  // node sizes (kind ごと、 unified row h は engine が max() で算出)
19
19
  node: {
20
- actor: { w: 340, h: 200 },
21
- function: { w: 380, h: 170 },
20
+ actor: { w: 340, h: 165 },
21
+ function: { w: 380, h: 151 },
22
22
  storage: { w: 400, h: 240 },
23
- event: { w: 360, h: 200 },
23
+ event: { w: 360, h: 156 },
24
24
  card: { w: 320, h: 150 },
25
25
  // 人系
26
- person: { w: 280, h: 180 },
27
- "user-group": { w: 320, h: 180 },
28
- admin: { w: 280, h: 180 },
29
- developer: { w: 280, h: 180 },
30
- "external-user": { w: 300, h: 180 },
26
+ person: { w: 280, h: 116 },
27
+ "user-group": { w: 320, h: 116 },
28
+ admin: { w: 280, h: 116 },
29
+ developer: { w: 280, h: 116 },
30
+ "external-user": { w: 300, h: 116 },
31
31
  // インフラ
32
- database: { w: 320, h: 200 },
33
- cache: { w: 280, h: 160 },
34
- queue: { w: 340, h: 140 },
35
- "message-bus": { w: 380, h: 140 },
32
+ database: { w: 320, h: 172 },
33
+ cache: { w: 280, h: 116 },
34
+ queue: { w: 340, h: 116 },
35
+ "message-bus": { w: 380, h: 116 },
36
36
  cloud: { w: 320, h: 180 },
37
- cdn: { w: 320, h: 160 },
37
+ cdn: { w: 320, h: 116 },
38
38
  // アプリ系
39
- service: { w: 320, h: 180 },
40
- api: { w: 320, h: 160 },
41
- frontend: { w: 320, h: 180 },
42
- backend: { w: 320, h: 180 },
43
- webhook: { w: 320, h: 160 },
44
- microservice: { w: 320, h: 180 },
39
+ service: { w: 320, h: 116 },
40
+ api: { w: 320, h: 116 },
41
+ frontend: { w: 320, h: 116 },
42
+ backend: { w: 320, h: 116 },
43
+ webhook: { w: 320, h: 116 },
44
+ microservice: { w: 320, h: 116 },
45
45
  // データ / 判定
46
- signer: { w: 300, h: 180 },
47
- oracle: { w: 320, h: 180 },
48
- "merkle-tree": { w: 340, h: 220 },
46
+ signer: { w: 300, h: 116 },
47
+ oracle: { w: 320, h: 116 },
48
+ "merkle-tree": { w: 340, h: 116 },
49
49
  decision: { w: 300, h: 180 },
50
50
  // Chart 系 (CAR-994 Phase A) ... 1 node に datum 配列を持ち、 kind 内で SVG geometry 描画。
51
51
  // 実際の w/h は preset chart() が w/h override で指定 (default fallback は preset 未指定時のみ)。