@cardenelabs/dragon 0.42.2 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +34 -1
  2. package/dist/cli.cjs +4630 -1690
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +4630 -1690
  5. package/dist/cli.js.map +1 -1
  6. package/dist/export.cjs +4267 -1555
  7. package/dist/export.cjs.map +1 -1
  8. package/dist/export.d.cts +1 -1
  9. package/dist/export.d.ts +1 -1
  10. package/dist/export.js +4267 -1555
  11. package/dist/export.js.map +1 -1
  12. package/dist/index.cjs +4348 -1381
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +118 -3
  15. package/dist/index.d.ts +118 -3
  16. package/dist/index.js +4348 -1381
  17. package/dist/index.js.map +1 -1
  18. package/dist/{ink-B8EZL7JV.d.cts → ink-DeDtzaTL.d.cts} +47 -3
  19. package/dist/{ink-B8EZL7JV.d.ts → ink-DeDtzaTL.d.ts} +47 -3
  20. package/dist/node.cjs +3504 -1625
  21. package/dist/node.cjs.map +1 -1
  22. package/dist/node.js +3504 -1625
  23. package/dist/node.js.map +1 -1
  24. package/dist/player.global.js +3 -2
  25. package/package.json +1 -1
  26. package/src/field-messages.ts +6 -0
  27. package/src/index.ts +8 -1
  28. package/src/layout/lineup.ts +219 -0
  29. package/src/layout/tree.ts +458 -0
  30. package/src/look/values.ts +73 -2
  31. package/src/messages.ts +88 -2
  32. package/src/parser.ts +212 -2
  33. package/src/printer.ts +36 -2
  34. package/src/render/icons.ts +2 -0
  35. package/src/render/lineup.ts +184 -0
  36. package/src/render/parts.ts +16 -7
  37. package/src/render/svg.ts +72 -6
  38. package/src/render/tree.ts +165 -0
  39. package/src/schema.ts +76 -4
  40. package/src/schemas/diagram.schema.json +207 -19
  41. package/src/schemas/validate-diagram.js +1 -1
  42. package/src/timeline.ts +16 -2
  43. package/src/words.ts +25 -2
package/src/schema.ts CHANGED
@@ -53,7 +53,12 @@ export type DiagramEvent =
53
53
  | { type: "branch"; branch: string; from: string }
54
54
  | { type: "now"; to: number }
55
55
  | TimeMarkEvent
56
- | TimeSpanEvent;
56
+ | TimeSpanEvent
57
+ | TreeLeaf
58
+ | TreeNode
59
+ | LineupOrder
60
+ | { type: "seal" | "open" | "pick"; box: string }
61
+ | LineupStamp;
57
62
 
58
63
  /** 時間軸の図 (#3165) の、印の列 `row` の `from` から `to` の目盛りの印の色を変える出来事 */
59
64
  export interface TimeMarkEvent {
@@ -133,6 +138,44 @@ export interface GitCommit {
133
138
  note?: string;
134
139
  }
135
140
 
141
+ /**
142
+ * 木の図 (#3233) の葉を出す出来事。書いた段で葉の箱が現れる。`hash` を書くと箱に値を出し、名札を葉の下の札に出す
143
+ */
144
+ export interface TreeLeaf {
145
+ type: "leaf";
146
+ id: string;
147
+ hash?: string;
148
+ }
149
+
150
+ /** 木の図の、1 つ以上の子から親を組む出来事。書いた段で親の箱と、子から親への木の線が現れる */
151
+ export interface TreeNode {
152
+ type: "node";
153
+ id: string;
154
+ children: string[];
155
+ hash?: string;
156
+ }
157
+
158
+ /** 列の図 (#3239) の、列 `box` の並びを `items` に書き換える出来事。前の段との差分を描く部品が滑る動きに変える */
159
+ export interface LineupOrder {
160
+ type: "line";
161
+ box: string;
162
+ items: string[];
163
+ }
164
+
165
+ /** 列の図の、列 `box` の右に `text` の札を押す出来事 */
166
+ export interface LineupStamp {
167
+ type: "stamp";
168
+ box: string;
169
+ text: string;
170
+ }
171
+
172
+ /** 列の図のチップ。`color` を書かないチップは薄い色で、`label` を書かないチップは色だけで出す */
173
+ export interface LineupItem {
174
+ id: string;
175
+ color?: Color;
176
+ label?: string;
177
+ }
178
+
136
179
  /** 枝分かれの図の枝。上から宣言した順に帯を並べる */
137
180
  export interface GitBranch {
138
181
  id: string;
@@ -163,7 +206,7 @@ export interface Step {
163
206
 
164
207
  export interface Diagram {
165
208
  version: number;
166
- kind: "sequence" | "architecture" | "state" | "git" | "time";
209
+ kind: "sequence" | "architecture" | "state" | "git" | "time" | "tree" | "lineup";
167
210
  title: string;
168
211
  view?: ViewMode;
169
212
  regions?: Region[];
@@ -174,6 +217,7 @@ export interface Diagram {
174
217
  state?: { paths: StatePath[] };
175
218
  git?: { branches: GitBranch[] };
176
219
  time?: TimeSpec;
220
+ lineup?: { items: LineupItem[] };
177
221
  }
178
222
 
179
223
  export interface FieldError {
@@ -190,7 +234,7 @@ export interface CheckOptions {
190
234
  }
191
235
 
192
236
  /** 段の中で起きることの種類。schema の event の `discriminator` が見る `type` の値 */
193
- const EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span"] as const satisfies readonly DiagramEvent["type"][];
237
+ const EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node", "line", "seal", "open", "pick", "stamp"] as const satisfies readonly DiagramEvent["type"][];
194
238
 
195
239
  /**
196
240
  * その種類の図に書けない根の欄を書いた時の決まりの場所 (#3164)。根の欄に `not: {}` を置く決まり (`absent`) を指し、
@@ -201,7 +245,16 @@ const ABSENT = "#/definitions/absent/not";
201
245
  * 種類の欄でない欄を書ける図の種類。区画は枝分かれの図と時間軸の図に書けない。
202
246
  * 線の列 (`at` と `into`)、節目の丸の色 (`color`)、物差し (`meters`) は時間軸の図だけが書ける (#3165)
203
247
  */
204
- const ABSENT_KINDS: Record<string, string> = { regions: "sequence / architecture / state", at: "time", into: "time", color: "time", meters: "time" };
248
+ const ABSENT_KINDS: Record<string, string> = {
249
+ regions: "sequence / architecture / state",
250
+ at: "time",
251
+ into: "time",
252
+ color: "time",
253
+ meters: "time",
254
+ region: "sequence / architecture / state",
255
+ icon: "sequence / architecture / state / git / time / tree",
256
+ link: "sequence / architecture / state / git / time / tree",
257
+ };
205
258
  /** 運ぶ物の書けない組み合わせ (`not: { required: [欄] }`)。誤りの場所の最後の欄で引く */
206
259
  const NOT_ALLOWED: Record<string, Allowed> = {
207
260
  carry: { field: "text", kind: "tag" },
@@ -217,6 +270,18 @@ const GIT_EVENTS = ["commit", "branch"] as const satisfies readonly DiagramEvent
217
270
  const TIME_EVENT = /\/events\/items\/not$/u;
218
271
  /** 時間軸の図だけが書ける出来事 */
219
272
  const TIME_EVENTS = ["now", "mark", "span"] as const satisfies readonly DiagramEvent["type"][];
273
+ /** 木の図でない図に、木の図だけの出来事を書いた時の決まりの場所 (#3233)。出来事の `allOf` の中に `not` を置く */
274
+ const TREE_EVENT = /\/events\/items\/allOf\/0\/not$/u;
275
+ /** 木の図だけが書ける出来事 */
276
+ const TREE_EVENTS = ["leaf", "node"] as const satisfies readonly DiagramEvent["type"][];
277
+ /** 列の図でない図に、列の図だけの出来事を書いた時の決まりの場所 (#3239) */
278
+ const LINEUP_EVENT = "#/definitions/notLineupEvent/not";
279
+ /** 列の図だけが書ける出来事 */
280
+ const LINEUP_EVENTS = ["line", "seal", "open", "pick", "stamp"] as const satisfies readonly DiagramEvent["type"][];
281
+ /** 列の図に、線と処理の出来事を書いた時の決まりの場所 (#3239) */
282
+ const WIRED_EVENT = "#/definitions/notWiredEvent/not";
283
+ /** 列の図が書けない、箱と線の図の出来事 */
284
+ const WIRED_EVENTS = ["edge", "action"] as const satisfies readonly DiagramEvent["type"][];
220
285
  /** 時間軸の図の目盛りの長さの決まり (`^[0-9]+(\.[0-9]+)?(<単位>|<単位>)$`)。書ける単位を読む */
221
286
  const DURATION = /^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u;
222
287
  /** 割合の決まり。百分率の `%` を持つ */
@@ -263,6 +328,9 @@ function toFieldError(error: ErrorObject, errors: readonly ErrorObject[], m: Fie
263
328
  if (RESERVED_ID.test(error.schemaPath)) return { pointer: at, message: m.reserved(STATE_ENDS) };
264
329
  if (GIT_EVENT.test(error.schemaPath)) return { pointer: at, message: m.kindOnly(GIT_EVENTS, "git") };
265
330
  if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TIME_EVENTS, "time") };
331
+ if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TREE_EVENTS, "tree") };
332
+ if (error.schemaPath === LINEUP_EVENT) return { pointer: `${at}/type`, message: m.kindOnly(LINEUP_EVENTS, "lineup") };
333
+ if (error.schemaPath === WIRED_EVENT) return { pointer: `${at}/type`, message: m.kindOnly(WIRED_EVENTS, "sequence / architecture / state / git / time / tree") };
266
334
  const last = at.slice(at.lastIndexOf("/") + 1);
267
335
  if (error.schemaPath === ABSENT) return { pointer: at, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };
268
336
  const allowed = NOT_ALLOWED[last];
@@ -283,6 +351,8 @@ function toFieldError(error: ErrorObject, errors: readonly ErrorObject[], m: Fie
283
351
  return { pointer: at, message: m.type(String(params.type)) };
284
352
  case "minLength":
285
353
  return { pointer: at, message: m.minLength(Number(params.limit)) };
354
+ case "maxLength":
355
+ return { pointer: at, message: m.maxLength(Number(params.limit)) };
286
356
  case "pattern": {
287
357
  if (error.schemaPath === URL_RULE) return { pointer: at, message: m.url };
288
358
  const pattern = String(params.pattern);
@@ -295,6 +365,8 @@ function toFieldError(error: ErrorObject, errors: readonly ErrorObject[], m: Fie
295
365
  }
296
366
  case "minItems":
297
367
  return { pointer: at, message: m.minItems(Number(params.limit)) };
368
+ case "maxItems":
369
+ return { pointer: at, message: m.maxItems(Number(params.limit)) };
298
370
  case "minimum":
299
371
  return { pointer: at, message: m.minimum(Number(params.limit)) };
300
372
  case "const":
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "title": "dragon の図の原本",
3
- "description": "区画、箱、線、運ぶ物、段、中身の帯の 6 部品を共通の骨組みに置き、図の種類だけの物は種類の欄に置く。座標は持たない。箱は枝分かれの図と時間軸の図だけが持たなくてよい。",
3
+ "description": "区画、箱、線、運ぶ物、段、中身の帯の 6 部品を共通の骨組みに置き、図の種類だけの物は種類の欄に置く。座標は持たない。箱は枝分かれの図と時間軸の図と木の図だけが持たなくてよい。列の図の箱は列になる。",
4
4
  "type": "object",
5
5
  "additionalProperties": false,
6
6
  "required": ["version", "kind", "title", "boxes", "steps"],
7
7
  "properties": {
8
8
  "version": { "description": "形式の版", "type": "integer", "minimum": 1 },
9
- "kind": { "description": "図の種類", "enum": ["sequence", "architecture", "state", "git", "time"] },
9
+ "kind": { "description": "図の種類", "enum": ["sequence", "architecture", "state", "git", "time", "tree", "lineup"] },
10
10
  "title": { "$ref": "#/definitions/text" },
11
11
  "view": { "description": "見せ方。書かなければ字の大きさで選ぶ。fixed は全体を止めて中だけ動かし、follow は寄って動かし全体図で今どこかを示す", "enum": ["fixed", "follow"] },
12
12
  "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } },
@@ -16,7 +16,8 @@
16
16
  "sequence": { "$ref": "#/definitions/sequence" },
17
17
  "state": { "$ref": "#/definitions/state" },
18
18
  "git": { "$ref": "#/definitions/git" },
19
- "time": { "$ref": "#/definitions/time" }
19
+ "time": { "$ref": "#/definitions/time" },
20
+ "lineup": { "$ref": "#/definitions/lineup" }
20
21
  },
21
22
  "if": { "required": ["kind"], "properties": { "kind": { "const": "sequence" } } },
22
23
  "then": {
@@ -27,7 +28,8 @@
27
28
  "strip": { "$ref": "#/definitions/plainStrip" },
28
29
  "state": { "$ref": "#/definitions/absent" },
29
30
  "git": { "$ref": "#/definitions/absent" },
30
- "time": { "$ref": "#/definitions/absent" }
31
+ "time": { "$ref": "#/definitions/absent" },
32
+ "lineup": { "$ref": "#/definitions/absent" }
31
33
  }
32
34
  },
33
35
  "else": {
@@ -39,7 +41,8 @@
39
41
  "steps": { "$ref": "#/definitions/plainSteps" },
40
42
  "strip": { "$ref": "#/definitions/plainStrip" },
41
43
  "git": { "$ref": "#/definitions/absent" },
42
- "time": { "$ref": "#/definitions/absent" }
44
+ "time": { "$ref": "#/definitions/absent" },
45
+ "lineup": { "$ref": "#/definitions/absent" }
43
46
  }
44
47
  },
45
48
  "else": {
@@ -51,7 +54,8 @@
51
54
  "strip": { "$ref": "#/definitions/plainStrip" },
52
55
  "state": { "$ref": "#/definitions/absent" },
53
56
  "regions": { "$ref": "#/definitions/absent" },
54
- "time": { "$ref": "#/definitions/absent" }
57
+ "time": { "$ref": "#/definitions/absent" },
58
+ "lineup": { "$ref": "#/definitions/absent" }
55
59
  }
56
60
  },
57
61
  "else": {
@@ -62,17 +66,51 @@
62
66
  "steps": { "$ref": "#/definitions/timeSteps" },
63
67
  "state": { "$ref": "#/definitions/absent" },
64
68
  "git": { "$ref": "#/definitions/absent" },
65
- "regions": { "$ref": "#/definitions/absent" }
69
+ "regions": { "$ref": "#/definitions/absent" },
70
+ "lineup": { "$ref": "#/definitions/absent" }
66
71
  }
67
72
  },
68
73
  "else": {
69
- "properties": {
70
- "boxes": { "minItems": 1 },
71
- "steps": { "$ref": "#/definitions/plainSteps" },
72
- "strip": { "$ref": "#/definitions/plainStrip" },
73
- "state": { "$ref": "#/definitions/absent" },
74
- "git": { "$ref": "#/definitions/absent" },
75
- "time": { "$ref": "#/definitions/absent" }
74
+ "if": { "required": ["kind"], "properties": { "kind": { "const": "tree" } } },
75
+ "then": {
76
+ "properties": {
77
+ "steps": { "$ref": "#/definitions/treeSteps" },
78
+ "strip": { "$ref": "#/definitions/plainStrip" },
79
+ "state": { "$ref": "#/definitions/absent" },
80
+ "git": { "$ref": "#/definitions/absent" },
81
+ "time": { "$ref": "#/definitions/absent" },
82
+ "regions": { "$ref": "#/definitions/absent" },
83
+ "lineup": { "$ref": "#/definitions/absent" }
84
+ }
85
+ },
86
+ "else": {
87
+ "if": { "required": ["kind"], "properties": { "kind": { "const": "lineup" } } },
88
+ "then": {
89
+ "required": ["lineup"],
90
+ "properties": {
91
+ "boxes": {
92
+ "minItems": 1,
93
+ "items": { "properties": { "icon": { "$ref": "#/definitions/absent" }, "link": { "$ref": "#/definitions/absent" }, "region": { "$ref": "#/definitions/absent" } } }
94
+ },
95
+ "steps": { "$ref": "#/definitions/lineupSteps" },
96
+ "strip": { "$ref": "#/definitions/plainStrip" },
97
+ "state": { "$ref": "#/definitions/absent" },
98
+ "git": { "$ref": "#/definitions/absent" },
99
+ "time": { "$ref": "#/definitions/absent" },
100
+ "regions": { "$ref": "#/definitions/absent" }
101
+ }
102
+ },
103
+ "else": {
104
+ "properties": {
105
+ "boxes": { "minItems": 1 },
106
+ "steps": { "$ref": "#/definitions/plainSteps" },
107
+ "strip": { "$ref": "#/definitions/plainStrip" },
108
+ "state": { "$ref": "#/definitions/absent" },
109
+ "git": { "$ref": "#/definitions/absent" },
110
+ "time": { "$ref": "#/definitions/absent" },
111
+ "lineup": { "$ref": "#/definitions/absent" }
112
+ }
113
+ }
76
114
  }
77
115
  }
78
116
  }
@@ -82,12 +120,13 @@
82
120
  "text": { "type": "string", "minLength": 1 },
83
121
  "absent": { "description": "この図の種類では書けない欄", "not": {} },
84
122
  "plainSteps": {
85
- "description": "枝分かれの図でも時間軸の図でもない図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) を書けない",
123
+ "description": "枝分かれの図でも時間軸の図でも木の図でも列の図でもない図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない",
86
124
  "items": {
87
125
  "properties": {
88
126
  "events": {
89
127
  "items": {
90
128
  "not": { "$ref": "#/definitions/timeEvent" },
129
+ "allOf": [{ "not": { "$ref": "#/definitions/treeEvent" } }, { "$ref": "#/definitions/notLineupEvent" }],
91
130
  "properties": {
92
131
  "type": { "not": { "enum": ["commit", "branch"] } },
93
132
  "at": { "$ref": "#/definitions/absent" },
@@ -100,12 +139,13 @@
100
139
  }
101
140
  },
102
141
  "gitSteps": {
103
- "description": "枝分かれの図の段。時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) を書けない",
142
+ "description": "枝分かれの図の段。時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない",
104
143
  "items": {
105
144
  "properties": {
106
145
  "events": {
107
146
  "items": {
108
147
  "not": { "$ref": "#/definitions/timeEvent" },
148
+ "allOf": [{ "not": { "$ref": "#/definitions/treeEvent" } }, { "$ref": "#/definitions/notLineupEvent" }],
109
149
  "properties": { "at": { "$ref": "#/definitions/absent" }, "into": { "$ref": "#/definitions/absent" }, "color": { "$ref": "#/definitions/absent" } }
110
150
  }
111
151
  }
@@ -113,8 +153,61 @@
113
153
  }
114
154
  },
115
155
  "timeSteps": {
116
- "description": "時間軸の図の段。枝分かれの図だけの出来事 (commit と branch) を書けない",
117
- "items": { "properties": { "events": { "items": { "properties": { "type": { "not": { "enum": ["commit", "branch"] } } } } } } }
156
+ "description": "時間軸の図の段。枝分かれの図だけの出来事 (commit と branch) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない",
157
+ "items": {
158
+ "properties": {
159
+ "events": { "items": { "allOf": [{ "not": { "$ref": "#/definitions/treeEvent" } }, { "$ref": "#/definitions/notLineupEvent" }], "properties": { "type": { "not": { "enum": ["commit", "branch"] } } } } }
160
+ }
161
+ }
162
+ },
163
+ "treeSteps": {
164
+ "description": "木の図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない",
165
+ "items": {
166
+ "properties": {
167
+ "events": {
168
+ "items": {
169
+ "not": { "$ref": "#/definitions/timeEvent" },
170
+ "allOf": [{ "$ref": "#/definitions/notLineupEvent" }],
171
+ "properties": {
172
+ "type": { "not": { "enum": ["commit", "branch"] } },
173
+ "at": { "$ref": "#/definitions/absent" },
174
+ "into": { "$ref": "#/definitions/absent" },
175
+ "color": { "$ref": "#/definitions/absent" }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "lineupSteps": {
183
+ "description": "列の図の段。線と処理と、枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (color) と、木の図だけの出来事 (leaf と node) を書けない",
184
+ "items": {
185
+ "properties": {
186
+ "events": {
187
+ "items": {
188
+ "not": { "$ref": "#/definitions/timeEvent" },
189
+ "allOf": [{ "not": { "$ref": "#/definitions/treeEvent" } }, { "$ref": "#/definitions/notWiredEvent" }],
190
+ "properties": {
191
+ "type": { "not": { "enum": ["commit", "branch"] } },
192
+ "color": { "$ref": "#/definitions/absent" }
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "treeEvent": {
200
+ "description": "木の図だけが書ける出来事",
201
+ "required": ["type"],
202
+ "properties": { "type": { "enum": ["leaf", "node"] } }
203
+ },
204
+ "notLineupEvent": {
205
+ "description": "列の図だけが書ける出来事を書けない",
206
+ "not": { "required": ["type"], "properties": { "type": { "enum": ["line", "seal", "open", "pick", "stamp"] } } }
207
+ },
208
+ "notWiredEvent": {
209
+ "description": "箱と線の図の出来事を書けない",
210
+ "not": { "required": ["type"], "properties": { "type": { "enum": ["edge", "action"] } } }
118
211
  },
119
212
  "timeEvent": {
120
213
  "description": "時間軸の図だけが書ける出来事",
@@ -304,6 +397,81 @@
304
397
  "color": { "$ref": "#/definitions/color" }
305
398
  }
306
399
  },
400
+ {
401
+ "description": "葉を出す。木の図だけが書ける。書いた段で葉の箱が現れる。hash を書くと箱に値を出し、名札を葉の下の札に出す",
402
+ "type": "object",
403
+ "additionalProperties": false,
404
+ "required": ["type", "id"],
405
+ "properties": {
406
+ "type": { "const": "leaf" },
407
+ "id": { "$ref": "#/definitions/id" },
408
+ "hash": { "$ref": "#/definitions/hash" }
409
+ }
410
+ },
411
+ {
412
+ "description": "1 つ以上の子から親を組む。木の図だけが書ける。書いた段で親の箱と、子から親への木の線が現れる",
413
+ "type": "object",
414
+ "additionalProperties": false,
415
+ "required": ["type", "id", "children"],
416
+ "properties": {
417
+ "type": { "const": "node" },
418
+ "id": { "$ref": "#/definitions/id" },
419
+ "children": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/id" } },
420
+ "hash": { "$ref": "#/definitions/hash" }
421
+ }
422
+ },
423
+ {
424
+ "description": "列の box の並びを items に書き換える。列の図だけが書ける。チップは前に居た列から滑り、どの列にも居なかったチップは弾んで現れ、列から外れたチップは消える",
425
+ "type": "object",
426
+ "additionalProperties": false,
427
+ "required": ["type", "box", "items"],
428
+ "properties": {
429
+ "type": { "const": "line" },
430
+ "box": { "$ref": "#/definitions/id" },
431
+ "items": { "type": "array", "minItems": 1, "maxItems": 12, "items": { "$ref": "#/definitions/id" } }
432
+ }
433
+ },
434
+ {
435
+ "description": "列 box に封をして、チップを隠す。列の図だけが書ける",
436
+ "type": "object",
437
+ "additionalProperties": false,
438
+ "required": ["type", "box"],
439
+ "properties": {
440
+ "type": { "const": "seal" },
441
+ "box": { "$ref": "#/definitions/id" }
442
+ }
443
+ },
444
+ {
445
+ "description": "列 box の封を開ける。列の図だけが書ける",
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "required": ["type", "box"],
449
+ "properties": {
450
+ "type": { "const": "open" },
451
+ "box": { "$ref": "#/definitions/id" }
452
+ }
453
+ },
454
+ {
455
+ "description": "列 box を選ぶ。列の図だけが書ける。列の縁に色が付き、ほかの列が薄くなる",
456
+ "type": "object",
457
+ "additionalProperties": false,
458
+ "required": ["type", "box"],
459
+ "properties": {
460
+ "type": { "const": "pick" },
461
+ "box": { "$ref": "#/definitions/id" }
462
+ }
463
+ },
464
+ {
465
+ "description": "列 box の右に text の札を押す。列の図だけが書ける",
466
+ "type": "object",
467
+ "additionalProperties": false,
468
+ "required": ["type", "box", "text"],
469
+ "properties": {
470
+ "type": { "const": "stamp" },
471
+ "box": { "$ref": "#/definitions/id" },
472
+ "text": { "$ref": "#/definitions/text" }
473
+ }
474
+ },
307
475
  {
308
476
  "description": "中身の帯の欄の値と札",
309
477
  "type": "object",
@@ -369,7 +537,27 @@
369
537
  "note": { "$ref": "#/definitions/text" }
370
538
  }
371
539
  },
372
- "hash": { "description": "commit の hash。16 進の字で 4 から 40 字", "type": "string", "pattern": "^[0-9a-f]{4,40}$" },
540
+ "hash": { "description": "commit と木の箱の hash。16 進の字で 4 から 40 字", "type": "string", "pattern": "^[0-9a-f]{4,40}$" },
541
+ "lineup": {
542
+ "description": "列の図の種類の欄。列に並べるチップ",
543
+ "type": "object",
544
+ "additionalProperties": false,
545
+ "required": ["items"],
546
+ "properties": {
547
+ "items": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/item" } }
548
+ }
549
+ },
550
+ "item": {
551
+ "description": "チップ。color を書かないチップは薄い色で、label を書かないチップは色だけで出す",
552
+ "type": "object",
553
+ "additionalProperties": false,
554
+ "required": ["id"],
555
+ "properties": {
556
+ "id": { "$ref": "#/definitions/id" },
557
+ "color": { "$ref": "#/definitions/color" },
558
+ "label": { "description": "チップに載せる字", "type": "string", "minLength": 1, "maxLength": 4 }
559
+ }
560
+ },
373
561
  "time": {
374
562
  "description": "時間軸の図の種類の欄。目盛り、区切り、印の列、節目、拡大の範囲",
375
563
  "type": "object",