@cardenelabs/dragon 0.18.2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -58,7 +58,7 @@ type V05ParseResult = {
58
58
  * 書くと、項目を足した時に案内か一覧のどちらかが取り残される (実際に `states` / `values` が
59
59
  * 一覧に 1 件も無い状態で放置されていた)。
60
60
  */
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", "direction"];
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", "direction", "palette"];
62
62
  /** 受け付ける図種。 記法一覧はここを見る。 */
63
63
  declare const PRESET_TYPES: ReadonlySet<PresetType>;
64
64
  /**
@@ -146,6 +146,18 @@ declare const DRAW_WORDS: ReadonlySet<string>;
146
146
  */
147
147
  declare const DIRECTIONS: readonly ["縦", "横"];
148
148
  type DslDirection = (typeof DIRECTIONS)[number];
149
+ /**
150
+ * 図の配色 (`palette:`、 #1553)。
151
+ *
152
+ * cdl は色を持たない (形だけを描く)。 名前を `data-cdl-palette` として markup に出すので、
153
+ * dragon の `cdl-theme.css` がその名前を見て 7 つの口 (台 / 行の面 / 縞 / 枠 / 字 / 型名 / 線)
154
+ * に色を当てる。
155
+ *
156
+ * **名前を自由文字列にしない**。 書き間違えると既定の色みのまま出るので、書き手には
157
+ * 「効かない」 としか見えない。 語を絞れば読めない語をその場で知らせられる。
158
+ */
159
+ declare const PALETTES: readonly ["kinari", "celadon"];
160
+ type DslPalette = (typeof PALETTES)[number];
149
161
  /** NodeKind 別名 (日本語 → English) */
150
162
  declare const NODE_KIND_ALIAS: Record<string, NodeKind>;
151
163
  /** Tone 別名 */
@@ -382,6 +394,13 @@ type DslDocument = {
382
394
  directionPos?: {
383
395
  line: number;
384
396
  };
397
+ /**
398
+ * 図の配色 (`palette:`、 #1553)。
399
+ *
400
+ * 名前だけを持つ。 実際の色は消費側 (`cdl-theme.css`) が決めるので、ここには値を書かない。
401
+ * ER 図は書かなくても `kinari` (生成りに茶) になる = 別の色みにしたい時だけ書く。
402
+ */
403
+ palette?: DslPalette;
385
404
  groups?: Record<string, DslGroup>;
386
405
  /**
387
406
  * 値を見せる部品 (`readouts:`、 #1374)。 割合の輪や数え上げを図の脇に出す。
@@ -686,6 +705,10 @@ type DslStep = {
686
705
  * `kind` にしないのは、箱の種類 (`DslActor.kind`) と同じ語が別の意味を持つため。
687
706
  */
688
707
  msgKind?: SequenceMessageKind;
708
+ /** 辺の役目 (cdl#618)。 `main` を書いた辺だけ「いま」 の色で引く */
709
+ role?: "main";
710
+ /** 名前の下地を敷くか (cdl#618)。 書かなければ敷く */
711
+ labelPlate?: boolean;
689
712
  labelOffsetX?: number;
690
713
  labelOffsetY?: number;
691
714
  /** true で説明文を矢印の線の上に重ねる。 分岐図の条件ラベル用。 */
@@ -1598,6 +1621,13 @@ interface DragonJson {
1598
1621
  reveal?: EdgeReveal;
1599
1622
  /** 図の並ぶ向き (#1494)。 記法の最上位 `direction:` と同じ。 JSON は英語の語で書く */
1600
1623
  direction?: "vertical" | "horizontal";
1624
+ /**
1625
+ * 図の配色 (#1553)。 記法の最上位 `palette:` と同じ。
1626
+ *
1627
+ * 名前だけを図に載せる = cdl は色を持たず、値は `cdl-theme.css` が決める。
1628
+ * ER 図は書かなくても `kinari` になる。
1629
+ */
1630
+ palette?: DslPalette;
1601
1631
  }
1602
1632
  interface JsonActor {
1603
1633
  name: string;
@@ -1758,6 +1788,14 @@ interface JsonStep {
1758
1788
  tailHead?: EdgeHead;
1759
1789
  headFill?: EdgeHeadFill;
1760
1790
  tailHeadFill?: EdgeHeadFill;
1791
+ /**
1792
+ * 辺の役目 (cdl#618)。 記法の `{ role: main }` と同じ。
1793
+ *
1794
+ * `main` を書いた辺だけ「いま」 の色で引く。 主となる 1 本 (または 1 続き) にだけ書く。
1795
+ */
1796
+ role?: "main";
1797
+ /** 名前の下地を敷くか (cdl#618)。 記法の `{ labelPlate: false }` と同じ。 既定は敷く */
1798
+ labelPlate?: boolean;
1761
1799
  /** クラス図の関係の語 (#1466)。 書くと端の形 / 塗り / 線種がまとめて決まる */
1762
1800
  relation?: ClassRelationType;
1763
1801
  /** 順序図の言づての種類 (#1466)。 `call` / `return` / `fire` */
@@ -2309,6 +2347,15 @@ declare const diagramJsonSchema: {
2309
2347
  enum: string[];
2310
2348
  description: string;
2311
2349
  };
2350
+ role: {
2351
+ type: string;
2352
+ enum: string[];
2353
+ description: string;
2354
+ };
2355
+ labelPlate: {
2356
+ type: string;
2357
+ description: string;
2358
+ };
2312
2359
  kind: {
2313
2360
  type: string;
2314
2361
  enum: string[];
@@ -3083,6 +3130,11 @@ declare const diagramJsonSchema: {
3083
3130
  enum: string[];
3084
3131
  description: string;
3085
3132
  };
3133
+ palette: {
3134
+ type: string;
3135
+ enum: string[];
3136
+ description: string;
3137
+ };
3086
3138
  reveal: {
3087
3139
  type: string;
3088
3140
  enum: string[];
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ type V05ParseResult = {
58
58
  * 書くと、項目を足した時に案内か一覧のどちらかが取り残される (実際に `states` / `values` が
59
59
  * 一覧に 1 件も無い状態で放置されていた)。
60
60
  */
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", "direction"];
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", "direction", "palette"];
62
62
  /** 受け付ける図種。 記法一覧はここを見る。 */
63
63
  declare const PRESET_TYPES: ReadonlySet<PresetType>;
64
64
  /**
@@ -146,6 +146,18 @@ declare const DRAW_WORDS: ReadonlySet<string>;
146
146
  */
147
147
  declare const DIRECTIONS: readonly ["縦", "横"];
148
148
  type DslDirection = (typeof DIRECTIONS)[number];
149
+ /**
150
+ * 図の配色 (`palette:`、 #1553)。
151
+ *
152
+ * cdl は色を持たない (形だけを描く)。 名前を `data-cdl-palette` として markup に出すので、
153
+ * dragon の `cdl-theme.css` がその名前を見て 7 つの口 (台 / 行の面 / 縞 / 枠 / 字 / 型名 / 線)
154
+ * に色を当てる。
155
+ *
156
+ * **名前を自由文字列にしない**。 書き間違えると既定の色みのまま出るので、書き手には
157
+ * 「効かない」 としか見えない。 語を絞れば読めない語をその場で知らせられる。
158
+ */
159
+ declare const PALETTES: readonly ["kinari", "celadon"];
160
+ type DslPalette = (typeof PALETTES)[number];
149
161
  /** NodeKind 別名 (日本語 → English) */
150
162
  declare const NODE_KIND_ALIAS: Record<string, NodeKind>;
151
163
  /** Tone 別名 */
@@ -382,6 +394,13 @@ type DslDocument = {
382
394
  directionPos?: {
383
395
  line: number;
384
396
  };
397
+ /**
398
+ * 図の配色 (`palette:`、 #1553)。
399
+ *
400
+ * 名前だけを持つ。 実際の色は消費側 (`cdl-theme.css`) が決めるので、ここには値を書かない。
401
+ * ER 図は書かなくても `kinari` (生成りに茶) になる = 別の色みにしたい時だけ書く。
402
+ */
403
+ palette?: DslPalette;
385
404
  groups?: Record<string, DslGroup>;
386
405
  /**
387
406
  * 値を見せる部品 (`readouts:`、 #1374)。 割合の輪や数え上げを図の脇に出す。
@@ -686,6 +705,10 @@ type DslStep = {
686
705
  * `kind` にしないのは、箱の種類 (`DslActor.kind`) と同じ語が別の意味を持つため。
687
706
  */
688
707
  msgKind?: SequenceMessageKind;
708
+ /** 辺の役目 (cdl#618)。 `main` を書いた辺だけ「いま」 の色で引く */
709
+ role?: "main";
710
+ /** 名前の下地を敷くか (cdl#618)。 書かなければ敷く */
711
+ labelPlate?: boolean;
689
712
  labelOffsetX?: number;
690
713
  labelOffsetY?: number;
691
714
  /** true で説明文を矢印の線の上に重ねる。 分岐図の条件ラベル用。 */
@@ -1598,6 +1621,13 @@ interface DragonJson {
1598
1621
  reveal?: EdgeReveal;
1599
1622
  /** 図の並ぶ向き (#1494)。 記法の最上位 `direction:` と同じ。 JSON は英語の語で書く */
1600
1623
  direction?: "vertical" | "horizontal";
1624
+ /**
1625
+ * 図の配色 (#1553)。 記法の最上位 `palette:` と同じ。
1626
+ *
1627
+ * 名前だけを図に載せる = cdl は色を持たず、値は `cdl-theme.css` が決める。
1628
+ * ER 図は書かなくても `kinari` になる。
1629
+ */
1630
+ palette?: DslPalette;
1601
1631
  }
1602
1632
  interface JsonActor {
1603
1633
  name: string;
@@ -1758,6 +1788,14 @@ interface JsonStep {
1758
1788
  tailHead?: EdgeHead;
1759
1789
  headFill?: EdgeHeadFill;
1760
1790
  tailHeadFill?: EdgeHeadFill;
1791
+ /**
1792
+ * 辺の役目 (cdl#618)。 記法の `{ role: main }` と同じ。
1793
+ *
1794
+ * `main` を書いた辺だけ「いま」 の色で引く。 主となる 1 本 (または 1 続き) にだけ書く。
1795
+ */
1796
+ role?: "main";
1797
+ /** 名前の下地を敷くか (cdl#618)。 記法の `{ labelPlate: false }` と同じ。 既定は敷く */
1798
+ labelPlate?: boolean;
1761
1799
  /** クラス図の関係の語 (#1466)。 書くと端の形 / 塗り / 線種がまとめて決まる */
1762
1800
  relation?: ClassRelationType;
1763
1801
  /** 順序図の言づての種類 (#1466)。 `call` / `return` / `fire` */
@@ -2309,6 +2347,15 @@ declare const diagramJsonSchema: {
2309
2347
  enum: string[];
2310
2348
  description: string;
2311
2349
  };
2350
+ role: {
2351
+ type: string;
2352
+ enum: string[];
2353
+ description: string;
2354
+ };
2355
+ labelPlate: {
2356
+ type: string;
2357
+ description: string;
2358
+ };
2312
2359
  kind: {
2313
2360
  type: string;
2314
2361
  enum: string[];
@@ -3083,6 +3130,11 @@ declare const diagramJsonSchema: {
3083
3130
  enum: string[];
3084
3131
  description: string;
3085
3132
  };
3133
+ palette: {
3134
+ type: string;
3135
+ enum: string[];
3136
+ description: string;
3137
+ };
3086
3138
  reveal: {
3087
3139
  type: string;
3088
3140
  enum: string[];