@delurio/cli 0.8.0 → 0.10.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.
@@ -72,8 +72,8 @@
72
72
  "description": "The entity's fields, by name, each a JSON Schema (2020-12) with delurio's keywords.",
73
73
  "additionalProperties": { "$ref": "#/$defs/field" }
74
74
  },
75
- "required": { "$ref": "#/$defs/names", "description": "The fields that must be present." },
76
- "key": { "$ref": "#/$defs/names", "description": "The fields that identify the entity; `[id]` when left out.", "examples": [["userId", "clientId"]] },
75
+ "required": { "$ref": "#/$defs/names", "description": "The fields that must be present, each one of its `fields`." },
76
+ "key": { "$ref": "#/$defs/names", "description": "The fields that identify the entity, each one of its `fields`; `[id]` when left out.", "examples": [["userId", "clientId"]] },
77
77
  "lifecycle": {
78
78
  "type": "array",
79
79
  "description": "The entity's states, as `from -> to: why` sentences. Quote each: an unquoted item that contains `: ` is read as a map.",
@@ -86,6 +86,8 @@
86
86
  "items": { "type": "object" },
87
87
  "examples": [[{ "userId": "0199f9a0-11aa-7b22-8c33-4d44e55f6601", "clientId": "0199f9b2-3c4d-7e5f-8a6b-7c8d9e0f1a2b", "scopes": ["openid"] }]]
88
88
  },
89
+ "note": { "type": "string", "description": "The author's own words about the entity, which no tool reads (SPEC.md §5)." },
90
+ "planned": { "type": "string", "minLength": 1, "description": "The entity is written before its code: no code makes it true yet. Why, or where that is tracked: words, an issue. It names no code (`source`) while it says so (SPEC.md §5).", "examples": ["the second phase builds it (#12)"] },
89
91
  "source": { "$ref": "#/$defs/sourceAnchor" }
90
92
  }
91
93
  },
@@ -193,7 +195,7 @@
193
195
  "contentMediaType": { "type": "string", "description": "JSON Schema: the media type of the string's content.", "examples": ["text/calendar", "application/json"] },
194
196
  "contentSchema": { "$ref": "#/$defs/schema", "description": "JSON Schema: the schema of the string's decoded content." },
195
197
 
196
- "references": { "type": "string", "description": "delurio: the field holds the key of this other entity." },
198
+ "references": { "type": "string", "description": "delurio: the field holds the key of this other entity, one of the domain's own (SPEC.md §5)." },
197
199
  "unique": {
198
200
  "description": "delurio: no two entities have the same value: `true`, or `case-insensitive`.",
199
201
  "enum": [true, "case-insensitive"]
@@ -244,6 +246,7 @@
244
246
  "examples": [["audit:consent.decided"]]
245
247
  },
246
248
  "note": { "type": "string", "description": "The author's own words about the action, which no tool reads (SPEC.md §5)." },
249
+ "planned": { "type": "string", "minLength": 1, "description": "The action is written before its code: no code makes it true yet. Why, or where that is tracked: words, an issue. It names no code (`source`) while it says so (SPEC.md §5).", "examples": ["the second phase builds it (#12)"] },
247
250
  "source": { "$ref": "#/$defs/sourceAnchor" }
248
251
  }
249
252
  },
@@ -252,7 +255,7 @@
252
255
  "description": "The action's response: `returns` an entity, a `redirect`, a `status`, or a JSON Schema.",
253
256
  "$ref": "#/$defs/keywords",
254
257
  "properties": {
255
- "returns": { "type": "string", "description": "The entity the action returns." },
258
+ "returns": { "type": "string", "description": "The entity the action returns, one of the domain's own (SPEC.md §5)." },
256
259
  "redirect": { "type": "string", "description": "Where the response redirects, in words or as a path." },
257
260
  "status": { "type": "integer", "minimum": 100, "maximum": 599, "description": "The HTTP status of the response." }
258
261
  },
@@ -283,9 +286,9 @@
283
286
  "actor": { "type": "string", "description": "Who the policy is for.", "examples": ["end-user", "anyone", "agent"] },
284
287
  "needs": { "type": "string", "description": "What the actor must hold.", "examples": ["session"] },
285
288
  "where": { "type": "string", "description": "The condition under which it holds, in words." },
286
- "read": { "$ref": "#/$defs/names", "description": "The entities the actor may read." },
287
- "write": { "$ref": "#/$defs/names", "description": "The entities the actor may write." },
288
- "do": { "$ref": "#/$defs/names", "description": "The actions the actor may invoke." },
289
+ "read": { "$ref": "#/$defs/names", "description": "The entities of the domain the actor may read." },
290
+ "write": { "$ref": "#/$defs/names", "description": "The entities of the domain the actor may write." },
291
+ "do": { "$ref": "#/$defs/names", "description": "The actions of the domain the actor may invoke." },
289
292
  "source": { "$ref": "#/$defs/sourceAnchor" }
290
293
  }
291
294
  },
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://unpkg.com/@delurio/cli@0.9.0/schemas/gaps.schema.json",
4
+ "title": "delurio gaps of a product (needs.gaps.yaml)",
5
+ "description": "Every need of a product's flows that is missing, by the flow's id and the need's id, in delurio-graph/0 (SPEC.md §13). It sits at the root of the product's graphs and covers the flows under its folder. A need that is missing and not listed here fails the check, and so does an entry whose need is met: the list only shrinks on its own.",
6
+ "type": "object",
7
+ "required": ["schema", "kind", "id", "gaps"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schema": {
11
+ "description": "The format and its version. Every graph file starts with it.",
12
+ "const": "delurio-graph/0"
13
+ },
14
+ "kind": { "description": "The kind of graph file. A needs.gaps.yaml is `gaps`.", "const": "gaps" },
15
+ "id": {
16
+ "type": "string",
17
+ "description": "The product's id, as its flows' ids begin.",
18
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
19
+ "examples": ["example.notes"]
20
+ },
21
+ "title": { "type": "string", "description": "The list in plain words, for people." },
22
+ "summary": { "type": "string", "description": "What the gaps are, in a few plain sentences: the phases still to come, for instance." },
23
+ "status": {
24
+ "description": "`proposed`: written, nobody has approved it. `approved`: the owner reviewed and accepted the list.",
25
+ "enum": ["proposed", "approved"]
26
+ },
27
+ "gaps": {
28
+ "type": "object",
29
+ "description": "The needs that are missing, by flow id: each a list of need ids, every one of them a need of that flow's needs.yaml that says `missing`. Empty when every need is met.",
30
+ "propertyNames": {
31
+ "type": "string",
32
+ "description": "A flow's id, as its needs.yaml gives it.",
33
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
34
+ },
35
+ "additionalProperties": {
36
+ "type": "array",
37
+ "description": "The ids of the flow's needs that are missing.",
38
+ "minItems": 1,
39
+ "uniqueItems": true,
40
+ "items": {
41
+ "type": "string",
42
+ "description": "A need's id: kebab-case.",
43
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
44
+ }
45
+ },
46
+ "examples": [{ "example.restoreNote": ["says-when-it-is-erased"] }]
47
+ }
48
+ }
49
+ }
@@ -146,19 +146,46 @@
146
146
  "commit": { "type": "string", "description": "The commit the extractor read." },
147
147
  "app": { "type": "string", "description": "The application's folder in the repository." },
148
148
  "menu": { "type": "string", "description": "The file that holds the menus." },
149
- "locales": { "type": "string", "description": "The application's translation files; `{locale}` stands for the locale." }
149
+ "locales": {
150
+ "description": "The application's message file, or a list of every file it reads; `{locale}` stands for the locale in each path (SPEC.md §6).",
151
+ "anyOf": [
152
+ { "type": "string" },
153
+ { "type": "array", "minItems": 1, "items": { "type": "string" } }
154
+ ],
155
+ "examples": ["messages/{locale}.json", ["libs/i18n/locales/{locale}/web.json", "libs/i18n/locales/{locale}/common.json"]]
156
+ }
150
157
  },
151
158
  "additionalProperties": { "type": "string", "description": "Another file or folder of the application the graph was read from." }
152
159
  },
153
160
  "extract": {
154
161
  "type": "object",
155
- "description": "How the extractor reads the application: its adapter, the names it gives to pages that no menu entry names, the titles it takes, and the locales it copies into catalog/.",
162
+ "description": "How the extractor reads the application: its adapter, the names it gives to pages that no menu entry names, the titles it takes, the locales it copies into catalog/, and the fields it lays over the entries it generates.",
156
163
  "additionalProperties": false,
157
164
  "properties": {
158
165
  "adapter": { "type": "string", "description": "The extractor adapter for this application." },
159
166
  "names": { "type": "object", "description": "Route to page id, for pages that no menu entry names.", "additionalProperties": { "type": "string", "description": "The page id." } },
160
167
  "titles": { "type": "object", "description": "Page id to the catalog key of its title.", "additionalProperties": { "type": "string", "description": "The catalog key." } },
161
- "locales": { "type": "array", "description": "The locales copied into catalog/, as BCP 47 tags.", "items": { "$ref": "#/$defs/locale" } }
168
+ "locales": { "type": "array", "description": "The locales copied into catalog/, as BCP 47 tags.", "items": { "$ref": "#/$defs/locale" } },
169
+ "entries": {
170
+ "type": "object",
171
+ "description": "Fields laid over a generated entry, which nav.yaml cannot change otherwise, keyed by the entry's ends as it is cited: `<from>-><to>`, followed by its how or its label where two share their ends (SPEC.md §6).",
172
+ "propertyNames": { "pattern": "^(frame:[\\w-]+|[\\w-]+)->[\\w-]+( \\S+)?$" },
173
+ "additionalProperties": {
174
+ "type": "object",
175
+ "description": "The fields laid over the entry, or skip with the reason it is left out.",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "when": { "$ref": "#/$defs/expression", "description": "The guard under which the entry is offered." },
179
+ "data": { "type": "boolean", "description": "`true` when it needs an item to exist (a row to click)." },
180
+ "label": { "type": "string", "description": "Its words: a catalog key, or plain words." },
181
+ "how": { "$ref": "#/$defs/entry/properties/how" },
182
+ "back": { "type": "boolean", "description": "`true` for a way back." },
183
+ "clicks": { "type": "integer", "minimum": 0, "description": "How many clicks it takes." },
184
+ "skip": { "type": "string", "minLength": 1, "description": "Why the generated entry is left out." }
185
+ }
186
+ },
187
+ "examples": [{ "home->discover": { "when": "not signedIn" }, "frame:none->privacy": { "skip": "the privacy page links to itself" } }]
188
+ }
162
189
  }
163
190
  },
164
191
  "guards": {
@@ -232,6 +259,10 @@
232
259
  "frame": { "type": "string", "description": "The frame drawn around the page." },
233
260
  "opensFor": { "$ref": "#/$defs/expression", "description": "The guard under which the page opens; it refuses everyone else." },
234
261
  "refusal": { "type": "string", "description": "How the page says no, in words." },
262
+ "byAddress": {
263
+ "type": "boolean",
264
+ "description": "People open the page by its address, typed or followed from outside the app (a link in an e-mail, a sign-in another site sends them to), as nothing in the app links to it: a persona no entry brings there reaches it so, with no clicks, and it is not unreachable (SPEC.md §6)."
265
+ },
235
266
  "pageCodes": { "type": "string", "description": "Generated: the name of the permission codes that open the page, as the application's permission table names them." },
236
267
  "evidence": { "type": "string", "description": "The code that shows the page's kind or gate, in words." },
237
268
  "source": { "$ref": "#/$defs/sourceAnchor" }
@@ -0,0 +1,189 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://unpkg.com/@delurio/cli@0.9.0/schemas/needs.schema.json",
4
+ "title": "delurio needs of a flow (needs.yaml)",
5
+ "description": "What must exist for a flow's users, in delurio-graph/0 (SPEC.md §13): a closed list beside the flow's flow.yaml, each need with the evidence that it exists, or `missing` and why it does not yet. A need that is missing is a gap of the product, listed in its needs.gaps.yaml.",
6
+ "type": "object",
7
+ "required": ["schema", "kind", "id", "needs"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schema": { "$ref": "#/$defs/formatVersion" },
11
+ "kind": { "description": "The kind of graph file. A needs.yaml is `needs`.", "const": "needs" },
12
+ "id": {
13
+ "type": "string",
14
+ "description": "The id of the flow beside this file, whose needs these are.",
15
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
16
+ "examples": ["example.restoreNote"]
17
+ },
18
+ "title": { "type": "string", "description": "The list in plain words, for people." },
19
+ "summary": { "type": "string", "description": "Where the needs come from and what they cover, in a few plain sentences." },
20
+ "status": {
21
+ "description": "`proposed`: written, nobody has approved it. `approved`: the owner reviewed and accepted the list. A list is written from what the flow's users need, never read from the code, so it is never `captured`.",
22
+ "enum": ["proposed", "approved"]
23
+ },
24
+ "needs": {
25
+ "type": "array",
26
+ "description": "The needs, in the order people read them. Each id comes once.",
27
+ "minItems": 1,
28
+ "items": { "$ref": "#/$defs/need" }
29
+ }
30
+ },
31
+ "$defs": {
32
+ "formatVersion": {
33
+ "description": "The format and its version. Every graph file starts with it.",
34
+ "const": "delurio-graph/0"
35
+ },
36
+ "need": {
37
+ "type": "object",
38
+ "description": "One thing that must exist for the flow's users. A need without `missing` is met, and names evidence outside the graph (a source, a test, a scenario or a setting); a need with `missing` is a gap, and may name what exists of it so far.",
39
+ "required": ["id", "need"],
40
+ "additionalProperties": false,
41
+ "properties": {
42
+ "id": { "$ref": "#/$defs/needId" },
43
+ "need": {
44
+ "type": "string",
45
+ "description": "What must exist, in a sentence of the graph's language, from the users' side: what they can do or what they are told.",
46
+ "minLength": 1,
47
+ "examples": ["The owner of an archived note restores it from the note's own page, and it is active again."]
48
+ },
49
+ "evidence": {
50
+ "type": "array",
51
+ "description": "What shows that the need exists: the code, a test, a scenario that walks it, the states and nodes it is drawn as, a setting a deployment gives. Every piece must resolve.",
52
+ "minItems": 1,
53
+ "items": { "$ref": "#/$defs/evidence" }
54
+ },
55
+ "missing": {
56
+ "type": "string",
57
+ "description": "That the need does not exist yet, and why or where that is tracked: words, an issue, a finding's id. Its flow and id must then be in the product's needs.gaps.yaml.",
58
+ "minLength": 1,
59
+ "examples": ["archived notes are not erased yet; the second phase erases them"]
60
+ },
61
+ "note": { "type": "string", "description": "The author's own words. No tool reads them." }
62
+ },
63
+ "anyOf": [{ "required": ["evidence"] }, { "required": ["missing"] }]
64
+ },
65
+ "needId": {
66
+ "type": "string",
67
+ "description": "A need's id in its flow: kebab-case. The gaps name it so.",
68
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
69
+ "examples": ["restore-from-its-page"]
70
+ },
71
+ "path": {
72
+ "type": "string",
73
+ "description": "A path relative to the application's repository root (SPEC.md §9).",
74
+ "pattern": "^[^\\s/][^\\s]*$"
75
+ },
76
+ "evidence": {
77
+ "type": "object",
78
+ "description": "One piece of evidence, of one kind: `source`, `test`, `scenario`, `state`, `node` or `setting`.",
79
+ "additionalProperties": false,
80
+ "properties": {
81
+ "source": {
82
+ "type": "string",
83
+ "description": "The code that makes the need true: `<path>:<line>`, or a bare `<path>` for a whole file, relative to the application's repository root (SPEC.md §9). The file must exist and have that line.",
84
+ "pattern": "^[^\\s/:][^\\s:]*(:[0-9]+)?$",
85
+ "examples": ["app/notes.js", "src/notes/restore.ts:42"]
86
+ },
87
+ "test": {
88
+ "$ref": "#/$defs/path",
89
+ "description": "A test of the need: its file, relative to the application's repository root. The file must exist.",
90
+ "examples": ["app/notes.test.js"]
91
+ },
92
+ "name": {
93
+ "type": "string",
94
+ "description": "With `source`: a name the file holds, such as the function that does it. With `test`: the test's name as it is written, in quotes or as a test function's name. The file must hold it, not as a part of a longer word.",
95
+ "minLength": 1,
96
+ "examples": ["restoreNote", "restores an archived note"]
97
+ },
98
+ "scenario": {
99
+ "type": "string",
100
+ "description": "A scenario of a binding (SPEC.md §7) that walks the need on the app. The binding is the flow's own binding.yaml, or the one `binding` names; it binds this flow and has the scenario, its `extends` included.",
101
+ "minLength": 1,
102
+ "examples": ["owner"]
103
+ },
104
+ "binding": {
105
+ "$ref": "#/$defs/path",
106
+ "description": "With `scenario`: the binding that has it, relative to the application's repository root, when it is not the flow's own binding.yaml.",
107
+ "examples": ["e2e/notes.binding.yaml"]
108
+ },
109
+ "state": {
110
+ "type": "string",
111
+ "description": "A state of the flow the need is drawn as. Where only missing needs name it, a tool that walks the flow on the app leaves it out.",
112
+ "minLength": 1,
113
+ "examples": ["restoring"]
114
+ },
115
+ "node": {
116
+ "type": "string",
117
+ "description": "A node of the flow's screens (ui.yaml) the need is drawn as. Where only missing needs name it, a tool that walks the flow on the app leaves it out.",
118
+ "minLength": 1,
119
+ "examples": ["restore"]
120
+ },
121
+ "setting": {
122
+ "type": "string",
123
+ "description": "An environment variable a deployment sets for the need. The file `in` names sets it on a line that is not commented out.",
124
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
125
+ "examples": ["NOTES_SESSION_SECRET"]
126
+ },
127
+ "in": {
128
+ "$ref": "#/$defs/path",
129
+ "description": "With `setting`: the file that tells a deployment what to set, relative to the application's repository root: a dotenv file such as .env.example, or a Compose file.",
130
+ "examples": [".env.example", "compose.yaml"]
131
+ }
132
+ },
133
+ "allOf": [
134
+ {
135
+ "$comment": "a piece of evidence names its kind",
136
+ "anyOf": [
137
+ { "required": ["source"] },
138
+ { "required": ["test"] },
139
+ { "required": ["scenario"] },
140
+ { "required": ["state"] },
141
+ { "required": ["node"] },
142
+ { "required": ["setting"] }
143
+ ]
144
+ },
145
+ {
146
+ "$comment": "a piece of evidence is of one kind: give each kind an item of its own",
147
+ "if": { "required": ["source"] },
148
+ "then": { "properties": { "test": false, "scenario": false, "state": false, "node": false, "setting": false } }
149
+ },
150
+ {
151
+ "$comment": "a piece of evidence is of one kind: give each kind an item of its own",
152
+ "if": { "required": ["test"] },
153
+ "then": { "properties": { "scenario": false, "state": false, "node": false, "setting": false } }
154
+ },
155
+ {
156
+ "$comment": "a piece of evidence is of one kind: give each kind an item of its own",
157
+ "if": { "required": ["scenario"] },
158
+ "then": { "properties": { "state": false, "node": false, "setting": false } }
159
+ },
160
+ {
161
+ "$comment": "a piece of evidence is of one kind: give each kind an item of its own",
162
+ "if": { "required": ["state"] },
163
+ "then": { "properties": { "node": false, "setting": false } }
164
+ },
165
+ {
166
+ "$comment": "a piece of evidence is of one kind: give each kind an item of its own",
167
+ "if": { "required": ["node"] },
168
+ "then": { "properties": { "setting": false } }
169
+ },
170
+ {
171
+ "$comment": "name goes with a source or a test",
172
+ "if": { "required": ["name"] },
173
+ "then": { "anyOf": [{ "required": ["source"] }, { "required": ["test"] }] }
174
+ },
175
+ {
176
+ "$comment": "binding goes with a scenario",
177
+ "if": { "required": ["binding"] },
178
+ "then": { "required": ["scenario"] }
179
+ },
180
+ {
181
+ "$comment": "a setting names the file that sets it, and in goes with a setting",
182
+ "if": { "required": ["setting"] },
183
+ "then": { "required": ["in"] },
184
+ "else": { "properties": { "in": false } }
185
+ }
186
+ ]
187
+ }
188
+ }
189
+ }
@@ -36,19 +36,39 @@
36
36
  "additionalProperties": { "type": "string", "description": "The sample value." },
37
37
  "examples": [{ "client": "Acme Notes" }]
38
38
  },
39
- "changes": {
39
+ "task": {
40
40
  "type": "object",
41
- "description": "What the flow changes and what follows, in its users' own words: what is created, sent, charged or removed, who sees it, and whether it can be undone. Required under --strict when the flow's steps invoke a writing action of its domain.",
41
+ "description": "The flow's name as its users know it, in their own words and language, such as \"Invite a member\": what Rehber names the task by, and what a list of tasks or a video shows. The graph's `title` is in the graph's language, for the people who write it; this is in every locale.",
42
42
  "required": ["key"],
43
43
  "additionalProperties": false,
44
44
  "properties": {
45
- "key": { "$ref": "#/$defs/catalogKey", "description": "The catalog key of the note; every locale's catalog must have it.", "examples": ["Changes.note"] }
45
+ "key": { "$ref": "#/$defs/catalogKey", "description": "The catalog key of the name; every locale's catalog must have it.", "examples": ["Invite.task"] }
46
46
  }
47
47
  },
48
+ "changes": {
49
+ "$comment": "exactly one of key or missing",
50
+ "type": "object",
51
+ "description": "What the flow changes and what follows, in its users' own words: what is created, sent, charged or removed, who sees it, and whether it can be undone. Required under --strict when the flow's steps invoke a writing action of its domain: `{ key }`, or `{ missing: <why> }` where the app has no such message yet, a gap that fails nothing (SPEC.md §4).",
52
+ "additionalProperties": false,
53
+ "properties": {
54
+ "key": { "$ref": "#/$defs/catalogKey", "description": "The catalog key of the note; every locale's catalog must have it.", "examples": ["Changes.note"] },
55
+ "missing": {
56
+ "type": "string",
57
+ "minLength": 1,
58
+ "description": "Why the flow has no changes note yet, such as an app that has no message saying what the flow changes. Rehber does not guide the flow's writing steps, and check gives the gap as a note (changes-note-gap).",
59
+ "examples": ["the app does not say what an import changes yet"]
60
+ }
61
+ },
62
+ "oneOf": [{ "required": ["key"] }, { "required": ["missing"] }]
63
+ },
48
64
  "nodes": {
49
65
  "type": "object",
50
66
  "description": "The nodes of the screens, by id. A node is shown in a state when the state is in `in`, not in `unless`, and `when` holds.",
51
- "propertyNames": { "$ref": "#/$defs/identifier" },
67
+ "propertyNames": {
68
+ "$ref": "#/$defs/identifier",
69
+ "not": { "const": "opener" },
70
+ "description": "A node's id: camelCase, and not opener, which a returnsFocus says for the node that opened its dialog (SPEC.md §4)."
71
+ },
52
72
  "additionalProperties": { "$ref": "#/$defs/node" }
53
73
  },
54
74
  "focus": {
@@ -212,8 +232,8 @@
212
232
  "enum": ["page", "text", "action", "field", "list", "status", "alert"]
213
233
  },
214
234
  "component": {
215
- "description": "A kit-neutral component; a kit maps it to the product's own (SPEC.md §8). A `TextField`'s `text` is its label, and the field is named by it.",
216
- "enum": ["Page", "Heading", "Text", "Button", "LinkButton", "TextField", "List", "ListItem", "Status", "Alert"]
235
+ "description": "A kit-neutral component; a kit maps it to the product's own (SPEC.md §8). A `TextField`'s, a `Checkbox`'s, a `Radio`'s and a `Select`'s `text` is its label, and the control is named by it. A `Checkbox` (role checkbox or switch) and a `Radio` (role radio) say with `checked` whether they are checked; a `Select` (role combobox) is a choice of one option, and its `value` is the option it shows chosen.",
236
+ "enum": ["Page", "Heading", "Text", "Button", "LinkButton", "TextField", "Checkbox", "Radio", "Select", "List", "ListItem", "Status", "Alert"]
217
237
  },
218
238
  "role": {
219
239
  "description": "The WAI-ARIA 1.2 role the node exposes; `kit check` reads it from the browser's accessibility tree.",
@@ -238,6 +258,11 @@
238
258
  "unless": { "$ref": "#/$defs/states", "description": "The flow states the node is not shown in." },
239
259
  "when": { "$ref": "#/$defs/expression", "description": "A guard or context flag of the flow that must hold for the node to show." },
240
260
  "disabledIn": { "$ref": "#/$defs/states", "description": "The states where the node is shown but disabled." },
261
+ "disabledWhen": {
262
+ "$ref": "#/$defs/expression",
263
+ "description": "An expression over the flow's context (SPEC.md §3): where it holds, the node is shown but disabled, in any state that shows it, such as a button that waits until a VAT number is typed or a box is ticked. Beside disabledIn, the node is disabled where either says so. A replay compares it in each situation it stops in.",
264
+ "examples": ["not vatGiven", "not accepted"]
265
+ },
241
266
  "emits": {
242
267
  "type": "string",
243
268
  "description": "The event the node sends when pressed: an event of the flow, UPPER_SNAKE.",
@@ -282,7 +307,7 @@
282
307
  },
283
308
  "edge": {
284
309
  "type": "object",
285
- "description": "A relation between nodes: `{ labelledBy: [node, labelNode] }`, `{ triggers: [node, state] }` or `{ returnsFocus: [dialog, node] }`.",
310
+ "description": "A relation between nodes: `{ labelledBy: [node, labelNode] }`, `{ triggers: [node, state] }` or `{ returnsFocus: [dialog, node | [node, ..] | opener] }`.",
286
311
  "minProperties": 1,
287
312
  "maxProperties": 1,
288
313
  "additionalProperties": false,
@@ -303,8 +328,16 @@
303
328
  },
304
329
  "returnsFocus": {
305
330
  "type": "array",
306
- "description": "A dialog (a page node whose role is dialog or alertdialog) and the node that has focus when it closes, usually the one that opened it. It wins over `focus` for the state the dialog closes into, when that state shows the node.",
307
- "prefixItems": [{ "$ref": "#/$defs/nodeRef" }, { "$ref": "#/$defs/nodeRef" }],
331
+ "description": "A dialog (a page node whose role is dialog or alertdialog) and the node that has focus when it closes, usually the one that opened it. Where several nodes open the dialog, the list of them, or opener: the focus goes back to the one pressed to open it. It wins over `focus` for the state the dialog closes into, when that state shows the node.",
332
+ "prefixItems": [
333
+ { "$ref": "#/$defs/nodeRef" },
334
+ {
335
+ "anyOf": [
336
+ { "$ref": "#/$defs/nodeRef", "description": "The node, or opener: the node pressed to open the dialog." },
337
+ { "type": "array", "items": { "$ref": "#/$defs/nodeRef" }, "minItems": 2, "uniqueItems": true, "description": "The nodes that open the dialog: the one pressed to open it has the focus." }
338
+ ]
339
+ }
340
+ ],
308
341
  "minItems": 2,
309
342
  "maxItems": 2
310
343
  }