@cardenelabs/dragon 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { NODE_KINDS, TONES, parseFormula, extractIdentifiers, inputDefaultValue, layout, applyDerivedValues, diagram, rendersRows, requiredRowsHeight, requiredRowsWidth, sequence, flow, swimlane, er, stateMachine, topology } from '@cardenelabs/cdl';
1
+ import { NODE_KINDS, TONES, EDGE_STYLES, EDGE_REVEALS, parseFormula, EDGE_HEADS, EDGE_HEAD_FILLS, extractIdentifiers, inputDefaultValue, layout, applyDerivedValues, diagram, classDiagram, sequence, sequenceStepId, flow, swimlane, er, stateMachine, topology, CLASS_RELATION_LOOK, SEQUENCE_MESSAGE_LOOK, FSM_ACTION_MARK } from '@cardenelabs/cdl';
2
2
 
3
3
  // src/keywords.ts
4
4
  var HEADERS = {
@@ -1883,6 +1883,10 @@ var \u3064\u307E\u307F\u306E\u8868 = {
1883
1883
 
1884
1884
  // src/v05/parser.ts
1885
1885
  var EDGE_SIDE_VALUES = ["top", "right", "bottom", "left"];
1886
+ var EDGE_HEAD_VALUES = EDGE_HEADS;
1887
+ var EDGE_HEAD_FILL_VALUES = EDGE_HEAD_FILLS;
1888
+ var CLASS_RELATION_VALUES = Object.keys(CLASS_RELATION_LOOK);
1889
+ var SEQ_MESSAGE_VALUES = Object.keys(SEQUENCE_MESSAGE_LOOK);
1886
1890
  var TOP_LEVEL_KEYS = [
1887
1891
  "title",
1888
1892
  "type",
@@ -1907,7 +1911,11 @@ var TOP_LEVEL_KEYS = [
1907
1911
  // 押下などの出来事で動く仕掛け (#1393)
1908
1912
  "events",
1909
1913
  // 巻き上げに応じて進む値 (#1393)
1910
- "scrolls"
1914
+ "scrolls",
1915
+ // 動いている間の帯 (#1466)。 順序図だけが読む
1916
+ "bands",
1917
+ // 矢印をいつ出すか (#1470)
1918
+ "reveal"
1911
1919
  ];
1912
1920
  var LANE_ID_ENTRY = /^([\p{L}\p{N}_-]+)\s*:\s*\{([^}]*)\}\s*$/u;
1913
1921
  function \u540D\u524D\u3068\u4E2D\u62EC\u5F27\u306B\u5272\u308B(\u884C) {
@@ -1994,6 +2002,11 @@ var PRESET_TYPES = /* @__PURE__ */ new Set([
1994
2002
  "pie",
1995
2003
  "bar",
1996
2004
  "line",
2005
+ "gauge",
2006
+ "radial",
2007
+ "stat",
2008
+ "waffle",
2009
+ "stacked",
1997
2010
  "funnel",
1998
2011
  "tree",
1999
2012
  "journey",
@@ -2042,7 +2055,7 @@ var NODE_KIND_VALID = /* @__PURE__ */ new Set([
2042
2055
  ...Object.keys(INFRA_KIND_ALIAS)
2043
2056
  ]);
2044
2057
  var TONE_VALID = new Set(TONES);
2045
- var STYLE_VALID = /* @__PURE__ */ new Set(["solid", "dotted-flow"]);
2058
+ var STYLE_VALID = new Set(EDGE_STYLES);
2046
2059
  function \u66F8\u3051\u308B\u8272\u540D() {
2047
2060
  return [.../* @__PURE__ */ new Set([...TONES, ...Object.keys(TONE_ALIAS)])];
2048
2061
  }
@@ -2062,6 +2075,7 @@ function parseTextDslV05(src) {
2062
2075
  let type = null;
2063
2076
  let eyebrow = null;
2064
2077
  let eyebrowLine = 0;
2078
+ let reveal = null;
2065
2079
  let axes = void 0;
2066
2080
  let axesLine = 0;
2067
2081
  let actors = [];
@@ -2070,6 +2084,7 @@ function parseTextDslV05(src) {
2070
2084
  const values = [];
2071
2085
  let viewport = void 0;
2072
2086
  let lanesMap = void 0;
2087
+ let bands = void 0;
2073
2088
  let readoutsList = void 0;
2074
2089
  let inputsList = void 0;
2075
2090
  let formulasList = void 0;
@@ -2102,6 +2117,22 @@ function parseTextDslV05(src) {
2102
2117
  i += 1;
2103
2118
  continue;
2104
2119
  }
2120
+ if (head.key === "reveal") {
2121
+ const v = (head.value ?? "").trim();
2122
+ if (v.length > 0) {
2123
+ if (EDGE_REVEALS.includes(v)) {
2124
+ reveal = v;
2125
+ } else {
2126
+ errors.push({
2127
+ line: line.no,
2128
+ message: `reveal \u304C\u8AAD\u3081\u307E\u305B\u3093 (\u66F8\u3044\u305F\u5024: ${v})`,
2129
+ hint: `\u4F7F\u3048\u308B\u8A9E = ${EDGE_REVEALS.join(" / ")}`
2130
+ });
2131
+ }
2132
+ }
2133
+ i += 1;
2134
+ continue;
2135
+ }
2105
2136
  if (head.key === "eyebrow") {
2106
2137
  const v = (head.value ?? "").trim();
2107
2138
  eyebrow = v.length > 0 ? v : null;
@@ -2282,6 +2313,24 @@ function parseTextDslV05(src) {
2282
2313
  i = next;
2283
2314
  continue;
2284
2315
  }
2316
+ if (head.key === "bands") {
2317
+ const { items, next } = collectIndentedList(lines, i + 1, line.indent);
2318
+ bands = [];
2319
+ for (const it of items) {
2320
+ const m = it.trimmed.match(/^(?:-\s*)?(.+?)\s*:\s*(\d+)\s*\.\.\s*(\d+)\s*$/);
2321
+ if (!m) {
2322
+ errors.push({
2323
+ line: it.no,
2324
+ message: `\u5E2F\u306E\u66F8\u304D\u65B9\u304C\u8AAD\u3081\u307E\u305B\u3093: "${it.trimmed}"`,
2325
+ hint: "use `- DB: 1..2` (\u9762\u306E\u540D\u524D\u3068\u3001\u6BB5\u306E\u756A\u53F7\u306E\u533A\u9593)"
2326
+ });
2327
+ continue;
2328
+ }
2329
+ bands.push({ actor: m[1], from: Number(m[2]), to: Number(m[3]) });
2330
+ }
2331
+ i = next;
2332
+ continue;
2333
+ }
2285
2334
  if (head.key === "lanes") {
2286
2335
  const { items, next } = collectIndentedList(lines, i + 1, line.indent);
2287
2336
  lanesMap = {};
@@ -2496,6 +2545,7 @@ function parseTextDslV05(src) {
2496
2545
  title,
2497
2546
  type,
2498
2547
  ...eyebrow !== null ? { eyebrow, eyebrowPos: { line: eyebrowLine } } : {},
2548
+ ...reveal !== null ? { reveal } : {},
2499
2549
  ...axes !== void 0 ? { axes, axesPos: { line: axesLine } } : {},
2500
2550
  actors,
2501
2551
  flow: flow2,
@@ -2503,6 +2553,7 @@ function parseTextDslV05(src) {
2503
2553
  ...values.length > 0 ? { values } : {},
2504
2554
  viewport,
2505
2555
  lanes: lanesMap,
2556
+ ...bands && bands.length > 0 ? { bands } : {},
2506
2557
  readouts: readoutsList,
2507
2558
  inputs: inputsList,
2508
2559
  formulas: formulasList,
@@ -3427,6 +3478,11 @@ function applyContinuationLines(actor, rest, errors) {
3427
3478
  case "\u5024":
3428
3479
  out.value = stripQuotes(raw);
3429
3480
  break;
3481
+ // 前の時点の値 (#1450)。 内訳を帯で示す図と値 1 つを大きく示す図が読む
3482
+ case "previous":
3483
+ case "\u524D\u306E\u5024":
3484
+ out.previous = stripQuotes(raw);
3485
+ break;
3430
3486
  case "shape":
3431
3487
  case "\u56F3\u5F62":
3432
3488
  out.shape = \u56F3\u5F62\u3068\u3057\u3066\u8AAD\u3080(raw, ln.no, errors);
@@ -3460,6 +3516,19 @@ function applyContinuationLines(actor, rest, errors) {
3460
3516
  case "\u884C":
3461
3517
  out.rows = raw.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim())).filter(Boolean);
3462
3518
  break;
3519
+ /*
3520
+ * 行頭の印 (#1466)。 `rows` と同じ並びで、空文字はその行に印を付けない。
3521
+ *
3522
+ * **語の意味は図の種類が決める**。 ER は `pk` / `fk` / `opt`、状態遷移は
3523
+ * `entry` / `exit` / `do` / `internal`。 印の 2 軸 (形 × 塗り) は共通だが、その軸が
3524
+ * 何を指すかは種類ごとに違う = 1 つの語彙に畳むと、どの図でも意味が合わない語が残る。
3525
+ *
3526
+ * 空の要素を捨てない (`filter(Boolean)` を掛けない) = 並びが `rows` とずれる。
3527
+ */
3528
+ case "marks":
3529
+ case "\u5370":
3530
+ out.marks = raw.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim()));
3531
+ break;
3463
3532
  case "\u4F4D\u7F6E":
3464
3533
  case "pos": {
3465
3534
  const value = stripQuotes(raw);
@@ -3574,8 +3643,14 @@ var ACTOR_ITEM_KEYS = /* @__PURE__ */ new Set([
3574
3643
  "\u88DC\u8DB3",
3575
3644
  "value",
3576
3645
  "\u5024",
3646
+ // 前の時点の値 (#1450)。 内訳の変化を帯で示す図と、値 1 つを大きく示す図が読む
3647
+ "previous",
3648
+ "\u524D\u306E\u5024",
3577
3649
  "rows",
3578
3650
  "\u884C",
3651
+ // 行頭の印 (#1466)。 `rows` と同じ並びで、形 × 塗り の 2 軸を語で書く
3652
+ "marks",
3653
+ "\u5370",
3579
3654
  // 箱の中に描く図形 (#1374)
3580
3655
  "shape",
3581
3656
  "\u56F3\u5F62",
@@ -3699,7 +3774,9 @@ var ACTOR_RESERVED_FIELDS = /* @__PURE__ */ new Set([
3699
3774
  "subtitle",
3700
3775
  "eyebrow",
3701
3776
  "value",
3777
+ "previous",
3702
3778
  "rows",
3779
+ "marks",
3703
3780
  "lane",
3704
3781
  "stack",
3705
3782
  "initial",
@@ -3801,7 +3878,9 @@ var INLINE_ACTOR_ALIASES = {
3801
3878
  \u7A2E\u985E: "kind",
3802
3879
  \u88DC\u8DB3: "subtitle",
3803
3880
  \u5024: "value",
3804
- \u884C: "rows"
3881
+ \u524D\u306E\u5024: "previous",
3882
+ \u884C: "rows",
3883
+ \u5370: "marks"
3805
3884
  };
3806
3885
  function \u4E2D\u62EC\u5F27\u306E\u5225\u540D\u3092\u5BC4\u305B\u308B(opts) {
3807
3886
  let \u89E6\u3063\u305F = false;
@@ -3819,7 +3898,9 @@ var INLINE_ACTOR_KEYS = /* @__PURE__ */ new Set([
3819
3898
  "subtitle",
3820
3899
  "eyebrow",
3821
3900
  "value",
3901
+ "previous",
3822
3902
  "rows",
3903
+ "marks",
3823
3904
  "lane",
3824
3905
  "stack",
3825
3906
  "initial",
@@ -3866,6 +3947,27 @@ var FLOW_INLINE_READERS = {
3866
3947
  cardinality: (v) => v,
3867
3948
  // 矢印がどの辺から出るか (#1385)。 描画側は 4 方向を取り、書かなければ自動で選ぶ
3868
3949
  side: (v) => v !== void 0 && EDGE_SIDE_VALUES.includes(v) ? v : void 0,
3950
+ // 矢印の先の形 (#1462)。 書かなければ描画側の既定 (塗った三角) になる
3951
+ head: (v) => v !== void 0 && EDGE_HEAD_VALUES.includes(v) ? v : void 0,
3952
+ // 出どころ側の端の形 (#1466)。 ER は端ごとに違う個数を示すので両端に要る
3953
+ tailHead: (v) => v !== void 0 && EDGE_HEAD_VALUES.includes(v) ? v : void 0,
3954
+ // 端の印の塗り (#1466)。 白抜きの菱が「持つ」、塗った菱が「抱える」
3955
+ headFill: (v) => v !== void 0 && EDGE_HEAD_FILL_VALUES.includes(v) ? v : void 0,
3956
+ tailHeadFill: (v) => v !== void 0 && EDGE_HEAD_FILL_VALUES.includes(v) ? v : void 0,
3957
+ /*
3958
+ * クラス図の関係の種類 (#1466)。 書くと **線と端の形と塗りと付く側** がまとめて決まる
3959
+ * (`CLASS_RELATION_LOOK`)。
3960
+ *
3961
+ * 4 つを個別に書かせない = 組合せは 6 通りしか無く、1 つでも書き違えると読み手に別の意味で
3962
+ * 伝わる (菱を逆に置くと持ち主が入れ替わる)。 種類で書けばその 6 通りから外れない。
3963
+ */
3964
+ relation: (v) => v !== void 0 && CLASS_RELATION_VALUES.includes(v) ? v : void 0,
3965
+ /*
3966
+ * 順序図の言づての種類 (#1466)。 書くと線と矢の形がまとめて決まる。
3967
+ *
3968
+ * 呼ぶ (実線 + 塗った矢) / 返す (破線 + 開いた矢) / 投げる (実線 + 開いた矢) の 3 つ。
3969
+ */
3970
+ kind: (v) => v !== void 0 && SEQ_MESSAGE_VALUES.includes(v) ? v : void 0,
3869
3971
  /*
3870
3972
  * 矢印を値に追随させる 3 欄 (#1396)。 箱の `wBind` (#1392) と同じく文字列だけを取る。
3871
3973
  *
@@ -3930,7 +4032,10 @@ function parseActor2(line, errors) {
3930
4032
  owner: isPart ? void 0 : opts.owner,
3931
4033
  end: isPart ? void 0 : opts.end,
3932
4034
  value: opts.value,
4035
+ previous: opts.previous,
3933
4036
  rows: opts.rows ? opts.rows.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim())).filter(Boolean) : void 0,
4037
+ // 行頭の印 (#1466)。 `rows` と同じ並びなので **空の要素を捨てない**
4038
+ marks: opts.marks ? opts.marks.replace(/^\[|\]$/g, "").split(/,(?![^[]*\])/).map((x) => stripQuotes(x.trim())) : void 0,
3934
4039
  lane: opts.lane,
3935
4040
  // 箱の中に描く図形 (#1374)。 パーツでは状態の上書きとして意味を持つため横取りしない
3936
4041
  shape: isPart || opts.shape === void 0 ? void 0 : \u56F3\u5F62\u3068\u3057\u3066\u8AAD\u3080(opts.shape, line.no, errors),
@@ -4026,6 +4131,22 @@ function parseFlowStep(line, no, errors) {
4026
4131
  hint: `\u4F7F\u3048\u308B\u5024 = ${EDGE_SIDE_VALUES.join(", ")}`
4027
4132
  });
4028
4133
  }
4134
+ for (const [\u6B04, \u4F7F\u3048\u308B] of [
4135
+ ["head", EDGE_HEAD_VALUES],
4136
+ ["tailHead", EDGE_HEAD_VALUES],
4137
+ ["headFill", EDGE_HEAD_FILL_VALUES],
4138
+ ["tailHeadFill", EDGE_HEAD_FILL_VALUES],
4139
+ ["relation", CLASS_RELATION_VALUES],
4140
+ ["kind", SEQ_MESSAGE_VALUES]
4141
+ ]) {
4142
+ if (opts[\u6B04] !== void 0 && \u4E2D\u62EC\u5F27[\u6B04] === void 0) {
4143
+ errors.push({
4144
+ line: line.no,
4145
+ message: `\u77E2\u5370\u306E ${\u6B04} \u304C\u8AAD\u3081\u307E\u305B\u3093: "${opts[\u6B04]}"`,
4146
+ hint: `\u4F7F\u3048\u308B\u5024 = ${\u4F7F\u3048\u308B.join(", ")}`
4147
+ });
4148
+ }
4149
+ }
4029
4150
  \u6570\u3068\u771F\u507D = \u8868\u3067\u8AAD\u3080(FLOW_INLINE_VALUE_KINDS, opts, "\u77E2\u5370\u306E ", line.no, errors);
4030
4151
  rest = \u584A.\u524D.trim();
4031
4152
  }
@@ -4033,6 +4154,12 @@ function parseFlowStep(line, no, errors) {
4033
4154
  const guard = \u4E2D\u62EC\u5F27.guard;
4034
4155
  const cardinality = \u4E2D\u62EC\u5F27.cardinality;
4035
4156
  const side = \u4E2D\u62EC\u5F27.side;
4157
+ const head = \u4E2D\u62EC\u5F27.head;
4158
+ const tailHead = \u4E2D\u62EC\u5F27.tailHead;
4159
+ const headFill = \u4E2D\u62EC\u5F27.headFill;
4160
+ const tailHeadFill = \u4E2D\u62EC\u5F27.tailHeadFill;
4161
+ const relation = \u4E2D\u62EC\u5F27.relation;
4162
+ const msgKind = \u4E2D\u62EC\u5F27.kind;
4036
4163
  const widthBind = \u8FFD\u968F\u3059\u308B\u5927\u304D\u3055\u3068\u3057\u3066\u8AAD\u3080(
4037
4164
  \u4E2D\u62EC\u5F27.widthBind,
4038
4165
  "\u77E2\u5370\u306E widthBind ",
@@ -4102,6 +4229,12 @@ function parseFlowStep(line, no, errors) {
4102
4229
  guard,
4103
4230
  cardinality,
4104
4231
  side,
4232
+ head,
4233
+ tailHead,
4234
+ headFill,
4235
+ tailHeadFill,
4236
+ relation,
4237
+ msgKind,
4105
4238
  widthBind,
4106
4239
  strokeBind,
4107
4240
  dashOffsetBind,
@@ -4261,16 +4394,34 @@ function parsePhase(block, errors) {
4261
4394
  continue;
4262
4395
  }
4263
4396
  if (key === "draw") {
4264
- const \u8A9E = stripQuotes(value).trim();
4397
+ const [\u8A9E = "", \u5272\u5408\u306E\u6587\u5B57, ...\u4F59\u308A] = stripQuotes(value).trim().split(/\s+/);
4265
4398
  if (!DRAW_WORDS.has(\u8A9E)) {
4266
4399
  errors.push({
4267
4400
  line: ln.no,
4268
4401
  message: `draw \u306B\u66F8\u3051\u306A\u3044\u8A9E\u3067\u3059: "${\u8A9E}"`,
4269
4402
  hint: `\u4F7F\u3048\u308B\u8A9E = ${[...DRAW_WORDS].join(", ")}`
4270
4403
  });
4404
+ } else if (\u4F59\u308A.length > 0) {
4405
+ errors.push({
4406
+ line: ln.no,
4407
+ message: `draw \u306B\u66F8\u3051\u308B\u9805\u76EE\u306F\u8A9E\u3068\u5272\u5408\u306E 2 \u3064\u307E\u3067\u3067\u3059: "${stripQuotes(value).trim()}"`,
4408
+ hint: "use `draw: line 0.4`"
4409
+ });
4271
4410
  } else {
4272
4411
  phase.draw = \u8A9E;
4273
4412
  phase.drawPos = { line: ln.no };
4413
+ if (\u5272\u5408\u306E\u6587\u5B57 !== void 0) {
4414
+ const \u5272\u5408 = Number(\u5272\u5408\u306E\u6587\u5B57);
4415
+ if (!Number.isFinite(\u5272\u5408) || \u5272\u5408 <= 0 || \u5272\u5408 > 1) {
4416
+ errors.push({
4417
+ line: ln.no,
4418
+ message: `draw \u306E\u5272\u5408\u304C\u7BC4\u56F2\u5916\u3067\u3059: "${\u5272\u5408\u306E\u6587\u5B57}"`,
4419
+ hint: "0 \u3088\u308A\u5927\u304D\u304F 1 \u4EE5\u4E0B\u3067\u66F8\u304D\u307E\u3059 (\u4F8B `draw: line 0.4`)"
4420
+ });
4421
+ } else {
4422
+ phase.drawRatio = \u5272\u5408;
4423
+ }
4424
+ }
4274
4425
  }
4275
4426
  i += 1;
4276
4427
  continue;
@@ -4773,7 +4924,6 @@ function compileToCdl(doc, opts) {
4773
4924
  doc = canonicalizeFlowActors(doc);
4774
4925
  const \u66F8\u3044\u305F\u307E\u307E = doc;
4775
4926
  doc = dropUnresolvedFlow(doc);
4776
- doc = dropSelfLoopFlow(doc);
4777
4927
  const \u5206\u3051\u305F = disambiguateActorIds(doc, opts?.onNotice);
4778
4928
  doc = \u5206\u3051\u305F.doc;
4779
4929
  let diagram2;
@@ -4814,6 +4964,21 @@ function compileToCdl(doc, opts) {
4814
4964
  case "line":
4815
4965
  diagram2 = compileValueChart(doc, "line", "chart-line", opts?.onNotice);
4816
4966
  break;
4967
+ case "gauge":
4968
+ diagram2 = compileValueChart(doc, "gauge", "chart-gauge", opts?.onNotice);
4969
+ break;
4970
+ case "radial":
4971
+ diagram2 = compileValueChart(doc, "radial", "chart-radial", opts?.onNotice);
4972
+ break;
4973
+ case "stat":
4974
+ diagram2 = compileValueChart(doc, "stat", "chart-stat", opts?.onNotice);
4975
+ break;
4976
+ case "waffle":
4977
+ diagram2 = compileValueChart(doc, "waffle", "chart-waffle", opts?.onNotice);
4978
+ break;
4979
+ case "stacked":
4980
+ diagram2 = compileValueChart(doc, "stacked", "chart-stacked-bar", opts?.onNotice);
4981
+ break;
4817
4982
  case "funnel":
4818
4983
  diagram2 = compileFunnel(doc, opts?.onNotice);
4819
4984
  break;
@@ -4842,15 +5007,16 @@ function compileToCdl(doc, opts) {
4842
5007
  applyNodeTones(diagram2, doc);
4843
5008
  reportMissingFocusTargets(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4844
5009
  reportMissingFlowActors(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4845
- reportSelfLoopFlow(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4846
5010
  reportFlowEndpointNotHonored(doc, \u5206\u3051\u305F.\u5143\u306E\u540D\u524D, opts?.onNotice);
4847
5011
  reportLaneNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
5012
+ reportActorKindNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
5013
+ reportMessageOptionNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4848
5014
  reportDocEyebrowNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4849
5015
  reportDrawNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4850
5016
  reportChartFieldsNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4851
5017
  reportAxesNotHonored(\u66F8\u3044\u305F\u307E\u307E, opts?.onNotice);
4852
5018
  const placed = resolveRelativeDoc(diagram2, doc, opts?.onNotice, opts?.partsCatalog);
4853
- applyCanvasPivotPositions(diagram2, placed);
5019
+ applyCanvasPivotPositions(diagram2, placed, opts?.onNotice);
4854
5020
  const \u8FFD\u52A0\u3057\u305F\u7E26\u5217 = [];
4855
5021
  const extended = applyV05Extensions(diagram2, placed, \u8FFD\u52A0\u3057\u305F\u7E26\u5217);
4856
5022
  const inheritedDerivedSourceLines = opts?.onNotice ? /* @__PURE__ */ new Map() : void 0;
@@ -4873,6 +5039,7 @@ function compileToCdl(doc, opts) {
4873
5039
  }
4874
5040
  injectStaticPhase(merged);
4875
5041
  materializeStates(merged, doc);
5042
+ if (doc.reveal !== void 0) merged.edgeReveal = doc.reveal;
4876
5043
  \u8A9E\u306E\u72B6\u614B\u3092\u56F3\u306E\u8A9E\u3078\u76F4\u3059(merged);
4877
5044
  const \u7573\u3093\u3060\u304D\u3063\u304B\u3051 = foldValueTriggers(merged, doc, opts?.onNotice);
4878
5045
  attachDerivedValues(merged, doc, opts?.onNotice, inheritedDerivedSourceLines, \u7573\u3093\u3060\u304D\u3063\u304B\u3051);
@@ -5072,6 +5239,11 @@ var \u56F3\u7A2E\u306E\u4F5C\u308A = {
5072
5239
  pie: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5073
5240
  bar: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5074
5241
  line: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5242
+ gauge: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5243
+ radial: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5244
+ stat: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5245
+ waffle: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5246
+ stacked: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5075
5247
  funnel: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5076
5248
  tree: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
5077
5249
  journey: "\u56F3\u5168\u4F53\u3092 1 \u7BB1",
@@ -5084,27 +5256,6 @@ function dropUnresolvedFlow(doc) {
5084
5256
  const flow2 = doc.flow.filter((s) => \u8868.has(s.from) && \u8868.has(s.to));
5085
5257
  return flow2.length === doc.flow.length ? doc : { ...doc, flow: flow2 };
5086
5258
  }
5087
- function dropSelfLoopFlow(doc) {
5088
- if (\u56F3\u7A2E\u306E\u4F5C\u308A[doc.type] === "\u56F3\u5168\u4F53\u3092 1 \u7BB1") return doc;
5089
- const flow2 = doc.flow.filter((s) => s.from !== s.to);
5090
- return flow2.length === doc.flow.length ? doc : { ...doc, flow: flow2 };
5091
- }
5092
- function reportSelfLoopFlow(doc, onNotice) {
5093
- if (!onNotice) return;
5094
- if (\u56F3\u7A2E\u306E\u4F5C\u308A[doc.type] === "\u56F3\u5168\u4F53\u3092 1 \u7BB1") return;
5095
- const \u77E5\u3089\u305B\u305F = /* @__PURE__ */ new Set();
5096
- for (const s of doc.flow) {
5097
- if (s.from !== s.to || \u77E5\u3089\u305B\u305F.has(s.from)) continue;
5098
- \u77E5\u3089\u305B\u305F.add(s.from);
5099
- onNotice({
5100
- kind: "flow-self-loop",
5101
- actor: s.from,
5102
- line: s.pos.line,
5103
- message: `"${truncateForMessage(s.from)}" \u304B\u3089\u81EA\u5206\u3078\u623B\u308B\u77E2\u5370\u306F\u63CF\u3051\u307E\u305B\u3093 (\u7D44\u307F\u7ACB\u3066\u304B\u3089\u5916\u3057\u307E\u3057\u305F)`,
5104
- hint: "\u9014\u4E2D\u306E\u7BB1\u3092 1 \u3064\u8DB3\u3057\u3066 2 \u672C\u306B\u5206\u3051\u308B\u304B\u3001 \u6BB5 (animation) \u3067\u72B6\u614B\u304C\u5909\u308F\u308B\u69D8\u5B50\u3068\u3057\u3066\u898B\u305B\u308B"
5105
- });
5106
- }
5107
- }
5108
5259
  function \u56F3\u306E\u5C0F\u898B\u51FA\u3057(doc) {
5109
5260
  return doc.eyebrow === void 0 ? {} : { eyebrow: doc.eyebrow };
5110
5261
  }
@@ -5183,6 +5334,59 @@ function reportFlowEndpointNotHonored(doc, \u5143\u306E\u540D\u524D, onNotice) {
5183
5334
  });
5184
5335
  }
5185
5336
  }
5337
+ function reportMessageOptionNotHonored(doc, onNotice) {
5338
+ if (!onNotice) return;
5339
+ if (doc.type !== "sequence" && doc.type !== "solidity") return;
5340
+ for (const s of doc.flow) {
5341
+ const \u52B9\u304B\u306A\u3044 = [
5342
+ s.tone !== void 0 ? "\u8272\u5473" : "",
5343
+ s.sub !== void 0 ? "\u6DFB\u3048\u5B57" : "",
5344
+ s.side !== void 0 ? "\u5BC4\u305B" : ""
5345
+ ].filter((x) => x !== "");
5346
+ if (\u52B9\u304B\u306A\u3044.length === 0) continue;
5347
+ onNotice({
5348
+ kind: "message-option-not-honored",
5349
+ actor: s.from,
5350
+ line: s.pos?.line ?? 0,
5351
+ message: `"${truncateForMessage(s.label)}" \u306B\u66F8\u3044\u305F ${\u52B9\u304B\u306A\u3044.join(" / ")} \u306F\u52B9\u304D\u307E\u305B\u3093 (type: ${doc.type} \u306E\u677F\u306F\u8A9E\u3068\u5411\u304D\u3068\u7A2E\u985E\u3060\u3051\u3092\u63CF\u304D\u307E\u3059)`,
5352
+ hint: "\u677F\u306B\u306F\u77E2\u5370\u304C\u7121\u3044\u305F\u3081\u98FE\u308A\u3092\u8F09\u305B\u308B\u5148\u304C\u3042\u308A\u307E\u305B\u3093\u3002 \u8A00\u3065\u3066\u306E\u7A2E\u985E (kind: call / return / fire) \u3067\u63CF\u304D\u5206\u3051\u3066\u304F\u3060\u3055\u3044"
5353
+ });
5354
+ }
5355
+ }
5356
+ function reportActorKindNotHonored(doc, onNotice) {
5357
+ if (!onNotice) return;
5358
+ if (doc.type !== "sequence" && doc.type !== "solidity") return;
5359
+ for (const a of doc.actors) {
5360
+ if (a.partId !== void 0) continue;
5361
+ const \u52B9\u304B\u306A\u3044 = [
5362
+ /*
5363
+ * 種類は `sequence` でだけ落ちる。
5364
+ *
5365
+ * `solidity` は種類で **面の並びを決める** (`compileSolidity`) ので、絵にならなくても
5366
+ * 書いた意味は figure に出ている。 落ちたと伝えると、正しく効いている指定に毎回鳴る。
5367
+ *
5368
+ * 記法を通すと既定の `actor` が必ず入るため、値ではなく書いたかどうかの印で見る。
5369
+ * 記法を通さず直接組み立てた場合はこの印が無いので、種類を置いたこと自体を「書いた」 とみなす
5370
+ */
5371
+ doc.type === "sequence" && a.kindWritten !== false && a.kind !== void 0 ? "\u7A2E\u985E" : "",
5372
+ a.posW !== void 0 || a.posH !== void 0 ? "\u5927\u304D\u3055" : "",
5373
+ a.posX !== void 0 || a.posY !== void 0 || a.posRel !== void 0 ? "\u4F4D\u7F6E" : "",
5374
+ a.rows !== void 0 ? "\u884C" : "",
5375
+ a.tone !== void 0 ? "\u8272" : "",
5376
+ a.eyebrow !== void 0 ? "\u5C0F\u898B\u51FA\u3057" : "",
5377
+ a.value !== void 0 ? "\u5024" : "",
5378
+ a.shape !== void 0 ? "\u56F3\u5F62" : ""
5379
+ ].filter((x) => x !== "");
5380
+ if (\u52B9\u304B\u306A\u3044.length === 0) continue;
5381
+ onNotice({
5382
+ kind: "actor-kind-not-honored",
5383
+ actor: a.name,
5384
+ line: a.pos?.line ?? 0,
5385
+ message: `"${truncateForMessage(a.name)}" \u306B\u66F8\u3044\u305F ${\u52B9\u304B\u306A\u3044.join(" / ")} \u306F\u52B9\u304D\u307E\u305B\u3093 (type: ${doc.type} \u306E\u677F\u306F\u540D\u524D\u3068\u547C\u3073\u540D\u3060\u3051\u3092\u63CF\u304D\u307E\u3059)`,
5386
+ hint: "\u677F\u306B\u306F\u9762\u3054\u3068\u306E\u7BB1\u304C\u7121\u3044\u305F\u3081\u98FE\u308A\u3092\u8F09\u305B\u308B\u5148\u304C\u3042\u308A\u307E\u305B\u3093\u3002 \u547C\u3073\u540D (subtitle) \u306B\u66F8\u304F\u304B\u3001\u7BB1\u3092\u6301\u3064\u56F3\u7A2E\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044"
5387
+ });
5388
+ }
5389
+ }
5186
5390
  function reportLaneNotHonored(doc, onNotice) {
5187
5391
  if (!onNotice) return;
5188
5392
  if (doc.type === "mind") return;
@@ -5230,6 +5434,11 @@ var \u7A7A\u306E\u5F62\u306E\u9003\u3052\u5148 = {
5230
5434
  pie: [],
5231
5435
  bar: [],
5232
5436
  line: [],
5437
+ gauge: [],
5438
+ radial: [],
5439
+ stat: [],
5440
+ waffle: [],
5441
+ stacked: [],
5233
5442
  funnel: [],
5234
5443
  tree: [],
5235
5444
  journey: [],
@@ -5577,7 +5786,7 @@ function applyNodeTones(diagram2, doc) {
5577
5786
  }
5578
5787
  }
5579
5788
  }
5580
- function applyCanvasPivotPositions(diagram2, doc) {
5789
+ function applyCanvasPivotPositions(diagram2, doc, onNotice) {
5581
5790
  for (const actor of doc.actors) {
5582
5791
  if (actor.partId !== void 0) continue;
5583
5792
  const aliasSlug = slugify(actor.name);
@@ -5602,14 +5811,25 @@ function applyCanvasPivotPositions(diagram2, doc) {
5602
5811
  if (actor.nodes) {
5603
5812
  for (const [subKey, override] of Object.entries(actor.nodes)) {
5604
5813
  if (override.posX === void 0 || override.posY === void 0) continue;
5814
+ let \u5F53\u305F\u3063\u305F = 0;
5605
5815
  for (const node of diagram2.nodes) {
5606
5816
  if (node.id === `${aliasSlug}-${subKey}` || node.id === `${subKey}-${aliasSlug}`) {
5607
5817
  node.posX = override.posX;
5608
5818
  node.posY = override.posY;
5609
5819
  if (override.posW !== void 0) node.posW = override.posW;
5610
5820
  if (override.posH !== void 0) node.posH = override.posH;
5821
+ \u5F53\u305F\u3063\u305F += 1;
5611
5822
  }
5612
5823
  }
5824
+ if (\u5F53\u305F\u3063\u305F === 0) {
5825
+ onNotice?.({
5826
+ kind: "sub-node-not-found",
5827
+ actor: actor.name,
5828
+ line: actor.pos?.line ?? 0,
5829
+ message: `"${truncateForMessage(actor.name)}" \u306E nodes \u306B\u66F8\u3044\u305F "${truncateForMessage(subKey)}" \u306B\u5F53\u305F\u308B\u7BB1\u304C\u56F3\u306B\u3042\u308A\u307E\u305B\u3093`,
5830
+ hint: "1 \u4EBA\u306B\u8907\u6570\u306E\u7BB1\u3092\u4F5C\u308B\u56F3\u7A2E\u3067\u3060\u3051\u52B9\u304D\u307E\u3059\u3002 \u7BB1\u305D\u306E\u3082\u306E\u306E\u4F4D\u7F6E\u306F actor \u5074\u306E \u4F4D\u7F6E: \u306B\u66F8\u3044\u3066\u304F\u3060\u3055\u3044"
5831
+ });
5832
+ }
5613
5833
  }
5614
5834
  }
5615
5835
  }
@@ -5832,10 +6052,13 @@ function partVisualSize(part, targetW, targetH) {
5832
6052
  var PARTS_PER_ROW = 3;
5833
6053
  var PARTS_GAP = 120;
5834
6054
  var STACK_PITCH = 280;
5835
- function partsGridCenters(baseNodeCount, items) {
6055
+ function partsBaseRows(nodes) {
6056
+ return nodes.reduce((acc, n) => acc + Math.max(1, Math.ceil(positiveOr(n.h, 0) / STACK_PITCH)), 0);
6057
+ }
6058
+ function partsGridCenters(baseRows, items) {
5836
6059
  const out = /* @__PURE__ */ new Map();
5837
6060
  if (items.length === 0) return out;
5838
- const safeCount = Number.isSafeInteger(baseNodeCount) && baseNodeCount >= 0 ? baseNodeCount : 0;
6061
+ const safeCount = Number.isSafeInteger(baseRows) && baseRows >= 0 ? baseRows : 0;
5839
6062
  const top = safeCount * STACK_PITCH + PARTS_GAP * 2;
5840
6063
  const seen = /* @__PURE__ */ new Set();
5841
6064
  const unique = items.filter((i) => {
@@ -5918,7 +6141,7 @@ function partGridCenters(target, doc, partsCatalog, accepted, acceptedFrom) {
5918
6141
  extents.set(a.name, partFrameExtent(part, t.w, t.h));
5919
6142
  }
5920
6143
  const centers = partsGridCenters(
5921
- baseNodes.length,
6144
+ partsBaseRows(baseNodes),
5922
6145
  placedActors.map((a) => ({ id: a.name, ...extents.get(a.name) }))
5923
6146
  );
5924
6147
  const out = /* @__PURE__ */ new Map();
@@ -5968,7 +6191,11 @@ function cleanupPlaceholderActor(target, doc, a) {
5968
6191
  for (const n of target.nodes) {
5969
6192
  if (ownedLaneIds.has(n.lane)) ownedNodeIds.add(n.id);
5970
6193
  }
6194
+ const \u7D20\u306E\u7BB1\u306Eid = new Set(
6195
+ doc.actors.filter((x) => x.partId === void 0).map((x) => slugify(x.name))
6196
+ );
5971
6197
  const matchesAliasSlug = (id) => {
6198
+ if (\u7D20\u306E\u7BB1\u306Eid.has(id)) return false;
5972
6199
  if (id === aliasSlug) return true;
5973
6200
  if (id.startsWith(`${aliasSlug}-`)) return true;
5974
6201
  if (/^s\d+-/.test(id) && id.endsWith(`-${aliasSlug}`)) return true;
@@ -5982,14 +6209,14 @@ function cleanupPlaceholderActor(target, doc, a) {
5982
6209
  if (drop) removedEdgeIds.add(e.id);
5983
6210
  return !drop;
5984
6211
  });
5985
- if (doc.type === "sequence" || doc.type === "solidity") {
5986
- target.lanes = target.lanes.filter((l) => {
5987
- if (a.lane !== void 0 && l.id === a.lane) return true;
5988
- if (l.label === a.name) return false;
5989
- if (l.id === aliasSlug) return false;
5990
- return true;
5991
- });
5992
- }
6212
+ const \u6B8B\u308B\u7BB1\u3092\u6301\u3064 = new Set(target.nodes.map((n) => n.lane));
6213
+ target.lanes = target.lanes.filter((l) => {
6214
+ if (a.lane !== void 0 && l.id === a.lane) return true;
6215
+ if (\u6B8B\u308B\u7BB1\u3092\u6301\u3064.has(l.id)) return true;
6216
+ if (l.label === a.name) return false;
6217
+ if (l.id === aliasSlug) return false;
6218
+ return true;
6219
+ });
5993
6220
  for (const phase of target.phases) {
5994
6221
  phase.activate = phase.activate.filter((id) => !relatedToActor(id) && !removedEdgeIds.has(id));
5995
6222
  }
@@ -6351,15 +6578,11 @@ function applyEdgeInlineOptions(diagram2, doc, sourceLines) {
6351
6578
  return;
6352
6579
  }
6353
6580
  const used = /* @__PURE__ */ new Set();
6354
- const isSeqLike = doc.type === "sequence" || doc.type === "solidity";
6355
- doc.flow.forEach((s, stepIdx) => {
6581
+ doc.flow.forEach((s) => {
6356
6582
  const fromId = slugify(s.from);
6357
6583
  const toId = slugify(s.to);
6358
6584
  const target = diagram2.edges.find((e) => {
6359
6585
  if (used.has(e.id)) return false;
6360
- if (isSeqLike) {
6361
- return (e.from === `s${stepIdx}-${fromId}` || e.from === fromId) && (e.to === `s${stepIdx}-${toId}` || e.from === e.to);
6362
- }
6363
6586
  return e.from === fromId && e.to === toId;
6364
6587
  });
6365
6588
  if (!target) return;
@@ -6410,6 +6633,10 @@ function \u77E2\u5370\u3078\u66F8\u304D\u5199\u3059(target, s, doc) {
6410
6633
  }
6411
6634
  }
6412
6635
  if (s.side !== void 0) target.side = s.side;
6636
+ if (s.head !== void 0) target.head = s.head;
6637
+ if (s.tailHead !== void 0) target.tailHead = s.tailHead;
6638
+ if (s.headFill !== void 0) target.headFill = s.headFill;
6639
+ if (s.tailHeadFill !== void 0) target.tailHeadFill = s.tailHeadFill;
6413
6640
  if (s.labelOffsetX !== void 0) target.labelOffsetX = s.labelOffsetX;
6414
6641
  if (s.labelOffsetY !== void 0) target.labelOffsetY = s.labelOffsetY;
6415
6642
  if (s.overlay !== void 0) target.overlay = s.overlay;
@@ -6427,16 +6654,6 @@ function \u9396\u306E\u3069\u306E\u884C\u304B\u3089\u6765\u305F\u304B(doc, edgeI
6427
6654
  if (to === void 0) return void 0;
6428
6655
  return doc.flow.find((s) => s.to === to.name);
6429
6656
  }
6430
- var DRAWABLE_KINDS = new Set(NODE_KINDS);
6431
- var KIND_ALIAS = {
6432
- eoa: "shape-wallet",
6433
- wallet: "shape-wallet",
6434
- multisig: "signer",
6435
- contract: "shape-smart-contract",
6436
- proxy: "shape-smart-contract",
6437
- library: "shape-code-block",
6438
- interface: "shape-code-block"
6439
- };
6440
6657
  function \u5F0F\u306B\u66F8\u304F\u6570(n) {
6441
6658
  if (!Number.isFinite(n)) return "0";
6442
6659
  const text = String(n);
@@ -6764,99 +6981,6 @@ var SINGLE_BOX_KINDS = /* @__PURE__ */ new Set([
6764
6981
  "tree-hierarchy",
6765
6982
  "journey-map"
6766
6983
  ]);
6767
- function drawableKind(kind) {
6768
- if (kind === void 0) return void 0;
6769
- const mapped = KIND_ALIAS[kind] ?? kind;
6770
- return DRAWABLE_KINDS.has(mapped) ? mapped : void 0;
6771
- }
6772
- function alignSeqHeaderHeights(diagram2, doc) {
6773
- if (doc.type !== "sequence" && doc.type !== "solidity") return;
6774
- const isEnd = (n) => n.id === `${n.lane}-header` || n.id === `${n.lane}-footer`;
6775
- const ends = diagram2.nodes.filter(isEnd);
6776
- if (ends.length === 0) return;
6777
- const auto = ends.filter((n) => n.posH === void 0);
6778
- if (auto.length === 0) return;
6779
- const tallest = Math.max(...auto.map((n) => n.h ?? 0));
6780
- if (tallest <= 0) return;
6781
- for (const n of auto) n.h = tallest;
6782
- }
6783
- var LABEL_MIN_H = {
6784
- // `shape-` のうち、 高さを上げれば下のはみ出しが消える 4 種 (#1067)。 値は「収まる最小の高さ」
6785
- // で、 1 手前 (値 - 1) では 0.9-1 はみ出すことを実測した
6786
- "shape-person": 228,
6787
- // 名札 72 で下へ 155.9
6788
- "shape-server-rack": 166,
6789
- // 94
6790
- "shape-website": 98,
6791
- // 26
6792
- "shape-warehouse": 79
6793
- // 7
6794
- };
6795
- var LABEL_NEVER_FITS = /* @__PURE__ */ new Set([
6796
- // 左右にはみ出す 24 種。 横幅は高さで変わらないため直らない
6797
- "shape-api-gateway",
6798
- "shape-atm",
6799
- "shape-auditor",
6800
- "shape-bank",
6801
- "shape-bitcoin-chain",
6802
- "shape-blockchain",
6803
- "shape-blockchain-block",
6804
- "shape-blockchain-node",
6805
- "shape-brokerage",
6806
- "shape-code-block",
6807
- "shape-customer-service",
6808
- "shape-ethereum-chain",
6809
- "shape-hexagon",
6810
- "shape-kanban-card",
6811
- "shape-lawyer",
6812
- "shape-network-node",
6813
- "shape-nft",
6814
- "shape-notary",
6815
- "shape-regulator",
6816
- "shape-satellite",
6817
- "shape-smart-contract",
6818
- "shape-terminal",
6819
- "shape-trader",
6820
- "shape-trust-bank",
6821
- // 下のはみ出しが高さに依らない 6 種
6822
- "shape-cylinder",
6823
- "shape-diamond",
6824
- "shape-file",
6825
- "shape-folder",
6826
- "shape-mobile-device",
6827
- "shape-stack",
6828
- // 上へ出る絵が名札の大きさでは読めない。 `#1067` では「上は何ともぶつからない」 として残したが、
6829
- // 実際には絵が小さく潰れて名前と重なり、 横に並べた時も 1 本だけ頭が浮く (user 実機確認)
6830
- "shape-wallet"
6831
- ]);
6832
- function hasAuthoredText(n) {
6833
- if (n.subtitle !== void 0 || n.eyebrow !== void 0 || n.value !== void 0) return true;
6834
- return rendersRows(n.kind) && (n.rows?.length ?? 0) > 0;
6835
- }
6836
- function dropUnfittableEndKinds(diagram2, doc) {
6837
- if (doc.type !== "sequence" && doc.type !== "solidity") return;
6838
- const ends = /* @__PURE__ */ new Map();
6839
- for (const n of diagram2.nodes) {
6840
- if (n.id !== `${n.lane}-header` && n.id !== `${n.lane}-footer`) continue;
6841
- const pair = ends.get(n.lane);
6842
- if (pair === void 0) ends.set(n.lane, [n]);
6843
- else pair.push(n);
6844
- }
6845
- for (const pair of ends.values()) {
6846
- if (pair.some(hasAuthoredText)) continue;
6847
- const \u53CE\u307E\u3089\u306A\u3044 = pair.some((n) => {
6848
- if (LABEL_NEVER_FITS.has(n.kind)) return true;
6849
- const need = LABEL_MIN_H[n.kind];
6850
- if (need === void 0) return false;
6851
- const h = (n.posX !== void 0 && n.posY !== void 0 ? n.posH : void 0) ?? n.h;
6852
- return h !== void 0 && h < need;
6853
- });
6854
- if (!\u53CE\u307E\u3089\u306A\u3044) continue;
6855
- for (const n of pair) {
6856
- if (LABEL_NEVER_FITS.has(n.kind) || LABEL_MIN_H[n.kind] !== void 0) n.kind = "card";
6857
- }
6858
- }
6859
- }
6860
6984
  function applyGroupContainers(diagram2, doc) {
6861
6985
  if (!doc.groups || Object.keys(doc.groups).length === 0) return;
6862
6986
  for (const [id, g] of Object.entries(doc.groups)) {
@@ -7024,34 +7148,46 @@ function compileGantt(doc) {
7024
7148
  return b.build();
7025
7149
  }
7026
7150
  function compileClass(doc) {
7027
- const b = diagram(slugify(doc.title), { topic: doc.title });
7028
- const CLASS_W = 400;
7029
- const CLASS_LANE_W = 450;
7030
- if (doc.actors.length === 0) return b.build();
7031
- doc.actors.forEach((a, idx) => {
7032
- const nodeId = slugify(a.name);
7033
- const laneId = `lane-${nodeId}`;
7034
- b.lane(laneId, { width: CLASS_LANE_W });
7035
- b.node(nodeId, {
7036
- lane: laneId,
7037
- stack: 0,
7038
- kind: "storage",
7151
+ const b = classDiagram({ id: slugify(doc.title), topic: doc.title });
7152
+ if (doc.actors.length === 0) return diagram(slugify(doc.title), { topic: doc.title }).build();
7153
+ const \u5217\u756A\u53F7 = /* @__PURE__ */ new Map();
7154
+ for (const a of doc.actors) {
7155
+ if (a.lane === void 0) continue;
7156
+ if (!\u5217\u756A\u53F7.has(a.lane)) \u5217\u756A\u53F7.set(a.lane, \u5217\u756A\u53F7.size);
7157
+ }
7158
+ for (const a of doc.actors) {
7159
+ const rows = (a.rows ?? []).filter((r) => !/^[─-]+$/.test(r.trim()));
7160
+ const \u632F\u308B\u821E\u3044 = (r) => r.includes("(");
7161
+ const attributes = rows.filter((r) => !\u632F\u308B\u821E\u3044(r));
7162
+ const methods = rows.filter(\u632F\u308B\u821E\u3044);
7163
+ b.class({
7164
+ id: slugify(a.name),
7039
7165
  title: \u7BB1\u306E\u984C(a),
7040
- w: CLASS_W
7166
+ ...attributes.length > 0 ? { attributes: [...attributes] } : {},
7167
+ ...methods.length > 0 ? { methods: [...methods] } : {},
7168
+ ...a.eyebrow ? { stereotype: a.eyebrow } : {},
7169
+ ...a.lane !== void 0 ? { col: \u5217\u756A\u53F7.get(a.lane) ?? 0 } : {},
7170
+ ...a.stack !== void 0 ? { row: a.stack } : {}
7041
7171
  });
7042
- });
7043
- for (const s of doc.flow) {
7044
- const fromId = slugify(s.from);
7045
- const toId = slugify(s.to);
7046
- b.edge(fromId, toId, {
7047
- label: s.label,
7048
- ...s.sub ? { sub: s.sub } : {},
7049
- ...s.side ? { side: s.side } : {},
7050
- ...s.tone ? { tone: s.tone } : {},
7051
- ...s.style ? { style: s.style } : {}
7172
+ }
7173
+ for (const s2 of doc.flow) {
7174
+ b.relation({
7175
+ from: slugify(s2.from),
7176
+ to: slugify(s2.to),
7177
+ // 種類を書かない矢印は「使う」 扱い = 端が開いた矢になり、線と印の組が最も素直
7178
+ type: s2.relation ?? "uses",
7179
+ ...s2.label ? { label: s2.label } : {},
7180
+ ...s2.sub ? { cardinality: s2.sub } : {},
7181
+ ...s2.tone ? { tone: s2.tone } : {},
7182
+ ...s2.style ? { style: s2.style } : {},
7183
+ ...s2.head ? { head: s2.head } : {},
7184
+ ...s2.headFill ? { headFill: s2.headFill } : {},
7185
+ ...s2.tailHead ? { tailHead: s2.tailHead } : {}
7052
7186
  });
7053
7187
  }
7054
- return b.build();
7188
+ const built = b.build();
7189
+ const \u66F8\u3044\u305F\u6BB5\u304C\u3042\u308B = (doc.animate?.phases.length ?? 0) > 0;
7190
+ return \u66F8\u3044\u305F\u6BB5\u304C\u3042\u308B ? { ...built, phases: [] } : built;
7055
7191
  }
7056
7192
  function parseShareValue(raw) {
7057
7193
  if (raw === void 0) return null;
@@ -7078,10 +7214,13 @@ function \u53C2\u7167\u3059\u308B\u540D\u524D(value) {
7078
7214
  function compileValueChart(doc, \u578B, kind, onNotice) {
7079
7215
  const b = diagram(slugify(doc.title), { topic: doc.title });
7080
7216
  const CHART_W = 640;
7081
- const CHART_H = \u578B === "pie" ? 320 : 368;
7217
+ const \u4F4E\u3044\u578B = \u578B === "pie" || \u578B === "gauge" || \u578B === "radial" || \u578B === "waffle" || \u578B === "stat";
7218
+ const CHART_H = \u4F4E\u3044\u578B ? 320 : 368;
7082
7219
  b.lane("chart", { width: CHART_W + 64 });
7083
7220
  const data = [];
7084
7221
  const \u8AAD\u3081\u306A\u3044 = [];
7222
+ const \u524D\u304C\u8AAD\u3081\u306A\u3044 = [];
7223
+ let \u524D\u304C\u8AAD\u3081\u306A\u3044\u884C = 0;
7085
7224
  const \u672A\u5BA3\u8A00 = [];
7086
7225
  let \u672A\u5BA3\u8A00\u884C = 0;
7087
7226
  const \u53C2\u7167\u3067\u304D\u308B = \u6570\u306E\u6B04\u304B\u3089\u53C2\u7167\u3067\u304D\u308B\u540D\u524D(doc);
@@ -7099,9 +7238,29 @@ function compileValueChart(doc, \u578B, kind, onNotice) {
7099
7238
  \u672A\u5BA3\u8A00.push(a.name);
7100
7239
  continue;
7101
7240
  }
7102
- data.push({ label: \u7BB1\u306E\u984C(a), value, ...a.tone !== void 0 ? { tone: a.tone } : {} });
7241
+ const \u524D = a.previous === void 0 ? null : parseChartValue(a.previous);
7242
+ if (a.previous !== void 0 && \u524D === null) {
7243
+ if (\u524D\u304C\u8AAD\u3081\u306A\u3044.length === 0) \u524D\u304C\u8AAD\u3081\u306A\u3044\u884C = a.pos?.line ?? 0;
7244
+ \u524D\u304C\u8AAD\u3081\u306A\u3044.push(a.name);
7245
+ }
7246
+ data.push({
7247
+ label: \u7BB1\u306E\u984C(a),
7248
+ value,
7249
+ ...\u524D === null ? {} : { previous: \u524D },
7250
+ ...a.tone !== void 0 ? { tone: a.tone } : {}
7251
+ });
7103
7252
  }
7104
- const \u8A9E = \u578B === "pie" ? { \u91CF: "\u5272\u5408", \u56F3: "\u5186", \u4F8B: '"45%"' } : \u578B === "bar" ? { \u91CF: "\u5024", \u56F3: "\u68D2", \u4F8B: '"420"' } : { \u91CF: "\u5024", \u56F3: "\u6298\u308C\u7DDA", \u4F8B: '"180"' };
7253
+ const \u8A9E\u306E\u8868 = {
7254
+ pie: { \u91CF: "\u5272\u5408", \u56F3: "\u5186", \u4F8B: '"45%"' },
7255
+ bar: { \u91CF: "\u5024", \u56F3: "\u68D2", \u4F8B: '"420"' },
7256
+ line: { \u91CF: "\u5024", \u56F3: "\u6298\u308C\u7DDA", \u4F8B: '"180"' },
7257
+ gauge: { \u91CF: "\u5024", \u56F3: "\u534A\u5186", \u4F8B: '"680"' },
7258
+ radial: { \u91CF: "\u5024", \u56F3: "\u5F27", \u4F8B: '"72"' },
7259
+ stat: { \u91CF: "\u5024", \u56F3: "\u5927\u304D\u306A\u6570\u5B57", \u4F8B: '"1200"' },
7260
+ waffle: { \u91CF: "\u5272\u5408", \u56F3: "100 \u500B\u306E\u5370", \u4F8B: '"45%"' },
7261
+ stacked: { \u91CF: "\u5185\u8A33\u306E\u5024", \u56F3: "\u5E2F", \u4F8B: '"320"' }
7262
+ };
7263
+ const \u8A9E = \u8A9E\u306E\u8868[\u578B];
7105
7264
  const \u4F1D\u3048\u308B = (\u7A2E\u985E, \u540D\u524D, message, line = 0) => {
7106
7265
  onNotice?.({ kind: \u7A2E\u985E, actor: \u540D\u524D, line, message });
7107
7266
  if (typeof console !== "undefined" && console.warn) console.warn(`[dragon] ${message}`);
@@ -7122,6 +7281,14 @@ function compileValueChart(doc, \u578B, kind, onNotice) {
7122
7281
  \u672A\u5BA3\u8A00\u884C
7123
7282
  );
7124
7283
  }
7284
+ if (\u524D\u304C\u8AAD\u3081\u306A\u3044.length > 0) {
7285
+ \u4F1D\u3048\u308B(
7286
+ "chart-value-unreadable",
7287
+ \u524D\u304C\u8AAD\u3081\u306A\u3044[0],
7288
+ `type: ${\u578B} \u3067\u524D\u306E\u6642\u70B9\u306E\u5024\u3092\u8AAD\u3081\u306A\u3044\u9805\u76EE\u304C\u3042\u308A\u307E\u3059 (\u524D\u306E\u5024\u3092\u4F7F\u3044\u307E\u305B\u3093): ${\u524D\u304C\u8AAD\u3081\u306A\u3044.join(", ")}\u3002 \`- \u540D\u524D: { value: ` + \u8A9E.\u4F8B + ", previous: " + \u8A9E.\u4F8B + " }` \u306E\u5F62\u3067\u66F8\u3044\u3066\u304F\u3060\u3055\u3044",
7289
+ \u524D\u304C\u8AAD\u3081\u306A\u3044\u884C
7290
+ );
7291
+ }
7125
7292
  if (doc.flow.length > 0) {
7126
7293
  \u4F1D\u3048\u308B(
7127
7294
  "chart-edge-dropped",
@@ -7602,9 +7769,50 @@ function compileC4(doc) {
7602
7769
  }
7603
7770
  return b.build();
7604
7771
  }
7772
+ var \u984C\u3092\u6301\u305F\u306A\u3044\u7A2E\u985E = /* @__PURE__ */ new Set(["mark-start", "mark-end"]);
7605
7773
  function \u7BB1\u306E\u984C(a) {
7774
+ if (a.title === void 0 && a.kind !== void 0 && \u984C\u3092\u6301\u305F\u306A\u3044\u7A2E\u985E.has(a.kind)) return "";
7606
7775
  return a.title ?? a.name;
7607
7776
  }
7777
+ function \u884C\u3092\u7D44\u307F\u7ACB\u3066\u5668\u304C\u6301\u3064(type) {
7778
+ return type === "class";
7779
+ }
7780
+ function \u884C\u3068\u5370\u3092\u7D44\u3080(type, rows, marks) {
7781
+ const \u5370 = \u884C\u982D\u306E\u5370\u306B\u3059\u308B(type, marks);
7782
+ if (\u5370 === null) return null;
7783
+ if (type !== "er") {
7784
+ return { rows: [...rows], rowMarks: rows.map((_, i) => \u5370[i] ?? null) };
7785
+ }
7786
+ const \u9375 = [];
7787
+ const \u5024 = [];
7788
+ rows.forEach((_, i) => (\u5370[i]?.underline === true ? \u9375 : \u5024).push(i));
7789
+ const \u4E26\u3073 = \u9375.length > 0 && \u5024.length > 0 ? [...\u9375, -1, ...\u5024] : [...\u9375, ...\u5024];
7790
+ return {
7791
+ rows: \u4E26\u3073.map((i) => i < 0 ? "" : rows[i] ?? ""),
7792
+ rowMarks: \u4E26\u3073.map((i) => i < 0 ? null : \u5370[i] ?? null)
7793
+ };
7794
+ }
7795
+ function \u884C\u982D\u306E\u5370\u306B\u3059\u308B(type, marks) {
7796
+ if (type === "er") {
7797
+ return marks.map((m) => {
7798
+ const \u8A9E = m.trim().split(/\s+/).filter(Boolean);
7799
+ return {
7800
+ shape: \u8A9E.includes("fk") ? "chevron" : "square",
7801
+ filled: !\u8A9E.includes("opt"),
7802
+ ...\u8A9E.includes("pk") ? { underline: true } : {}
7803
+ };
7804
+ });
7805
+ }
7806
+ if (type === "state") {
7807
+ return marks.map((m) => {
7808
+ const \u8A9E = m.trim();
7809
+ if (\u8A9E === "") return null;
7810
+ const \u8868 = FSM_ACTION_MARK;
7811
+ return \u8868[\u8A9E] ?? null;
7812
+ });
7813
+ }
7814
+ return null;
7815
+ }
7608
7816
  var \u653E\u5C04\u3067\u63CF\u3051\u306A\u3044\u6B04\u306E\u540D\u524D = {
7609
7817
  kind: "\u7A2E\u985E",
7610
7818
  eyebrow: "\u4E0A\u306E\u5C0F\u898B\u51FA\u3057",
@@ -7613,10 +7821,12 @@ var \u653E\u5C04\u3067\u63CF\u3051\u306A\u3044\u6B04\u306E\u540D\u524D = {
7613
7821
  owner: "\u62C5\u5F53 (\u5DE5\u7A0B\u306E\u4E26\u3073\u306E\u6B04)",
7614
7822
  end: "\u7D42\u308F\u308B\u6642\u671F (\u5DE5\u7A0B\u306E\u4E26\u3073\u306E\u6B04)",
7615
7823
  rows: "\u884C",
7824
+ marks: "\u5370",
7616
7825
  lane: "\u67A0\u306E\u6307\u5B9A",
7617
7826
  stack: "\u7A4D\u3080\u9806",
7618
7827
  initial: "\u59CB\u307E\u308A / \u7D42\u308F\u308A \u306E\u5370",
7619
7828
  final: "\u59CB\u307E\u308A / \u7D42\u308F\u308A \u306E\u5370",
7829
+ previous: "\u524D\u306E\u6642\u70B9\u306E\u5024",
7620
7830
  colorHex: "\u8272\u756A\u53F7",
7621
7831
  stateOverride: "\u72B6\u614B\u306E\u4E0A\u66F8\u304D",
7622
7832
  // 位置は「登場人物ごとの箱をどこに置くか」 の指定で、 箱が 1 つの図では置く先が無い
@@ -7811,75 +8021,35 @@ function reportEmptyDeclaredLanes(diagram2, \u8FFD\u52A0\u3057\u305F\u7E26\u5217
7811
8021
  }
7812
8022
  }
7813
8023
  function applyV05Extensions(diagram2, doc, \u8FFD\u52A0\u3057\u305F\u7E26\u5217out) {
7814
- const isSeqLike = doc.type === "sequence" || doc.type === "solidity";
7815
8024
  for (const a of doc.actors) {
7816
8025
  const dragonSlug = slugify(a.name);
7817
- let primaryNodes;
7818
- if (isSeqLike) {
7819
- const ownedLaneIds = new Set(
7820
- diagram2.lanes.filter((l) => l.label === a.name).map((l) => l.id)
7821
- );
7822
- primaryNodes = ownedLaneIds.size > 0 ? diagram2.nodes.filter((n) => ownedLaneIds.has(n.lane) && n.id === `${n.lane}-header`) : diagram2.nodes.filter((n) => n.id === `${dragonSlug}-header`);
7823
- } else {
7824
- primaryNodes = diagram2.nodes.filter((n) => n.id === dragonSlug);
7825
- }
8026
+ const primaryNodes = diagram2.nodes.filter((n) => n.id === dragonSlug);
7826
8027
  for (const node of primaryNodes) {
7827
- if (a.title !== void 0) {
7828
- node.title = a.title;
7829
- if (isSeqLike) {
7830
- const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
7831
- if (footer) footer.title = a.title;
7832
- if (a.posW === void 0) {
7833
- const titleW = Math.max(140, a.title.length * 22 + 52);
7834
- node.w = titleW;
7835
- if (footer) footer.w = titleW;
7836
- }
7837
- }
7838
- }
8028
+ if (a.title !== void 0) node.title = a.title;
7839
8029
  const \u8AAC\u660E = doc.type === "c4" ? \u6BB5\u3092\u8AAD\u307F\u53D6\u308B(a.subtitle).\u8AAC\u660E : a.subtitle;
7840
8030
  if (\u8AAC\u660E !== void 0) node.subtitle = \u8AAC\u660E;
7841
8031
  if (a.eyebrow !== void 0) node.eyebrow = a.eyebrow;
7842
8032
  if (a.value !== void 0) node.value = a.value;
7843
- if (a.rows !== void 0) node.rows = a.rows;
7844
- if (!isSeqLike) {
7845
- if (a.posW !== void 0) node.w = a.posW;
7846
- if (a.posH !== void 0) node.h = a.posH;
7847
- }
7848
- const drawn = isSeqLike && a.kindWritten !== false ? drawableKind(a.kind) : void 0;
7849
- if (drawn !== void 0) {
7850
- node.kind = drawn;
7851
- const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
7852
- if (footer) footer.kind = drawn;
7853
- }
7854
- if (isSeqLike && a.rows !== void 0 && a.rows.length > 0 && rendersRows(a.kind)) {
7855
- node.h = Math.max(node.h ?? 0, requiredRowsHeight(a.kind, a.rows.length) ?? 0);
7856
- node.w = Math.max(node.w ?? 0, requiredRowsWidth(a.rows, a.kind));
7857
- }
7858
- if (isSeqLike) {
7859
- if (a.posW !== void 0) node.w = a.posW;
7860
- if (a.posH !== void 0) node.h = a.posH;
7861
- const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
7862
- if (footer && a.posW !== void 0) footer.w = a.posW;
8033
+ if (a.rows !== void 0 && !\u884C\u3092\u7D44\u307F\u7ACB\u3066\u5668\u304C\u6301\u3064(doc.type)) node.rows = a.rows;
8034
+ if (a.marks !== void 0 && a.rows !== void 0) {
8035
+ const \u7D44 = \u884C\u3068\u5370\u3092\u7D44\u3080(doc.type, a.rows, a.marks);
8036
+ if (\u7D44 !== null) {
8037
+ node.rows = \u7D44.rows;
8038
+ node.rowMarks = \u7D44.rowMarks;
8039
+ }
8040
+ }
8041
+ if (doc.type === "state" && node.kind === "storage" && node.rowMarks === void 0) {
8042
+ node.rows = a.rows ?? [];
8043
+ node.rowMarks = [];
7863
8044
  }
8045
+ if (a.posW !== void 0) node.w = a.posW;
8046
+ if (a.posH !== void 0) node.h = a.posH;
7864
8047
  if (a.shape !== void 0) {
7865
8048
  const dynamicKind = `dyn-${a.shape.kind}`;
7866
8049
  node.kind = dynamicKind;
7867
8050
  node.shape = { ...a.shape };
7868
- if (isSeqLike) {
7869
- const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
7870
- if (footer) {
7871
- footer.kind = dynamicKind;
7872
- footer.shape = { ...a.shape };
7873
- }
7874
- }
7875
- }
7876
- if (a.visibleIf !== void 0) {
7877
- node.visibleIf = a.visibleIf;
7878
- if (isSeqLike) {
7879
- const footer = diagram2.nodes.find((n) => n.id === `${node.lane}-footer`);
7880
- if (footer) footer.visibleIf = a.visibleIf;
7881
- }
7882
8051
  }
8052
+ if (a.visibleIf !== void 0) node.visibleIf = a.visibleIf;
7883
8053
  if (a.wBind !== void 0) node.wBind = a.wBind;
7884
8054
  if (a.hBind !== void 0) node.hBind = a.hBind;
7885
8055
  if (a.opacity !== void 0) node.opacity = a.opacity;
@@ -7887,8 +8057,6 @@ function applyV05Extensions(diagram2, doc, \u8FFD\u52A0\u3057\u305F\u7E26\u5217o
7887
8057
  if (a.renderOffsetY !== void 0) node.renderOffsetY = a.renderOffsetY;
7888
8058
  }
7889
8059
  }
7890
- alignSeqHeaderHeights(diagram2, doc);
7891
- dropUnfittableEndKinds(diagram2, doc);
7892
8060
  if (doc.animate && doc.animate.phases.length > 0 && diagram2.phases.length === 0) {
7893
8061
  injectPhasesFallback(diagram2, doc);
7894
8062
  }
@@ -7984,6 +8152,9 @@ function injectPhasesFallback(diagram2, doc) {
7984
8152
  body: p.body ?? "",
7985
8153
  activate: activateIds,
7986
8154
  ...drawIds.length > 0 ? { draw: drawIds } : {},
8155
+ // 描く速さ (#1441)。 **描く相手が決まった段にだけ載せる** = 語が効かない図種
8156
+ // (`drawIds` が空) で割合だけ渡すと、描画側が「draw が空なのに割合がある」 と知らせる
8157
+ ...drawIds.length > 0 && p.drawRatio !== void 0 ? { drawRatio: p.drawRatio } : {},
7987
8158
  tweens: (p.tweens ?? []).map((t) => ({ stateId: t.state, from: t.from, to: t.to })),
7988
8159
  sets: (p.sets ?? []).map((s) => ({ stateId: s.state, value: s.value })),
7989
8160
  ...p.badge ? { badge: p.badge } : {}
@@ -7991,13 +8162,17 @@ function injectPhasesFallback(diagram2, doc) {
7991
8162
  }
7992
8163
  }
7993
8164
  function compileSequence(doc) {
7994
- if (doc.animate && doc.animate.phases.length > 0) {
7995
- return compileSequenceWithAnimate(doc);
7996
- }
7997
8165
  const seqBuilder = sequence({
7998
8166
  id: slugify(doc.title),
7999
8167
  topic: doc.title,
8000
- actors: doc.actors.map((a) => a.name)
8168
+ /*
8169
+ * 見出しに出すのは **書いた題** (#1466)。 名前は矢印の端として指すためのもので、
8170
+ * `title:` を書いたらそちらを出す (`箱の題`)。 板でも他の図種と同じ規約にする。
8171
+ */
8172
+ actors: doc.actors.map(
8173
+ (a) => a.subtitle ? { name: \u7BB1\u306E\u984C(a), subtitle: a.subtitle } : \u7BB1\u306E\u984C(a)
8174
+ ),
8175
+ ...doc.bands && doc.bands.length > 0 ? { bands: doc.bands } : {}
8001
8176
  });
8002
8177
  for (const s of doc.flow) {
8003
8178
  seqBuilder.step({
@@ -8007,140 +8182,43 @@ function compileSequence(doc) {
8007
8182
  ...s.sub ? { sub: s.sub } : {},
8008
8183
  ...s.side ? { side: s.side } : {},
8009
8184
  ...s.tone ? { tone: s.tone } : {},
8010
- ...s.style ? { style: s.style } : {}
8185
+ ...s.style ? { style: s.style } : {},
8186
+ ...s.msgKind ? { kind: s.msgKind } : {}
8011
8187
  });
8012
8188
  }
8013
- return seqBuilder.build();
8014
- }
8015
- function compileSequenceWithAnimate(doc) {
8016
- const b = diagram(slugify(doc.title), { topic: doc.title });
8017
- const laneW = 340;
8018
- const actorIds = /* @__PURE__ */ new Map();
8019
- doc.actors.forEach((a, i) => {
8020
- const id = slugify(a.name);
8021
- actorIds.set(a.name, id);
8022
- actorIds.set(id, id);
8023
- const laneOpts = { width: laneW, label: a.name, lifeline: true };
8024
- if (a.posX !== void 0 && a.posY !== void 0) {
8025
- laneOpts.posX = a.posX;
8026
- laneOpts.posY = a.posY;
8027
- if (a.posW !== void 0) laneOpts.posW = a.posW;
8028
- if (a.posH !== void 0) laneOpts.posH = a.posH;
8029
- }
8030
- b.lane(id, laneOpts);
8031
- const headerId = `${id}-header`;
8032
- const actorW = Math.max(140, \u7BB1\u306E\u984C(a).length * 22 + 52);
8033
- b.node(headerId, { lane: id, stack: 0, kind: "card", title: \u7BB1\u306E\u984C(a), w: actorW, h: 72 });
8034
- const spacerId = `${id}-spacer`;
8035
- b.node(spacerId, { lane: id, stack: 1, kind: "card", title: "", w: 2, h: 40 });
8036
- });
8037
- doc.flow.forEach((s, idx) => {
8038
- const fromLaneId = actorIds.get(s.from);
8039
- const toLaneId = actorIds.get(s.to);
8040
- if (fromLaneId === void 0 || toLaneId === void 0) return;
8041
- const stack = idx + 2;
8042
- const fromBoxId = `s${idx}-${fromLaneId}`;
8043
- const toBoxId = `s${idx}-${toLaneId}`;
8044
- b.node(fromBoxId, { lane: fromLaneId, stack, kind: "card", title: "", w: 2, h: 2 });
8045
- if (fromLaneId !== toLaneId) {
8046
- b.node(toBoxId, { lane: toLaneId, stack, kind: "card", title: "", w: 2, h: 2 });
8047
- }
8048
- const edgeId = `e${idx}-${fromLaneId}-${toLaneId}`;
8049
- b.edge(fromBoxId, fromLaneId === toLaneId ? fromBoxId : toBoxId, {
8050
- id: edgeId,
8051
- label: s.label,
8052
- ...s.sub ? { sub: s.sub } : {},
8053
- ...s.side ? { side: s.side } : {},
8054
- ...s.tone ? { tone: s.tone } : {},
8055
- ...s.style ? { style: s.style } : {}
8056
- });
8057
- });
8058
- const footerStack = doc.flow.length + 2;
8059
- doc.actors.forEach((a) => {
8060
- const laneId = actorIds.get(a.name) ?? slugify(a.name);
8061
- const footerId = `${laneId}-footer`;
8062
- const actorW = Math.max(140, \u7BB1\u306E\u984C(a).length * 22 + 52);
8063
- b.node(footerId, {
8064
- lane: laneId,
8065
- stack: footerStack,
8066
- kind: "card",
8067
- title: \u7BB1\u306E\u984C(a),
8068
- w: actorW,
8069
- h: 72,
8070
- role: "lifeline-footer"
8071
- });
8072
- });
8073
- for (const st of doc.animate?.states ?? []) {
8074
- b.state(st.name, { initial: st.initial });
8075
- }
8076
- for (const p of doc.animate?.phases ?? []) {
8077
- b.phase(
8078
- slugify(p.name),
8079
- {
8189
+ const built = seqBuilder.build();
8190
+ const \u6BB5 = doc.animate?.phases ?? [];
8191
+ if (\u6BB5.length === 0) return built;
8192
+ const \u756A\u53F7 = /* @__PURE__ */ new Map();
8193
+ doc.flow.forEach((f, i) => \u756A\u53F7.set(`${slugify(f.from)} -> ${slugify(f.to)}`, i));
8194
+ const \u72B6\u614B\u540D = sequenceStepId();
8195
+ return {
8196
+ ...built,
8197
+ states: [...built.states, { id: \u72B6\u614B\u540D, initial: "0" }],
8198
+ phases: \u6BB5.map((p, i) => {
8199
+ const \u756A = Math.max(
8200
+ 0,
8201
+ ...(p.highlight ?? []).map(
8202
+ (f) => \u756A\u53F7.get(f.split("->").map((x) => slugify(x.trim())).join(" -> ")) ?? -1
8203
+ )
8204
+ );
8205
+ return {
8206
+ id: `p${i}`,
8080
8207
  duration: p.durationMs,
8081
8208
  title: p.name,
8082
- body: p.body ?? ""
8083
- },
8084
- (pb) => {
8085
- const activateIds = resolveHighlight(p, doc, actorIds);
8086
- if (activateIds.length > 0) {
8087
- pb.activate(...activateIds);
8088
- }
8089
- for (const t of p.tweens ?? []) {
8090
- pb.tween(t.state, t.from, t.to);
8091
- }
8092
- for (const s of p.sets ?? []) {
8093
- pb.set(s.state, s.value);
8094
- }
8095
- if (p.badge) {
8096
- pb.badge(p.badge);
8097
- }
8098
- return pb;
8099
- }
8100
- );
8101
- }
8102
- return b.build();
8103
- }
8104
- function resolveHighlight(phase, doc, actorIds, _stepEdgeIds) {
8105
- const out = [];
8106
- const knownNames = new Set(actorIds.keys());
8107
- for (const raw of phase.highlight ?? []) {
8108
- const entry = parseFocusEntry(raw, knownNames);
8109
- if (entry.kind === "edge") {
8110
- const fromLaneId = actorIds.get(entry.from) ?? slugify(entry.from);
8111
- const toLaneId = actorIds.get(entry.to) ?? slugify(entry.to);
8112
- doc.flow.forEach((s, idx) => {
8113
- const sFromId = actorIds.get(s.from) ?? slugify(s.from);
8114
- const sToId = actorIds.get(s.to) ?? slugify(s.to);
8115
- if (sFromId === fromLaneId && sToId === toLaneId) {
8116
- out.push(`e${idx}-${fromLaneId}-${toLaneId}`);
8117
- }
8118
- });
8119
- const stackIdx = doc.flow.findIndex((s) => {
8120
- const sFromId = actorIds.get(s.from) ?? slugify(s.from);
8121
- const sToId = actorIds.get(s.to) ?? slugify(s.to);
8122
- return sFromId === fromLaneId && sToId === toLaneId;
8123
- });
8124
- if (stackIdx >= 0) {
8125
- out.push(`s${stackIdx}-${fromLaneId}`);
8126
- if (fromLaneId !== toLaneId) out.push(`s${stackIdx}-${toLaneId}`);
8127
- }
8128
- continue;
8129
- }
8130
- const laneId = actorIds.get(entry.name) ?? slugLookup(actorIds, entry.name);
8131
- if (laneId) {
8132
- out.push(`${laneId}-header`);
8133
- out.push(`${laneId}-footer`);
8134
- doc.flow.forEach((s, idx) => {
8135
- const sFromId = actorIds.get(s.from) ?? slugify(s.from);
8136
- const sToId = actorIds.get(s.to) ?? slugify(s.to);
8137
- if (sFromId === laneId || sToId === laneId) {
8138
- out.push(`s${idx}-${laneId}`);
8139
- }
8140
- });
8141
- }
8142
- }
8143
- return out;
8209
+ body: p.body ?? "",
8210
+ activate: [slugify(doc.title)],
8211
+ ...p.badge ? { badge: p.badge } : {},
8212
+ /*
8213
+ * **書いた状態の動きも一緒に運ぶ** (#1466)。 板の段は「今どの言づてか」 を状態に
8214
+ * 書くが、記法は同じ段に `遷移:` / `切替:` も書ける。 板の分だけを載せると、
8215
+ * 書いた動きが黙って落ちる (実測で `tweens` が 0 件になっていた)。
8216
+ */
8217
+ sets: [...(p.sets ?? []).map((x) => ({ stateId: x.state, value: x.value })), { stateId: \u72B6\u614B\u540D, value: \u756A }],
8218
+ tweens: (p.tweens ?? []).map((t) => ({ stateId: t.state, from: t.from, to: t.to }))
8219
+ };
8220
+ })
8221
+ };
8144
8222
  }
8145
8223
  function slugLookup(byName, wanted) {
8146
8224
  let hit;
@@ -8263,8 +8341,14 @@ function \u59CB\u307E\u308A\u3068\u7D42\u308F\u308A\u306E\u6C7A\u3081\u65B9(doc)
8263
8341
  \u7D42\u308F\u308A: (a, idx) => \u66F8\u3044\u305F\u7D42\u308F\u308A ? a.final === true : idx === doc.actors.length - 1 && doc.actors.length > 1
8264
8342
  };
8265
8343
  }
8344
+ var \u72B6\u614B\u306E\u56F3\u306E\u65E2\u5B9A\u306E\u7A2E\u985E = "card";
8345
+ function \u65E2\u5B9A\u3068\u9055\u3046\u7A2E\u985E\u3092\u66F8\u3044\u305F(doc) {
8346
+ return doc.actors.some(
8347
+ (a) => a.kindWritten === true && \u63CF\u3051\u308B\u7A2E\u5225(a.kind) !== \u72B6\u614B\u306E\u56F3\u306E\u65E2\u5B9A\u306E\u7A2E\u985E
8348
+ );
8349
+ }
8266
8350
  function compileState(doc) {
8267
- if (doc.animate && doc.animate.phases.length > 0) {
8351
+ if (doc.animate && doc.animate.phases.length > 0 || \u65E2\u5B9A\u3068\u9055\u3046\u7A2E\u985E\u3092\u66F8\u3044\u305F(doc)) {
8268
8352
  return compileGenericWithAnimate(doc, { kind: "state", laneWidth: 360 });
8269
8353
  }
8270
8354
  const fsm = stateMachine({
@@ -8332,7 +8416,13 @@ function \u5F8C\u308D\u3078\u623B\u308B\u77E2\u5370\u304B(kind, fromId, toId, \u
8332
8416
  if (\u5143 === void 0 || \u5148 === void 0) return false;
8333
8417
  return \u5148 < \u5143;
8334
8418
  }
8335
- var \u7E26\u5217\u3092\u9078\u3079\u308B\u56F3\u7A2E = /* @__PURE__ */ new Set(["flow", "topology", "swimlane"]);
8419
+ var \u7E26\u5217\u3092\u9078\u3079\u308B\u56F3\u7A2E = /* @__PURE__ */ new Set([
8420
+ "flow",
8421
+ "topology",
8422
+ "swimlane",
8423
+ "class",
8424
+ "state"
8425
+ ]);
8336
8426
  function \u66F8\u3044\u305F\u7E26\u5217\u306B\u7F6E\u304F(kind, doc) {
8337
8427
  if (!\u7E26\u5217\u3092\u9078\u3079\u308B\u56F3\u7A2E.has(kind)) return false;
8338
8428
  const \u5BFE\u8C61 = doc.actors.filter((a) => a.partId === void 0);
@@ -8960,7 +9050,7 @@ function writeVerticalForm(seg, headIdx, lineCount, headIndent, x, y) {
8960
9050
  else seg.splice(insertAt * 2, 0, newLine, sep);
8961
9051
  return seg.join("");
8962
9052
  }
8963
- var \u7DDA\u7A2E = ["solid", "dotted-flow"];
9053
+ var \u7DDA\u7A2E = EDGE_STYLES;
8964
9054
  var \u8272\u540D\u306E\u8868 = new Map([
8965
9055
  ...TONES.map((t) => [t.toLowerCase(), t]),
8966
9056
  ...Object.entries(TONE_ALIAS).map(([k, v]) => [k.toLowerCase(), v])
@@ -9127,7 +9217,11 @@ var ACCEPTED_KEYS = {
9127
9217
  "formulas",
9128
9218
  // 押下などの出来事で動く仕掛けと、巻き上げに応じて進む値 (#1393)
9129
9219
  "events",
9130
- "scrolls"
9220
+ "scrolls",
9221
+ // 順序図で面が動いている間の帯 (#1466)
9222
+ "bands",
9223
+ // 矢印をいつ出すか (#1470)
9224
+ "reveal"
9131
9225
  ],
9132
9226
  actor: [
9133
9227
  "name",
@@ -9135,6 +9229,8 @@ var ACCEPTED_KEYS = {
9135
9229
  "subtitle",
9136
9230
  "eyebrow",
9137
9231
  "value",
9232
+ // 前の時点の値 (#1450)。 内訳の変化を帯で示す図と、値 1 つを大きく示す図が読む
9233
+ "previous",
9138
9234
  "rows",
9139
9235
  "lane",
9140
9236
  "stack",
@@ -9165,7 +9261,9 @@ var ACCEPTED_KEYS = {
9165
9261
  "hBind",
9166
9262
  "opacity",
9167
9263
  "renderOffsetX",
9168
- "renderOffsetY"
9264
+ "renderOffsetY",
9265
+ // 行頭の印 (#1466)。 行ごとに 1 つ、図の種類ごとの語で書く
9266
+ "marks"
9169
9267
  ],
9170
9268
  step: [
9171
9269
  "from",
@@ -9174,6 +9272,14 @@ var ACCEPTED_KEYS = {
9174
9272
  "sub",
9175
9273
  // 矢印がどの辺から出るか (#1385)
9176
9274
  "side",
9275
+ // 矢印の先の形 (#1462)
9276
+ "head",
9277
+ // 端の印の残り 3 欄と、関係の語 / 言づての種類 (#1466)
9278
+ "tailHead",
9279
+ "headFill",
9280
+ "tailHeadFill",
9281
+ "relation",
9282
+ "kind",
9177
9283
  "tone",
9178
9284
  "style",
9179
9285
  "guard",
@@ -9187,7 +9293,7 @@ var ACCEPTED_KEYS = {
9187
9293
  "overlay",
9188
9294
  "pos"
9189
9295
  ],
9190
- phase: ["step", "duration", "focus", "body", "badge", "tween", "set", "draw"],
9296
+ phase: ["step", "duration", "focus", "body", "badge", "tween", "set", "draw", "drawRatio"],
9191
9297
  viewport: ["width", "height", "scale", "laneWidth", "gap", "laneGap", "nodeGap", "labelMargin"],
9192
9298
  lane: ["x", "width", "label", "contain", "lifeline", "pos"],
9193
9299
  group: ["label", "lanes"],
@@ -9219,7 +9325,11 @@ var \u6B04\u306E\u578B\u8868 = {
9219
9325
  formulas: "object",
9220
9326
  // 押下と巻き上げ (#1393)。 中身は下の検査が 1 件ずつ見る
9221
9327
  events: "\u4E26\u3073",
9222
- scrolls: "object"
9328
+ scrolls: "object",
9329
+ // 順序図で面が動いている間の帯 (#1466)
9330
+ bands: "\u4E26\u3073",
9331
+ // 矢印をいつ出すか (#1470)
9332
+ reveal: "\u975E\u7A7A\u306E\u6587\u5B57\u5217"
9223
9333
  },
9224
9334
  actor: {
9225
9335
  name: "\u5FC5\u9808\u306E\u975E\u7A7A\u6587\u5B57\u5217",
@@ -9227,6 +9337,7 @@ var \u6B04\u306E\u578B\u8868 = {
9227
9337
  subtitle: "\u6587\u5B57\u5217",
9228
9338
  eyebrow: "\u6587\u5B57\u5217",
9229
9339
  value: "\u6587\u5B57\u5217",
9340
+ previous: "\u6587\u5B57\u5217",
9230
9341
  rows: "\u6587\u5B57\u5217\u306E\u4E26\u3073",
9231
9342
  lane: "\u6587\u5B57\u5217",
9232
9343
  stack: "\u6570",
@@ -9257,7 +9368,9 @@ var \u6B04\u306E\u578B\u8868 = {
9257
9368
  hBind: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
9258
9369
  opacity: "\u6570\u304B\u6587\u5B57\u5217",
9259
9370
  renderOffsetX: "\u6570\u304B\u6587\u5B57\u5217",
9260
- renderOffsetY: "\u6570\u304B\u6587\u5B57\u5217"
9371
+ renderOffsetY: "\u6570\u304B\u6587\u5B57\u5217",
9372
+ // 行頭の印 (#1466)
9373
+ marks: "\u6587\u5B57\u5217\u306E\u4E26\u3073"
9261
9374
  },
9262
9375
  step: {
9263
9376
  from: "\u5FC5\u9808\u306E\u6587\u5B57\u5217",
@@ -9266,6 +9379,13 @@ var \u6B04\u306E\u578B\u8868 = {
9266
9379
  sub: "\u6587\u5B57\u5217",
9267
9380
  // 矢印がどの辺から出るか (#1385)
9268
9381
  side: "\u8FBA",
9382
+ head: "\u7AEF\u306E\u5F62",
9383
+ // 端の印の残り 3 欄と、関係の語 / 言づての種類 (#1466)
9384
+ tailHead: "\u7AEF\u306E\u5F62",
9385
+ headFill: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
9386
+ tailHeadFill: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
9387
+ relation: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
9388
+ kind: "\u975E\u7A7A\u306E\u6587\u5B57\u5217",
9269
9389
  tone: "\u8272",
9270
9390
  style: "\u7DDA\u7A2E",
9271
9391
  guard: "\u6587\u5B57\u5217",
@@ -9287,7 +9407,8 @@ var \u6B04\u306E\u578B\u8868 = {
9287
9407
  badge: "\u6587\u5B57\u5217",
9288
9408
  tween: "object",
9289
9409
  set: "object",
9290
- draw: "\u63CF\u304F\u3082\u306E"
9410
+ draw: "\u63CF\u304F\u3082\u306E",
9411
+ drawRatio: "\u6570"
9291
9412
  },
9292
9413
  viewport: {
9293
9414
  width: "\u6570",
@@ -9446,6 +9567,16 @@ function \u5024\u3092\u691C\u67FB(v, \u578B, path, \u540D\u524D, errors) {
9446
9567
  });
9447
9568
  }
9448
9569
  return;
9570
+ case "\u7AEF\u306E\u5F62":
9571
+ if (v === void 0) return;
9572
+ if (typeof v !== "string" || !EDGE_HEAD_VALUES.includes(v)) {
9573
+ errors.push({
9574
+ path,
9575
+ message: `${\u540D\u524D} must be one of: ${EDGE_HEAD_VALUES.join(", ")}`,
9576
+ hint: typeof v === "string" ? `got "${v}"` : `got ${typeof v}`
9577
+ });
9578
+ }
9579
+ return;
9449
9580
  case "\u63CF\u304F\u3082\u306E":
9450
9581
  if (v === void 0) return;
9451
9582
  if (typeof v !== "string" || !DRAW_WORDS.has(v)) {
@@ -9630,6 +9761,33 @@ function \u8868\u3067\u4E2D\u8EAB\u3092\u691C\u67FB\u3059\u308B(o, \u8868, path,
9630
9761
  }
9631
9762
  }
9632
9763
  }
9764
+ function validateBands(v, errors) {
9765
+ if (v === void 0) return;
9766
+ if (!Array.isArray(v)) {
9767
+ errors.push({
9768
+ path: "$.bands",
9769
+ message: "bands must be an array of band objects",
9770
+ hint: `got ${v === null ? "null" : typeof v}`
9771
+ });
9772
+ return;
9773
+ }
9774
+ v.forEach((b, i) => {
9775
+ const path = `$.bands[${i}]`;
9776
+ if (typeof b !== "object" || b === null || Array.isArray(b)) {
9777
+ errors.push({ path, message: "band must be an object", hint: "{ actor, from, to } \u306E\u5F62\u3067\u66F8\u304F" });
9778
+ return;
9779
+ }
9780
+ const o = b;
9781
+ if (typeof o.actor !== "string" || o.actor === "") {
9782
+ errors.push({ path: `${path}.actor`, message: "band.actor must be a non-empty string" });
9783
+ }
9784
+ for (const k of ["from", "to"]) {
9785
+ if (typeof o[k] !== "number" || !Number.isInteger(o[k]) || o[k] < 0) {
9786
+ errors.push({ path: `${path}.${k}`, message: `band.${k} must be a non-negative integer` });
9787
+ }
9788
+ }
9789
+ });
9790
+ }
9633
9791
  function validateReadouts(v, errors) {
9634
9792
  if (v === void 0) return;
9635
9793
  if (!Array.isArray(v)) {
@@ -10094,6 +10252,7 @@ function validateJson(json) {
10094
10252
  const j = \u5199\u3057.value;
10095
10253
  checkUnknownKeys(j, "root", "$", errors);
10096
10254
  validateReadouts(j.readouts, errors);
10255
+ validateBands(j.bands, errors);
10097
10256
  validateInputs(j.inputs, errors);
10098
10257
  validateFormulas(j.formulas, j.inputs, errors);
10099
10258
  validateEvents(j.events, errors);
@@ -10325,7 +10484,10 @@ function jsonToDoc(json) {
10325
10484
  subtitle: a.subtitle,
10326
10485
  eyebrow: a.eyebrow,
10327
10486
  value: a.value,
10487
+ previous: a.previous,
10328
10488
  rows: a.rows,
10489
+ // 行頭の印 (#1466)。 行と対で読む
10490
+ marks: a.marks,
10329
10491
  lane: a.lane,
10330
10492
  stack: a.stack,
10331
10493
  initial: a.initial,
@@ -10381,6 +10543,14 @@ function jsonToDoc(json) {
10381
10543
  label: s.label,
10382
10544
  sub: s.sub,
10383
10545
  side: s.side,
10546
+ // 矢印の先の形 (#1462)。 読めない語は組み立てが落とす
10547
+ head: s.head,
10548
+ // 端の印の残り 3 欄と、関係の語 / 言づての種類 (#1466)
10549
+ tailHead: s.tailHead,
10550
+ headFill: s.headFill,
10551
+ tailHeadFill: s.tailHeadFill,
10552
+ relation: s.relation,
10553
+ msgKind: s.kind,
10384
10554
  // 箱と同じ読み替えを通す (#1304)。 通さないと `tone: "成功"` が色名として解決されないまま
10385
10555
  // 図に届き、同じ値が箱では色になり矢印では色にならない
10386
10556
  tone: resolveTone(s.tone),
@@ -10425,6 +10595,9 @@ function jsonToDoc(json) {
10425
10595
  badge: p.badge,
10426
10596
  // 書いた段だけが欄を持つ。 空文字を置くと「書いた」 と「書いていない」 が同じ形になる
10427
10597
  ...p.draw !== void 0 ? { draw: p.draw, drawPos: p0 } : {},
10598
+ // 割合は `draw` がある段にだけ写す。 単独で書いても描く相手が決まらず何も起きないので、
10599
+ // 記法側 (同じ行に書かせる形) と同じ状態に揃える
10600
+ ...p.draw !== void 0 && p.drawRatio !== void 0 ? { drawRatio: p.drawRatio } : {},
10428
10601
  // 段の中で動かす分 (#1186)。 記法側の `tweens` / `sets` と同じ形に写す。
10429
10602
  // 空の配列を置かないのは、記法側が「無ければ field ごと持たない」 形だから
10430
10603
  ...p.tween && Object.keys(p.tween).length > 0 ? {
@@ -10473,6 +10646,10 @@ function jsonToDoc(json) {
10473
10646
  formulas,
10474
10647
  events,
10475
10648
  scrolls,
10649
+ // 順序図で面が動いている間の帯 (#1466)
10650
+ bands: json.bands,
10651
+ // 矢印をいつ出すか (#1470)
10652
+ reveal: json.reveal,
10476
10653
  pos: p0
10477
10654
  };
10478
10655
  }
@@ -10520,6 +10697,11 @@ var diagram_default = {
10520
10697
  "pie",
10521
10698
  "bar",
10522
10699
  "line",
10700
+ "gauge",
10701
+ "radial",
10702
+ "stat",
10703
+ "waffle",
10704
+ "stacked",
10523
10705
  "funnel",
10524
10706
  "tree",
10525
10707
  "journey",
@@ -10527,11 +10709,11 @@ var diagram_default = {
10527
10709
  "c4",
10528
10710
  "mind"
10529
10711
  ],
10530
- description: '\u56F3\u306E\u7A2E\u985E\u3002 \u578B\u3054\u3068\u306B actors \u306E\u66F8\u304D\u65B9\u304C\u9055\u3046\u3002 [\u95A2\u4FC2\u3092\u63CF\u304F] sequence (\u6642\u7CFB\u5217\u306E\u547C\u3073\u51FA\u3057) / flow (\u51E6\u7406\u306E\u6D41\u308C) / swimlane (\u8CAC\u52D9\u3054\u3068\u306E\u6D41\u308C) / er (DB \u306E schema) / state (\u72B6\u614B\u306E\u9077\u79FB) / topology (network) / solidity (contract) / class (UML \u306E class) / c4 (architecture) / mind (\u767A\u60F3\u306E\u679D\u5206\u304B\u308C) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306B\u77E2\u5370\u3092\u66F8\u304F\u3002 [\u5024\u3092\u63CF\u304F] pie (\u5272\u5408) / bar (\u68D2\u306E\u9AD8\u3055) / line (\u7DDA\u306E\u9AD8\u3055\u3001 \u66F8\u3044\u305F\u9806\u306B\u4E26\u3076) \u306F actors \u306B `- \u540D\u524D: "45"` \u306E\u5F62\u3067\u6570\u3092\u66F8\u304F\u3002 funnel (\u6BB5\u3054\u3068\u306B\u6E1B\u308B\u6570) \u3082\u540C\u3058\u5F62\u3002 [\u8A9E\u3092\u63CF\u304F] journey (\u4F53\u9A13\u306E\u8D77\u4F0F) \u306F `- \u767B\u9332: "\u4E0D\u6E80"` \u306E\u5F62\u3067 \u6700\u9AD8 / \u6E80\u8DB3 / \u666E\u901A / \u4E0D\u6E80 / \u6012\u308A \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 quadrant (2 \u8EF8\u306E\u4ED5\u5206\u3051) \u306F `- \u91CD\u8907\u524A\u9664: "\u5DE6\u4E0A"` \u306E\u5F62\u3067 \u5DE6\u4E0A / \u53F3\u4E0A / \u5DE6\u4E0B / \u53F3\u4E0B \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 [\u6642\u671F\u3092\u63CF\u304F] gantt (\u5DE5\u7A0B\u306E\u4E26\u3073) \u306F `- \u8A2D\u8A08: "1\u6708"` \u306E\u5F62\u3067\u59CB\u307E\u308A\u306E\u6642\u671F\u3092\u66F8\u304D\u3001 flow \u306E\u77E2\u5370\u3067\u524D\u5F8C\u95A2\u4FC2\u3092\u66F8\u304F\u3002 [\u89AA\u5B50\u3092\u63CF\u304F] tree (\u89AA\u5B50\u306E\u5165\u308C\u5B50) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306E\u77E2\u5370\u3067\u89AA\u5B50\u3092\u66F8\u304F (\u77E2\u5370\u306E\u5148\u304C\u5B50)'
10712
+ description: '\u56F3\u306E\u7A2E\u985E\u3002 \u578B\u3054\u3068\u306B actors \u306E\u66F8\u304D\u65B9\u304C\u9055\u3046\u3002 [\u95A2\u4FC2\u3092\u63CF\u304F] sequence (\u6642\u7CFB\u5217\u306E\u547C\u3073\u51FA\u3057) / flow (\u51E6\u7406\u306E\u6D41\u308C) / swimlane (\u8CAC\u52D9\u3054\u3068\u306E\u6D41\u308C) / er (DB \u306E schema) / state (\u72B6\u614B\u306E\u9077\u79FB) / topology (network) / solidity (contract) / class (UML \u306E class) / c4 (architecture) / mind (\u767A\u60F3\u306E\u679D\u5206\u304B\u308C) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306B\u77E2\u5370\u3092\u66F8\u304F\u3002 [\u5024\u3092\u63CF\u304F] pie (\u5272\u5408) / bar (\u68D2\u306E\u9AD8\u3055) / line (\u7DDA\u306E\u9AD8\u3055\u3001 \u66F8\u3044\u305F\u9806\u306B\u4E26\u3076) / gauge (\u5408\u8A08\u3092\u534A\u5186\u3067\u793A\u3059) / radial (\u5F27\u306E\u9577\u3055\u3067\u6BD4\u3079\u308B) / stat (\u5024 1 \u3064\u3092\u5927\u304D\u304F\u793A\u3059) / waffle (\u5272\u5408\u3092 100 \u500B\u306E\u5370\u3067\u793A\u3059) / stacked (\u5185\u8A33\u3092\u5E2F\u3067\u793A\u3059) \u306F actors \u306B `- \u540D\u524D: "45"` \u306E\u5F62\u3067\u6570\u3092\u66F8\u304F\u3002 stat \u3068 stacked \u306F `- \u540D\u524D: { value: "320", previous: "280" }` \u306E\u5F62\u3067\u524D\u306E\u6642\u70B9\u306E\u5024\u3082\u66F8\u3051\u308B\u3002 funnel (\u6BB5\u3054\u3068\u306B\u6E1B\u308B\u6570) \u3082\u540C\u3058\u5F62\u3002 [\u8A9E\u3092\u63CF\u304F] journey (\u4F53\u9A13\u306E\u8D77\u4F0F) \u306F `- \u767B\u9332: "\u4E0D\u6E80"` \u306E\u5F62\u3067 \u6700\u9AD8 / \u6E80\u8DB3 / \u666E\u901A / \u4E0D\u6E80 / \u6012\u308A \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 quadrant (2 \u8EF8\u306E\u4ED5\u5206\u3051) \u306F `- \u91CD\u8907\u524A\u9664: "\u5DE6\u4E0A"` \u306E\u5F62\u3067 \u5DE6\u4E0A / \u53F3\u4E0A / \u5DE6\u4E0B / \u53F3\u4E0B \u306E\u3069\u308C\u304B\u3092\u66F8\u304F\u3002 [\u6642\u671F\u3092\u63CF\u304F] gantt (\u5DE5\u7A0B\u306E\u4E26\u3073) \u306F `- \u8A2D\u8A08: "1\u6708"` \u306E\u5F62\u3067\u59CB\u307E\u308A\u306E\u6642\u671F\u3092\u66F8\u304D\u3001 flow \u306E\u77E2\u5370\u3067\u524D\u5F8C\u95A2\u4FC2\u3092\u66F8\u304F\u3002 [\u89AA\u5B50\u3092\u63CF\u304F] tree (\u89AA\u5B50\u306E\u5165\u308C\u5B50) \u306F actors \u306B\u540D\u524D\u3092\u4E26\u3079 flow \u306E\u77E2\u5370\u3067\u89AA\u5B50\u3092\u66F8\u304F (\u77E2\u5370\u306E\u5148\u304C\u5B50)'
10531
10713
  },
10532
10714
  eyebrow: {
10533
10715
  type: "string",
10534
- description: "\u56F3\u8868\u306E\u7BB1\u306E\u4E0A\u306B\u51FA\u3059\u5C0F\u898B\u51FA\u3057 (\u7701\u7565\u53EF)\u3002 \u52B9\u304F\u306E\u306F\u56F3\u5168\u4F53\u3092 1 \u7BB1\u306B\u3059\u308B\u578B (pie / bar / line / funnel / tree / journey / quadrant / mind / gantt) \u3060\u3051\u3002 \u7BB1\u3054\u3068\u306B\u5206\u304B\u308C\u308B\u578B\u3067\u306F\u76F8\u624B\u304C\u6C7A\u307E\u3089\u306A\u3044\u305F\u3081\u3001 actors[].eyebrow \u306B\u66F8\u304F"
10716
+ description: "\u56F3\u8868\u306E\u7BB1\u306E\u4E0A\u306B\u51FA\u3059\u5C0F\u898B\u51FA\u3057 (\u7701\u7565\u53EF)\u3002 \u52B9\u304F\u306E\u306F\u56F3\u5168\u4F53\u3092 1 \u7BB1\u306B\u3059\u308B\u578B (pie / bar / line / gauge / radial / stat / waffle / stacked / funnel / tree / journey / quadrant / mind / gantt) \u3060\u3051\u3002 \u7BB1\u3054\u3068\u306B\u5206\u304B\u308C\u308B\u578B\u3067\u306F\u76F8\u624B\u304C\u6C7A\u307E\u3089\u306A\u3044\u305F\u3081\u3001 actors[].eyebrow \u306B\u66F8\u304F"
10535
10717
  },
10536
10718
  axes: {
10537
10719
  type: "object",
@@ -10600,6 +10782,10 @@ var diagram_default = {
10600
10782
  type: "string",
10601
10783
  description: "actor \u6570\u5024\u8868\u793A (kind: actor \u7528)"
10602
10784
  },
10785
+ previous: {
10786
+ type: "string",
10787
+ description: "\u524D\u306E\u6642\u70B9\u306E\u5024\u3002 type: stacked \u304C 2 \u672C\u76EE\u306E\u5E2F\u3068\u3057\u3066\u63CF\u304D\u3001type: stat \u304C\u5DEE\u3068\u3057\u3066\u51FA\u3059\u3002 \u66F8\u304B\u306A\u3044\u56F3\u306F 1 \u672C\u306E\u307E\u307E"
10788
+ },
10603
10789
  rows: {
10604
10790
  type: "array",
10605
10791
  items: {
@@ -10607,6 +10793,13 @@ var diagram_default = {
10607
10793
  },
10608
10794
  description: "storage \u5185\u306E column \u5217 (kind: storage \u7528)"
10609
10795
  },
10796
+ marks: {
10797
+ type: "array",
10798
+ items: {
10799
+ type: "string"
10800
+ },
10801
+ description: "\u884C\u982D\u306E\u5370\u3002 rows \u3068\u540C\u3058\u6570\u3060\u3051\u4E26\u3079\u308B\u3002 \u8A9E\u306E\u610F\u5473\u306F\u56F3\u306E\u7A2E\u985E\u304C\u6C7A\u3081\u308B = er \u306F pk / fk / opt\u3001class \u306F + / - \u3068 () \u306E\u6709\u7121\u3001state \u306F entry / do / exit / internal"
10802
+ },
10610
10803
  lane: {
10611
10804
  type: "string",
10612
10805
  description: "swimlane / topology \u3067\u5C5E\u3059\u308B lane id"
@@ -10941,7 +11134,7 @@ var diagram_default = {
10941
11134
  },
10942
11135
  style: {
10943
11136
  type: "string",
10944
- enum: ["solid", "dotted-flow"],
11137
+ enum: ["solid", "dotted-flow", "dashed"],
10945
11138
  description: "\u77E2\u5370\u306E\u7DDA\u7A2E"
10946
11139
  },
10947
11140
  guard: {
@@ -10957,6 +11150,36 @@ var diagram_default = {
10957
11150
  enum: ["top", "right", "bottom", "left"],
10958
11151
  description: "\u77E2\u5370\u304C\u3069\u306E\u8FBA\u304B\u3089\u51FA\u308B\u304B\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070\u63CF\u753B\u5074\u304C\u81EA\u52D5\u3067\u9078\u3076\u3002"
10959
11152
  },
11153
+ head: {
11154
+ type: "string",
11155
+ enum: ["none", "triangle", "diamond", "open", "crow", "one", "zero-one", "many", "zero-many"],
11156
+ description: "\u7740\u304D\u5148\u5074\u306E\u7AEF\u306E\u5F62\u3002 \u7AEF\u306E\u5F62\u3067\u95A2\u4FC2\u306E\u7A2E\u985E\u3092\u793A\u3059 = triangle (\u7D99\u3050) / diamond (\u6301\u3064) / open (\u4F7F\u3046) / crow (\u591A) / one / zero-one / many / zero-many (\u500B\u6570)\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070\u5857\u3063\u305F\u4E09\u89D2\u306B\u306A\u308B\u3002"
11157
+ },
11158
+ tailHead: {
11159
+ type: "string",
11160
+ enum: ["none", "triangle", "diamond", "open", "crow", "one", "zero-one", "many", "zero-many"],
11161
+ description: "\u51FA\u3069\u3053\u308D\u5074\u306E\u7AEF\u306E\u5F62\u3002 \u4E21\u7AEF\u306B\u5225\u3005\u306E\u5370\u3092\u7ACB\u3066\u308B\u6642\u306B\u66F8\u304F\u3002"
11162
+ },
11163
+ headFill: {
11164
+ type: "string",
11165
+ enum: ["solid", "hollow"],
11166
+ description: "\u7740\u304D\u5148\u5074\u306E\u7AEF\u306E\u5857\u308A\u3002 \u4E2D\u7A7A\u306F\u300C\u5F31\u3044\u95A2\u4FC2\u300D \u3092\u8868\u3059\u3002"
11167
+ },
11168
+ tailHeadFill: {
11169
+ type: "string",
11170
+ enum: ["solid", "hollow"],
11171
+ description: "\u51FA\u3069\u3053\u308D\u5074\u306E\u7AEF\u306E\u5857\u308A\u3002"
11172
+ },
11173
+ relation: {
11174
+ type: "string",
11175
+ enum: ["extends", "implements", "aggregates", "composes", "associates", "uses"],
11176
+ description: "\u30AF\u30E9\u30B9\u56F3\u306E\u95A2\u4FC2\u306E\u8A9E\u3002 \u66F8\u304F\u3068\u7AEF\u306E\u5F62 / \u5857\u308A / \u7DDA\u7A2E\u304C\u307E\u3068\u3081\u3066\u6C7A\u307E\u308B\u3002"
11177
+ },
11178
+ kind: {
11179
+ type: "string",
11180
+ enum: ["call", "return", "fire"],
11181
+ description: "\u9806\u5E8F\u56F3\u306E\u8A00\u3065\u3066\u306E\u7A2E\u985E\u3002 call (\u8FD4\u4E8B\u3092\u5F85\u3064) / return (\u8FD4\u3057) / fire (\u8FD4\u4E8B\u3092\u5F85\u305F\u306A\u3044)\u3002"
11182
+ },
10960
11183
  labelOffsetX: {
10961
11184
  type: "number",
10962
11185
  description: "\u30E9\u30D9\u30EB\u4F4D\u7F6E x \u8ABF\u6574"
@@ -11077,6 +11300,12 @@ var diagram_default = {
11077
11300
  enum: ["line", "bar", "pie", "journey", "mind", "tree", "gantt", "funnel"],
11078
11301
  description: "\u3053\u306E phase \u3067\u8D77\u70B9\u304B\u3089\u63CF\u304F\u3082\u306E\u3002 \u8A9E\u306F\u56F3\u7A2E\u3068\u63C3\u3048\u308B\u3002 line / journey = \u7DDA\u304C\u5DE6\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / bar = \u68D2\u304C\u6A2A\u8EF8\u304B\u3089\u4E0A\u3078\u4F38\u3073\u308B / pie = \u6247\u304C 12 \u6642\u304B\u3089\u6642\u8A08\u56DE\u308A\u306B\u958B\u304F / mind = \u679D\u304C\u4E2D\u5FC3\u304B\u3089\u5916\u3078\u4F38\u3073\u308B / tree = \u679D\u304C\u6839\u304B\u3089\u4E0B\u3078\u4F38\u3073\u308B / gantt = \u5E2F\u304C\u5404\u59CB\u7AEF\u304B\u3089\u53F3\u3078\u4F38\u3073\u308B / funnel = \u6BB5\u304C\u4E0A\u7AEF\u304B\u3089\u9806\u306B\u7A4D\u307E\u308C\u308B"
11079
11302
  },
11303
+ drawRatio: {
11304
+ type: "number",
11305
+ exclusiveMinimum: 0,
11306
+ maximum: 1,
11307
+ description: "\u63CF\u304D\u7D42\u3048\u308B\u307E\u3067\u306B phase \u306E\u4F55\u5272\u3092\u4F7F\u3046\u304B\u3002 0.4 \u306A\u3089\u9032\u307F\u304C 0.4 \u306B\u9054\u3057\u305F\u6642\u70B9\u3067\u63CF\u304D\u7D42\u308F\u308A\u3001\u6B8B\u308A\u306F\u63CF\u304D\u7D42\u308F\u3063\u305F\u59FF\u306E\u307E\u307E\u5024\u3060\u3051\u304C\u52D5\u304F\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070 phase \u306E\u7D42\u308F\u308A\u306B\u63CF\u304D\u7D42\u308F\u308B\u3002 draw \u3068\u4E00\u7DD2\u306B\u66F8\u304F (draw \u304C\u7121\u3044\u3068\u4F55\u3082\u8D77\u304D\u306A\u3044)"
11308
+ },
11080
11309
  tween: {
11081
11310
  type: "object",
11082
11311
  description: "\u3053\u306E phase \u3067\u88DC\u9593\u3059\u308B\u72B6\u614B\u3002 \u72B6\u614B\u540D -> [\u958B\u59CB\u5024, \u7D42\u4E86\u5024]\u3002 \u540D\u524D\u306F\u82F1\u5B57\u304B _ \u3067\u59CB\u3081\u3001 \u82F1\u6570\u5B57\u3068 _ \u3060\u3051\u3092\u4F7F\u3046",
@@ -12237,6 +12466,25 @@ var diagram_default = {
12237
12466
  pattern: "^[A-Za-z_][A-Za-z0-9_]*$"
12238
12467
  }
12239
12468
  },
12469
+ reveal: {
12470
+ type: "string",
12471
+ enum: ["phase", "all"],
12472
+ description: "\u77E2\u5370\u3092\u3044\u3064\u51FA\u3059\u304B\u3002 phase (\u65E2\u5B9A) = \u6BB5\u304C\u540D\u6307\u3057\u3059\u308B\u77E2\u5370\u306F\u305D\u306E\u6BB5\u304C\u6765\u308B\u307E\u3067\u63CF\u304B\u306A\u3044\u3002 all = \u6BB5\u306B\u95A2\u308F\u3089\u305A\u6700\u521D\u304B\u3089\u5168\u90E8\u63CF\u304F\u3002"
12473
+ },
12474
+ bands: {
12475
+ type: "array",
12476
+ description: "\u9806\u5E8F\u56F3\u3067\u9762\u304C\u52D5\u3044\u3066\u3044\u308B\u9593\u306E\u5E2F\u3002 \u66F8\u304B\u306A\u3051\u308C\u3070\u9762\u3054\u3068\u306B\u300C\u6700\u521D\u306B\u95A2\u308F\u3063\u305F\u6BB5\u304B\u3089\u6700\u5F8C\u307E\u3067\u300D \u306E 1 \u672C\u306B\u306A\u308B\u3002",
12477
+ items: {
12478
+ type: "object",
12479
+ required: ["actor", "from", "to"],
12480
+ additionalProperties: false,
12481
+ properties: {
12482
+ actor: { type: "string", description: "\u5E2F\u3092\u51FA\u3059\u9762\u306E\u540D\u524D" },
12483
+ from: { type: "integer", minimum: 0, description: "\u59CB\u307E\u308A\u306E\u8A00\u3065\u3066\u306E\u756A\u53F7 (0 \u8D77\u70B9)" },
12484
+ to: { type: "integer", minimum: 0, description: "\u7D42\u308F\u308A\u306E\u8A00\u3065\u3066\u306E\u756A\u53F7 (0 \u8D77\u70B9)" }
12485
+ }
12486
+ }
12487
+ },
12240
12488
  events: {
12241
12489
  type: "array",
12242
12490
  description: "\u62BC\u4E0B\u306A\u3069\u306E\u51FA\u6765\u4E8B\u3067\u52D5\u304F\u4ED5\u639B\u3051\u3002 \u76F8\u624B\u306F\u540D\u524D\u3067\u6307\u3059 (box / lane / arrow / diagram \u306E\u3069\u308C\u304B 1 \u3064)\u3002",
@@ -12412,6 +12660,6 @@ function isV05Source(src) {
12412
12660
  return true;
12413
12661
  }
12414
12662
 
12415
- export { DIAGRAM_BOUNDARY_PADDING, DRAW_TARGETS, DRAW_WORDS, JSONを分解する, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, RELATIVE_GAP_DEFAULT, 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, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, 区間に広げる, 記法を分解する };
12663
+ export { DIAGRAM_BOUNDARY_PADDING, DRAW_TARGETS, DRAW_WORDS, JSONを分解する, MAX_INPUT_BYTES, MAX_INPUT_ELEMENTS, MAX_PART_SCALE, NODE_KIND_ALIAS, NODE_KIND_VALID, PHASE_ITEM_WORDS, PRESET_TYPES, RELATIVE_GAP_DEFAULT, 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, partsBaseRows, partsGridCenters, pointsOutside, rectsOverlap, resolveRelativePos, stripExternalPaint, stripQuotes, textDslToDiagram, validateDragonJson, writeActorPosition, 区間に広げる, 記法を分解する };
12416
12664
  //# sourceMappingURL=index.js.map
12417
12665
  //# sourceMappingURL=index.js.map