@cardenelabs/cdl 0.23.0 → 0.25.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/CHANGELOG.md CHANGED
@@ -5,6 +5,109 @@ CDL (Chainome Diagram Language) の主要変更履歴。
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.25.0] - 2026-09-03
9
+
10
+ ### Added
11
+
12
+ - **表の箱に 1 行おきの縞を敷けるようにした** (#1553)
13
+
14
+ ER 図は小さい字が密に並ぶので、行を横に追う時の目印が無い。
15
+ `id` の右端にある `bigint` がどの行のものか、目で辿り直すことになる。
16
+
17
+ 色を増やさずに、面を 1 行おきに変えて追えるようにする。
18
+ 色数を足して分ける形は 9 回試して全て外れており、増やすほど図が散らかった。
19
+
20
+ `rowStripe` を `CdlNode` に足し、`er` が設計の形 (`columns` を書いた実体) で立てた
21
+ 実体に既定で敷く。 `er({ rowStripe: false })` で切れる。
22
+
23
+ **クラス図には敷かない**。 同じ `storage` を使うが、持ち物と振る舞いは行頭の印
24
+ (四角と山形) で既に分かれている。 縞を足すと手掛かりが 3 つになる。
25
+
26
+ 縞の位置は `rowStripeBand` が行の baseline から導く。
27
+ 縞だけが自前の定数を持つと、行送りを変えた時に字だけ動いて縞が取り残される。
28
+ 呼び名で行の塊が下がる箱では、描画側が行に足すのと同じ値を帯にも足す。
29
+
30
+ 帯は baseline を挟む。 上端を baseline に置くと字が帯の上へはみ出す。
31
+
32
+ 箱の下端をまたぐ縞は描かない。 行数と箱の高さは独立に決まるので、行が多い図では
33
+ 最後の行が箱の外に来る。
34
+
35
+ 色は `--cdl-row-stripe` を読み、無ければ `--cdl-label-bg` に落ちる。
36
+ 消費側が縞と札の下地を別に決めたくなった時に、engine を変えずに分けられる。
37
+
38
+ - **図に別の配色を名指しできるようにした** (#1553)
39
+
40
+ `palette` を `CdlDiagram` と `diagram()` と `er()` に足し、
41
+ `data-cdl-palette` として舞台の `<svg>` に出す。
42
+
43
+ **cdl は色の値を持たない**。 名前を markup に出すだけで、実際の値は消費側
44
+ (dragon の theme 等) が名前を見て決める。 値を engine に持たせると、
45
+ 消費側が配色を変えるたびに engine の release が要る。
46
+
47
+ 空文字は書かなかった扱いにする = 空の目印を出すと、消費側の `[data-cdl-palette]` が
48
+ 配色を書いていない図にも当たる。
49
+
50
+ 遮断は `layout` 1 箇所に置く。 描画は必ず組み立てを通るので、
51
+ 組み立て API と `er` は素通しにしてある。 上流にも置くと、どの入力でも通らない分岐が残る。
52
+
53
+ ## [0.24.0] - 2026-09-02
54
+
55
+ ### Added
56
+
57
+ - **見せ方を持つ箱に目印を出すようにした** (#620)
58
+
59
+ `#616` で足した `look` が消費側の画面に出なかった。 dragon の `cdl-theme.css` が
60
+ `node-body > rect` の `fill` を `!important` で固定しており、`look` が決めた面
61
+ (`none` / 薄い面 / 墨のベタ) が全て既定の面に潰れていた。
62
+
63
+ 消費側は「見せ方を持つ箱」 と「持たない箱」 を区別できない。 markup に手掛かりが無かった。
64
+
65
+ `look` を持つ kind の箱に `data-cdl-look` を出す。 持たない kind には出さない
66
+ (空文字を出すと消費側の `:not()` が効かなくなる)。
67
+
68
+ - **辺に役目を持たせ、順路を朱で引けるようにした** (#618)
69
+
70
+ 辺の見せ方が 1 通りしかなく、太さも名前の置き方も図の役目に関わらず同じだった。
71
+ `infra-demo` は「要求が通る道」 と「App が持つ預け先」 の 2 種を持つが、どちらも同じ線で
72
+ 描かれ、どこから読むかが決まらない。
73
+
74
+ | 足したもの | 既定 | 書くと |
75
+ |---|---|---|
76
+ | `role: "main"` | tone の色 | 「いま」 の色 (`--cdl-now`) で引く |
77
+ | `labelPlate: false` | 丸い下地を敷く | 字だけを線の上に置く |
78
+
79
+ 線の太さの既定を下げた (光って 5 → 2.5、光らず 2.5 → 1.25)。
80
+ 消費側 (dragon) が `!important` で 2.25 に上書きしており、箱の枠 (1.75) より太かった。
81
+
82
+ **値は 3 層を通る**。 `InfraConnection` (書き手の入口) → `edge()` (基底の組立て) →
83
+ `CdlEdge` (描く側) のすべてに足さないと、設定しても何も起きない。
84
+ 当初 1 層目だけに足して黙って落ちた。
85
+
86
+ - **箱の見せ方を色でなく形で選べるようにした** (#616)
87
+
88
+ 箱の見せ方が全種別で同じで、違いは枠線の色と右上の絵記号だけだった。
89
+ 色で種別を分ける形は、消費側の配色によっては読めない。 dragon の茶墨は種別の色が
90
+ 4 つとも暗く彩度が低く、枠線の面積では差が出ない (隔たりは 18.6 以上あるが効かない)。
91
+
92
+ `KindStyle` に `look` を足し、面と枠の描き方を 5 通りから選べるようにした。
93
+
94
+ | `look` | 描き方 | 何を示すか | 当てた種別 |
95
+ |---|---|---|---|
96
+ | `outline` | 面を塗らず枠だけ | 図の外にある | `person` |
97
+ | `tint` | 文字色 6% の面 | 通り道 | `cdn` |
98
+ | `solid` | 文字色のベタ + 紙色の字 | ここが働く | `service` |
99
+ | `ledger` | 面 + 底に二重の罫 | 消えては困る | `queue` |
100
+ | `dashed` | 面を塗らず破線の枠 | 作り直せる | `cache` |
101
+
102
+ 未指定は従来どおりで、`look` を書いた 5 種別だけが変わる。
103
+
104
+ **`ledger` は四角の箱にだけ効く**。 円筒や雲は形そのものが役目を示しており、底の罫を
105
+ 足す場所が無い。 `database` は円筒なので当てていない。
106
+
107
+ **ベタ塗りでも枠は種別の色のまま**。 「光っている節の枠は種別の色」 は既存の契約で、
108
+ `node-styling` が守っている。 面だけを墨で塗る。
109
+
110
+
8
111
  ## [0.23.0] - 2026-09-02
9
112
 
10
113
  ### Added
@@ -1185,7 +1288,8 @@ Initial OSS release.
1185
1288
  使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
1186
1289
  行き止まりになる。
1187
1290
 
1188
- [Unreleased]: https://github.com/cardene777/cdl/compare/v0.23.0...HEAD
1291
+ [Unreleased]: https://github.com/cardene777/cdl/compare/v0.24.0...HEAD
1292
+ [0.24.0]: https://github.com/cardene777/cdl/compare/v0.23.0...v0.24.0
1189
1293
  [0.23.0]: https://github.com/cardene777/cdl/compare/v0.22.0...v0.23.0
1190
1294
  [0.22.0]: https://github.com/cardene777/cdl/compare/v0.21.2...v0.22.0
1191
1295
  [0.21.2]: https://github.com/cardene777/cdl/compare/v0.21.1...v0.21.2
package/dist/index.cjs CHANGED
@@ -9493,6 +9493,8 @@ function diagram(id, options) {
9493
9493
  tone: opts.tone ?? "accent",
9494
9494
  side: opts.side,
9495
9495
  style: opts.style,
9496
+ role: opts.role,
9497
+ labelPlate: opts.labelPlate,
9496
9498
  head: opts.head,
9497
9499
  headFill: opts.headFill,
9498
9500
  tailHead: opts.tailHead,
@@ -11482,6 +11484,8 @@ function diagram(id, options) {
11482
11484
  topic: options.topic,
11483
11485
  // 既定 (extract) は省略して JSON 形状を変えない。 exclude を明示した図だけ持たせる。
11484
11486
  ...options.structuredData === "exclude" ? { structuredData: "exclude" } : {},
11487
+ // 配色の名前は素通しする。 空文字の遮断は `layout` が持つ (後段が必ず通るため)
11488
+ ...options.palette !== void 0 ? { palette: options.palette } : {},
11485
11489
  // inputs / formulas / scrollTriggers / eventBindings は空なら省略 (static diagram の JSON 形状維持)
11486
11490
  ...inputs.length > 0 ? { inputs: [...inputs] } : {},
11487
11491
  ...formulas.length > 0 ? { formulas: [...formulas] } : {},
@@ -11792,6 +11796,12 @@ function rowBaselineY(kind, index) {
11792
11796
  if (!rendersRows(kind)) return null;
11793
11797
  return kind === "storage" ? ROW_TOP_STORAGE + index * ROW_PITCH_STORAGE : ROW_TOP_GENERIC + genericTextShift(kind) + index * ROW_PITCH_GENERIC;
11794
11798
  }
11799
+ function rowStripeBand(kind, index, shift) {
11800
+ const baseline = rowBaselineY(kind, index);
11801
+ if (baseline === null) return null;
11802
+ const pitch = ROW_PITCH_STORAGE ;
11803
+ return { y: baseline + shift - pitch / 2, h: pitch };
11804
+ }
11795
11805
  function genericTextShift(kind) {
11796
11806
  return KINDS_SHAPE_CYLINDER.has(kind ?? "") ? GENERIC_TEXT_SHIFT_CYLINDER : 0;
11797
11807
  }
@@ -20256,6 +20266,12 @@ function layout(diag) {
20256
20266
  ...diag.derived ? { derived: diag.derived } : {},
20257
20267
  // 矢印をいつ出すか (#582)。 描き手が読む欄なので、そのまま持ち越す
20258
20268
  ...diag.edgeReveal ? { edgeReveal: diag.edgeReveal } : {},
20269
+ // どの配色で描くか (#1553)。 空文字は書かなかった扱いにする = 空の目印を出すと、
20270
+ // 消費側の `[data-cdl-palette]` が配色を書いていない図にも当たる。
20271
+ //
20272
+ // **遮断はここだけに置く**。 描画は必ず組み立てを通り、組み立て API も `er` も
20273
+ // 素通しにしてある。 上流にも置くと、どの入力でも通らない分岐が残る
20274
+ ...diag.palette ? { palette: diag.palette } : {},
20259
20275
  bboxes,
20260
20276
  collisions,
20261
20277
  nearCollisions,
@@ -21979,6 +21995,12 @@ function edgeHeadPaint(head, fill, color) {
21979
21995
  }
21980
21996
  return { fill: color, stroke: "none" };
21981
21997
  }
21998
+ function defaultEdgeWidth(active) {
21999
+ return active ? 2.5 : 1.25;
22000
+ }
22001
+ function edgeColor(edge) {
22002
+ return edge.role === "main" ? "var(--cdl-now, #c0421f)" : toneColor(edge.tone);
22003
+ }
21982
22004
  function opacityAttr(opacity) {
21983
22005
  return opacity < 1 ? opacity : void 0;
21984
22006
  }
@@ -21992,7 +22014,7 @@ function CdlEdgeView({
21992
22014
  progress,
21993
22015
  stateValues
21994
22016
  }) {
21995
- const color = toneColor(edge.tone);
22017
+ const color = edgeColor(edge);
21996
22018
  const \u7AEF\u306E\u540D\u524D = (h, f) => {
21997
22019
  const \u5F62 = h ?? EDGE_HEAD_DEFAULT;
21998
22020
  if (\u5F62 === "none") return void 0;
@@ -22082,7 +22104,7 @@ function SolidEdgePath({
22082
22104
  stateValues
22083
22105
  }) {
22084
22106
  const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
22085
- const defaultWidth = active ? 5 : 2.5;
22107
+ const defaultWidth = defaultEdgeWidth(active);
22086
22108
  const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
22087
22109
  const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
22088
22110
  const boundDashOffset = edge.dashOffsetBind && stateValues ? resolveNumericAttr(edge.dashOffsetBind, stateValues, 0) : void 0;
@@ -22159,7 +22181,7 @@ function CdlEdgeGlowView({
22159
22181
  active
22160
22182
  }) {
22161
22183
  if (!active) return null;
22162
- const color = toneColor(edge.tone);
22184
+ const color = edgeColor(edge);
22163
22185
  return /* @__PURE__ */ jsxRuntime.jsx(EdgeGlowCircles, { color, edgeId: edge.id });
22164
22186
  }
22165
22187
  function CdlEdgeLabelView({
@@ -22167,7 +22189,7 @@ function CdlEdgeLabelView({
22167
22189
  active
22168
22190
  }) {
22169
22191
  if (!hasRenderedLabel(edge)) return null;
22170
- const color = toneColor(edge.tone);
22192
+ const color = edgeColor(edge);
22171
22193
  const bbox = computeLabelBBoxWorld(edge);
22172
22194
  const boxW = bbox.w;
22173
22195
  const boxH = bbox.h;
@@ -22185,7 +22207,7 @@ function CdlEdgeLabelView({
22185
22207
  "data-cdl-edge-label-text": edge.label,
22186
22208
  "data-cdl-edge-sub-text": edge.sub ?? "",
22187
22209
  children: [
22188
- /* @__PURE__ */ jsxRuntime.jsx(
22210
+ edge.labelPlate !== false && /* @__PURE__ */ jsxRuntime.jsx(
22189
22211
  "rect",
22190
22212
  {
22191
22213
  "data-cdl-role": "edge-label-bg",
@@ -22801,6 +22823,25 @@ function StorageNode({
22801
22823
  strokeWidth: active ? 3 : 1.25
22802
22824
  }
22803
22825
  ),
22826
+ node.rowStripe && rows.map((_, idx) => {
22827
+ if (idx % 2 !== 0) return null;
22828
+ const \u5E2F = rowStripeBand("storage", idx, \u884C\u306E\u4E0B\u3052);
22829
+ if (!\u5E2F) return null;
22830
+ if (\u5E2F.y + \u5E2F.h > node.h) return null;
22831
+ return /* @__PURE__ */ jsxRuntime.jsx(
22832
+ "rect",
22833
+ {
22834
+ "data-cdl-role": "node-row-stripe",
22835
+ "data-cdl-row-index": idx,
22836
+ x: 1,
22837
+ y: \u5E2F.y,
22838
+ width: node.w - 2,
22839
+ height: \u5E2F.h,
22840
+ fill: "var(--cdl-row-stripe, var(--cdl-label-bg, #f3f4f6))"
22841
+ },
22842
+ `stripe-${idx}`
22843
+ );
22844
+ }),
22804
22845
  node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
22805
22846
  \u5370\u3067\u5206\u3051\u308B && node.subtitle && // 呼び名は **印で分ける箱でだけ** 出す (#578)。 従来の箱は題の下に区切り線が来るので
22806
22847
  // 置き場が無い
@@ -22908,9 +22949,29 @@ function StorageNode({
22908
22949
  })
22909
22950
  ] });
22910
22951
  }
22952
+ var TINT_FILL = "color-mix(in srgb, var(--cdl-text, #1a1f2a) 6%, transparent)";
22953
+ function lookPaint(look, accent, active) {
22954
+ const \u65E2\u5B9A\u67A0 = active ? accent : "var(--cdl-divider, #d4d4d8)";
22955
+ const \u65E2\u5B9A\u592A\u3055 = active ? 3 : 1.25;
22956
+ switch (look) {
22957
+ case "outline":
22958
+ return { fill: "none", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
22959
+ case "tint":
22960
+ return { fill: TINT_FILL, stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
22961
+ case "solid":
22962
+ return { fill: "var(--cdl-text, #1a1f2a)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: true };
22963
+ case "ledger":
22964
+ return { fill: "var(--cdl-node-fill, #ffffff)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
22965
+ case "dashed":
22966
+ return { fill: "none", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, dash: "6 4", onSolid: false };
22967
+ default:
22968
+ return { fill: "var(--cdl-node-fill, #ffffff)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
22969
+ }
22970
+ }
22911
22971
  var STYLES = {
22912
22972
  // 人系
22913
22973
  person: {
22974
+ look: "outline",
22914
22975
  accent: "var(--cdl-tone-accent, #2d6a8f)",
22915
22976
  eyebrowColor: "var(--cdl-tone-accent, #2d6a8f)",
22916
22977
  icon: "M12 12c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm0 2c-2.7 0-8 1.3-8 4v2h16v-2c0-2.7-5.3-4-8-4z"
@@ -22943,11 +23004,13 @@ var STYLES = {
22943
23004
  shape: "cylinder"
22944
23005
  },
22945
23006
  cache: {
23007
+ look: "dashed",
22946
23008
  accent: "var(--cdl-tone-warning, #a67a2e)",
22947
23009
  eyebrowColor: "var(--cdl-tone-warning, #a67a2e)",
22948
23010
  icon: "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
22949
23011
  },
22950
23012
  queue: {
23013
+ look: "ledger",
22951
23014
  accent: "var(--cdl-tone-warning, #a67a2e)",
22952
23015
  eyebrowColor: "var(--cdl-tone-warning, #a67a2e)",
22953
23016
  icon: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z"
@@ -22964,12 +23027,14 @@ var STYLES = {
22964
23027
  shape: "cloud"
22965
23028
  },
22966
23029
  cdn: {
23030
+ look: "tint",
22967
23031
  accent: "var(--cdl-tone-info, #5a8ec1)",
22968
23032
  eyebrowColor: "var(--cdl-tone-info, #5a8ec1)",
22969
23033
  icon: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
22970
23034
  },
22971
23035
  // アプリ系
22972
23036
  service: {
23037
+ look: "solid",
22973
23038
  accent: "var(--cdl-tone-teal, #2f8770)",
22974
23039
  eyebrowColor: "var(--cdl-tone-teal, #2f8770)",
22975
23040
  icon: "M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"
@@ -23041,6 +23106,7 @@ function GenericNode({
23041
23106
  const w = node.w;
23042
23107
  const h = node.h;
23043
23108
  const shape = style.shape ?? "rect";
23109
+ const paint = lookPaint(style.look, style.accent, active);
23044
23110
  const shapeEl = (() => {
23045
23111
  if (shape === "cylinder") {
23046
23112
  const rx = w / 2;
@@ -23098,19 +23164,23 @@ function GenericNode({
23098
23164
  circles.map((c, i) => /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: c.cx, cy: c.cy, r: c.r - (active ? 1.5 : 0.75), fill: "var(--cdl-node-fill, #ffffff)" }, `mask-${i}`))
23099
23165
  ] });
23100
23166
  }
23101
- return /* @__PURE__ */ jsxRuntime.jsx(
23102
- "rect",
23103
- {
23104
- x: 0,
23105
- y: 0,
23106
- width: w,
23107
- height: h,
23108
- rx: 18,
23109
- fill: "var(--cdl-node-fill, #ffffff)",
23110
- stroke: active ? style.accent : "var(--cdl-divider, #d4d4d8)",
23111
- strokeWidth: active ? 3 : 1.25
23112
- }
23113
- );
23167
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23168
+ /* @__PURE__ */ jsxRuntime.jsx(
23169
+ "rect",
23170
+ {
23171
+ x: 0,
23172
+ y: 0,
23173
+ width: w,
23174
+ height: h,
23175
+ rx: 18,
23176
+ fill: paint.fill,
23177
+ stroke: paint.stroke,
23178
+ strokeWidth: paint.strokeWidth,
23179
+ strokeDasharray: paint.dash
23180
+ }
23181
+ ),
23182
+ style.look === "ledger" && /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 1, y1: h - 7, x2: w - 1, y2: h - 7, stroke: paint.stroke, strokeWidth: 1 })
23183
+ ] });
23114
23184
  })();
23115
23185
  const resolvedValue = value !== void 0 ? interpolate(value, stateValues) : void 0;
23116
23186
  const hasRows = (node.rows?.length ?? 0) > 0;
@@ -23133,56 +23203,64 @@ function GenericNode({
23133
23203
  const iconX = centered ? w / 2 + 40 : w - 48;
23134
23204
  const iconY = centered ? h / 2 - 44 - \u7D75\u306E\u82AF : 18 + cylinderShift;
23135
23205
  const dominantBaseline = centered ? "middle" : void 0;
23136
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x} ${y})`, "data-cdl-role": "node-body", children: [
23137
- shapeEl,
23138
- /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${iconX} ${iconY}) scale(1)`, "data-cdl-role": "node-kind-icon", children: [
23139
- /* @__PURE__ */ jsxRuntime.jsx("rect", { width: 24, height: 24, fill: "transparent" }),
23140
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
23141
- ] }),
23142
- node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: eyebrowY, fontSize: 17, fontWeight: 700, letterSpacing: 1.5, fill: style.eyebrowColor, textAnchor, dominantBaseline, children: node.eyebrow }),
23143
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: textX, y: titleY, fontSize: 20, fontWeight: 700, fill: "var(--cdl-text, #1a1f2a)", textAnchor, dominantBaseline, style: node.kind === "function" || node.kind === "api" ? { fontFamily: "'JetBrains Mono', monospace" } : void 0, children: node.title }),
23144
- node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: subtitleY, fontSize: 17, fill: "var(--cdl-text-dim, #5a6270)", textAnchor, dominantBaseline, style: { fontFamily: "'JetBrains Mono', monospace" }, children: node.subtitle }),
23145
- resolvedValue && /* @__PURE__ */ jsxRuntime.jsx(
23146
- "text",
23147
- {
23148
- x: w - 20,
23149
- y: h - 24,
23150
- fontSize: 32,
23151
- fontWeight: 700,
23152
- textAnchor: "end",
23153
- fill: "var(--cdl-text, #1a1f2a)",
23154
- style: { fontFamily: "'JetBrains Mono', monospace" },
23155
- children: resolvedValue
23156
- }
23157
- ),
23158
- node.rows && node.rows.length > 0 && (() => {
23159
- const resolved = node.rows.map((row) => interpolate(row, stateValues));
23160
- const splits = resolved.map(splitRow);
23161
- const leftMaxWidth = splits.reduce(
23162
- (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
23163
- 0
23164
- );
23165
- const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
23166
- return /* @__PURE__ */ jsxRuntime.jsx("g", { children: splits.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(0 ${rowBaselineY(node.kind, i)})`, children: [
23167
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-row", "data-cdl-row-index": i, x: ROW_PAD_X_PX, y: 0, fontSize: 18, fill: "var(--cdl-text-dim, #5a6270)", children: s.left }),
23168
- /* @__PURE__ */ jsxRuntime.jsx(
23206
+ return /* @__PURE__ */ jsxRuntime.jsxs(
23207
+ "g",
23208
+ {
23209
+ transform: `translate(${x} ${y})`,
23210
+ "data-cdl-role": "node-body",
23211
+ "data-cdl-look": style.look,
23212
+ children: [
23213
+ shapeEl,
23214
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${iconX} ${iconY}) scale(1)`, "data-cdl-role": "node-kind-icon", children: [
23215
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: 24, height: 24, fill: "transparent" }),
23216
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
23217
+ ] }),
23218
+ node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: eyebrowY, fontSize: 17, fontWeight: 700, letterSpacing: 1.5, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : style.eyebrowColor, textAnchor, dominantBaseline, children: node.eyebrow }),
23219
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: textX, y: titleY, fontSize: 20, fontWeight: 700, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text, #1a1f2a)", textAnchor, dominantBaseline, style: node.kind === "function" || node.kind === "api" ? { fontFamily: "'JetBrains Mono', monospace" } : void 0, children: node.title }),
23220
+ node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: subtitleY, fontSize: 17, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text-dim, #5a6270)", textAnchor, dominantBaseline, style: { fontFamily: "'JetBrains Mono', monospace" }, children: node.subtitle }),
23221
+ resolvedValue && /* @__PURE__ */ jsxRuntime.jsx(
23169
23222
  "text",
23170
23223
  {
23171
- "data-cdl-role": "node-row",
23172
- "data-cdl-row-index": i,
23173
- x: rightColX,
23174
- y: 0,
23175
- fontSize: 21,
23224
+ x: w - 20,
23225
+ y: h - 24,
23226
+ fontSize: 32,
23176
23227
  fontWeight: 700,
23177
- textAnchor: "start",
23228
+ textAnchor: "end",
23178
23229
  fill: "var(--cdl-text, #1a1f2a)",
23179
23230
  style: { fontFamily: "'JetBrains Mono', monospace" },
23180
- children: s.right
23231
+ children: resolvedValue
23181
23232
  }
23182
- )
23183
- ] }, i)) });
23184
- })()
23185
- ] });
23233
+ ),
23234
+ node.rows && node.rows.length > 0 && (() => {
23235
+ const resolved = node.rows.map((row) => interpolate(row, stateValues));
23236
+ const splits = resolved.map(splitRow);
23237
+ const leftMaxWidth = splits.reduce(
23238
+ (m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
23239
+ 0
23240
+ );
23241
+ const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
23242
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { children: splits.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(0 ${rowBaselineY(node.kind, i)})`, children: [
23243
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-row", "data-cdl-row-index": i, x: ROW_PAD_X_PX, y: 0, fontSize: 18, fill: "var(--cdl-text-dim, #5a6270)", children: s.left }),
23244
+ /* @__PURE__ */ jsxRuntime.jsx(
23245
+ "text",
23246
+ {
23247
+ "data-cdl-role": "node-row",
23248
+ "data-cdl-row-index": i,
23249
+ x: rightColX,
23250
+ y: 0,
23251
+ fontSize: 21,
23252
+ fontWeight: 700,
23253
+ textAnchor: "start",
23254
+ fill: "var(--cdl-text, #1a1f2a)",
23255
+ style: { fontFamily: "'JetBrains Mono', monospace" },
23256
+ children: s.right
23257
+ }
23258
+ )
23259
+ ] }, i)) });
23260
+ })()
23261
+ ]
23262
+ }
23263
+ );
23186
23264
  }
23187
23265
  var MARK_INNER_RATIO = 0.56;
23188
23266
  var RING_WIDTH_ACTIVE = 6;
@@ -29611,6 +29689,7 @@ function CdlStage({
29611
29689
  "aria-label": buildDiagramAltText(laid.topic, currentPhase),
29612
29690
  "data-cdl-stage": "",
29613
29691
  "data-cdl-scale": diagramScale === 1 ? void 0 : diagramScale,
29692
+ "data-cdl-palette": laid.palette,
29614
29693
  children: [
29615
29694
  /* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
29616
29695
  Object.entries(TONE).flatMap(
@@ -30484,7 +30563,8 @@ var ER_CARDINALITY_HEAD = {
30484
30563
  function er(preset) {
30485
30564
  const entityW = resolveStorageBoxW(preset.entityWidth, "er", "entityWidth");
30486
30565
  const tone = preset.defaultTone ?? "info";
30487
- const b = diagram(preset.id, { topic: preset.topic });
30566
+ const \u7E1E\u3092\u6577\u304F = preset.rowStripe ?? true;
30567
+ const b = diagram(preset.id, { topic: preset.topic, palette: preset.palette });
30488
30568
  const entities = [];
30489
30569
  const phaseActivate = [];
30490
30570
  let relIdx = 0;
@@ -30520,7 +30600,10 @@ function er(preset) {
30520
30600
  ...\u8A2D\u8A08\u306E\u5F62 ? {} : { eyebrow: "\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3" },
30521
30601
  ...\u8A2D\u8A08\u306E\u5F62 && e.subtitle ? { subtitle: e.subtitle } : {},
30522
30602
  rows,
30523
- ...\u8A2D\u8A08\u306E\u5F62 ? { rowMarks: \u5370 } : {}
30603
+ ...\u8A2D\u8A08\u306E\u5F62 ? { rowMarks: \u5370 } : {},
30604
+ // 縞は設計の形だけに敷く (#1553)。 `rows` を直接書いた古い形は行頭の印を持たず、
30605
+ // 群の区切りも線で表しているので、縞を足すと手掛かりが 3 つになる
30606
+ ...\u8A2D\u8A08\u306E\u5F62 && \u7E1E\u3092\u6577\u304F ? { rowStripe: true } : {}
30524
30607
  });
30525
30608
  entities.push(e.id);
30526
30609
  phaseActivate.push(e.id);
@@ -30711,6 +30794,8 @@ function infrastructure(preset) {
30711
30794
  ...c.sub ? { sub: c.sub } : {},
30712
30795
  tone: c.tone ?? tone,
30713
30796
  style: c.style ?? style,
30797
+ ...c.role ? { role: c.role } : {},
30798
+ ...c.labelPlate === void 0 ? {} : { labelPlate: c.labelPlate },
30714
30799
  labelOffsetX: c.labelOffsetX ?? 0,
30715
30800
  labelOffsetY: c.labelOffsetY ?? 0
30716
30801
  });