@delurio/cli 0.17.0 → 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/CHANGELOG.md +24 -0
- package/README.md +10 -10
- package/SPEC.md +58 -20
- package/js/graph.d.ts +50 -2
- package/js/graph.js +55 -3
- package/js/internal.js +2 -2
- package/js/native.d.cts +41 -2
- package/package.json +7 -7
- package/schemas/binding.schema.json +169 -19
- package/schemas/catalog.schema.json +2 -2
- package/schemas/ui.schema.json +78 -7
package/schemas/ui.schema.json
CHANGED
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
},
|
|
83
83
|
"focus": {
|
|
84
84
|
"type": "object",
|
|
85
|
-
"description": "The node that has focus when the flow enters a state from another state, after someone acts or a step ends, by state. A page that opens gives the focus to its `initialFocus` instead, and a dialog that closes to its `returnsFocus` node.
|
|
85
|
+
"description": "The node that has focus when the flow enters a state from another state, after someone acts or a step ends, by state: one node, or a list of nodes of which the first the state draws has it (the note of what just happened, each drawn by its own `when`). A page that opens gives the focus to its `initialFocus` instead, and a dialog that closes to its `returnsFocus` node. Each node is shown in that state.",
|
|
86
86
|
"propertyNames": { "$ref": "#/$defs/stateRef" },
|
|
87
|
-
"additionalProperties": { "$ref": "#/$defs/
|
|
88
|
-
"examples": [{ "consent": "retryAlert" }]
|
|
87
|
+
"additionalProperties": { "$ref": "#/$defs/focusNodes", "description": "The node, or the nodes in order, that have focus in that state." },
|
|
88
|
+
"examples": [{ "consent": "retryAlert" }, { "teamPage": ["goneAlert", "approvedNote", "requestDeclinedNote", "resentNote"] }]
|
|
89
89
|
},
|
|
90
90
|
"edges": {
|
|
91
91
|
"type": "array",
|
|
@@ -131,6 +131,13 @@
|
|
|
131
131
|
"description": "The id of a state of the flow.",
|
|
132
132
|
"pattern": "^([a-z][A-Za-z0-9]*|[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)?)$"
|
|
133
133
|
},
|
|
134
|
+
"focusNodes": {
|
|
135
|
+
"description": "One node, or a list of nodes in order, of which the first drawn has the focus (SPEC.md §4, a list of nodes, the first drawn).",
|
|
136
|
+
"anyOf": [
|
|
137
|
+
{ "$ref": "#/$defs/nodeRef" },
|
|
138
|
+
{ "type": "array", "items": { "$ref": "#/$defs/nodeRef" }, "minItems": 1, "uniqueItems": true, "description": "The nodes, in order: the first the state draws has the focus." }
|
|
139
|
+
]
|
|
140
|
+
},
|
|
134
141
|
"nodeRef": {
|
|
135
142
|
"type": "string",
|
|
136
143
|
"description": "The id of a node of this UI graph.",
|
|
@@ -276,12 +283,25 @@
|
|
|
276
283
|
"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. A repeat node's may also read its row's place among the rows it draws: repeat.first, repeat.last and repeat.index (from 1), such as the first row's Move up (proposed on 23 Nov 2026).",
|
|
277
284
|
"examples": ["not vatGiven", "not accepted", "repeat.first", "saving or repeat.last"]
|
|
278
285
|
},
|
|
286
|
+
"readOnlyIn": {
|
|
287
|
+
"$ref": "#/$defs/states",
|
|
288
|
+
"description": "On a field that can be read-only: the states where it is shown read-only, such as a field while its form is sent. It keeps its value and can have the focus, and takes no input (HTML readonly, or aria-readonly), unlike a disabled one. A replay compares it in each situation it stops in, by the readonly property of the browser's accessibility tree. A state is in disabledIn or in readOnlyIn, not in both (SPEC.md §4)."
|
|
289
|
+
},
|
|
279
290
|
"emits": {
|
|
280
291
|
"type": "string",
|
|
281
292
|
"description": "The event the node sends when pressed: an event of the flow, UPPER_SNAKE.",
|
|
282
293
|
"pattern": "^[A-Z][A-Z0-9_]*$"
|
|
283
294
|
},
|
|
295
|
+
"whenGone": {
|
|
296
|
+
"$ref": "#/$defs/focusNodes",
|
|
297
|
+
"description": "On a node that sends an event: the node that has focus when this node was pressed and the state the flow lands in no longer draws it (a row the step moved away), where that state draws it, or a list of nodes of which the first so drawn has it; it does not apply where a dialog closes. Else a page's initialFocus, then focus.<state> (SPEC.md §4, a pressed node that is gone).",
|
|
298
|
+
"examples": ["resentNote", ["replayingStatus", "replayFailedAlert"]]
|
|
299
|
+
},
|
|
284
300
|
"initialFocus": { "$ref": "#/$defs/nodeRef", "description": "On a page: the node that has focus when it opens, at the flow's start or when a transition shows it." },
|
|
301
|
+
"modal": {
|
|
302
|
+
"type": "boolean",
|
|
303
|
+
"description": "On a dialog (a page whose role is dialog or alertdialog): whether it is modal, true unless it says false. Where a modal dialog is shown, the nodes outside it are read as absent, as if the state were not in their `in`: the rest of the page is inert (HTML showModal, aria-modal). false: a dialog that leaves the page as it is, such as a guide's box beside the element it points to (SPEC.md §4)."
|
|
304
|
+
},
|
|
285
305
|
"repeat": { "type": "string", "description": "The node is drawn once per item of this data: once per row when the samples give its rows (`samples.<data>`), else once. Its params may read the item's fields as `row.<field>`, and so may its `checked`. Adjacent nodes with the same repeat are drawn side by side, one row per item.", "examples": ["request.scopes"] },
|
|
286
306
|
"frame": {
|
|
287
307
|
"description": "For a page: whether it may be framed; `never` (served with CSP frame-ancestors 'none').",
|
|
@@ -353,14 +373,48 @@
|
|
|
353
373
|
"$comment": "duringStep is only on a node that sends an event: it says where that event is handled",
|
|
354
374
|
"if": { "required": ["duringStep"], "properties": { "duringStep": { "const": true } } },
|
|
355
375
|
"then": { "required": ["emits"] }
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"$comment": "whenGone is only on a node that sends an event: where the focus goes when the node pressed is gone",
|
|
379
|
+
"if": { "not": { "required": ["emits"] } },
|
|
380
|
+
"then": { "properties": { "whenGone": false } }
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"$comment": "readOnlyIn is only on a field that can be read-only: one whose role takes aria-readonly (checkbox, columnheader, combobox, grid, gridcell, listbox, radiogroup, rowheader, searchbox, slider, spinbutton, switch, textbox, treegrid), or a native date, time, datetime-local, month or week input",
|
|
384
|
+
"if": {
|
|
385
|
+
"not": {
|
|
386
|
+
"required": ["type"],
|
|
387
|
+
"properties": { "type": { "const": "field" } },
|
|
388
|
+
"anyOf": [
|
|
389
|
+
{
|
|
390
|
+
"required": ["role"],
|
|
391
|
+
"properties": {
|
|
392
|
+
"role": {
|
|
393
|
+
"enum": [
|
|
394
|
+
"checkbox", "columnheader", "combobox", "grid", "gridcell", "listbox", "radiogroup", "rowheader", "searchbox",
|
|
395
|
+
"slider", "spinbutton", "switch", "textbox", "treegrid"
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
{ "required": ["native"], "properties": { "native": { "enum": ["date", "time", "datetime-local", "month", "week"] } } }
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"then": { "properties": { "readOnlyIn": false } }
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"$comment": "modal is only on a dialog: a page whose role is dialog or alertdialog",
|
|
408
|
+
"if": { "not": { "required": ["type", "role"], "properties": { "type": { "const": "page" }, "role": { "enum": ["dialog", "alertdialog"] } } } },
|
|
409
|
+
"then": { "properties": { "modal": false } }
|
|
356
410
|
}
|
|
357
411
|
]
|
|
358
412
|
},
|
|
359
413
|
"edge": {
|
|
360
414
|
"type": "object",
|
|
361
|
-
"description": "A relation between nodes: `{ labelledBy: [node, labelNode] }`, `{ triggers: [node, state] }` or `{ returnsFocus: [dialog, node | [node, ..] | opener] }`.",
|
|
415
|
+
"description": "A relation between nodes: `{ labelledBy: [node, labelNode] }`, `{ triggers: [node, state] }` or `{ returnsFocus: [dialog, node | [node, ..] | opener], whenGone: node }`.",
|
|
362
416
|
"minProperties": 1,
|
|
363
|
-
"maxProperties":
|
|
417
|
+
"maxProperties": 2,
|
|
364
418
|
"additionalProperties": false,
|
|
365
419
|
"properties": {
|
|
366
420
|
"labelledBy": {
|
|
@@ -379,7 +433,7 @@
|
|
|
379
433
|
},
|
|
380
434
|
"returnsFocus": {
|
|
381
435
|
"type": "array",
|
|
382
|
-
"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
|
|
436
|
+
"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 the node is still drawn there; where it is gone, the edge's `whenGone` has the focus, else the rules after it.",
|
|
383
437
|
"prefixItems": [
|
|
384
438
|
{ "$ref": "#/$defs/nodeRef" },
|
|
385
439
|
{
|
|
@@ -391,8 +445,25 @@
|
|
|
391
445
|
],
|
|
392
446
|
"minItems": 2,
|
|
393
447
|
"maxItems": 2
|
|
448
|
+
},
|
|
449
|
+
"whenGone": {
|
|
450
|
+
"$ref": "#/$defs/focusNodes",
|
|
451
|
+
"description": "On a returnsFocus: the node that has focus when the dialog closes and the node returnsFocus names is no longer drawn (the row a removal took away), where the state the dialog closes into draws it, or a list of nodes of which the first so drawn has it; else a page's initialFocus, then focus.<state> (SPEC.md §4, each dialog's own node where its opener is gone).",
|
|
452
|
+
"examples": ["removedNote", ["pausedStatus", "waitingStatus"]]
|
|
394
453
|
}
|
|
395
|
-
}
|
|
454
|
+
},
|
|
455
|
+
"allOf": [
|
|
456
|
+
{
|
|
457
|
+
"$comment": "whenGone is only on a returnsFocus: where the focus goes when the dialog closes and the node it names is gone",
|
|
458
|
+
"if": { "not": { "required": ["returnsFocus"] } },
|
|
459
|
+
"then": { "properties": { "whenGone": false } }
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"$comment": "an edge is one relation: labelledBy, triggers, or returnsFocus with its whenGone",
|
|
463
|
+
"if": { "not": { "required": ["whenGone"] } },
|
|
464
|
+
"then": { "maxProperties": 1 }
|
|
465
|
+
}
|
|
466
|
+
]
|
|
396
467
|
},
|
|
397
468
|
"tone": {
|
|
398
469
|
"description": "A tone a node takes (SPEC.md §4): neutral, info, success, warning or danger.",
|