@cardenelabs/dragon 0.28.0 → 0.32.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.
Files changed (66) hide show
  1. package/README.md +391 -16
  2. package/dist/index.cjs +13479 -7403
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +2360 -208
  5. package/dist/index.d.ts +2360 -208
  6. package/dist/index.js +13462 -7405
  7. package/dist/index.js.map +1 -1
  8. package/package.json +12 -13
  9. package/src/compile/actor-ids.ts +297 -0
  10. package/src/compile/actor-option-notice.ts +379 -0
  11. package/src/compile/actors.ts +103 -0
  12. package/src/compile/c4.ts +74 -0
  13. package/src/compile/chain.ts +93 -0
  14. package/src/compile/chart-fields.ts +193 -0
  15. package/src/compile/deep-rewrite.ts +30 -0
  16. package/src/compile/derived-source.ts +18 -0
  17. package/src/compile/direction.ts +102 -0
  18. package/src/compile/edge-option-notice.ts +112 -0
  19. package/src/compile/er-relation.ts +200 -0
  20. package/src/compile/flow.ts +54 -0
  21. package/src/compile/flowchart.ts +344 -0
  22. package/src/compile/funnel.ts +87 -0
  23. package/src/compile/gantt.ts +337 -0
  24. package/src/compile/generic.ts +696 -0
  25. package/src/compile/hierarchy.ts +92 -0
  26. package/src/compile/journey.ts +93 -0
  27. package/src/compile/kinds.ts +148 -0
  28. package/src/compile/lanes.ts +138 -0
  29. package/src/compile/metro.ts +271 -0
  30. package/src/compile/mind.ts +393 -0
  31. package/src/compile/node-title.ts +24 -0
  32. package/src/compile/notice.ts +141 -0
  33. package/src/compile/order.ts +62 -0
  34. package/src/compile/parts-lookup.ts +17 -0
  35. package/src/compile/parts.ts +2709 -0
  36. package/src/compile/placement-apply.ts +689 -0
  37. package/src/compile/placement.ts +15 -0
  38. package/src/compile/quadrant.ts +265 -0
  39. package/src/compile/record.ts +75 -0
  40. package/src/compile/row-marks.ts +128 -0
  41. package/src/compile/rows.ts +40 -0
  42. package/src/compile/sequence.ts +305 -0
  43. package/src/compile/slug.ts +37 -0
  44. package/src/compile/stages.ts +247 -0
  45. package/src/compile/subtitle.ts +35 -0
  46. package/src/compile/swimlane-marks.ts +87 -0
  47. package/src/compile/swimlane.ts +82 -0
  48. package/src/compile/timeline.ts +213 -0
  49. package/src/compile/topology.ts +44 -0
  50. package/src/compile/tree.ts +69 -0
  51. package/src/compile/value-chart.ts +337 -0
  52. package/src/compile/values.ts +432 -0
  53. package/src/compile/word-state.ts +82 -0
  54. package/src/compile.ts +1806 -6971
  55. package/src/focus.ts +2 -2
  56. package/src/index.ts +42 -9
  57. package/src/json-line-map.ts +30 -0
  58. package/src/json-parser.ts +1760 -168
  59. package/src/keywords.ts +251 -17
  60. package/src/near-name.ts +42 -0
  61. package/src/notation-lint.ts +41 -64
  62. package/src/relative-pos.ts +71 -2
  63. package/src/schema.ts +1 -1
  64. package/src/schemas/diagram.json +680 -23
  65. package/src/types.ts +337 -36
  66. package/src/v05/parser.ts +2553 -354
package/dist/index.d.cts CHANGED
@@ -1,6 +1,124 @@
1
- import { NodeKind, Tone, CdlDiagram, EdgeStyle, EdgeHead, EdgeHeadFill, ClassRelationType, SequenceMessageKind, EdgeReveal, RelationFocus, LaidDiagram } from '@cardenelabs/cdl';
1
+ import { LegendMark, NodeKind, Tone, CdlNode, BarCornerRadii, CdlDiagram, CdlLegendItem, RowWell, EdgeStyle, EdgeHead, EdgeHeadFill, ClassRelationType, SequenceMessageKind, EdgeReveal, RelationFocus, LaidDiagram } from '@cardenelabs/cdl';
2
2
  export { CdlDiagram } from '@cardenelabs/cdl';
3
3
 
4
+ /**
5
+ * Text DSL i18n キーワード一覧
6
+ * 日本語 / 英語両対応 (大文字小文字無視)
7
+ */
8
+
9
+ /**
10
+ * 図の並ぶ向き (`direction:`、 #1494)。
11
+ *
12
+ * 縦列 (`lane`) は横、段 (`stack`) は縦に置かれるので、向きは「1 つの縦列に積む」 か
13
+ * 「1 人ずつ縦列を作る」 かの選択になる。 どちらも組み立て側に既にある経路で、
14
+ * 記法から名指しできる言葉が無かった。
15
+ */
16
+ declare const DIRECTIONS: readonly ["縦", "横"];
17
+ type DslDirection = (typeof DIRECTIONS)[number];
18
+ /**
19
+ * 向きの別名。 色 (`色` / `color` / `tone`) と同じく日本語と英語の両方で書ける。
20
+ *
21
+ * 正規の語を鍵にも入れておく = 引く側が別名かどうかを気にせず 1 度で解決できる。
22
+ */
23
+ declare const DIRECTION_ALIAS: Record<string, DslDirection>;
24
+ /**
25
+ * 箱を並べる順 (`order:`、 #2655)。
26
+ *
27
+ * 書かなければ **書いた順** のまま。 `種類` と書くと箱の種類で並べ替えてから置く。
28
+ *
29
+ * これは図の型として持っていた差を語に出したもの。 並べ替えの鍵しか持たない型
30
+ * (`solidity`) が在り、`compile.ts` は「順序図 または その型」 という条件を 6 か所で
31
+ * 書いていた。 **型が 1 つ増えるたびに条件を 2 つ並べる形**になるので、差が並べ替えだけなら
32
+ * 型ではなく語で表す。
33
+ */
34
+ declare const ORDERS: readonly ["種類"];
35
+ type DslOrder = (typeof ORDERS)[number];
36
+ /**
37
+ * 並び順の別名。 向きと同じく日本語と英語の両方で書ける。
38
+ *
39
+ * 正規の語を鍵にも入れておく = 引く側が別名かどうかを気にせず 1 度で解決できる。
40
+ */
41
+ declare const ORDER_ALIAS: Record<string, DslOrder>;
42
+ /**
43
+ * 数を描く図の形 (`shape:`、 #2657)。
44
+ *
45
+ * 数の書き方 (`- 名前: "45"` の 1 行 1 値) は 9 つとも同じで、違うのは描かれる形だけ。
46
+ * 差が形だけなので型ではなく語で表す (並べ替えの語 #2655 と同じ判断)。
47
+ *
48
+ * **日本語の別名は持たない**。 いま `type:` に書く語が英語なので、語を移した先で
49
+ * 書き手が覚える綴りが増えない形にする。
50
+ */
51
+ declare const SHAPES: readonly ["pie", "bar", "line", "gauge", "radial", "stat", "waffle", "stacked", "slope"];
52
+ type DslShape = (typeof SHAPES)[number];
53
+ /** 泳法図の形 (`shape:`、 #2797)。 後続の形も chart と混ぜずここへ足す。 */
54
+ declare const SWIMLANE_SHAPES: readonly ["stages", "metro", "timeline"];
55
+ type DslSwimlaneShape = (typeof SWIMLANE_SHAPES)[number];
56
+ /** 最上位の `shape:` が取り得る語。 図種ごとの集合は `DIAGRAM_SHAPES` が決める。 */
57
+ type DslDiagramShape = DslShape | DslSwimlaneShape;
58
+ /**
59
+ * `shape:` を選べる図種と、その図種で書ける語 (#2797)。
60
+ *
61
+ * 解析・組み立て・schema の照合はこの表から導く。 集合を別々の場所で対応付けると、形を
62
+ * 足した時に一方だけが古くなり、同じ語が入口によって通ったり落ちたりする。
63
+ */
64
+ declare const DIAGRAM_SHAPES: {
65
+ readonly chart: readonly ["pie", "bar", "line", "gauge", "radial", "stat", "waffle", "stacked", "slope"];
66
+ readonly swimlane: readonly ["stages", "metro", "timeline"];
67
+ };
68
+ /** 全図種の `shape:` の語。 図種を決める前の読み取りと schema の照合に使う。 */
69
+ declare const ALL_DIAGRAM_SHAPES: readonly DslDiagramShape[];
70
+ /**
71
+ * 図の意匠 (`theme:`、 #1553 / #2790 / #2791 / #2792 / #2793 / #2794 / #2795 / #2796)。
72
+ *
73
+ * cdl は色を持たない (形だけを描く)。 名前を `data-cdl-palette` として markup に出すので、
74
+ * dragon の `cdl-theme.css` がその名前を見て 9 つの口
75
+ * (台 / 行の面 / 縞 / 枠 / 字 / 型名 / 線 / 所有 / 向きだけ) に色を当てる。
76
+ *
77
+ * **名前を自由文字列にしない**。 書き間違えると既定の色みのまま出るので、書き手には
78
+ * 「効かない」 としか見えない。 語を絞れば読めない語をその場で知らせられる。
79
+ */
80
+ declare const THEMES: readonly ["kinari", "celadon", "blueprint", "letterpress", "catalog", "terminal", "sketch", "neon", "relief"];
81
+ type DslTheme = (typeof THEMES)[number];
82
+ /**
83
+ * 意匠の別名 (#2790 / #2791 / #2792 / #2793 / #2794 / #2795 / #2796)。 向きと同じく日本語と英語の両方で書ける。
84
+ *
85
+ * `kinari` = 生成りに茶、 `celadon` = 青磁に墨、 `blueprint` = 図面、 `letterpress` = 活版、
86
+ * `catalog` = 図録、 `terminal` = 端末、 `sketch` = 手描き、 `neon` = 電飾、 `relief` = 浮彫。
87
+ *
88
+ * record は用途を一つに決められないため既定の意匠を持たない。UML クラス図に生成り色が要る時も
89
+ * 書き手が `theme:` を明記する。
90
+ */
91
+ declare const THEME_ALIAS: Record<string, DslTheme>;
92
+ /** 書いた意匠を正規の語に直す。 読めない語は `null`。 */
93
+ declare function resolveTheme(s: string): DslTheme | null;
94
+ /** 凡例の印の日本語名を描画側の名前へ直す表。 */
95
+ declare const LEGEND_MARK_ALIAS: Readonly<Record<string, LegendMark>>;
96
+ /** 凡例の印を描画側の名前へ直す。 読めない語は `null`。 */
97
+ declare function resolveLegendMark(s: string): LegendMark | null;
98
+ /**
99
+ * 意匠から字の測り方を引く (#2818 / #2918)。
100
+ *
101
+ * 意匠を替えても骨組みを変えず、端末の等幅字も箱へ収めるため、比例・等幅の広い方で測る。
102
+ * 公開済みの関数なので窓口を残し、どの意匠でも組み立てと同じ値を返す。
103
+ */
104
+ declare function 意匠の字の測り方(_theme: DslTheme): "widest";
105
+ /** 意匠と節から、見本に合わせた円の区画間の弧の長さを引く (#2871)。 */
106
+ declare function 意匠の円の区画の間(theme: DslTheme, node: Pick<CdlNode, "kind">): number | undefined;
107
+ /** `barCornerRadii` が効く棒を描く節か。 */
108
+ declare function 棒を描く節か(node: Pick<CdlNode, "kind" | "funnelForm">): boolean;
109
+ /**
110
+ * 意匠と節から、見本に合わせた棒の 4 隅の丸みを引く (#2863)。
111
+ *
112
+ * 手描きの見本は楕円の角 (`10px 14px 6px 12px / 14px 8px 12px 6px`) だが、cdl は
113
+ * 円の角だけを持つため、各隅の横と縦の平均を丸めて 12 / 11 / 9 / 9 とする。
114
+ * 生成りと青磁には見本が無いため値を返さず、記法で組み立てた形を保つ。
115
+ */
116
+ declare function 意匠の棒の角(theme: DslTheme, node: Pick<CdlNode, "kind" | "funnelForm">): BarCornerRadii | undefined;
117
+ /** NodeKind 別名 (日本語 → English) */
118
+ declare const NODE_KIND_ALIAS: Record<string, NodeKind>;
119
+ /** Tone 別名 */
120
+ declare const TONE_ALIAS: Record<string, Tone>;
121
+
4
122
  /**
5
123
  * Text DSL v0.5 parser
6
124
  *
@@ -58,9 +176,34 @@ type V05ParseResult = {
58
176
  * 書くと、項目を足した時に案内か一覧のどちらかが取り残される (実際に `states` / `values` が
59
177
  * 一覧に 1 件も無い状態で放置されていた)。
60
178
  */
61
- declare const TOP_LEVEL_KEYS: readonly ["title", "type", "actors", "flow", "states", "values", "animation", "viewport", "lanes", "groups", "eyebrow", "axes", "readouts", "inputs", "formulas", "events", "scrolls", "bands", "reveal", "relations", "direction", "palette"];
179
+ declare const TOP_LEVEL_KEYS: readonly ["title", "type", "actors", "flow", "states", "values", "animation", "viewport", "lanes", "groups", "eyebrow", "axes", "regions", "readouts", "inputs", "formulas", "events", "scrolls", "bands", "reveal", "relations", "direction", "order", "shape", "form", "ticks", "ganttToday", "ganttTickLabels", "ganttBarEnd", "ganttBarThickness", "chartSeriesSkipMuted", "chartLineSeries", "chartPieCenterLabel", "chartPieTableColumns", "chartPieRingWidth", "chartSlopePeriods", "chartSlopeEmphasisIds", "chartSlopeUnit", "chartStackedPeriods", "chartStackedRateId", "chartStackedLegendPosition", "chartGaugeValue", "chartWaffleLegendPosition", "funnelForm", "funnelRate", "quadrantPointLabelSide", "treeNodeForm", "treeSize", "treeEdgeTone", "treeEdgeHead", "mindForm", "mindSize", "journeyForm", "journeyLineForm", "journeyLabels", "journeySize", "sequenceActorForm", "sequenceLabelForm", "sequenceReturnHead", "sequenceKindLabels", "sequenceRowGap", "sequenceGutter", "sequenceBandWidth", "sequenceSelfLoop", "figureCard", "figureSize", "terminalDecoration", "cornerForm", "figureKindLabel", "figureInset", "chartBarSize", "chartBarShape", "chartLineSize", "chartPieSize", "chartWaffleSize", "chartSlopeLabelTemplate", "chartSlopeSize", "chartStackedLayout", "chartGaugeSize", "ganttSize", "quadrantLabelPosition", "quadrantSize", "stageLayout", "theme", "legend", "legendOffset", "legendFontSize", "edgeEndGap", "stageHeader"];
62
180
  /** 受け付ける図種。 記法一覧はここを見る。 */
63
181
  declare const PRESET_TYPES: ReadonlySet<PresetType>;
182
+ /**
183
+ * 図種の別名 (#2655 / #2657)。
184
+ *
185
+ * **差が語 1 つしかない図種を、畳んだ先の型とその語に読み替える**。
186
+ *
187
+ * | 古い綴り | 読み替え先 | 差 |
188
+ * |---|---|---|
189
+ * | `solidity` | `sequence` + `order: 種類` | 箱を種類で並べ替えるだけで、独自の組み立てを持たない |
190
+ * | 数を描く 9 つ | `chart` + `shape: <綴り>` | 同じ組み立て関数に渡す文字列 2 つしか違わない |
191
+ *
192
+ * 型として持つと、同じ扱いをする条件と表が型の数だけ増える。 `solidity` は
193
+ * 「順序図 または その型」 という条件を 12 か所に増やし、数を描く 9 つは 4 つの表に
194
+ * 同じ値の行を 9 行ずつ並べていた (足す人が 1 か所書き忘れると黙って外れる)。
195
+ *
196
+ * **読み替えは読み取りの入口 1 か所に閉じる**。 ここを通った後は古い綴りが
197
+ * どこにも残らないので、組み立て側は畳んだ先の型として 1 通りに扱える。
198
+ *
199
+ * 古い名前で書いた記法はそのまま動く = 別名を消すのは別の回にする。
200
+ */
201
+ type 読み替え先 = {
202
+ type: PresetType;
203
+ order?: DslOrder;
204
+ shape?: DslShape;
205
+ };
206
+ declare const TYPE_ALIASES: ReadonlyMap<string, 読み替え先>;
64
207
  /**
65
208
  * 記法だけが持つ種類。 描画側には無いが、 図種ごとの組み立てで意味を持つ。
66
209
  *
@@ -71,18 +214,16 @@ declare const PRESET_TYPES: ReadonlySet<PresetType>;
71
214
  * 図の組み立てが落ちる = 描画側は知らない種類の大きさを引けない (#1420 で実測、
72
215
  * `Cannot read properties of undefined (reading 'h')`)。
73
216
  */
74
- declare const DSL_ONLY_KINDS: readonly ["entity", "state", "contract", "eoa", "multisig", "proxy", "library", "interface"];
217
+ declare const DSL_ONLY_KINDS: readonly ["entity", "state", "contract", "eoa", "multisig", "proxy", "library", "interface", "loop"];
75
218
  /** 記法だけが持つ種類。 描画側の `NodeKind` には含まれない */
76
219
  type DslOnlyKind = (typeof DSL_ONLY_KINDS)[number];
77
220
  /**
78
- * 受け付ける箱の種類。 描画できる種類 (cdl の `NODE_KINDS`) に、 記法だけが持つ種類を足す。
221
+ * 記法が受理する種類の全体。 これに載っていない種類は見本 (パーツ) の候補になる。
79
222
  *
80
- * 以前は手書きの 31 種だった。 描画できる 90 種のうち 78 種が記法から書けず、 部品名として
81
- * 扱われて「そんな部品は無い」 と警告が出るだけだった。 描画側を出所に加えることで
223
+ * 描画できる種類 (cdl の `NODE_KINDS`) に、 記法だけが持つ種類と基盤の別名を足す。
224
+ * 手書きの一覧だった頃は、 描画側に種類が増えても記法から書けず、 部品名として扱われて
225
+ * 「そんな部品は無い」 と警告が出るだけだった。 描画側を出所に加えることで
82
226
  * 「描画できるものは書ける」 が成立する。
83
- */
84
- /**
85
- * 記法が受理する種類の全体。 これに載っていない種類は見本 (パーツ) の候補になる。
86
227
  *
87
228
  * 画面側が「本文が見本を使っているか」 を判定するのに使う (#1022)。 手書きの一覧を
88
229
  * 別に持つと、種類が増えた時にそちらだけ取り残されて余分な読み込みが起きる。
@@ -136,48 +277,18 @@ declare const PHASE_ITEM_WORDS: readonly ["focus", "badge", "body", "description
136
277
  *
137
278
  * いまは語と図種が同じ綴りだが、**同じものとして扱わない**。 語は書き手が書く名前で、
138
279
  * 図種は `type:` が取る値。 片方だけ別名を足したくなった時に、対応が表に残っている形にする。
280
+ *
281
+ * **数を描く図は形まで指す** (#2657)。 9 つの型を `chart` 1 つに畳んだので、型だけを
282
+ * 指すと `draw: pie` を棒の図に書いても咎められなくなる = 語ごとの相手を型から形へ
283
+ * 下ろして、畳む前と同じ細かさで判定する。
139
284
  */
140
- declare const DRAW_TARGETS: ReadonlyMap<string, PresetType>;
285
+ declare const DRAW_TARGETS: ReadonlyMap<string, {
286
+ type: PresetType;
287
+ shape?: DslShape;
288
+ }>;
141
289
  /** `draw:` に書ける語。 表から導く (#1314) */
142
290
  declare const DRAW_WORDS: ReadonlySet<string>;
143
291
 
144
- /**
145
- * Text DSL i18n キーワード一覧
146
- * 日本語 / 英語両対応 (大文字小文字無視)
147
- */
148
-
149
- /**
150
- * 図の並ぶ向き (`direction:`、 #1494)。
151
- *
152
- * 縦列 (`lane`) は横、段 (`stack`) は縦に置かれるので、向きは「1 つの縦列に積む」 か
153
- * 「1 人ずつ縦列を作る」 かの選択になる。 どちらも組み立て側に既にある経路で、
154
- * 記法から名指しできる言葉が無かった。
155
- */
156
- declare const DIRECTIONS: readonly ["縦", "横"];
157
- type DslDirection = (typeof DIRECTIONS)[number];
158
- /**
159
- * 向きの別名。 色 (`色` / `color` / `tone`) と同じく日本語と英語の両方で書ける。
160
- *
161
- * 正規の語を鍵にも入れておく = 引く側が別名かどうかを気にせず 1 度で解決できる。
162
- */
163
- declare const DIRECTION_ALIAS: Record<string, DslDirection>;
164
- /**
165
- * 図の配色 (`palette:`、 #1553)。
166
- *
167
- * cdl は色を持たない (形だけを描く)。 名前を `data-cdl-palette` として markup に出すので、
168
- * dragon の `cdl-theme.css` がその名前を見て 7 つの口 (台 / 行の面 / 縞 / 枠 / 字 / 型名 / 線)
169
- * に色を当てる。
170
- *
171
- * **名前を自由文字列にしない**。 書き間違えると既定の色みのまま出るので、書き手には
172
- * 「効かない」 としか見えない。 語を絞れば読めない語をその場で知らせられる。
173
- */
174
- declare const PALETTES: readonly ["kinari", "celadon"];
175
- type DslPalette = (typeof PALETTES)[number];
176
- /** NodeKind 別名 (日本語 → English) */
177
- declare const NODE_KIND_ALIAS: Record<string, NodeKind>;
178
- /** Tone 別名 */
179
- declare const TONE_ALIAS: Record<string, Tone>;
180
-
181
292
  /**
182
293
  * 位置を他の要素からの相対で書くための解決。
183
294
  *
@@ -191,8 +302,19 @@ declare const TONE_ALIAS: Record<string, Tone>;
191
302
  * 2 つあるため、 解決の規則は本 file に 1 つだけ置いて両方から呼ぶ。 片方だけ直すと画面が
192
303
  * 直らない事故を、 規則を共有することで構造的に防ぐ。
193
304
  */
194
- /** 基準からどちら側に置くか。 */
195
- type RelativeDirection = "right" | "left" | "above" | "below";
305
+ /**
306
+ * 基準からどちら側に置くか。
307
+ *
308
+ * 語の一覧は下の `RELATIVE_DIRECTIONS` が持つ。 型を並べ直さず、一覧から導く。
309
+ */
310
+ type RelativeDirection = (typeof RELATIVE_DIRECTIONS)[number];
311
+ /**
312
+ * 向きとして受ける語の一覧。
313
+ *
314
+ * 読み取りの入口が 2 つある (本文の `位置: Web の右 200` と JSON の `posRel.dir`) ため、
315
+ * 一覧を 1 箇所に置いて両方から引く。 2 度書くと、向きを足した時に片方だけが取り残される。
316
+ */
317
+ declare const RELATIVE_DIRECTIONS: readonly ["right", "left", "above", "below"];
196
318
  /** 相対で書かれた位置の指定。 */
197
319
  type RelativePos = {
198
320
  /** 基準にする相手の名前。 `actors:` に書かれた名前をそのまま持つ。 */
@@ -277,8 +399,16 @@ type DslNodeKind = NodeKind | DslOnlyKind;
277
399
  * 写して持つと欄が増えた時にずれる。 指した先が変われば型検査が教える。
278
400
  */
279
401
  type DslDynShape = NonNullable<CdlDiagram["nodes"][number]["shape"]>;
280
- /** 値を見せる部品 (#1374)。 図形と同じ理由で描画側の型をそのまま使う */
281
- type DslReadout = NonNullable<CdlDiagram["readouts"]>[number];
402
+ /**
403
+ * 値を見せる部品 (#1374)。 図形と同じ理由で描画側の型をそのまま使う。
404
+ *
405
+ * `pos` は書いた行 (#2405)。 読む元の名前を突き合わせた知らせが、直す行を指すのに使う。
406
+ * **図へ載せる時に外す** (`compile.ts` の読み取り値を載せる所) = 残すと、行を足しただけで
407
+ * 組み上がる図が変わる。 JSON から読んだ文書は行を持たないため `undefined` になる。
408
+ */
409
+ type DslReadout = NonNullable<CdlDiagram["readouts"]>[number] & {
410
+ pos?: Position;
411
+ };
282
412
  /** 読む人が動かすつまみ (#1389)。 部品と同じ理由で描画側の型をそのまま使う */
283
413
  type DslInput = NonNullable<CdlDiagram["inputs"]>[number];
284
414
  /** つまみの値から決まる値 (#1391)。 描画側の型に、知らせ用の記述位置だけを足す。 */
@@ -315,7 +445,27 @@ type DslEventBinding = {
315
445
  handlerId: string;
316
446
  pos: Position;
317
447
  };
318
- type PresetType = "sequence" | "flow" | "swimlane" | "er" | "state" | "topology" | "solidity" | "gantt" | "class" | "pie" | "bar" | "line" | "gauge" | "radial" | "stat" | "waffle" | "stacked" | "slope" | "funnel" | "tree" | "journey" | "quadrant" | "c4" | "mind";
448
+ type PresetType = "sequence" | "flow" | "flowchart" | "swimlane"
449
+ /**
450
+ * 箱が行を持ち、箱どうしが関係を持つ図 (#2782)。
451
+ *
452
+ * 畳む前は `er` / `state` / `class` の 3 つに分かれていたが、描画側へ渡す形は同じだった。
453
+ * 箱はいずれも `storage`、行頭の印はいずれも 形 (四角 / 山形) × 塗り (塗る / 中空) の
454
+ * 2 軸で、違うのはその軸を何と呼ぶかだけだった (`pk` / `fk` / `opt` と
455
+ * `entry` / `exit` / `do` / `internal`)。
456
+ *
457
+ * dragon の語は 3 つ (`鍵` / `外` / `条件`) で、印の 3 軸と 1 対 1 に対応する。
458
+ * 古い語は読み取りの入口でこの 3 語へ読み替える (`compile/row-marks.ts` の `行頭の語の別名`)。
459
+ */
460
+ | "record" | "topology" | "gantt"
461
+ /**
462
+ * 数を描く図 (#2657)。 形は `shape:` が決める。
463
+ *
464
+ * 畳む前は形ごとに 9 つの型 (`pie` / `bar` / …) を持っていたが、書き方も組み立ても
465
+ * 同じで、渡す文字列 2 つしか違わなかった。 古い綴りは読み替えの入口で この型と
466
+ * 形の語の組に読み替える。
467
+ */
468
+ | "chart" | "funnel" | "tree" | "journey" | "quadrant" | "c4" | "mind";
319
469
  type Position = {
320
470
  line: number;
321
471
  column?: number;
@@ -343,6 +493,159 @@ type LayoutMode = "auto" | "manual";
343
493
  type DslDocument = {
344
494
  title: string;
345
495
  type: PresetType;
496
+ /** 円グラフの見せ方。 読めない語も組み立ての知らせにするため、入口では文字列で保持する。 */
497
+ form?: string;
498
+ /** `form` を書いた行。 */
499
+ formPos?: Position;
500
+ /** ガントチャートの目盛り。 書かなければ工程の始まりから作る従来の規則を使う。 */
501
+ ticks?: string[];
502
+ /** `ticks` を書いた行。 */
503
+ ticksPos?: Position;
504
+ /** ガントチャートの今日の線の位置と札。 */
505
+ ganttToday?: {
506
+ index: number;
507
+ label: string;
508
+ };
509
+ /** 工程の端とは独立して描く目盛り名。 */
510
+ ganttTickLabels?: string[];
511
+ /** 帯の終わりを位置として扱う。 */
512
+ ganttBarEnd?: "position";
513
+ /** 行の字に対して見本の比で細くする。 */
514
+ ganttBarThickness?: "thin";
515
+ /** 図表の系列色で `muted` の項目を数えない。 */
516
+ chartSeriesSkipMuted?: NonNullable<CdlDiagram["nodes"][number]["chartSeriesSkipMuted"]>;
517
+ /** 折れ線の複数系列。 */
518
+ chartLineSeries?: NonNullable<CdlDiagram["nodes"][number]["chartLineSeries"]>;
519
+ /** 円の中心で合計の下に置く字。 */
520
+ chartPieCenterLabel?: NonNullable<CdlDiagram["nodes"][number]["chartPieCenterLabel"]>;
521
+ /** 円の表に置く列。 */
522
+ chartPieTableColumns?: NonNullable<CdlDiagram["nodes"][number]["chartPieTableColumns"]>;
523
+ /** 円の輪の太さ。 */
524
+ chartPieRingWidth?: NonNullable<CdlDiagram["nodes"][number]["chartPieRingWidth"]>;
525
+ /** 傾き図の左右の時点名。 */
526
+ chartSlopePeriods?: NonNullable<CdlDiagram["nodes"][number]["chartSlopePeriods"]>;
527
+ /** 傾き図で主役にする項目の id。 */
528
+ chartSlopeEmphasisIds?: NonNullable<CdlDiagram["nodes"][number]["chartSlopeEmphasisIds"]>;
529
+ /** 傾き図の値に付ける単位。 */
530
+ chartSlopeUnit?: NonNullable<CdlDiagram["nodes"][number]["chartSlopeUnit"]>;
531
+ /** 内訳の帯の期間。 */
532
+ chartStackedPeriods?: NonNullable<CdlDiagram["nodes"][number]["chartStackedPeriods"]>;
533
+ /** 内訳の帯の右に率を描く項目の id。 */
534
+ chartStackedRateId?: NonNullable<CdlDiagram["nodes"][number]["chartStackedRateId"]>;
535
+ /** 内訳の帯の凡例の位置。 */
536
+ chartStackedLegendPosition?: NonNullable<CdlDiagram["nodes"][number]["chartStackedLegendPosition"]>;
537
+ /** 半円を固定の尺で読む値。 */
538
+ chartGaugeValue?: NonNullable<CdlDiagram["nodes"][number]["chartGaugeValue"]>;
539
+ /** 升目の一覧を置く側。 */
540
+ chartWaffleLegendPosition?: NonNullable<CdlDiagram["nodes"][number]["chartWaffleLegendPosition"]>;
541
+ /** 漏斗の形。 */
542
+ funnelForm?: NonNullable<CdlDiagram["nodes"][number]["funnelForm"]>;
543
+ /** 漏斗に描く率。 */
544
+ funnelRate?: NonNullable<CdlDiagram["nodes"][number]["funnelRate"]>;
545
+ /** 座標で置いた四象限の点の名前を置く側。 */
546
+ quadrantPointLabelSide?: NonNullable<CdlDiagram["nodes"][number]["quadrantPointLabelSide"]>;
547
+ /** 木の箱を根まで同じ枠で描くか。 */
548
+ treeNodeForm?: NonNullable<CdlDiagram["nodes"][number]["treeNodeForm"]>;
549
+ /** 木の札・字・枝間の寸法。 */
550
+ treeSize?: NonNullable<CdlDiagram["nodes"][number]["treeSize"]>;
551
+ /** 木の枝色を 1 色にするか、段ごとに分けるか。 */
552
+ treeEdgeTone?: NonNullable<CdlDiagram["nodes"][number]["treeEdgeTone"]>;
553
+ /** 木の枝先の印。 */
554
+ treeEdgeHead?: NonNullable<CdlDiagram["nodes"][number]["treeEdgeHead"]>;
555
+ /** 放射の中心・枝・葉を、面か輪郭のどちらで描くか。 */
556
+ mindForm?: NonNullable<CdlDiagram["nodes"][number]["mindForm"]>;
557
+ /** 放射の札・字・枝間の寸法。 */
558
+ mindSize?: NonNullable<CdlDiagram["nodes"][number]["mindSize"]>;
559
+ /** ジャーニーの段を帯か罫で描くか。 */
560
+ journeyForm?: NonNullable<CdlDiagram["nodes"][number]["journeyForm"]>;
561
+ /** ジャーニーの点を曲線か直線で結ぶか。 */
562
+ journeyLineForm?: NonNullable<CdlDiagram["nodes"][number]["journeyLineForm"]>;
563
+ /** ジャーニーの 5 段に描く名前。 */
564
+ journeyLabels?: NonNullable<CdlDiagram["nodes"][number]["journeyLabels"]>;
565
+ /** ジャーニーの描画面と点列の左右余白。 */
566
+ journeySize?: NonNullable<CdlDiagram["nodes"][number]["journeySize"]>;
567
+ /** 図表の見出し帯と足。 */
568
+ figureCard?: NonNullable<CdlDiagram["nodes"][number]["figureCard"]>;
569
+ /** 端末意匠用の窓操作・字送り・行番号。 */
570
+ terminalDecoration?: NonNullable<CdlDiagram["nodes"][number]["terminalDecoration"]>;
571
+ /** 矩形札の一様角と手描き角を意匠で選ぶ。 */
572
+ cornerForm?: NonNullable<CdlDiagram["nodes"][number]["cornerForm"]>;
573
+ /** 階層図とマインドマップの種類札。 */
574
+ figureKindLabel?: NonNullable<CdlDiagram["nodes"][number]["figureKindLabel"]>;
575
+ /** 図表札の見出しと足の間に置く飾りの凹み面。 */
576
+ figureInset?: {
577
+ top?: number;
578
+ right?: number;
579
+ bottom?: number;
580
+ left?: number;
581
+ radius?: number;
582
+ };
583
+ /** 棒グラフの見本寸法。 */
584
+ chartBarSize?: NonNullable<CdlDiagram["nodes"][number]["chartBarSize"]>;
585
+ /** 棒グラフの棒を分割するか、上だけ丸めて一体にするか。 */
586
+ chartBarShape?: NonNullable<CdlDiagram["nodes"][number]["chartBarShape"]>;
587
+ /** 折れ線グラフの見本寸法。 */
588
+ chartLineSize?: NonNullable<CdlDiagram["nodes"][number]["chartLineSize"]>;
589
+ /** 円グラフの見本寸法。 */
590
+ chartPieSize?: NonNullable<CdlDiagram["nodes"][number]["chartPieSize"]>;
591
+ /** 升目図の左端と升目の送り。 */
592
+ chartWaffleSize?: NonNullable<CdlDiagram["nodes"][number]["chartWaffleSize"]>;
593
+ /** 傾き図の左右の札の書式。 */
594
+ chartSlopeLabelTemplate?: NonNullable<CdlDiagram["nodes"][number]["chartSlopeLabelTemplate"]>;
595
+ /** 傾き図の見本寸法。 */
596
+ chartSlopeSize?: NonNullable<CdlDiagram["nodes"][number]["chartSlopeSize"]>;
597
+ /** 内訳の帯の見本配置。 */
598
+ chartStackedLayout?: NonNullable<CdlDiagram["nodes"][number]["chartStackedLayout"]>;
599
+ /** 半円図の見本寸法。 */
600
+ chartGaugeSize?: NonNullable<CdlDiagram["nodes"][number]["chartGaugeSize"]>;
601
+ /** ガント図の見本寸法。 */
602
+ ganttSize?: NonNullable<CdlDiagram["nodes"][number]["ganttSize"]>;
603
+ /** 四象限の区画名を置く位置。 */
604
+ quadrantLabelPosition?: NonNullable<CdlDiagram["nodes"][number]["quadrantLabelPosition"]>;
605
+ /** 四象限の見本寸法。 */
606
+ quadrantSize?: NonNullable<CdlDiagram["nodes"][number]["quadrantSize"]>;
607
+ /**
608
+ * 図全体を 1 箱にする図種の札の大きさ。
609
+ *
610
+ * `viewport` は図全体の画布なので分ける。`width` / `height` は既存の viewport と lane の
611
+ * 綴りに揃え、描画側だけが使う短い `w` / `h` を記法へ漏らさない。
612
+ */
613
+ figureSize?: {
614
+ width: number;
615
+ height: number;
616
+ };
617
+ /** 図の下へ指定順に置く凡例。 */
618
+ legend?: CdlLegendItem[];
619
+ /** 図全体の凡例の位置を既定位置からずらす。 */
620
+ legendOffset?: NonNullable<CdlDiagram["legendOffset"]>;
621
+ /** 線の両端と発着する箱の縁との隙間。 */
622
+ edgeEndGap?: NonNullable<CdlDiagram["edgeEndGap"]>;
623
+ /** 順序図の参加者を枠で囲む。 */
624
+ sequenceActorForm?: "box";
625
+ /** 順序図の段へ種類印と種類名を添える。 */
626
+ sequenceLabelForm?: "kind";
627
+ /** 順序図の返す言づてにも塗った三角の矢じりを使う。 */
628
+ sequenceReturnHead?: "solid";
629
+ /** 順序図の言づての段の間。 */
630
+ sequenceRowGap?: number;
631
+ /** 順序図の左の札の列幅。 */
632
+ sequenceGutter?: number;
633
+ /** 順序図の動いている間の帯幅。 */
634
+ sequenceBandWidth?: number;
635
+ /** 順序図の自分へ戻る線の形と寸法。 */
636
+ sequenceSelfLoop?: {
637
+ form?: "orthogonal";
638
+ width?: number;
639
+ drop?: number;
640
+ };
641
+ /** 順序図の種類名の表示語。 */
642
+ sequenceKindLabels?: Partial<Record<"call" | "return" | "fire", string>>;
643
+ /** 図の凡例の字の大きさ。 */
644
+ legendFontSize?: number;
645
+ /** 段の箱で全意匠に共通して使う見出しの寸法。 */
646
+ stageHeader?: DslStageHeader;
647
+ /** 段の列幅・列間と戻る線の迂回寸法。 */
648
+ stageLayout?: NonNullable<CdlDiagram["stageLayout"]>;
346
649
  /**
347
650
  * 図全体を 1 箱にする図種 (`pie` / `bar` / `line` / `funnel` / `tree` / `journey` /
348
651
  * `quadrant` / `mind` / `gantt`) で、 その箱の上に出す小見出し (#1247)。
@@ -369,6 +672,14 @@ type DslDocument = {
369
672
  axes?: DslAxes;
370
673
  /** `axes` を書いた行 (#1251)。 知らせの行番号に使う */
371
674
  axesPos?: Position;
675
+ /**
676
+ * 2 軸で仕分ける図の区画の名前 (#2667)。
677
+ *
678
+ * `axes` が軸の両端の名前を持つのに対し、こちらは区画の中に出す名前を持つ。
679
+ * 軸の掛け合わせ (`効果が大きい × 手間が小さい`) から一段離れた言い方
680
+ * (`すぐやる`) を書くための欄。
681
+ */
682
+ regions?: DslRegions;
372
683
  actors: DslActor[];
373
684
  flow: DslStep[];
374
685
  animate?: DslAnimate;
@@ -402,14 +713,14 @@ type DslDocument = {
402
713
  * 既定 (`off`) は何もしない。 `hover` と書くと、箱に触れた時に その箱 ・ 繋がる線 ・
403
714
  * 相手の箱だけが光り、他が沈む。 描き手の `CdlDiagram.relationFocus` にそのまま渡る。
404
715
  *
405
- * クラス図と ER 図は **順番を持たない** 図で、段を追う見せ方は「どの順で読ませるか」 しか
716
+ * UML の関係や表の関係を描く record は **順番を持たない** 図で、段を追う見せ方は「どの順で読ませるか」 しか
406
717
  * 運ばない。 触れた箱の関係を光らせれば、読み手の問いにその場で答えられる。
407
718
  */
408
719
  relations?: RelationFocus;
409
720
  /**
410
721
  * 図の並ぶ向き (`direction:`、 #1494)。
411
722
  *
412
- * `縦` は 1 つの縦列に積み、`横` は 1 人ずつ縦列を作る。 効くのは流れ図と泳法図だけで、
723
+ * `縦` は 1 つの縦列に積み、`横` は 1 人ずつ縦列を作る。 効くのはフローと泳法図だけで、
413
724
  * 他の図種は並び方そのものが読み方を担うため書いても効かない (知らせを出す)。
414
725
  *
415
726
  * 全ての箱が縦列を書いた形では、書いた縦列が勝つ (同じく知らせを出す)。
@@ -420,15 +731,39 @@ type DslDocument = {
420
731
  line: number;
421
732
  };
422
733
  /**
423
- * 図の配色 (`palette:`、 #1553)。
734
+ * 箱を並べる順 (`order:`、 #2655)。
735
+ *
736
+ * 書かなければ書いた順のまま。 `種類` と書くと箱の種類で並べ替えてから置く。
737
+ * 効くのは順序図だけで、他の図種は並び方そのものが読み方を担うため書いても効かない
738
+ * (知らせを出す)。
739
+ *
740
+ * 並べ替えの鍵しか持たない図種 (`solidity`) を畳んだ先。 読み取りの入口で
741
+ * 順序図 + この語 に読み替えるので、古い名前で書いた記法はそのまま動く。
742
+ */
743
+ order?: DslOrder;
744
+ /** `order:` を書いた行。 効かない時の知らせで、書いた場所を指すために持つ */
745
+ orderPos?: {
746
+ line: number;
747
+ };
748
+ /** 図種ごとに選ぶ形 (#2657 / #2797)。 書ける語は `DIAGRAM_SHAPES` が決める */
749
+ shape?: DslDiagramShape;
750
+ /** `shape:` を書いた行。 効かない時の知らせで、書いた場所を指すために持つ */
751
+ shapePos?: {
752
+ line: number;
753
+ };
754
+ /**
755
+ * 図の意匠 (`theme:`、 #1553 / #2790)。
424
756
  *
425
757
  * 名前だけを持つ。 実際の色は消費側 (`cdl-theme.css`) が決めるので、ここには値を書かない。
426
- * ER 図とクラス図は書かなくても `kinari` (生成りに茶) になる。 どちらも箱の作りが同じ
427
- * (行頭の印 + 左に名前 + 右に型) で、名前と型が離れて並ぶため、行を横に追う目印
428
- * (行の縞) が要る。 縞の色は配色からしか来ないので、既定が無いと縞が箱の面と同じ色に
429
- * 落ちて 1 本も出ない。 書き手が `palette:` を書いた時はそちらが勝つ。
758
+ * `palette:` も同じ意匠を書く別名として読む。record の用途は一つに決められないため、
759
+ * UML クラス図の生成り色が要る時も本文で明記する。
430
760
  */
431
- palette?: DslPalette;
761
+ theme?: DslTheme;
762
+ /** `theme:` と別名の `palette:` を両方書いた時の行 (#2790)。 */
763
+ themeAlsoPalettePos?: {
764
+ themeLine: number;
765
+ paletteLine: number;
766
+ };
432
767
  groups?: Record<string, DslGroup>;
433
768
  /**
434
769
  * 値を見せる部品 (`readouts:`、 #1374)。 割合の輪や数え上げを図の脇に出す。
@@ -477,11 +812,32 @@ type DslAxes = {
477
812
  x?: {
478
813
  left?: string;
479
814
  right?: string;
480
- };
815
+ label?: never;
816
+ direction?: never;
817
+ } | DslAxisDirection;
481
818
  y?: {
482
819
  bottom?: string;
483
820
  top?: string;
484
- };
821
+ label?: never;
822
+ direction?: never;
823
+ } | DslAxisDirection;
824
+ };
825
+ /** 端の名前ではなく、向き付きの軸名を 1 つだけ描く形。 */
826
+ type DslAxisDirection = {
827
+ label: string;
828
+ direction: true;
829
+ };
830
+ /**
831
+ * 2 軸で仕分ける図の区画の名前 (#2667)。
832
+ *
833
+ * 欄の名前は描画側の区画の綴りに揃える。 記法では `左上` のような語で書き、
834
+ * 解析の時にここへ直す = 区画を指す語を 2 通り持たないため。
835
+ */
836
+ type DslRegions = {
837
+ topLeft?: string;
838
+ topRight?: string;
839
+ bottomLeft?: string;
840
+ bottomRight?: string;
485
841
  };
486
842
  /** 登場人物 (v0.5+ ... inline option 拡張) */
487
843
  type DslActor = {
@@ -498,6 +854,38 @@ type DslActor = {
498
854
  kindWritten?: boolean;
499
855
  /** v0.5+ inline option */
500
856
  subtitle?: string;
857
+ /** kind の意味を保ったまま共通の部品箱で描く。 */
858
+ kindForm?: "icon";
859
+ /** 共通の部品箱へ描く線画。 */
860
+ icon?: "person" | "box" | "database" | "lightning" | "cloud" | "terminal";
861
+ /** 行を持たない表の箱で行の代わりに描く注記。 */
862
+ emptyRowsNote?: string;
863
+ /** 表の箱の名前と小見出しを中央へ揃える。 */
864
+ titleAlign?: "center";
865
+ /** 表の箱の行の間に罫線を引く。 */
866
+ rowRules?: boolean;
867
+ /** 表の箱の行へ交互の縞を敷く。 */
868
+ rowStripe?: boolean;
869
+ /** 表の箱の題と行の baseline。 */
870
+ rowLayout?: NonNullable<CdlDiagram["nodes"][number]["rowLayout"]>;
871
+ /** 表の箱の見出し下の線を左右端まで引く。 */
872
+ rowDividerForm?: "full";
873
+ /** 表の箱の行のまとまりを収める透明な面。 */
874
+ rowWell?: RowWell;
875
+ /** 表の箱の行頭の印を色の段で分ける。 */
876
+ rowMarkForm?: "tone";
877
+ /** 表の箱を内側へ抱える親の表の箱の名前。 */
878
+ nestIn?: string;
879
+ /** 表または共通の部品箱の足。 */
880
+ figureCard?: NonNullable<CdlDiagram["nodes"][number]["figureCard"]>;
881
+ /** 路線図の駅名を駅の上下どちらへ置くか。 */
882
+ stationNamePosition?: "bottom";
883
+ /** 時間軸の担当を札のどちらへ置くか。 */
884
+ subtitlePlacement?: "right";
885
+ /** 流れ図の function の札の題の大きさ。 */
886
+ titleFontSize?: number;
887
+ /** 流れ図の始まり・終わりの印と次の箱との間。 */
888
+ markGap?: number;
501
889
  eyebrow?: string;
502
890
  value?: string;
503
891
  /**
@@ -518,7 +906,10 @@ type DslActor = {
518
906
  * `entry` / `exit` / `do` / `internal`。 印の 2 軸 (形 × 塗り) は共通だが、その軸が
519
907
  * 何を指すかは種類ごとに違う。
520
908
  */
521
- marks?: string[];
909
+ marks?: Array<string | {
910
+ mark: string;
911
+ tone?: "primary" | "muted";
912
+ }>;
522
913
  /**
523
914
  * 箱の中に描く図形 (`shape:`、 #1374)。 水位や角度を状態で動かせる。
524
915
  *
@@ -577,20 +968,45 @@ type DslActor = {
577
968
  * 他の図種では相手が無いため、書かれていたら組み立て側が知らせる。
578
969
  */
579
970
  end?: string;
971
+ /** 工程の始まりに出す札。節目の位置名とは独立して書ける。 */
972
+ startLabel?: string;
973
+ /** 帯を菱形の節目として描く。 */
974
+ milestone?: boolean;
975
+ /** 工程の帯を主役として描く。 */
976
+ emphasis?: "primary";
977
+ /**
978
+ * 四象限の点を置く座標。 左下が (0, 0)、右上が (1, 1)。
979
+ * 数のほか `{名前}` を受け、描画側の BoundNumber へそのまま渡す。
980
+ */
981
+ at?: {
982
+ x?: number | string;
983
+ y?: number | string;
984
+ raw: string;
985
+ };
986
+ /** `at` を書いた行。 */
987
+ atPos?: Position;
580
988
  /**
581
- * 体験の道筋 (`type: journey`) で、その段階が起きる場所 (#1251)。
989
+ * ユーザージャーニー (`type: journey`) で、その段階が起きる場所 (#1251)。
582
990
  *
583
991
  * 「どこで起きたか」 を段の下に出す。 他の図種では相手が無いため、書かれていたら
584
992
  * 組み立て側が知らせる。
585
993
  */
586
994
  touchpoint?: string;
587
995
  /**
588
- * 体験の道筋 (`type: journey`) で、その段階の改善の余地 (#1251)。
996
+ * ユーザージャーニー (`type: journey`) で、その段階の改善の余地 (#1251)。
589
997
  *
590
998
  * 気持ちが落ちる段に「何を直せるか」 を添える。 他の図種では相手が無いため、
591
999
  * 書かれていたら組み立て側が知らせる。
592
1000
  */
593
1001
  opportunity?: string;
1002
+ /** ジャーニーの改善注記を置く場所。 */
1003
+ opportunityPosition?: NonNullable<NonNullable<CdlDiagram["nodes"][number]["journeyData"]>[number]["opportunityPosition"]>;
1004
+ /**
1005
+ * 段階ごとの箱 (`type: swimlane` + `shape: stages`) で、この箱を入れる段階 (#2797)。
1006
+ *
1007
+ * 書かなければ担当 (`lane`)、担当も無ければ箱の名前を段階として使う。
1008
+ */
1009
+ stage?: string;
594
1010
  lane?: string;
595
1011
  stack?: number;
596
1012
  initial?: boolean;
@@ -692,6 +1108,9 @@ type DslStep = {
692
1108
  dashOffsetBind?: string;
693
1109
  /** 矢印がどの辺から出るか (#1385)。 書かなければ描画側が自動で選ぶ */
694
1110
  side?: "top" | "right" | "bottom" | "left";
1111
+ /** 矢印の出どころと行き先で、個別に使う辺。 */
1112
+ fromSide?: "top" | "right" | "bottom" | "left";
1113
+ toSide?: "top" | "right" | "bottom" | "left";
695
1114
  /**
696
1115
  * 矢印の先の形 (#1462)。 書かなければ従来どおり塗った三角。
697
1116
  *
@@ -709,13 +1128,14 @@ type DslStep = {
709
1128
  /** 出どころ側の印の塗り (#1466) */
710
1129
  tailHeadFill?: EdgeHeadFill;
711
1130
  /**
712
- * クラス図の出どころ側の多重度 (#1771)。 `sub` (行き先の端の多重度) と対。
1131
+ * UML の関係を持つ record の出どころ側の多重度 (#1771 / #2783)。
1132
+ * `sub` (行き先の端の多重度) と対。
713
1133
  *
714
- * クラス図でだけ効く (関係の語 `relation` と同じ)。 engine が出どころの端の近くに添える。
1134
+ * `relation` を書いた edge で効き、engine が出どころの端の近くに添える。
715
1135
  */
716
1136
  tailSub?: string;
717
1137
  /**
718
- * クラス図の関係の種類 (#1466)。 書くと線と端の形と塗りと付く側がまとめて決まる。
1138
+ * UML の関係の種類 (#1466 / #2783)。record に書くと線と端の形と塗りと付く側がまとめて決まる。
719
1139
  *
720
1140
  * 4 つを個別に書かせないのは、組合せが 6 通りしか無く、1 つでも書き違えると読み手に
721
1141
  * 別の意味で伝わるため (菱を逆に置くと持ち主が入れ替わる)。
@@ -733,6 +1153,17 @@ type DslStep = {
733
1153
  labelPlate?: boolean;
734
1154
  labelOffsetX?: number;
735
1155
  labelOffsetY?: number;
1156
+ /** cdl の固定直線経路。4 欄が全て揃った時だけ描画側が採用する。 */
1157
+ posX1?: number;
1158
+ posY1?: number;
1159
+ posX2?: number;
1160
+ posY2?: number;
1161
+ /** 固定した両端の間を通る直角の折れ線の点。 */
1162
+ waypoints?: NonNullable<CdlDiagram["edges"][number]["waypoints"]>;
1163
+ /** 線の名札を自動回避するか、作者の位置に固定するか。 */
1164
+ labelCollision?: NonNullable<CdlDiagram["edges"][number]["labelCollision"]>;
1165
+ /** 線の名札の幅・高さ・字の大きさ。 */
1166
+ labelSize?: NonNullable<CdlDiagram["edges"][number]["labelSize"]>;
736
1167
  /** true で説明文を矢印の線の上に重ねる。 分岐図の条件ラベル用。 */
737
1168
  overlay?: boolean;
738
1169
  /**
@@ -757,6 +1188,8 @@ type DslLane = {
757
1188
  x?: number;
758
1189
  width?: number;
759
1190
  label?: string;
1191
+ /** 路線図の担当の名札で、名前の下へ出す補足。 */
1192
+ subtitle?: string;
760
1193
  contain?: boolean;
761
1194
  lifeline?: boolean;
762
1195
  /**
@@ -767,6 +1200,15 @@ type DslLane = {
767
1200
  layoutPos?: LayoutPos;
768
1201
  pos: Position;
769
1202
  };
1203
+ /** 段の箱の列見出しの寸法。 */
1204
+ type DslStageHeader = {
1205
+ leftPad?: number;
1206
+ topPad: number;
1207
+ numberSize: number;
1208
+ gap: number;
1209
+ nameSize: number;
1210
+ bottomPad: number;
1211
+ };
770
1212
  /**
771
1213
  * 組の宣言 (v0.5+ top-level groups section)。
772
1214
  *
@@ -784,6 +1226,8 @@ type DslGroup = {
784
1226
  type DslViewport = {
785
1227
  width?: number;
786
1228
  height?: number;
1229
+ /** 描画内容だけを画布の中で横へずらす。 */
1230
+ contentOffsetX?: number;
787
1231
  /**
788
1232
  * 図全体の倍率 (default 1)。 箱 / 文字 / 線 / 間隔のすべてが等比で拡大縮小される。
789
1233
  *
@@ -860,13 +1304,22 @@ type DslValue = {
860
1304
  /** 動く長さ (ms) */
861
1305
  durationMs: number;
862
1306
  });
863
- /** ステップ (phase) */
864
- /** 動いている間の帯 (#1466)。 順序図で、面がいつ動いているかを段の番号で持つ */
1307
+ /**
1308
+ * 動いている間の帯 (#1466)。 順序図で、面がいつ動いているかを言づての番号で持つ。
1309
+ *
1310
+ * `from` / `to` が指すのは **板に載る言づての行** で、0 から数える (#2404 で実測)。
1311
+ * 段 (`animation` の `step`) ではない = 数も起点も違う。
1312
+ *
1313
+ * `pos` は書いた行 (#2404)。 名前と番号を突き合わせた知らせが、直す行を指すのに使う。
1314
+ * JSON から読んだ文書は行を持たないため `undefined` になる (矢印の飾りの知らせと同じ扱い)。
1315
+ */
865
1316
  type DslBand = {
866
1317
  actor: string;
867
1318
  from: number;
868
1319
  to: number;
1320
+ pos?: Position;
869
1321
  };
1322
+ /** ステップ (phase) */
870
1323
  type DslPhase = {
871
1324
  name: string;
872
1325
  durationMs: number;
@@ -949,44 +1402,16 @@ type ParseResult = {
949
1402
  declare function parseTextDsl(src: string): ParseResult;
950
1403
 
951
1404
  /**
952
- * AST (DslDocument) → 既存 preset API 経由 → LaidDiagram
1405
+ * 組み立てが出す知らせの形 (#2030 で `compile.ts` から移した)。
953
1406
  *
954
- * v0.3 ... アニメーション ブロック full compile 対応 (sequence preset のみ、 他 preset は v0.4 で順次)
955
- * - state / tween / set / highlight / badge / body を実 phase に注入
956
- * - アニメーション ありなら builder 直接経路 ... preset の標準 phase を置換
957
- * - アニメーション なしは v0.2 と同じく preset 経由
1407
+ * 図種ごとの file が受け取り口の型として使い、`compile.ts` が再輸出して外へ出す。
958
1408
  *
959
- * v0.2 ... 6 preset 全対応 (sequence / flow / swimlane / er / state / topology)
1409
+ * **葉に置く** = 型そのものは消えるが、TypeScript の取り込みの輪は残る。 輪があると
1410
+ * 読む順で解決が変わるため、型でも輪を作らない。
960
1411
  */
961
-
962
- interface CompileToCdlOpts {
963
- /**
964
- * CAR-1657 = parts identifier lookup catalog、 caller (CdlEditor / test) が inject。
965
- * DslActor.partId が set された actor を検出したら partsCatalog[partId] から CdlDiagram を
966
- * lookup + mergePartIntoDiagram で target に統合。 未渡し時は parts kind actor を skip + warn。
967
- */
968
- partsCatalog?: Record<string, CdlDiagram>;
969
- /**
970
- * 組み立ての途中で分かった「書いたのに効かなかったこと」 の受け取り口。
971
- *
972
- * 図は出せるので誤りにはしないが、 黙って捨てると書いた人が理由を追えない。 editor は
973
- * これを受けて画面に出す。 判定は組み立て側だけが持ち、 画面側は表示に徹する。
974
- */
975
- onNotice?: (notice: CompileNotice) => void;
976
- /**
977
- * edge が DSL のどの行から来たかの受け取り口 (#998)。
978
- *
979
- * preset によっては書いた step と生成される edge が一致しない (`type: flow` は actor を鎖状に
980
- * 繋ぐため `a -> c` と書いても `a -> b` になる)。 edge を起点に本文の行を直す機能は、 この
981
- * 対応が無いと別の行を書き換える。
982
- *
983
- * **対応が取れない edge については呼ばれない**。 「対応が無い」 と「行 0」 を区別するため。
984
- */
985
- onEdgeSource?: (edgeId: string, line: number) => void;
986
- }
987
1412
  /** 図は出せるが書いた通りにならなかった、 という知らせ。 */
988
1413
  type CompileNotice = {
989
- kind: "relative-position-ignored" | "focus-target-missing" | "state-override-rejected" | "external-paint-dropped" | "part-not-drawn" | "direction-not-honored" | "scale-reserved" | "part-color-ignored" | "part-state-missing" | "part-edge-dropped" | "part-node-ignored" | "part-lane-ignored" | "chart-value-unreadable" | "chart-edge-dropped" | "value-shadows-state" | "value-unresolved" | "value-duplicate" | "flow-actor-missing" | "value-trigger-unresolved" | "lane-not-honored" | "lane-declared-empty" | "eyebrow-not-honored" | "flow-endpoint-not-honored" | "draw-not-honored" | "draw-target-mismatch" | "formula-unresolved" | "event-target-missing" | "actor-kind-not-honored" | "message-option-not-honored" | "position-offset-ignored" | "group-lane-missing" | "group-lanes-apart";
1414
+ kind: "relative-position-ignored" | "focus-target-missing" | "state-override-rejected" | "external-paint-dropped" | "part-not-drawn" | "direction-not-honored" | "direction-same-as-default" | "order-not-honored" | "shape-not-honored" | "stage-from-lane" | "track-from-name" | "theme-palette-both" | "scale-reserved" | "part-color-ignored" | "part-state-missing" | "part-edge-dropped" | "part-not-found" | "part-node-ignored" | "part-lane-ignored" | "chart-value-unreadable" | "chart-edge-dropped" | "value-shadows-state" | "state-shadowed-by-input" | "value-unresolved" | "value-duplicate" | "flow-actor-missing" | "band-not-honored" | "band-actor-missing" | "band-row-out-of-range" | "value-trigger-unresolved" | "lane-not-honored" | "lane-option-not-honored" | "lane-declared-empty" | "eyebrow-not-honored" | "flow-endpoint-not-honored" | "draw-not-honored" | "draw-target-mismatch" | "formula-unresolved" | "readout-source-missing" | "event-target-missing" | "event-target-not-honored" | "focus-target-not-honored" | "actor-kind-not-honored" | "actor-option-not-honored" | "message-option-not-honored" | "position-offset-ignored" | "position-axis-missing" | "group-lane-missing" | "group-lanes-apart" | "cardinality-not-honored" | "edge-option-not-honored" | "gantt-end-before-start";
990
1415
  /** 対象の名前。 光らせる相手なら書かれた指定そのまま */
991
1416
  actor: string;
992
1417
  /** 書かれていた行 */
@@ -994,25 +1419,7 @@ type CompileNotice = {
994
1419
  message: string;
995
1420
  hint?: string;
996
1421
  };
997
- declare function compileToCdl(doc: DslDocument, opts?: CompileToCdlOpts): CdlDiagram;
998
- /**
999
- * 登場人物ごとの、 図の上での中心と大きさを測る。
1000
- *
1001
- * 対応付けは箱に表示される名前で行う。 id を使わない理由は `applyNodeTones` と同じで、
1002
- * slug の作り方が dragon と cdl で違うため記号を含む名前で一致しない。
1003
- *
1004
- * 1 人が複数の箱に分かれる図種 (順序図の上端 / 下端) では、 全部を囲む矩形を返す。
1005
- * 箱として現れない登場人物は縦列の矩形で代用する。
1006
- */
1007
- declare function measureActorBoxes(diagram: CdlDiagram,
1008
- /**
1009
- * 配置まで済ませた図。 渡すとここでは測り直さない (#1006)。
1010
- *
1011
- * 呼出側が既に組み立てているなら、 ここで `layout` を呼ぶと同じ図の配置を 2 度計算する。
1012
- * 図の規模に比例して重く、 辺 500 本で約 300ms (実測)。
1013
- * 渡す時は `diagram` と対にする = 別の図の配置を渡すと、 測る位置がずれる。
1014
- */
1015
- laidHint?: LaidDiagram): Map<string, AnchorBox>;
1422
+
1016
1423
  /**
1017
1424
  * この図を取り込んでよいか (#1015)。
1018
1425
  *
@@ -1118,9 +1525,10 @@ declare function partRenderSize(part: CdlDiagram): {
1118
1525
  * `readouts` を図の中では扱わないため、図として重ねても何も出ない。 位置決めのための
1119
1526
  * 1x1 の箱が 1 つあるだけになる。
1120
1527
  *
1121
- * catalog 80 件を測ると、この 2 群は `readouts` の有無で完全に分かれた。
1122
- * `readouts` を持つ 17 件は箱と図枠の面積比が全件 0.0000 (箱は 1x1)、
1123
- * 持たない 63 件は最小でも 0.1877。 境目に入る件は無い。
1528
+ * catalog を測ると、この 2 群は `readouts` の有無で完全に分かれる。
1529
+ * `readouts` を持つ 17 件は箱と図枠の面積比が全件 0.00007 (箱は 1x1 で図枠は 120x120)、
1530
+ * 持たない群は最小でも 0.37662。 境目に入る件は無い
1531
+ * (#2681 で図枠が中身に寄るようになり、どちらの群も値が上がったが隔たりは残った)。
1124
1532
  *
1125
1533
  * 判定は面積の閾値ではなく **`readouts` を持ち、かつ箱が図枠に対して極小** の 2 条件で行う。
1126
1534
  * 閾値だけで見ると、小さい箱を意図して置いた見本を巻き込む。 `readouts` だけで見ると、
@@ -1148,6 +1556,13 @@ declare function partBoxInFrame(part: CdlDiagram): {
1148
1556
  left: number;
1149
1557
  top: number;
1150
1558
  };
1559
+ /**
1560
+ * 測るためだけの配置が受け取った知らせの数 (#2312)。
1561
+ *
1562
+ * 読み込み時の知らせを 0 行で固定する検査が、母数として読む。 0 件なら「知らせが無い」 では
1563
+ * なく「測るための配置を 1 度も通っていない」 = 検査が空振りしている。
1564
+ */
1565
+ declare function 測るために受け取った知らせの数(): number;
1151
1566
  /**
1152
1567
  * パーツ 1 個の箱の外接矩形。
1153
1568
  *
@@ -1210,30 +1625,114 @@ declare function partsGridCenters(baseBottom: number | undefined, items: Readonl
1210
1625
  declare function 部品に上書きを当てる(part: CdlDiagram, actor: Pick<DslActor, "stateOverride" | "colorHex">): CdlDiagram;
1211
1626
 
1212
1627
  /**
1213
- * 記法の検査 (図を書く人向けの修正システム)。
1214
- *
1215
- * cdl / dragon の記法で書いた図 (`CdlDiagram`) を決まった規則で検査し、直し方を修正案
1216
- * (`suggestion`) として返す純粋関数。 言語モデルは使わない。
1628
+ * 登場人物ごとの、 図の上での中心と大きさを測る。
1217
1629
  *
1218
- * 検知システム (`check:cdl` / `check:dragon` / `check:kind`) は開発者向けで実装の不具合を
1219
- * 見つける。 こちらは図を書く人向けで、読む人へ伝わらない書き方 (図の説明に入り込んだ実装の
1220
- * 書き方、無い部品を指す参照、値や項目が空の図表など) を見つける。
1630
+ * 対応付けは箱に表示される名前で行う。 id を使わない理由は `applyNodeTones` と同じで、
1631
+ * slug の作り方が dragon と cdl で違うため記号を含む名前で一致しない。
1221
1632
  *
1222
- * 使い方:
1223
- * import { lintDiagram, autoFix } from "@cardenelabs/dragon";
1224
- * const report = lintDiagram(diagram);
1225
- * // report.issues = LintIssue[]
1226
- * // report.autoFixableCount = 自動修正で実際に解消できる指摘の数
1227
- * const patched = autoFix(diagram); // 自動修正を当てた新しい図 (元の図は変えない)
1633
+ * 1 人が複数の箱に分かれる図種 (順序図の上端 / 下端) では、 全部を囲む矩形を返す。
1634
+ * 箱として現れない登場人物は縦列の矩形で代用する。
1635
+ */
1636
+ declare function measureActorBoxes(diagram: CdlDiagram,
1637
+ /**
1638
+ * 配置まで済ませた図。 渡すとここでは測り直さない (#1006)。
1228
1639
  *
1229
- * 道具:
1230
- * node packages/dragon/scripts/dragon-lint.mjs apps/playground-spa/src/topics/catalog/presets.cdl.ts
1640
+ * 呼出側が既に組み立てているなら、 ここで `layout` を呼ぶと同じ図の配置を 2 度計算する。
1641
+ * 図の規模に比例して重く、 辺 500 本で約 300ms (実測)。
1642
+ * 渡す時は `diagram` と対にする = 別の図の配置を渡すと、 測る位置がずれる。
1231
1643
  */
1644
+ laidHint?: LaidDiagram): Map<string, AnchorBox>;
1232
1645
 
1233
- type LintSeverity = "warn" | "info";
1234
- type LintIssue = {
1235
- /** rule 識別子 */
1236
- rule: string;
1646
+ /**
1647
+ * AST (DslDocument) → 既存 preset API 経由 → LaidDiagram
1648
+ *
1649
+ * v0.3 ... アニメーション ブロック full compile 対応 (sequence preset のみ、 他 preset は v0.4 で順次)
1650
+ * - state / tween / set / highlight / badge / body を実 phase に注入
1651
+ * - アニメーション ありなら builder 直接経路 ... preset の標準 phase を置換
1652
+ * - アニメーション なしは v0.2 と同じく preset 経由
1653
+ *
1654
+ * v0.2 ... 6 preset 全対応 (sequence / flow / swimlane / er / state / topology)
1655
+ */
1656
+
1657
+ interface CompileToCdlOpts {
1658
+ /**
1659
+ * CAR-1657 = parts identifier lookup catalog、 caller (CdlEditor / test) が inject。
1660
+ * DslActor.partId が set された actor を検出したら partsCatalog[partId] から CdlDiagram を
1661
+ * lookup + mergePartIntoDiagram で target に統合。 未渡し時は parts kind actor を skip + warn。
1662
+ */
1663
+ partsCatalog?: Record<string, CdlDiagram>;
1664
+ /**
1665
+ * 組み立ての途中で分かった「書いたのに効かなかったこと」 の受け取り口。
1666
+ *
1667
+ * 図は出せるので誤りにはしないが、 黙って捨てると書いた人が理由を追えない。 editor は
1668
+ * これを受けて画面に出す。 判定は組み立て側だけが持ち、 画面側は表示に徹する。
1669
+ */
1670
+ onNotice?: (notice: CompileNotice) => void;
1671
+ /**
1672
+ * edge が DSL のどの行から来たかの受け取り口 (#998)。
1673
+ *
1674
+ * preset によっては書いた step と生成される edge が一致しない (`type: flow` は actor を鎖状に
1675
+ * 繋ぐため `a -> c` と書いても `a -> b` になる)。 edge を起点に本文の行を直す機能は、 この
1676
+ * 対応が無いと別の行を書き換える。
1677
+ *
1678
+ * **対応が取れない edge については呼ばれない**。 「対応が無い」 と「行 0」 を区別するため。
1679
+ */
1680
+ onEdgeSource?: (edgeId: string, line: number) => void;
1681
+ }
1682
+ declare function compileToCdl(doc: DslDocument, opts?: CompileToCdlOpts): CdlDiagram;
1683
+
1684
+ /**
1685
+ * 行頭の印を dragon の語で決める (#2782)。
1686
+ *
1687
+ * 描画側が持つ印は 3 軸しかない。 形 (四角 / 山形) と 塗り (塗る / 中空) と
1688
+ * 名前の下線で、この 3 軸に 1 対 1 で当たる語を dragon 自身が持つ。
1689
+ *
1690
+ * | 語 | 軸 | 意味 |
1691
+ * |---|---|---|
1692
+ * | `鍵` | 名前に下線を引く | その行で箱を見分ける |
1693
+ * | `外` | 行頭を山形にする | その行は箱の外とつながる |
1694
+ * | `条件` | 行頭を中空にする | その行は条件が揃った時だけ効く |
1695
+ *
1696
+ * 畳む前は 図種ごとに語を持っていた (表の図は `pk` / `fk` / `opt`、移り変わりの図は
1697
+ * `entry` / `exit` / `do` / `internal`)。 2 つの語彙は同じ 2 軸の格子を別の名前で
1698
+ * 呼んでいただけで、格子の 4 隅は 1 対 1 に重なる。
1699
+ *
1700
+ * | | 塗る | 中空 |
1701
+ * |---|---|---|
1702
+ * | 四角 | 語なし / `do` | `条件` / `opt` / `internal` |
1703
+ * | 山形 | `外` / `fk` / `entry` | `外 条件` / `fk opt` / `exit` |
1704
+ *
1705
+ * 古い語から dragon の語への読み替えは本 file の `行頭の語へ読み替える` が持ち、
1706
+ * 読み取りの入口 (記法 / JSON の 2 経路) が通す。 印にする時点で古い語は 1 つも残っていない。
1707
+ */
1708
+ declare const 行頭の語: readonly ["鍵", "外", "条件"];
1709
+ type 行頭の語 = (typeof 行頭の語)[number];
1710
+
1711
+ /**
1712
+ * 記法の検査 (図を書く人向けの修正システム)。
1713
+ *
1714
+ * cdl / dragon の記法で書いた図 (`CdlDiagram`) を決まった規則で検査し、直し方を修正案
1715
+ * (`suggestion`) として返す純粋関数。 言語モデルは使わない。
1716
+ *
1717
+ * 検知システム (`check:cdl` / `check:dragon` / `check:kind`) は開発者向けで実装の不具合を
1718
+ * 見つける。 こちらは図を書く人向けで、読む人へ伝わらない書き方 (図の説明に入り込んだ実装の
1719
+ * 書き方、無い部品を指す参照、値や項目が空の図表など) を見つける。
1720
+ *
1721
+ * 使い方:
1722
+ * import { lintDiagram, autoFix } from "@cardenelabs/dragon";
1723
+ * const report = lintDiagram(diagram);
1724
+ * // report.issues = LintIssue[]
1725
+ * // report.autoFixableCount = 自動修正で実際に解消できる指摘の数
1726
+ * const patched = autoFix(diagram); // 自動修正を当てた新しい図 (元の図は変えない)
1727
+ *
1728
+ * 道具:
1729
+ * node packages/dragon/scripts/dragon-lint.mjs apps/playground-spa/src/topics/catalog/presets.cdl.ts
1730
+ */
1731
+
1732
+ type LintSeverity = "warn" | "info";
1733
+ type LintIssue = {
1734
+ /** rule 識別子 */
1735
+ rule: string;
1237
1736
  severity: LintSeverity;
1238
1737
  /** 該当対象 (node id / edge id / diagram id) */
1239
1738
  target: string;
@@ -1302,12 +1801,12 @@ declare function rectsOverlap(a: DiagramBoundingBox, b: DiagramBoundingBox): boo
1302
1801
  * 書き方は 2 通り。 箱の名前 1 つか、 矢印 (`A -> B`) で 2 者を指す形。
1303
1802
  *
1304
1803
  * 読み方をここに 1 つだけ置く。 id の形は図種で違う (順序図は縦列の上端 / 下端 / 手順箱、
1305
- * 流れ図は箱 1 個) ため id への解決は図種ごとに残すが、 「どちらの書き方か」 の判断を
1804
+ * フローは箱 1 個) ため id への解決は図種ごとに残すが、 「どちらの書き方か」 の判断を
1306
1805
  * 図種ごとに持つと、 同じ記述が図種によって別の意味になる。
1307
1806
  *
1308
1807
  * 以前は図種ごとに判定していて、 順序図と汎用の 2 経路が `-` 1 文字を矢印と見なしていた。
1309
1808
  * その結果 `api-gateway` のような名前が「api から gateway への矢印」 と読まれ、 順序図では
1310
- * 光らず、 流れ図では名前に部分一致した別の矢印が光っていた (実測)。
1809
+ * 光らず、 フローでは名前に部分一致した別の矢印が光っていた (実測)。
1311
1810
  */
1312
1811
  /** 光らせる相手の指定。 */
1313
1812
  type FocusEntry = {
@@ -1536,6 +2035,33 @@ declare function describeOversize(size: InputSize): string | null;
1536
2035
  */
1537
2036
  declare function describeOversizeSource(src: string): string | null;
1538
2037
 
2038
+ /**
2039
+ * JSON / YAML の本文で「どこに書いたか」 を指す鍵と、そこから行番号を引く表 (#2117)。
2040
+ *
2041
+ * JSON を読む経路は行番号を持たないため、組み立ての知らせは全て 0 行になり、画面は
2042
+ * 「どの行の話か」 を出せなかった。 本文の行が分かる入口 (編集画面の YAML 欄) は、本文を
2043
+ * 読む時に場所ごとの行を集めてこの表で渡す。 表を渡さない呼出 (LLM が作った JSON を直に
2044
+ * 渡す経路) は今までどおり 0 行になる。
2045
+ *
2046
+ * 鍵の形は RFC 6901 (JSON Pointer) と同じにする (`/actors/1` / `/values/sales`)。
2047
+ * 名前をそのまま `.` で繋ぐ形にすると、`values` に `a.b` という名前を書いた場所と、
2048
+ * `values.a` の中の `b` という欄が同じ鍵になる。 `/` と `~` を書き換える規則があるため、
2049
+ * この形では重ならない。
2050
+ *
2051
+ * 表を作る側 (`apps/playground-spa/src/lib/yaml-lines.ts`) と引く側 (`json-parser.ts`) は
2052
+ * 同じ関数を呼ぶ。 別々に持つと、片方だけ直した時に **全ての行が引けなくなる** =
2053
+ * 引けない状態は知らせが 0 行に戻るだけで、図も誤りも変わらないため気付けない。
2054
+ */
2055
+ /** 本文の場所 (JSON Pointer) から、元の本文の行番号 (1 始まり) を引く表。 */
2056
+ type 書いた行の表 = ReadonlyMap<string, number>;
2057
+ /**
2058
+ * 場所を指す鍵を作る。 引数は上から順に、欄の名前と並びの番号。
2059
+ *
2060
+ * 文書そのものは引数なしで空文字になる。 1 つずつ足す時は、親の鍵に
2061
+ * `書いた場所の鍵(次の区切り)` を繋げる (同じ結果になる)。
2062
+ */
2063
+ declare function 書いた場所の鍵(...道: readonly (string | number)[]): string;
2064
+
1539
2065
  /**
1540
2066
  * LLM 向け JSON DSL parser。
1541
2067
  *
@@ -1544,7 +2070,7 @@ declare function describeOversizeSource(src: string): string | null;
1544
2070
  * で確実に生成できるよう、 flat な object array を優先した shape になっている。
1545
2071
  *
1546
2072
  * 使い方 (LLM):
1547
- * 1. `packages/dragon/schemas/diagram.json` の JSON Schema を LLM の tool schema に注入
2073
+ * 1. `packages/dragon/src/schemas/diagram.json` の JSON Schema を LLM の tool schema に注入
1548
2074
  * 2. LLM が JSON を返す
1549
2075
  * 3. `jsonToDiagram(json)` で CdlDiagram に変換
1550
2076
  * 4. validation error は throw、 retry loop で LLM に修正させる
@@ -1556,18 +2082,95 @@ declare function describeOversizeSource(src: string): string | null;
1556
2082
  * YAML `animation: [step: "..."]` ⇔ JSON `{animation: [{step: "...", duration: 1.4, focus: [...]}]}`
1557
2083
  */
1558
2084
 
2085
+ /** 古い綴りで書いた図種 (#2655 / #2657)。 受ける値は `TYPE_ALIASES` が SSOT */
2086
+ type 図種の別名 = "solidity" | DslShape;
1559
2087
  /**
1560
2088
  * LLM 向け JSON DSL の入力 shape。 YAML DSL と 1:1 対応、 top-level は flat な object。
1561
2089
  */
1562
2090
  interface DragonJson {
1563
2091
  /** 図の title (必須) */
1564
2092
  title: string;
1565
- /** preset type (必須): sequence / flow / swimlane / er / state / topology / solidity / gantt / class / pie / c4 / mind */
1566
- type: PresetType;
2093
+ /**
2094
+ * preset type (必須)。 受け付ける値は `PRESET_TYPES` と `TYPE_ALIASES` が SSOT。
2095
+ *
2096
+ * 別名 (#2655 / #2657) は読み取りで図種と語の 2 つに開く = `solidity` と書いた JSON は
2097
+ * 順序図 + 種類で並べ替え、`pie` と書いた JSON は 数を描く図 + 円の形 として読まれる。
2098
+ */
2099
+ type: PresetType | 図種の別名;
2100
+ /** 円グラフの見せ方。 */
2101
+ form?: string;
2102
+ /** `form` の和名。両方あれば `form` を採る。 */
2103
+ 見せ方?: string;
2104
+ /** ガントチャートの目盛り。 */
2105
+ ticks?: string[];
2106
+ /** `ticks` の和名。両方あれば `ticks` を採る。 */
2107
+ 目盛り?: string[];
2108
+ /** ガントチャートの今日の線の位置と札。 */
2109
+ ganttToday?: {
2110
+ index: number;
2111
+ label: string;
2112
+ };
2113
+ /** 工程の端とは独立した目盛り名。 */
2114
+ ganttTickLabels?: string[];
2115
+ ganttBarEnd?: "position";
2116
+ ganttBarThickness?: "thin";
2117
+ chartSeriesSkipMuted?: DslDocument["chartSeriesSkipMuted"];
2118
+ chartLineSeries?: DslDocument["chartLineSeries"];
2119
+ chartPieCenterLabel?: DslDocument["chartPieCenterLabel"];
2120
+ chartPieTableColumns?: DslDocument["chartPieTableColumns"];
2121
+ chartPieRingWidth?: DslDocument["chartPieRingWidth"];
2122
+ chartSlopePeriods?: DslDocument["chartSlopePeriods"];
2123
+ chartSlopeEmphasisIds?: DslDocument["chartSlopeEmphasisIds"];
2124
+ chartSlopeUnit?: DslDocument["chartSlopeUnit"];
2125
+ chartStackedPeriods?: DslDocument["chartStackedPeriods"];
2126
+ chartStackedRateId?: DslDocument["chartStackedRateId"];
2127
+ chartStackedLegendPosition?: DslDocument["chartStackedLegendPosition"];
2128
+ chartGaugeValue?: DslDocument["chartGaugeValue"];
2129
+ chartWaffleLegendPosition?: DslDocument["chartWaffleLegendPosition"];
2130
+ funnelForm?: DslDocument["funnelForm"];
2131
+ funnelRate?: DslDocument["funnelRate"];
2132
+ quadrantPointLabelSide?: DslDocument["quadrantPointLabelSide"];
2133
+ treeNodeForm?: DslDocument["treeNodeForm"];
2134
+ treeSize?: DslDocument["treeSize"];
2135
+ treeEdgeTone?: DslDocument["treeEdgeTone"];
2136
+ treeEdgeHead?: DslDocument["treeEdgeHead"];
2137
+ mindForm?: DslDocument["mindForm"];
2138
+ mindSize?: DslDocument["mindSize"];
2139
+ edgeEndGap?: DslDocument["edgeEndGap"];
2140
+ journeyForm?: DslDocument["journeyForm"];
2141
+ journeyLineForm?: DslDocument["journeyLineForm"];
2142
+ journeyLabels?: DslDocument["journeyLabels"];
2143
+ journeySize?: DslDocument["journeySize"];
2144
+ sequenceActorForm?: DslDocument["sequenceActorForm"];
2145
+ sequenceLabelForm?: DslDocument["sequenceLabelForm"];
2146
+ sequenceReturnHead?: DslDocument["sequenceReturnHead"];
2147
+ sequenceKindLabels?: DslDocument["sequenceKindLabels"];
2148
+ sequenceRowGap?: DslDocument["sequenceRowGap"];
2149
+ sequenceGutter?: DslDocument["sequenceGutter"];
2150
+ sequenceBandWidth?: DslDocument["sequenceBandWidth"];
2151
+ sequenceSelfLoop?: DslDocument["sequenceSelfLoop"];
2152
+ figureCard?: DslDocument["figureCard"];
2153
+ figureSize?: DslDocument["figureSize"];
2154
+ terminalDecoration?: DslDocument["terminalDecoration"];
2155
+ cornerForm?: DslDocument["cornerForm"];
2156
+ figureKindLabel?: DslDocument["figureKindLabel"];
2157
+ figureInset?: DslDocument["figureInset"];
2158
+ chartBarSize?: DslDocument["chartBarSize"];
2159
+ chartBarShape?: DslDocument["chartBarShape"];
2160
+ chartLineSize?: DslDocument["chartLineSize"];
2161
+ chartPieSize?: DslDocument["chartPieSize"];
2162
+ chartWaffleSize?: DslDocument["chartWaffleSize"];
2163
+ chartSlopeLabelTemplate?: DslDocument["chartSlopeLabelTemplate"];
2164
+ chartSlopeSize?: DslDocument["chartSlopeSize"];
2165
+ chartStackedLayout?: DslDocument["chartStackedLayout"];
2166
+ chartGaugeSize?: DslDocument["chartGaugeSize"];
2167
+ ganttSize?: DslDocument["ganttSize"];
2168
+ quadrantLabelPosition?: DslDocument["quadrantLabelPosition"];
2169
+ quadrantSize?: DslDocument["quadrantSize"];
1567
2170
  /**
1568
2171
  * 図表の箱の上に出す小見出し (optional)。 記法の最上位 `eyebrow:` と同じ (#1247)。
1569
2172
  *
1570
- * 効くのは図全体を 1 箱にする図種 (`pie` / `bar` / `line` / `funnel` / `tree` / `journey` /
2173
+ * 効くのは図全体を 1 箱にする図種 (`chart` / `funnel` / `tree` / `journey` /
1571
2174
  * `quadrant` / `mind` / `gantt`) だけ。 箱ごとに分かれる図種では相手が決まらないため、
1572
2175
  * 組み立て側が知らせを出す。 そちらは `actors[].eyebrow` に書く。
1573
2176
  */
@@ -1581,6 +2184,19 @@ interface DragonJson {
1581
2184
  * 他の図種には軸が無いため、書かれていたら組み立て側が知らせる。
1582
2185
  */
1583
2186
  axes?: JsonAxes;
2187
+ /**
2188
+ * 2 軸で仕分ける図の区画の名前 (#2667)。 記法の `regions:` と同じ。
2189
+ *
2190
+ * 鍵は項目の欄と同じ 4 語 (`左上` / `右上` / `左下` / `右下`)。 別の言い方を足すと
2191
+ * 同じ区画を 2 通りで呼ぶことになる。
2192
+ */
2193
+ regions?: JsonRegions;
2194
+ /** 図の凡例の字の大きさ。 */
2195
+ legendFontSize?: number;
2196
+ legendOffset?: DslDocument["legendOffset"];
2197
+ /** 段の箱で全意匠に共通して使う見出しの寸法。 */
2198
+ stageHeader?: DslStageHeader;
2199
+ stageLayout?: DslDocument["stageLayout"];
1584
2200
  /** 登場人物 (必須): 文字列 or { name, kind, ... } object */
1585
2201
  actors: (string | JsonActor)[];
1586
2202
  /** flow step 配列 (必須): { from, to, label, ... } */
@@ -1663,6 +2279,8 @@ interface DragonJson {
1663
2279
  x?: number;
1664
2280
  width?: number;
1665
2281
  label?: string;
2282
+ /** 路線図の担当の名札で、名前の下へ出す補足。 */
2283
+ subtitle?: string;
1666
2284
  contain?: boolean;
1667
2285
  lifeline?: boolean;
1668
2286
  /**
@@ -1688,16 +2306,33 @@ interface DragonJson {
1688
2306
  relations?: RelationFocus;
1689
2307
  /** 図の並ぶ向き (#1494)。 記法の最上位 `direction:` と同じ。 JSON は英語の語で書く */
1690
2308
  direction?: "vertical" | "horizontal";
1691
- /**
1692
- * 図の配色 (#1553)。 記法の最上位 `palette:` と同じ。
1693
- *
1694
- * 名前だけを図に載せる = cdl は色を持たず、値は `cdl-theme.css` が決める。
1695
- * ER 図とクラス図は書かなくても `kinari` (生成りに茶) になる。 どちらも箱の作りが同じ
1696
- * (行頭の印 + 左に名前 + 右に型) で、名前と型が離れて並ぶため、行を横に追う目印
1697
- * (行の縞) が要る。 縞の色は配色からしか来ないので、既定が無いと縞が箱の面と同じ色に
1698
- * 落ちて 1 本も出ない。 書き手が `palette:` を書いた時はそちらが勝つ。
1699
- */
1700
- palette?: DslPalette;
2309
+ /** 箱を並べ替える軸 (#2655)。 記法の最上位 `order:` と同じ。 JSON は英語の語で書く */
2310
+ order?: "kind";
2311
+ /** 図種ごとに選ぶ形 (#2657 / #2797)。 記法の最上位 `shape:` と同じ */
2312
+ shape?: DslDiagramShape;
2313
+ /** 図の意匠 (#1553 / #2790)。 記法の最上位 `theme:` と同じ。 */
2314
+ theme?: string;
2315
+ /** `theme` の別名。 両方書いた時は `theme` を使う。 */
2316
+ palette?: string;
2317
+ /** 図の下へ置く凡例。 印は記法と同じ英語名または和名で書く。 */
2318
+ legend?: CdlLegendItem[];
2319
+ }
2320
+ /**
2321
+ * 位置を他の要素からの相対で書く指定の、JSON 側の形 (#2039)。
2322
+ *
2323
+ * 記法の `位置: Web の右 200` を 3 つの欄に開いたもの。 内側の値は `RelativePos` と同じで、
2324
+ * 向きの語も同じ 4 つ (`right` / `left` / `above` / `below`) を使う。
2325
+ *
2326
+ * **向きの語を並べ直さない**。 `RelativeDirection` をそのまま使うことで、本文側に向きを
2327
+ * 足した時に JSON 側が黙って取り残される形を作らない。
2328
+ */
2329
+ interface JsonRelativePos {
2330
+ /** 基準にする相手の名前。 `actors:` に書かれた名前をそのまま書く */
2331
+ anchor: string;
2332
+ /** 基準からどちら側に置くか */
2333
+ dir: RelativeDirection;
2334
+ /** 相手との間隔。 書かなければ `RELATIVE_GAP_DEFAULT` */
2335
+ gap?: number;
1701
2336
  }
1702
2337
  interface JsonActor {
1703
2338
  name: string;
@@ -1727,14 +2362,31 @@ interface JsonActor {
1727
2362
  renderOffsetX?: number | string;
1728
2363
  renderOffsetY?: number | string;
1729
2364
  /**
1730
- * CAR-1657 unified syntax = 既存 NodeKind (28 個) に加えて parts identifier (arc-gauge 等) を
1731
- * accept する。 未知 kind 値は parts 候補として partId に格納、 compile 側 partsCatalog で解決。
2365
+ * CAR-1657 unified syntax = 既存 NodeKind (一覧は `v05/parser.ts` の `NODE_KIND_VALID`) に
2366
+ * 加えて parts identifier (arc-gauge 等) を accept する。
2367
+ * 未知 kind 値は parts 候補として partId に格納、 compile 側 partsCatalog で解決。
1732
2368
  * LLM structured output の typing 制約を緩めるため union に string 追加。
1733
2369
  * `string & {}` = NodeKind の候補を IDE 補完で提示しつつ任意 string も許容する idiom。
1734
2370
  * 素の `NodeKind | string` は no-redundant-type-constituents に抵触し補完も潰れる (#865)。
1735
2371
  */
1736
2372
  kind?: NodeKind | (string & {});
1737
2373
  subtitle?: string;
2374
+ kindForm?: "icon";
2375
+ icon?: DslActor["icon"];
2376
+ emptyRowsNote?: string;
2377
+ titleAlign?: "center";
2378
+ rowRules?: boolean;
2379
+ rowStripe?: boolean;
2380
+ rowLayout?: DslActor["rowLayout"];
2381
+ rowDividerForm?: DslActor["rowDividerForm"];
2382
+ rowWell?: DslActor["rowWell"];
2383
+ rowMarkForm?: "tone";
2384
+ nestIn?: string;
2385
+ figureCard?: DslActor["figureCard"];
2386
+ stationNamePosition?: "bottom";
2387
+ subtitlePlacement?: "right";
2388
+ titleFontSize?: number;
2389
+ markGap?: number;
1738
2390
  eyebrow?: string;
1739
2391
  value?: string;
1740
2392
  /**
@@ -1745,6 +2397,8 @@ interface JsonActor {
1745
2397
  */
1746
2398
  previous?: string;
1747
2399
  rows?: string[];
2400
+ /** 段階ごとの箱で、この箱を入れる段階。 記法の `stage` / `段階` と同じ (#2797)。 */
2401
+ stage?: string;
1748
2402
  lane?: string;
1749
2403
  stack?: number;
1750
2404
  initial?: boolean;
@@ -1754,6 +2408,17 @@ interface JsonActor {
1754
2408
  * と同じで、読み方は `DslActor.layoutPos` が持つ。
1755
2409
  */
1756
2410
  pos?: LayoutPos;
2411
+ /**
2412
+ * 位置を他の要素からの相対で書く指定 (#2039)。 記法の `位置: Web の右 200` と同じ。
2413
+ *
2414
+ * 記法は 1 本の文字列に「誰の」「どちら側に」「どれだけ離して」 を詰めるが、JSON では
2415
+ * 3 つの欄に分ける。 文字列を組み立てて渡す形にすると、書く側が記法の並び順と区切りを
2416
+ * 覚える必要が出る = JSON を書くのは主に LLM で、読み取りの規則は欄の名前で示す方が短い。
2417
+ *
2418
+ * 組み立ての段階で基準の実座標から `posX` / `posY` に直すため、解決した後は座標を直接
2419
+ * 書いた時と同じ経路を通る。 `pos` (配置後のずらし幅) とは別の欄。
2420
+ */
2421
+ posRel?: JsonRelativePos;
1757
2422
  /**
1758
2423
  * CAR-1657 parts state override (kind = parts identifier 時のみ有効)。
1759
2424
  * LLM JSON DSL では nested 明示 = `{ "state": { "v": 50 } }` が natural、 human 側の
@@ -1789,14 +2454,22 @@ interface JsonActor {
1789
2454
  * (記法側と同じ扱い)。
1790
2455
  */
1791
2456
  end?: string;
2457
+ startLabel?: string;
2458
+ milestone?: boolean;
2459
+ emphasis?: "primary";
2460
+ /** 四象限の座標 `[x, y]`。 */
2461
+ at?: [number | string, number | string];
2462
+ /** `at` の和名。両方あれば `at` を採る。 */
2463
+ 点の位置?: [number | string, number | string];
1792
2464
  /**
1793
- * 体験の道筋 (`type: journey`) で、その段階が起きる場所 (#1294)。 記法の `touchpoint:` と同じ。
2465
+ * ユーザージャーニー (`type: journey`) で、その段階が起きる場所 (#1294)。 記法の `touchpoint:` と同じ。
1794
2466
  */
1795
2467
  touchpoint?: string;
1796
2468
  /**
1797
- * 体験の道筋 (`type: journey`) で、その段階の改善の余地 (#1294)。 記法の `opportunity:` と同じ。
2469
+ * ユーザージャーニー (`type: journey`) で、その段階の改善の余地 (#1294)。 記法の `opportunity:` と同じ。
1798
2470
  */
1799
2471
  opportunity?: string;
2472
+ opportunityPosition?: DslActor["opportunityPosition"];
1800
2473
  /**
1801
2474
  * 箱を置く絶対座標と大きさ (#1294)。 記法の `posX:` / `posY:` / `posW:` / `posH:` と同じ。
1802
2475
  *
@@ -1813,20 +2486,51 @@ interface JsonActor {
1813
2486
  * 読めない項目名として知らせる)。
1814
2487
  */
1815
2488
  scale?: number;
2489
+ /**
2490
+ * 見本が持つ段を使うか (#2125)。 記法の `{ kind: wave-gauge, phase: false }` と同じ。
2491
+ *
2492
+ * 既定 (書かない) は見本の段を書いた段と番号ごとに並べて再生する。 `false` を書くと
2493
+ * 見本の段の中身 (点灯と値の変化) を空にし、値は書いた段だけが動かす。
2494
+ *
2495
+ * 見本 (parts) にしか効かない。 中身は状態の上書き (`state`) に `phase` として入る =
2496
+ * `"state": { "phase": false }` と同じ所へ届く。 記法が中括弧の中に 1 つの名前として
2497
+ * 書ける以上、JSON でも同じ名前で書けるようにする (入口で書き方が分かれない)。
2498
+ */
2499
+ phase?: boolean;
1816
2500
  /** 行頭の印 (#1466)。 行と対で読む。 語の意味は図の種類が決める */
1817
- marks?: string[];
2501
+ marks?: Array<string | {
2502
+ mark: string;
2503
+ tone?: "primary" | "muted";
2504
+ }>;
1818
2505
  }
1819
2506
  /** 2 軸で仕分ける図の軸の名前 (#1294)。 記法の `axes:` と同じ形 */
1820
2507
  interface JsonAxes {
1821
2508
  x?: {
1822
2509
  left?: string;
1823
2510
  right?: string;
2511
+ label?: never;
2512
+ direction?: never;
2513
+ } | {
2514
+ label: string;
2515
+ direction: true;
1824
2516
  };
1825
2517
  y?: {
1826
2518
  bottom?: string;
1827
2519
  top?: string;
2520
+ label?: never;
2521
+ direction?: never;
2522
+ } | {
2523
+ label: string;
2524
+ direction: true;
1828
2525
  };
1829
2526
  }
2527
+ /** 2 軸で仕分ける図の区画の名前 (#2667)。 記法の `regions:` と同じ形 */
2528
+ interface JsonRegions {
2529
+ 左上?: string;
2530
+ 右上?: string;
2531
+ 左下?: string;
2532
+ 右下?: string;
2533
+ }
1830
2534
  interface JsonStep {
1831
2535
  from: string;
1832
2536
  to: string;
@@ -1834,6 +2538,8 @@ interface JsonStep {
1834
2538
  sub?: string;
1835
2539
  /** 矢印がどの辺から出るか (#1385)。 記法の `side:` と同じ */
1836
2540
  side?: "top" | "right" | "bottom" | "left";
2541
+ fromSide?: "top" | "right" | "bottom" | "left";
2542
+ toSide?: "top" | "right" | "bottom" | "left";
1837
2543
  /**
1838
2544
  * 矢印の先の形 (#1462)。 記法の `{ head: triangle }` と同じ。
1839
2545
  *
@@ -1845,7 +2551,7 @@ interface JsonStep {
1845
2551
  tailHead?: EdgeHead;
1846
2552
  headFill?: EdgeHeadFill;
1847
2553
  tailHeadFill?: EdgeHeadFill;
1848
- /** クラス図の出どころ側の多重度 (#1771)。 記法の `{ tailSub: "1" }` と同じ */
2554
+ /** UML 関係の出どころ側の多重度 (#1771 / #2783)。記法の `{ tailSub: "1" }` と同じ */
1849
2555
  tailSub?: string;
1850
2556
  /**
1851
2557
  * 辺の役目 (cdl#618)。 記法の `{ role: main }` と同じ。
@@ -1855,7 +2561,7 @@ interface JsonStep {
1855
2561
  role?: "main";
1856
2562
  /** 名前の下地を敷くか (cdl#618)。 記法の `{ labelPlate: false }` と同じ。 既定は敷く */
1857
2563
  labelPlate?: boolean;
1858
- /** クラス図の関係の語 (#1466)。 書くと端の形 / 塗り / 線種がまとめて決まる */
2564
+ /** record の UML 関係の語 (#1466 / #2783)。書くと端の形 / 塗り / 線種がまとめて決まる */
1859
2565
  relation?: ClassRelationType;
1860
2566
  /** 順序図の言づての種類 (#1466)。 `call` / `return` / `fire` */
1861
2567
  kind?: SequenceMessageKind;
@@ -1877,6 +2583,13 @@ interface JsonStep {
1877
2583
  dashOffsetBind?: string;
1878
2584
  labelOffsetX?: number;
1879
2585
  labelOffsetY?: number;
2586
+ posX1?: number;
2587
+ posY1?: number;
2588
+ posX2?: number;
2589
+ posY2?: number;
2590
+ waypoints?: DslStep["waypoints"];
2591
+ labelCollision?: DslStep["labelCollision"];
2592
+ labelSize?: DslStep["labelSize"];
1880
2593
  /** true で説明文を矢印の線の上に重ねる。 分岐図の条件ラベル用。 */
1881
2594
  overlay?: boolean;
1882
2595
  /**
@@ -1899,6 +2612,13 @@ interface JsonPhase {
1899
2612
  focus?: string[];
1900
2613
  /** body 説明文 */
1901
2614
  body?: string;
2615
+ /**
2616
+ * 説明文の別名 (#2621)。 記法が `description:` を受けるので JSON でも受ける。
2617
+ *
2618
+ * **正の語は `body`**。 両方書いた段は `body` を採る = 正の語を優先すると決めておくと、
2619
+ * 読み手が「どちらが効くのか」 を実装を読まずに判断できる。
2620
+ */
2621
+ description?: string;
1902
2622
  /** badge label */
1903
2623
  badge?: string;
1904
2624
  /**
@@ -1960,6 +2680,13 @@ interface JsonDslError {
1960
2680
  declare function jsonToDiagram(json: unknown, opts?: {
1961
2681
  partsCatalog?: Record<string, CdlDiagram>;
1962
2682
  onNotice?: CompileToCdlOpts["onNotice"];
2683
+ /**
2684
+ * 本文の場所から書いた行を引く表 (#2117)。 渡すと知らせが書いた行を指す。
2685
+ *
2686
+ * JSON そのものは書いた場所を持たないため、本文の行が分かる入口 (編集画面の YAML 欄) が
2687
+ * 集めて渡す。 渡さない呼出は今までどおり全ての知らせが 0 行になる。
2688
+ */
2689
+ 行の表?: 書いた行の表;
1963
2690
  }): CdlDiagram;
1964
2691
  /**
1965
2692
  * JSON DSL を validate だけ実施 (compile しない)。 error 詳細を配列で取得したい場合に使う。
@@ -1988,7 +2715,7 @@ declare function validateDragonJson(json: unknown): {
1988
2715
  * });
1989
2716
  * const diagram = jsonToDiagram(res.content[0].input);
1990
2717
  *
1991
- * schema JSON は `packages/dragon/schemas/diagram.json` が SSOT、 本 file は import して再 export するだけ。
2718
+ * schema JSON は `packages/dragon/src/schemas/diagram.json` が SSOT、 本 file は import して再 export するだけ。
1992
2719
  */
1993
2720
  /**
1994
2721
  * Dragon DSL JSON Schema (Draft 7)。 Anthropic / OpenAI の tool schema にそのまま注入可能。
@@ -1999,6 +2726,12 @@ declare const diagramJsonSchema: {
1999
2726
  title: string;
2000
2727
  description: string;
2001
2728
  type: string;
2729
+ $defs: {
2730
+ positiveNumber: {
2731
+ type: string;
2732
+ exclusiveMinimum: number;
2733
+ };
2734
+ };
2002
2735
  required: string[];
2003
2736
  additionalProperties: boolean;
2004
2737
  properties: {
@@ -2012,68 +2745,1178 @@ declare const diagramJsonSchema: {
2012
2745
  enum: string[];
2013
2746
  description: string;
2014
2747
  };
2015
- eyebrow: {
2748
+ form: {
2016
2749
  type: string;
2750
+ enum: string[];
2017
2751
  description: string;
2018
2752
  };
2019
- axes: {
2753
+ 見せ方: {
2020
2754
  type: string;
2021
- additionalProperties: boolean;
2755
+ enum: string[];
2756
+ description: string;
2757
+ };
2758
+ ticks: {
2759
+ type: string;
2760
+ minItems: number;
2761
+ items: {
2762
+ type: string;
2763
+ minLength: number;
2764
+ };
2765
+ description: string;
2766
+ };
2767
+ 目盛り: {
2768
+ type: string;
2769
+ minItems: number;
2770
+ items: {
2771
+ type: string;
2772
+ minLength: number;
2773
+ };
2022
2774
  description: string;
2775
+ };
2776
+ ganttToday: {
2777
+ type: string;
2778
+ additionalProperties: boolean;
2779
+ required: string[];
2023
2780
  properties: {
2024
- x: {
2781
+ index: {
2025
2782
  type: string;
2026
- additionalProperties: boolean;
2027
- properties: {
2028
- left: {
2783
+ };
2784
+ label: {
2785
+ type: string;
2786
+ };
2787
+ };
2788
+ description: string;
2789
+ };
2790
+ ganttTickLabels: {
2791
+ type: string;
2792
+ minItems: number;
2793
+ items: {
2794
+ type: string;
2795
+ };
2796
+ description: string;
2797
+ };
2798
+ ganttBarEnd: {
2799
+ type: string;
2800
+ enum: string[];
2801
+ description: string;
2802
+ };
2803
+ ganttBarThickness: {
2804
+ type: string;
2805
+ enum: string[];
2806
+ description: string;
2807
+ };
2808
+ chartSeriesSkipMuted: {
2809
+ type: string;
2810
+ };
2811
+ chartLineSeries: {
2812
+ type: string;
2813
+ minItems: number;
2814
+ items: {
2815
+ type: string;
2816
+ additionalProperties: boolean;
2817
+ required: string[];
2818
+ properties: {
2819
+ label: {
2820
+ type: string;
2821
+ };
2822
+ tone: {
2823
+ type: string;
2824
+ };
2825
+ dash: {
2826
+ type: string;
2827
+ enum: string[];
2828
+ };
2829
+ marker: {
2830
+ type: string;
2831
+ enum: string[];
2832
+ };
2833
+ valueIndexes: {
2834
+ type: string;
2835
+ items: {
2029
2836
  type: string;
2837
+ minimum: number;
2030
2838
  };
2031
- right: {
2839
+ };
2840
+ points: {
2841
+ type: string;
2842
+ minItems: number;
2843
+ items: {
2032
2844
  type: string;
2845
+ additionalProperties: boolean;
2846
+ required: string[];
2847
+ properties: {
2848
+ label: {
2849
+ type: string;
2850
+ };
2851
+ value: {
2852
+ type: string[];
2853
+ };
2854
+ };
2033
2855
  };
2034
2856
  };
2035
2857
  };
2036
- y: {
2037
- type: string;
2038
- additionalProperties: boolean;
2039
- properties: {
2040
- bottom: {
2858
+ };
2859
+ };
2860
+ chartPieCenterLabel: {
2861
+ type: string;
2862
+ };
2863
+ chartPieTableColumns: {
2864
+ type: string;
2865
+ enum: string[];
2866
+ };
2867
+ chartPieRingWidth: {
2868
+ type: string;
2869
+ enum: string[];
2870
+ };
2871
+ chartSlopePeriods: {
2872
+ type: string;
2873
+ minItems: number;
2874
+ maxItems: number;
2875
+ items: {
2876
+ type: string;
2877
+ minLength: number;
2878
+ };
2879
+ };
2880
+ chartSlopeEmphasisIds: {
2881
+ type: string;
2882
+ minItems: number;
2883
+ items: {
2884
+ type: string;
2885
+ minLength: number;
2886
+ };
2887
+ };
2888
+ chartSlopeUnit: {
2889
+ type: string;
2890
+ };
2891
+ chartStackedPeriods: {
2892
+ type: string;
2893
+ minItems: number;
2894
+ items: {
2895
+ type: string;
2896
+ additionalProperties: boolean;
2897
+ required: string[];
2898
+ properties: {
2899
+ label: {
2900
+ type: string;
2901
+ };
2902
+ values: {
2903
+ type: string;
2904
+ items: {
2905
+ type: string[];
2906
+ };
2907
+ };
2908
+ };
2909
+ };
2910
+ };
2911
+ chartStackedRateId: {
2912
+ type: string;
2913
+ };
2914
+ chartStackedLegendPosition: {
2915
+ type: string;
2916
+ enum: string[];
2917
+ };
2918
+ chartGaugeValue: {
2919
+ type: string;
2920
+ additionalProperties: boolean;
2921
+ required: string[];
2922
+ properties: {
2923
+ max: {
2924
+ type: string;
2925
+ exclusiveMinimum: number;
2926
+ };
2927
+ current: {
2928
+ anyOf: ({
2929
+ type: string;
2930
+ pattern?: undefined;
2931
+ } | {
2932
+ type: string;
2933
+ pattern: string;
2934
+ })[];
2935
+ };
2936
+ target: {
2937
+ anyOf: ({
2938
+ type: string;
2939
+ pattern?: undefined;
2940
+ } | {
2941
+ type: string;
2942
+ pattern: string;
2943
+ })[];
2944
+ };
2945
+ previous: {
2946
+ anyOf: ({
2947
+ type: string;
2948
+ pattern?: undefined;
2949
+ } | {
2950
+ type: string;
2951
+ pattern: string;
2952
+ })[];
2953
+ };
2954
+ previousLabel: {
2955
+ type: string;
2956
+ };
2957
+ };
2958
+ };
2959
+ chartWaffleLegendPosition: {
2960
+ type: string;
2961
+ enum: string[];
2962
+ };
2963
+ funnelForm: {
2964
+ type: string;
2965
+ enum: string[];
2966
+ };
2967
+ funnelRate: {
2968
+ type: string;
2969
+ enum: string[];
2970
+ };
2971
+ quadrantPointLabelSide: {
2972
+ type: string;
2973
+ enum: string[];
2974
+ };
2975
+ treeNodeForm: {
2976
+ type: string;
2977
+ enum: string[];
2978
+ };
2979
+ treeSize: {
2980
+ type: string;
2981
+ additionalProperties: boolean;
2982
+ properties: {
2983
+ nodeWidths: {
2984
+ type: string;
2985
+ minItems: number;
2986
+ items: {
2987
+ type: string;
2988
+ exclusiveMinimum: number;
2989
+ };
2990
+ };
2991
+ nodeHeight: {
2992
+ type: string;
2993
+ exclusiveMinimum: number;
2994
+ };
2995
+ titleFontSize: {
2996
+ type: string;
2997
+ exclusiveMinimum: number;
2998
+ };
2999
+ subtitleFontSize: {
3000
+ type: string;
3001
+ exclusiveMinimum: number;
3002
+ };
3003
+ siblingGap: {
3004
+ type: string;
3005
+ minimum: number;
3006
+ };
3007
+ levelGap: {
3008
+ type: string;
3009
+ minimum: number;
3010
+ };
3011
+ };
3012
+ };
3013
+ treeEdgeTone: {
3014
+ type: string;
3015
+ enum: string[];
3016
+ };
3017
+ treeEdgeHead: {
3018
+ type: string;
3019
+ enum: string[];
3020
+ };
3021
+ mindForm: {
3022
+ type: string;
3023
+ enum: string[];
3024
+ };
3025
+ mindSize: {
3026
+ type: string;
3027
+ additionalProperties: boolean;
3028
+ properties: {
3029
+ contentOffset: {
3030
+ type: string;
3031
+ additionalProperties: boolean;
3032
+ required: string[];
3033
+ properties: {
3034
+ x: {
3035
+ type: string;
3036
+ };
3037
+ y: {
3038
+ type: string;
3039
+ };
3040
+ };
3041
+ };
3042
+ root: {
3043
+ type: string;
3044
+ additionalProperties: boolean;
3045
+ properties: {
3046
+ width: {
3047
+ type: string;
3048
+ exclusiveMinimum: number;
3049
+ };
3050
+ height: {
3051
+ type: string;
3052
+ exclusiveMinimum: number;
3053
+ };
3054
+ fontSize: {
3055
+ type: string;
3056
+ exclusiveMinimum: number;
3057
+ };
3058
+ };
3059
+ };
3060
+ branch: {
3061
+ type: string;
3062
+ additionalProperties: boolean;
3063
+ properties: {
3064
+ width: {
3065
+ type: string;
3066
+ exclusiveMinimum: number;
3067
+ };
3068
+ height: {
3069
+ type: string;
3070
+ exclusiveMinimum: number;
3071
+ };
3072
+ fontSize: {
3073
+ type: string;
3074
+ exclusiveMinimum: number;
3075
+ };
3076
+ };
3077
+ };
3078
+ leaf: {
3079
+ type: string;
3080
+ additionalProperties: boolean;
3081
+ properties: {
3082
+ fontSize: {
3083
+ type: string;
3084
+ exclusiveMinimum: number;
3085
+ };
3086
+ };
3087
+ };
3088
+ rootBranchGap: {
3089
+ type: string;
3090
+ minimum: number;
3091
+ };
3092
+ branchLeafGap: {
3093
+ type: string;
3094
+ minimum: number;
3095
+ };
3096
+ branchRowGap: {
3097
+ type: string;
3098
+ minimum: number;
3099
+ };
3100
+ branchRowOffset: {
3101
+ type: string;
3102
+ };
3103
+ leafRowGap: {
3104
+ type: string;
3105
+ minimum: number;
3106
+ };
3107
+ leafRowOffset: {
3108
+ type: string;
3109
+ };
3110
+ };
3111
+ };
3112
+ journeyForm: {
3113
+ type: string;
3114
+ enum: string[];
3115
+ };
3116
+ journeyLineForm: {
3117
+ type: string;
3118
+ enum: string[];
3119
+ };
3120
+ journeyLabels: {
3121
+ type: string;
3122
+ additionalProperties: boolean;
3123
+ required: string[];
3124
+ properties: {
3125
+ delighted: {
3126
+ type: string;
3127
+ minLength: number;
3128
+ };
3129
+ happy: {
3130
+ type: string;
3131
+ minLength: number;
3132
+ };
3133
+ neutral: {
3134
+ type: string;
3135
+ minLength: number;
3136
+ };
3137
+ frustrated: {
3138
+ type: string;
3139
+ minLength: number;
3140
+ };
3141
+ angry: {
3142
+ type: string;
3143
+ minLength: number;
3144
+ };
3145
+ };
3146
+ };
3147
+ sequenceActorForm: {
3148
+ type: string;
3149
+ enum: string[];
3150
+ };
3151
+ sequenceLabelForm: {
3152
+ type: string;
3153
+ enum: string[];
3154
+ };
3155
+ sequenceReturnHead: {
3156
+ type: string;
3157
+ enum: string[];
3158
+ };
3159
+ sequenceRowGap: {
3160
+ type: string;
3161
+ exclusiveMinimum: number;
3162
+ };
3163
+ sequenceGutter: {
3164
+ type: string;
3165
+ exclusiveMinimum: number;
3166
+ };
3167
+ sequenceBandWidth: {
3168
+ type: string;
3169
+ exclusiveMinimum: number;
3170
+ };
3171
+ sequenceSelfLoop: {
3172
+ type: string;
3173
+ additionalProperties: boolean;
3174
+ properties: {
3175
+ form: {
3176
+ type: string;
3177
+ enum: string[];
3178
+ };
3179
+ width: {
3180
+ type: string;
3181
+ exclusiveMinimum: number;
3182
+ };
3183
+ drop: {
3184
+ type: string;
3185
+ exclusiveMinimum: number;
3186
+ };
3187
+ };
3188
+ };
3189
+ sequenceKindLabels: {
3190
+ type: string;
3191
+ additionalProperties: boolean;
3192
+ properties: {
3193
+ call: {
3194
+ type: string;
3195
+ };
3196
+ return: {
3197
+ type: string;
3198
+ };
3199
+ fire: {
3200
+ type: string;
3201
+ };
3202
+ };
3203
+ };
3204
+ figureCard: {
3205
+ type: string;
3206
+ additionalProperties: boolean;
3207
+ required: string[];
3208
+ properties: {
3209
+ label: {
3210
+ type: string;
3211
+ };
3212
+ note: {
3213
+ type: string;
3214
+ };
3215
+ };
3216
+ };
3217
+ figureSize: {
3218
+ type: string;
3219
+ additionalProperties: boolean;
3220
+ required: string[];
3221
+ properties: {
3222
+ width: {
3223
+ type: string;
3224
+ exclusiveMinimum: number;
3225
+ };
3226
+ height: {
3227
+ type: string;
3228
+ exclusiveMinimum: number;
3229
+ };
3230
+ };
3231
+ };
3232
+ terminalDecoration: {
3233
+ type: string;
3234
+ additionalProperties: boolean;
3235
+ properties: {
3236
+ windowControls: {
3237
+ type: string;
3238
+ };
3239
+ cursor: {
3240
+ type: string;
3241
+ };
3242
+ rowOrdinal: {
3243
+ type: string;
3244
+ };
3245
+ };
3246
+ };
3247
+ cornerForm: {
3248
+ type: string;
3249
+ enum: string[];
3250
+ };
3251
+ chartBarShape: {
3252
+ type: string;
3253
+ enum: string[];
3254
+ };
3255
+ figureKindLabel: {
3256
+ type: string;
3257
+ additionalProperties: boolean;
3258
+ required: string[];
3259
+ properties: {
3260
+ text: {
3261
+ type: string;
3262
+ minLength: number;
3263
+ };
3264
+ x: {
3265
+ type: string;
3266
+ };
3267
+ y: {
3268
+ type: string;
3269
+ };
3270
+ fontSize: {
3271
+ type: string;
3272
+ exclusiveMinimum: number;
3273
+ };
3274
+ fontWeight: {
3275
+ type: string;
3276
+ exclusiveMinimum: number;
3277
+ };
3278
+ letterSpacing: {
3279
+ type: string;
3280
+ minimum: number;
3281
+ };
3282
+ };
3283
+ };
3284
+ figureInset: {
3285
+ type: string;
3286
+ additionalProperties: boolean;
3287
+ properties: {
3288
+ top: {
3289
+ type: string;
3290
+ minimum: number;
3291
+ };
3292
+ right: {
3293
+ type: string;
3294
+ minimum: number;
3295
+ };
3296
+ bottom: {
3297
+ type: string;
3298
+ minimum: number;
3299
+ };
3300
+ left: {
3301
+ type: string;
3302
+ minimum: number;
3303
+ };
3304
+ radius: {
3305
+ type: string;
3306
+ minimum: number;
3307
+ };
3308
+ };
3309
+ };
3310
+ journeySize: {
3311
+ type: string;
3312
+ additionalProperties: boolean;
3313
+ properties: {
3314
+ plotPadding: {
3315
+ type: string;
3316
+ additionalProperties: boolean;
3317
+ properties: {
3318
+ left: {
3319
+ type: string;
3320
+ minimum: number;
3321
+ };
3322
+ right: {
3323
+ type: string;
3324
+ minimum: number;
3325
+ };
3326
+ };
3327
+ };
3328
+ pointPadding: {
3329
+ type: string;
3330
+ additionalProperties: boolean;
3331
+ properties: {
3332
+ left: {
3333
+ type: string;
3334
+ minimum: number;
3335
+ };
3336
+ right: {
3337
+ type: string;
3338
+ minimum: number;
3339
+ };
3340
+ };
3341
+ };
3342
+ };
3343
+ };
3344
+ chartBarSize: {
3345
+ type: string;
3346
+ additionalProperties: boolean;
3347
+ properties: {
3348
+ tickFontSize: {
3349
+ $ref: string;
3350
+ };
3351
+ valueFontSize: {
3352
+ $ref: string;
3353
+ };
3354
+ labelFontSize: {
3355
+ $ref: string;
3356
+ };
3357
+ plotPadding: {
3358
+ type: string;
3359
+ additionalProperties: boolean;
3360
+ properties: {
3361
+ top: {
3362
+ type: string;
3363
+ minimum: number;
3364
+ };
3365
+ right: {
3366
+ type: string;
3367
+ minimum: number;
3368
+ };
3369
+ bottom: {
3370
+ type: string;
3371
+ minimum: number;
3372
+ };
3373
+ left: {
3374
+ type: string;
3375
+ minimum: number;
3376
+ };
3377
+ };
3378
+ };
3379
+ barWidth: {
3380
+ $ref: string;
3381
+ };
3382
+ cornerRadius: {
3383
+ type: string;
3384
+ minimum: number;
3385
+ };
3386
+ };
3387
+ };
3388
+ chartLineSize: {
3389
+ type: string;
3390
+ additionalProperties: boolean;
3391
+ properties: {
3392
+ valueLabelOffset: {
3393
+ type: string;
3394
+ additionalProperties: boolean;
3395
+ properties: {
3396
+ above: {
3397
+ type: string;
3398
+ minimum: number;
3399
+ };
3400
+ below: {
3401
+ type: string;
3402
+ minimum: number;
3403
+ };
3404
+ };
3405
+ };
3406
+ tickFontSize: {
3407
+ $ref: string;
3408
+ };
3409
+ periodFontSize: {
3410
+ $ref: string;
3411
+ };
3412
+ pointRadius: {
3413
+ $ref: string;
3414
+ };
3415
+ plotPadding: {
3416
+ type: string;
3417
+ additionalProperties: boolean;
3418
+ properties: {
3419
+ top: {
3420
+ type: string;
3421
+ minimum: number;
3422
+ };
3423
+ right: {
3424
+ type: string;
3425
+ minimum: number;
3426
+ };
3427
+ bottom: {
3428
+ type: string;
3429
+ minimum: number;
3430
+ };
3431
+ left: {
3432
+ type: string;
3433
+ minimum: number;
3434
+ };
3435
+ };
3436
+ };
3437
+ tickGap: {
3438
+ type: string;
3439
+ minimum: number;
3440
+ };
3441
+ pointPadding: {
3442
+ type: string;
3443
+ additionalProperties: boolean;
3444
+ properties: {
3445
+ left: {
3446
+ type: string;
3447
+ minimum: number;
3448
+ };
3449
+ right: {
3450
+ type: string;
3451
+ minimum: number;
3452
+ };
3453
+ };
3454
+ };
3455
+ periodY: {
3456
+ type: string;
3457
+ minimum: number;
3458
+ };
3459
+ };
3460
+ };
3461
+ chartPieSize: {
3462
+ type: string;
3463
+ additionalProperties: boolean;
3464
+ properties: {
3465
+ tableWidth: {
3466
+ $ref: string;
3467
+ };
3468
+ tableLabelFontSize: {
3469
+ $ref: string;
3470
+ };
3471
+ tableValueFontSize: {
3472
+ $ref: string;
3473
+ };
3474
+ tableRowGap: {
3475
+ type: string;
3476
+ minimum: number;
3477
+ };
3478
+ tablePaddingInline: {
3479
+ type: string;
3480
+ minimum: number;
3481
+ };
3482
+ outerRadius: {
3483
+ $ref: string;
3484
+ };
3485
+ centerX: {
3486
+ type: string;
3487
+ minimum: number;
3488
+ };
3489
+ };
3490
+ };
3491
+ chartWaffleSize: {
3492
+ type: string;
3493
+ additionalProperties: boolean;
3494
+ properties: {
3495
+ gridLeft: {
3496
+ type: string;
3497
+ minimum: number;
3498
+ };
3499
+ cellPitch: {
3500
+ $ref: string;
3501
+ };
3502
+ };
3503
+ };
3504
+ chartSlopeLabelTemplate: {
3505
+ type: string;
3506
+ additionalProperties: boolean;
3507
+ properties: {
3508
+ left: {
3509
+ type: string;
3510
+ };
3511
+ right: {
3512
+ type: string;
3513
+ };
3514
+ };
3515
+ };
3516
+ chartSlopeSize: {
3517
+ type: string;
3518
+ additionalProperties: boolean;
3519
+ properties: {
3520
+ pointRadius: {
3521
+ $ref: string;
3522
+ };
3523
+ periodFontSize: {
3524
+ $ref: string;
3525
+ };
3526
+ labelFontSize: {
3527
+ $ref: string;
3528
+ };
3529
+ leftAxisX: {
3530
+ type: string;
3531
+ minimum: number;
3532
+ };
3533
+ axisGap: {
3534
+ $ref: string;
3535
+ };
3536
+ labelAxisGap: {
3537
+ type: string;
3538
+ minimum: number;
3539
+ };
3540
+ plotPadding: {
3541
+ type: string;
3542
+ additionalProperties: boolean;
3543
+ properties: {
3544
+ top: {
3545
+ type: string;
3546
+ minimum: number;
3547
+ };
3548
+ bottom: {
3549
+ type: string;
3550
+ minimum: number;
3551
+ };
3552
+ };
3553
+ };
3554
+ pointPadding: {
3555
+ type: string;
3556
+ additionalProperties: boolean;
3557
+ properties: {
3558
+ top: {
3559
+ type: string;
3560
+ minimum: number;
3561
+ };
3562
+ bottom: {
3563
+ type: string;
3564
+ minimum: number;
3565
+ };
3566
+ };
3567
+ };
3568
+ };
3569
+ };
3570
+ chartStackedLayout: {
3571
+ type: string;
3572
+ additionalProperties: boolean;
3573
+ properties: {
3574
+ legendColumns: {
3575
+ type: string;
3576
+ minimum: number;
3577
+ };
3578
+ legendColumnGap: {
3579
+ type: string;
3580
+ minimum: number;
3581
+ };
3582
+ segmentGap: {
3583
+ type: string;
3584
+ minimum: number;
3585
+ };
3586
+ barThickness: {
3587
+ $ref: string;
3588
+ };
3589
+ barWidth: {
3590
+ $ref: string;
3591
+ };
3592
+ legendMarkSize: {
3593
+ $ref: string;
3594
+ };
3595
+ legendFontSize: {
3596
+ $ref: string;
3597
+ };
3598
+ periodFontSize: {
3599
+ $ref: string;
3600
+ };
3601
+ rateFontSize: {
3602
+ $ref: string;
3603
+ };
3604
+ legendOffsetY: {
3605
+ type: string;
3606
+ };
3607
+ };
3608
+ };
3609
+ chartGaugeSize: {
3610
+ type: string;
3611
+ additionalProperties: boolean;
3612
+ properties: {
3613
+ arcThickness: {
3614
+ $ref: string;
3615
+ };
3616
+ outerRadius: {
3617
+ $ref: string;
3618
+ };
3619
+ plotTop: {
3620
+ type: string;
3621
+ minimum: number;
3622
+ };
3623
+ valueFontSize: {
3624
+ $ref: string;
3625
+ };
3626
+ };
3627
+ };
3628
+ ganttSize: {
3629
+ type: string;
3630
+ additionalProperties: boolean;
3631
+ properties: {
3632
+ taskLabelFontSize: {
3633
+ $ref: string;
3634
+ };
3635
+ taskLabelAlign: {
3636
+ type: string;
3637
+ enum: string[];
3638
+ };
3639
+ taskLabelX: {
3640
+ type: string;
3641
+ minimum: number;
3642
+ };
3643
+ tickFontSize: {
3644
+ $ref: string;
3645
+ };
3646
+ tickCount: {
3647
+ type: string;
3648
+ minimum: number;
3649
+ };
3650
+ barThickness: {
3651
+ $ref: string;
3652
+ };
3653
+ milestoneFontSize: {
3654
+ $ref: string;
3655
+ };
3656
+ milestoneRadius: {
3657
+ $ref: string;
3658
+ };
3659
+ dependencyStrokeWidth: {
3660
+ $ref: string;
3661
+ };
3662
+ taskColumnWidth: {
3663
+ type: string;
3664
+ minimum: number;
3665
+ };
3666
+ timelinePaddingRight: {
3667
+ type: string;
3668
+ minimum: number;
3669
+ };
3670
+ };
3671
+ };
3672
+ quadrantLabelPosition: {
3673
+ type: string;
3674
+ enum: string[];
3675
+ };
3676
+ quadrantSize: {
3677
+ type: string;
3678
+ additionalProperties: boolean;
3679
+ properties: {
3680
+ plotOffset: {
3681
+ type: string;
3682
+ additionalProperties: boolean;
3683
+ properties: {
3684
+ x: {
3685
+ type: string;
3686
+ minimum: number;
3687
+ };
3688
+ y: {
3689
+ type: string;
3690
+ minimum: number;
3691
+ };
3692
+ };
3693
+ };
3694
+ plotSize: {
3695
+ $ref: string;
3696
+ };
3697
+ pointRadius: {
3698
+ $ref: string;
3699
+ };
3700
+ pointFontSize: {
3701
+ $ref: string;
3702
+ };
3703
+ pointLabelGap: {
3704
+ type: string;
3705
+ minimum: number;
3706
+ };
3707
+ quadrantFontSize: {
3708
+ $ref: string;
3709
+ };
3710
+ axisFontSize: {
3711
+ $ref: string;
3712
+ };
3713
+ };
3714
+ };
3715
+ eyebrow: {
3716
+ type: string;
3717
+ description: string;
3718
+ };
3719
+ axes: {
3720
+ type: string;
3721
+ additionalProperties: boolean;
3722
+ description: string;
3723
+ properties: {
3724
+ x: {
3725
+ type: string;
3726
+ additionalProperties: boolean;
3727
+ properties: {
3728
+ left: {
3729
+ type: string;
3730
+ };
3731
+ right: {
3732
+ type: string;
3733
+ };
3734
+ label: {
3735
+ type: string;
3736
+ };
3737
+ direction: {
3738
+ type: string;
3739
+ enum: boolean[];
3740
+ };
3741
+ };
3742
+ };
3743
+ y: {
3744
+ type: string;
3745
+ additionalProperties: boolean;
3746
+ properties: {
3747
+ bottom: {
3748
+ type: string;
3749
+ };
3750
+ top: {
3751
+ type: string;
3752
+ };
3753
+ label: {
3754
+ type: string;
3755
+ };
3756
+ direction: {
3757
+ type: string;
3758
+ enum: boolean[];
3759
+ };
3760
+ };
3761
+ };
3762
+ };
3763
+ };
3764
+ regions: {
3765
+ type: string;
3766
+ additionalProperties: boolean;
3767
+ description: string;
3768
+ properties: {
3769
+ 左上: {
3770
+ type: string;
3771
+ };
3772
+ 右上: {
3773
+ type: string;
3774
+ };
3775
+ 左下: {
3776
+ type: string;
3777
+ };
3778
+ 右下: {
3779
+ type: string;
3780
+ };
3781
+ };
3782
+ };
3783
+ actors: {
3784
+ type: string;
3785
+ minItems: number;
3786
+ description: string;
3787
+ items: {
3788
+ oneOf: ({
3789
+ type: string;
3790
+ description: string;
3791
+ required?: undefined;
3792
+ additionalProperties?: undefined;
3793
+ properties?: undefined;
3794
+ } | {
3795
+ type: string;
3796
+ required: string[];
3797
+ additionalProperties: boolean;
3798
+ properties: {
3799
+ name: {
3800
+ type: string;
3801
+ minLength: number;
3802
+ description: string;
3803
+ };
3804
+ kind: {
3805
+ type: string;
3806
+ description: string;
3807
+ };
3808
+ subtitle: {
3809
+ type: string;
3810
+ description: string;
3811
+ };
3812
+ kindForm: {
3813
+ type: string;
3814
+ enum: string[];
3815
+ };
3816
+ icon: {
3817
+ type: string;
3818
+ enum: string[];
3819
+ };
3820
+ emptyRowsNote: {
3821
+ type: string;
3822
+ };
3823
+ titleAlign: {
3824
+ type: string;
3825
+ enum: string[];
3826
+ };
3827
+ rowRules: {
3828
+ type: string;
3829
+ };
3830
+ rowStripe: {
3831
+ type: string;
3832
+ };
3833
+ rowLayout: {
3834
+ type: string;
3835
+ additionalProperties: boolean;
3836
+ properties: {
3837
+ titleBaseline: {
3838
+ type: string;
3839
+ minimum: number;
3840
+ };
3841
+ rowTop: {
3842
+ type: string;
3843
+ minimum: number;
3844
+ };
3845
+ rowPitch: {
3846
+ type: string;
3847
+ exclusiveMinimum: number;
3848
+ };
3849
+ };
3850
+ };
3851
+ rowDividerForm: {
3852
+ type: string;
3853
+ enum: string[];
3854
+ };
3855
+ rowWell: {
3856
+ type: string;
3857
+ additionalProperties: boolean;
3858
+ properties: {
3859
+ top: {
3860
+ type: string;
3861
+ minimum: number;
3862
+ };
3863
+ right: {
3864
+ type: string;
3865
+ minimum: number;
3866
+ };
3867
+ bottom: {
3868
+ type: string;
3869
+ minimum: number;
3870
+ };
3871
+ left: {
3872
+ type: string;
3873
+ minimum: number;
3874
+ };
3875
+ radius: {
3876
+ type: string;
3877
+ minimum: number;
3878
+ };
3879
+ };
3880
+ };
3881
+ rowMarkForm: {
3882
+ type: string;
3883
+ enum: string[];
3884
+ };
3885
+ nestIn: {
3886
+ type: string;
3887
+ minLength: number;
3888
+ };
3889
+ figureCard: {
2041
3890
  type: string;
3891
+ additionalProperties: boolean;
3892
+ required: string[];
3893
+ properties: {
3894
+ label: {
3895
+ type: string;
3896
+ };
3897
+ note: {
3898
+ type: string;
3899
+ };
3900
+ };
2042
3901
  };
2043
- top: {
3902
+ stationNamePosition: {
2044
3903
  type: string;
3904
+ enum: string[];
3905
+ description: string;
2045
3906
  };
2046
- };
2047
- };
2048
- };
2049
- };
2050
- actors: {
2051
- type: string;
2052
- minItems: number;
2053
- description: string;
2054
- items: {
2055
- oneOf: ({
2056
- type: string;
2057
- description: string;
2058
- required?: undefined;
2059
- additionalProperties?: undefined;
2060
- properties?: undefined;
2061
- } | {
2062
- type: string;
2063
- required: string[];
2064
- additionalProperties: boolean;
2065
- properties: {
2066
- name: {
3907
+ subtitlePlacement: {
2067
3908
  type: string;
2068
- minLength: number;
3909
+ enum: string[];
2069
3910
  description: string;
2070
3911
  };
2071
- kind: {
3912
+ titleFontSize: {
2072
3913
  type: string;
3914
+ exclusiveMinimum: number;
2073
3915
  description: string;
2074
3916
  };
2075
- subtitle: {
3917
+ markGap: {
2076
3918
  type: string;
3919
+ exclusiveMinimum: number;
2077
3920
  description: string;
2078
3921
  };
2079
3922
  eyebrow: {
@@ -2098,10 +3941,34 @@ declare const diagramJsonSchema: {
2098
3941
  marks: {
2099
3942
  type: string;
2100
3943
  items: {
2101
- type: string;
3944
+ oneOf: ({
3945
+ type: string;
3946
+ additionalProperties?: undefined;
3947
+ required?: undefined;
3948
+ properties?: undefined;
3949
+ } | {
3950
+ type: string;
3951
+ additionalProperties: boolean;
3952
+ required: string[];
3953
+ properties: {
3954
+ mark: {
3955
+ type: string;
3956
+ };
3957
+ tone: {
3958
+ type: string;
3959
+ enum: string[];
3960
+ };
3961
+ };
3962
+ })[];
2102
3963
  };
2103
3964
  description: string;
2104
3965
  };
3966
+ stage: {
3967
+ type: string;
3968
+ minLength: number;
3969
+ pattern: string;
3970
+ description: string;
3971
+ };
2105
3972
  lane: {
2106
3973
  type: string;
2107
3974
  description: string;
@@ -2150,6 +4017,37 @@ declare const diagramJsonSchema: {
2150
4017
  type: string;
2151
4018
  description: string;
2152
4019
  };
4020
+ startLabel: {
4021
+ type: string;
4022
+ description: string;
4023
+ };
4024
+ milestone: {
4025
+ type: string;
4026
+ description: string;
4027
+ };
4028
+ emphasis: {
4029
+ type: string;
4030
+ enum: string[];
4031
+ description: string;
4032
+ };
4033
+ at: {
4034
+ type: string;
4035
+ minItems: number;
4036
+ maxItems: number;
4037
+ items: {
4038
+ type: string[];
4039
+ };
4040
+ description: string;
4041
+ };
4042
+ 点の位置: {
4043
+ type: string;
4044
+ minItems: number;
4045
+ maxItems: number;
4046
+ items: {
4047
+ type: string[];
4048
+ };
4049
+ description: string;
4050
+ };
2153
4051
  touchpoint: {
2154
4052
  type: string;
2155
4053
  description: string;
@@ -2158,6 +4056,11 @@ declare const diagramJsonSchema: {
2158
4056
  type: string;
2159
4057
  description: string;
2160
4058
  };
4059
+ opportunityPosition: {
4060
+ type: string;
4061
+ enum: string[];
4062
+ description: string;
4063
+ };
2161
4064
  posX: {
2162
4065
  type: string;
2163
4066
  description: string;
@@ -2178,6 +4081,10 @@ declare const diagramJsonSchema: {
2178
4081
  type: string;
2179
4082
  description: string;
2180
4083
  };
4084
+ phase: {
4085
+ type: string;
4086
+ description: string;
4087
+ };
2181
4088
  pos: {
2182
4089
  type: string;
2183
4090
  additionalProperties: boolean;
@@ -2192,6 +4099,28 @@ declare const diagramJsonSchema: {
2192
4099
  };
2193
4100
  };
2194
4101
  };
4102
+ posRel: {
4103
+ type: string;
4104
+ additionalProperties: boolean;
4105
+ description: string;
4106
+ required: string[];
4107
+ properties: {
4108
+ anchor: {
4109
+ type: string;
4110
+ minLength: number;
4111
+ description: string;
4112
+ };
4113
+ dir: {
4114
+ type: string;
4115
+ enum: string[];
4116
+ description: string;
4117
+ };
4118
+ gap: {
4119
+ type: string;
4120
+ description: string;
4121
+ };
4122
+ };
4123
+ };
2195
4124
  visibleIf: {
2196
4125
  type: string;
2197
4126
  description: string;
@@ -2368,6 +4297,16 @@ declare const diagramJsonSchema: {
2368
4297
  enum: string[];
2369
4298
  description: string;
2370
4299
  };
4300
+ fromSide: {
4301
+ type: string;
4302
+ enum: string[];
4303
+ description: string;
4304
+ };
4305
+ toSide: {
4306
+ type: string;
4307
+ enum: string[];
4308
+ description: string;
4309
+ };
2371
4310
  head: {
2372
4311
  type: string;
2373
4312
  enum: string[];
@@ -2415,6 +4354,57 @@ declare const diagramJsonSchema: {
2415
4354
  type: string;
2416
4355
  description: string;
2417
4356
  };
4357
+ posX1: {
4358
+ type: string;
4359
+ description: string;
4360
+ };
4361
+ posY1: {
4362
+ type: string;
4363
+ description: string;
4364
+ };
4365
+ posX2: {
4366
+ type: string;
4367
+ description: string;
4368
+ };
4369
+ posY2: {
4370
+ type: string;
4371
+ description: string;
4372
+ };
4373
+ waypoints: {
4374
+ type: string;
4375
+ items: {
4376
+ type: string;
4377
+ additionalProperties: boolean;
4378
+ required: string[];
4379
+ properties: {
4380
+ x: {
4381
+ type: string;
4382
+ };
4383
+ y: {
4384
+ type: string;
4385
+ };
4386
+ };
4387
+ };
4388
+ };
4389
+ labelCollision: {
4390
+ type: string;
4391
+ enum: string[];
4392
+ };
4393
+ labelSize: {
4394
+ type: string;
4395
+ additionalProperties: boolean;
4396
+ properties: {
4397
+ width: {
4398
+ $ref: string;
4399
+ };
4400
+ height: {
4401
+ $ref: string;
4402
+ };
4403
+ fontSize: {
4404
+ $ref: string;
4405
+ };
4406
+ };
4407
+ };
2418
4408
  overlay: {
2419
4409
  type: string;
2420
4410
  description: string;
@@ -2526,6 +4516,10 @@ declare const diagramJsonSchema: {
2526
4516
  type: string;
2527
4517
  description: string;
2528
4518
  };
4519
+ description: {
4520
+ type: string;
4521
+ description: string;
4522
+ };
2529
4523
  badge: {
2530
4524
  type: string;
2531
4525
  description: string;
@@ -2582,6 +4576,9 @@ declare const diagramJsonSchema: {
2582
4576
  type: string;
2583
4577
  minimum: number;
2584
4578
  };
4579
+ contentOffsetX: {
4580
+ type: string;
4581
+ };
2585
4582
  laneWidth: {
2586
4583
  type: string;
2587
4584
  minimum: number;
@@ -2625,6 +4622,9 @@ declare const diagramJsonSchema: {
2625
4622
  label: {
2626
4623
  type: string;
2627
4624
  };
4625
+ subtitle: {
4626
+ type: string;
4627
+ };
2628
4628
  contain: {
2629
4629
  type: string;
2630
4630
  };
@@ -3243,11 +5243,163 @@ declare const diagramJsonSchema: {
3243
5243
  enum: string[];
3244
5244
  description: string;
3245
5245
  };
5246
+ shape: {
5247
+ type: string;
5248
+ enum: string[];
5249
+ description: string;
5250
+ };
5251
+ order: {
5252
+ type: string;
5253
+ enum: string[];
5254
+ description: string;
5255
+ };
5256
+ theme: {
5257
+ type: string;
5258
+ enum: string[];
5259
+ description: string;
5260
+ };
3246
5261
  palette: {
3247
5262
  type: string;
3248
5263
  enum: string[];
3249
5264
  description: string;
3250
5265
  };
5266
+ legend: {
5267
+ type: string;
5268
+ description: string;
5269
+ items: {
5270
+ type: string;
5271
+ additionalProperties: boolean;
5272
+ required: string[];
5273
+ properties: {
5274
+ mark: {
5275
+ type: string;
5276
+ enum: string[];
5277
+ };
5278
+ text: {
5279
+ type: string;
5280
+ minLength: number;
5281
+ };
5282
+ tone: {
5283
+ type: string;
5284
+ };
5285
+ lineStyle: {
5286
+ type: string;
5287
+ enum: string[];
5288
+ };
5289
+ align: {
5290
+ type: string;
5291
+ enum: string[];
5292
+ };
5293
+ lead: {
5294
+ type: string;
5295
+ };
5296
+ };
5297
+ oneOf: ({
5298
+ required: string[];
5299
+ not: {
5300
+ anyOf: {
5301
+ required: string[];
5302
+ }[];
5303
+ required?: undefined;
5304
+ };
5305
+ allOf?: undefined;
5306
+ } | {
5307
+ not: {
5308
+ required: string[];
5309
+ anyOf?: undefined;
5310
+ };
5311
+ allOf: {
5312
+ not: {
5313
+ required: string[];
5314
+ };
5315
+ }[];
5316
+ required?: undefined;
5317
+ })[];
5318
+ };
5319
+ };
5320
+ legendFontSize: {
5321
+ type: string;
5322
+ exclusiveMinimum: number;
5323
+ description: string;
5324
+ };
5325
+ edgeEndGap: {
5326
+ type: string;
5327
+ minimum: number;
5328
+ description: string;
5329
+ };
5330
+ legendOffset: {
5331
+ type: string;
5332
+ additionalProperties: boolean;
5333
+ properties: {
5334
+ x: {
5335
+ type: string;
5336
+ };
5337
+ y: {
5338
+ type: string;
5339
+ };
5340
+ };
5341
+ };
5342
+ stageHeader: {
5343
+ type: string;
5344
+ description: string;
5345
+ additionalProperties: boolean;
5346
+ required: string[];
5347
+ properties: {
5348
+ leftPad: {
5349
+ type: string;
5350
+ minimum: number;
5351
+ };
5352
+ topPad: {
5353
+ type: string;
5354
+ minimum: number;
5355
+ };
5356
+ numberSize: {
5357
+ type: string;
5358
+ exclusiveMinimum: number;
5359
+ };
5360
+ gap: {
5361
+ type: string;
5362
+ minimum: number;
5363
+ };
5364
+ nameSize: {
5365
+ type: string;
5366
+ exclusiveMinimum: number;
5367
+ };
5368
+ bottomPad: {
5369
+ type: string;
5370
+ minimum: number;
5371
+ };
5372
+ };
5373
+ };
5374
+ stageLayout: {
5375
+ type: string;
5376
+ additionalProperties: boolean;
5377
+ properties: {
5378
+ columnWidths: {
5379
+ type: string;
5380
+ additionalProperties: {
5381
+ type: string;
5382
+ minimum: number;
5383
+ };
5384
+ };
5385
+ columnGap: {
5386
+ type: string;
5387
+ minimum: number;
5388
+ };
5389
+ backDetourTopGap: {
5390
+ type: string;
5391
+ minimum: number;
5392
+ };
5393
+ backDetourSideGap: {
5394
+ type: string;
5395
+ minimum: number;
5396
+ };
5397
+ backDetourTargetInset: {
5398
+ type: string;
5399
+ minimum: number;
5400
+ };
5401
+ };
5402
+ };
3251
5403
  reveal: {
3252
5404
  type: string;
3253
5405
  enum: string[];
@@ -3407,4 +5559,4 @@ interface CompileOpts {
3407
5559
  */
3408
5560
  declare function textDslToDiagram(src: string, opts?: CompileOpts): CdlDiagram;
3409
5561
 
3410
- export { type AnchorBox, type CompileNotice, type CompileOpts, DIAGRAM_BOUNDARY_PADDING, DIRECTION_ALIAS, DRAW_TARGETS, DRAW_WORDS, type DiagramBoundingBox, type DragonJson, type DslActor, type DslAnimate, type DslDocument, type DslError, type DslGroup, type DslLane, type DslPhase, type DslSet, type DslState, type DslStep, type DslTween, type DslValue, type DslViewport, type FocusEntry, type InputSize, JSONを分解する, type JsonActor, type JsonAxes, type JsonDslError, type JsonPhase, type JsonStep, type LayoutMode, type LayoutPos, type LintIssue, type LintReport, type LintSeverity, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, type PresetType, RELATIVE_GAP_DEFAULT, type RelativeDirection, type RelativePos, TONE_ALIAS, TOP_LEVEL_KEYS, autoFix, compileToCdl, computeDiagramBoundingBox, countBytes, countDiagramElements, countDocElements, describeOversize, describeOversizeSource, diagramJsonSchema, isColorValue, jsonToDiagram, lintDiagram, measureActorBoxes, normalizePartScale, orderByDependency, parseFocusEntry, parseRelativePos, parseTextDsl, parseTextDslV05, partBoxInFrame, partDrawsInDiagram, partIsMeasurable, partRenderSize, partScaleFactor, partTargetScale, partTargetSize, partVisualSize, partsBaseBottom, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, type トークン, type トークンの種類, 区間に広げる, 記法を分解する, 部品に上書きを当てる };
5562
+ export { ALL_DIAGRAM_SHAPES, type AnchorBox, type CompileNotice, type CompileOpts, DIAGRAM_BOUNDARY_PADDING, DIAGRAM_SHAPES, DIRECTION_ALIAS, DRAW_TARGETS, DRAW_WORDS, type DiagramBoundingBox, type DragonJson, type DslActor, type DslAnimate, type DslDiagramShape, type DslDocument, type DslError, type DslGroup, type DslLane, type DslPhase, type DslSet, type DslShape, type DslState, type DslStep, type DslSwimlaneShape, type DslTheme, type DslTween, type DslValue, type DslViewport, type FocusEntry, type InputSize, JSONを分解する, type JsonActor, type JsonAxes, type JsonDslError, type JsonPhase, type JsonStep, LEGEND_MARK_ALIAS, type LayoutMode, type LayoutPos, type LintIssue, type LintReport, type LintSeverity, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, ORDERS, ORDER_ALIAS, PHASE_ITEM_WORDS, PRESET_TYPES, type PresetType, RELATIVE_GAP_DEFAULT, type RelativeDirection, type RelativePos, SHAPES, SWIMLANE_SHAPES, THEMES, THEME_ALIAS, TONE_ALIAS, TOP_LEVEL_KEYS, TYPE_ALIASES, autoFix, compileToCdl, computeDiagramBoundingBox, countBytes, countDiagramElements, countDocElements, describeOversize, describeOversizeSource, diagramJsonSchema, isColorValue, jsonToDiagram, lintDiagram, measureActorBoxes, normalizePartScale, orderByDependency, parseFocusEntry, parseRelativePos, parseTextDsl, parseTextDslV05, partBoxInFrame, partDrawsInDiagram, partIsMeasurable, partRenderSize, partScaleFactor, partTargetScale, partTargetSize, partVisualSize, partsBaseBottom, partsGridCenters, pointsOutside, rectsOverlap, resolveLegendMark, resolveRelativePos, resolveTheme, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, type トークン, type トークンの種類, 区間に広げる, 意匠の円の区画の間, 意匠の字の測り方, 意匠の棒の角, 書いた場所の鍵, type 書いた行の表, 棒を描く節か, 測るために受け取った知らせの数, 行頭の語, 記法を分解する, 部品に上書きを当てる };