@cardenelabs/dragon 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardenelabs/dragon",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "Dragon — 動く図を、人は行ごとの記法で、AI は JSON で書く。時系列図と構成図を段ごとに動かし、mp4・GIF・HTML・PNG に書き出す。",
5
5
  "license": "MIT",
6
6
  "author": "cardene777",
@@ -34,6 +34,10 @@ export interface FieldMessages {
34
34
  not: (allowed: Allowed | undefined) => string;
35
35
  /** 状態遷移図の箱の名札に、始まりと終わりの印の名前 (`names`) を書いた */
36
36
  reserved: (names: readonly string[]) => string;
37
+ /** `kind` の図だけが書ける出来事の種類 (`types`) を、別の種類の図に書いた (#3164) */
38
+ kindOnly: (types: readonly string[], kind: string) => string;
39
+ /** 16 進の字を `min` から `max` 字で書く決まり (commit の hash、#3164) */
40
+ hex: (min: number, max: number) => string;
37
41
  /** 選べる決まりがどれも欄が足りない時の、足りない欄。それ以外の時は空 */
38
42
  anyOf: (fields: readonly string[]) => string;
39
43
  oneOf: string;
@@ -77,6 +81,8 @@ const ja: FieldMessages = {
77
81
  const: (value) => `${value} にする`,
78
82
  not: (allowed) => (allowed ? `${allowed.field} の欄は kind が ${allowed.kind} の時だけ書ける` : "この欄の組み合わせは書けない"),
79
83
  reserved: (names) => `${names.join(" と ")} は状態遷移図の始まりと終わりの印の名前で、箱の名札に使えない`,
84
+ kindOnly: (types, kind) => `${types.join(" と ")} の出来事は kind が ${kind} の時だけ書ける`,
85
+ hex: (min, max) => `0 から 9 と a から f の字で ${min} から ${max} 字にする`,
80
86
  anyOf: (fields) =>
81
87
  fields.length > 0 ? `${fields.join(" か ")} の${fields.length === 2 ? "どちらか" : "どれか"}の欄が要る` : "書ける形のどれにも合わない",
82
88
  oneOf: "書ける形のどれか 1 つだけに合わせる",
@@ -99,6 +105,8 @@ const en: FieldMessages = {
99
105
  const: (value) => `Use ${value}`,
100
106
  not: (allowed) => (allowed ? `The ${allowed.field} field is allowed only when kind is ${allowed.kind}` : "This combination of fields is not allowed"),
101
107
  reserved: (names) => `${names.join(" and ")} name the start and end marks of a state diagram and cannot be box ids`,
108
+ kindOnly: (types, kind) => `${types.join(" and ")} events are allowed only when kind is ${kind}`,
109
+ hex: (min, max) => `Use ${min} to ${max} characters of 0-9 and a-f`,
102
110
  anyOf: (fields) => (fields.length > 0 ? `Write one of the ${fields.join(" or ")} fields` : "Does not match any of the allowed shapes"),
103
111
  oneOf: "Match exactly one of the allowed shapes",
104
112
  discriminator: (tag, values) => `${tag} is one of ${values.join(" / ")}`,
package/src/index.ts CHANGED
@@ -18,6 +18,8 @@ export {
18
18
  type Diagram,
19
19
  type DiagramEvent,
20
20
  type FieldError,
21
+ type GitBranch,
22
+ type GitCommit,
21
23
  type LabelSide,
22
24
  type Region,
23
25
  type StatePath,