@delurio/cli 0.18.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 +9 -0
- package/README.md +9 -9
- package/SPEC.md +16 -7
- package/js/graph.d.ts +8 -1
- package/package.json +7 -7
- package/schemas/ui.schema.json +41 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
While the version is 0.x, a release that can judge the same graphs differently (a new check, a stricter schema) bumps the minor; a fix that judges nothing differently bumps the patch.
|
|
4
4
|
|
|
5
|
+
## 0.19.0 (2026-12-01)
|
|
6
|
+
|
|
7
|
+
This release lets each dialog say where the focus goes when the node it would give the focus back to is gone, lets a node pressed with no dialog say the same of itself, and lets `focus.<state>` and those new keys give a list of nodes, of which the first drawn has the focus (SPEC.md §4). The ui schema takes them, and `check` holds graphs to them. A graph that uses none of them is judged as before.
|
|
8
|
+
|
|
9
|
+
- `whenGone: <node>` on a `returnsFocus` edge, `{ returnsFocus: [removeDialog, memberMenu], whenGone: removedNote }`, names the node that has the focus when the dialog closes and the node `returnsFocus` names is no longer drawn in the state the flow lands in (SPEC.md §4, Each dialog's own node where its opener is gone). The order is: the node `returnsFocus` names, if it is still drawn; else the edge's `whenGone`, if the new state draws it (by its `in` and `unless`; a replay reads its `when`, as for every node); else the rules after, unchanged: the `initialFocus` of a page that opens, else `focus.<state>`. Before, the focus fell to `focus.<state>`, one node for a state, so where several dialogs close into the same state, each taking away something else (a member's row, an invitation's), the graph could say the node for one of them only. `focusAfter(ui, from, to, pressed, gone)` in `@delurio/cli/graph` keeps its arguments and gives the `whenGone` node as it gives a `returnsFocus`, from the dialog that closes (`by: 'returnsFocus'`); a `whenGone` among `gone` gives way to the rules after it. `UiEdge` in the types takes `whenGone`. Decided on 1 Dec 2026 (Taha: "ekranın doğru yaptığı bir şeyi graph gösterebiliyorsa elbette göstermeli").
|
|
10
|
+
- The ui schema takes `whenGone` as a node's name, and only on a `returnsFocus` edge (rule `schema`, "whenGone is only on a returnsFocus"); an edge that gives two relations is refused as before, and its message now says that an edge is one relation. A `whenGone` that is not a node of the page keeps the graph from loading, at its place. `focus-not-shown` is given where a `whenGone` names a node that no state its dialog closes into shows (by `in` and `unless`), and no longer where a `returnsFocus` names a node no such state shows and each of those states shows the edge's `whenGone` or has a `focus.<state>`; where some have neither, its message names them and the `whenGone`.
|
|
11
|
+
- `focus.<state>` and `whenGone` take a node or a list of nodes (SPEC.md §4, A list of nodes, the first drawn): `focus: { teamPage: [goneAlert, approvedNote, requestDeclinedNote, resentNote] }`, `whenGone: [pausedStatus, waitingStatus]`. The focus goes to the first node of the list that the new state draws: shown by its `in` and `unless`, and not among the nodes `gone` a replay gives `focusAfter`, where it puts those whose `when` does not hold. A `whenGone` list none of whose nodes is drawn gives way to the rules after it, as one node does; a `focus.<state>` list none of whose nodes is drawn says nothing of the focus. Before, `focus.<state>` named one node, so a state entered in several ways, each drawing the note of what just happened by its own `when` (a request approved, one declined, an invitation resent), could give the focus to one of those notes only. A single node is read as before, and `focusAfter` keeps its arguments. The ui schema takes a list of at least one node, each once; `check` holds each node of a list as it holds one node, at its place in the list: `focus-not-shown` for a node of a `focus.<state>` list that its state does not show, that is no node of ui.yaml, or that a modal dialog makes absent wherever the flow is in the state, and for a node of a `whenGone` list that no state its dialog closes into shows; a node of a `whenGone` list that is no node of the page keeps the graph from loading. A state the dialog closes into is met by any node of the edge's `whenGone` list it shows. `Ui.focus` and `UiEdge.whenGone` in the types take a list. Decided on 1 Dec 2026.
|
|
12
|
+
- A node that sends an event may carry `whenGone: <node> | [<node>, ..]` (SPEC.md §4, A pressed node that is gone): where the focus goes when it was pressed and the state the flow lands in no longer draws it, as when Send again on an invitation that ran out moves its row to the open ones, while Resend on an open one runs the same step and keeps its row and the focus, or when Replay, pressed with no dialog, gives way to "Replaying…". The order is a new rule after the dialog's two: where no dialog closes on the move, the node pressed (`focusAfter`'s fourth argument) is not drawn in the new state (by its `in` and `unless`, or among `gone`, where a replay puts it when its `when` does not hold or its element on the row pressed has left the page), and the new state draws a node of its `whenGone`, the first such node has the focus; else the `initialFocus` of a page that opens, then `focus.<state>`, as before. Where a dialog closes, its edge says, and the `whenGone` of the node that opened it is not read. `focusAfter` keeps its arguments and gives the node by `focus`, from the node pressed. The ui schema takes the key only on a node with `emits` ("whenGone is only on a node that sends an event"); a `whenGone` that names no node of the page keeps the graph from loading; `focus-not-shown` is given for each node of it that no state the node's event leads to shows (from each state that shows the node, through the transitions on its event, past `always` and past the step it starts). The fold of the variables only the screens read leaves out the `when` of the nodes any `whenGone` names, as of those `focus` names. `UiNode` in the types takes `whenGone`. Decided on 1 Dec 2026.
|
|
13
|
+
|
|
5
14
|
## 0.18.0 (2026-11-30)
|
|
6
15
|
|
|
7
16
|
This release takes in five follow-ups from binding delurio's own panel (SPEC.md §4, §7): where the focus goes when the node a dialog would give it back to is gone, a field kept read-only while its form is sent, a passkey in the walk's own browser, the language a walk reads in when the flow has no catalog of the browser's, and a modal dialog that makes the rest of the page absent. It also takes in three answers of 30 Nov 2026 (SPEC.md §2, §4, §7): a catalog's plurals and selects, read as ICU MessageFormat, a check that walks a flow once for the variables only its screens read, and a scenario's `then` that holds every time a step happens. And it takes in two binding keys of 29 and 30 Nov 2026 for a faster replay (SPEC.md §7): a binding's `settle.time`, the replay's own time, and a navigation binding's `pages.<page>.serial`, a page opened one persona at a time. The ui and binding schemas take the new keys, and `check` holds graphs and bindings to them. A graph whose dialogs are shown with no node of the page behind them, that uses none of the new keys, whose messages ICU's MessageFormat reads as `{name}` was read before (no plural or select, no apostrophe before a brace, no space inside `{ }`), and whose bindings' `then` name only what its flow has, is judged as before.
|
package/README.md
CHANGED
|
@@ -120,21 +120,21 @@ A file is a woff2, woff, ttf or otf file of at most 2 MiB, and a kit's files are
|
|
|
120
120
|
## Write a graph in an editor
|
|
121
121
|
|
|
122
122
|
The npm package ships a JSON Schema (2020-12) for each kind of graph file in `schemas/`: `flow`, `ui`, `nav` (also `nav.extracted.yaml`), `domain`, `catalog`, `needs`, `gaps` (`needs.gaps.yaml`) and `binding` (`binding.yaml` and a shared `<name>.binding.yaml`). With them an editor completes keys, explains each one from SPEC.md on hover, and marks a typo, a value of the wrong kind, or a title cut short by a comma inside `{ }`. In VS Code, with the YAML extension, put this in `.vscode/settings.json`, with the version your project pins in
|
|
123
|
-
place of 0.
|
|
123
|
+
place of 0.19.0 (a schema from an older release does not know the keys added since):
|
|
124
124
|
|
|
125
125
|
```json
|
|
126
126
|
{
|
|
127
127
|
"yaml.schemas": {
|
|
128
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
129
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
130
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
131
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
132
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
133
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
134
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
128
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/flow.schema.json": "**/flow.yaml",
|
|
129
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/ui.schema.json": "**/ui.yaml",
|
|
130
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/nav.schema.json": ["**/nav.yaml", "**/nav.extracted.yaml"],
|
|
131
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/domain.schema.json": ["**/domain.yaml", "**/domain/*.yaml"],
|
|
132
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/needs.schema.json": "**/needs.yaml",
|
|
133
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/gaps.schema.json": "**/needs.gaps.yaml",
|
|
134
|
+
"https://unpkg.com/@delurio/cli@0.19.0/schemas/binding.schema.json": ["**/binding.yaml", "**/binding.*.yaml", "**/*.binding.yaml"]
|
|
135
135
|
},
|
|
136
136
|
"json.schemas": [
|
|
137
|
-
{ "fileMatch": ["**/catalog/*.json"], "url": "https://unpkg.com/@delurio/cli@0.
|
|
137
|
+
{ "fileMatch": ["**/catalog/*.json"], "url": "https://unpkg.com/@delurio/cli@0.19.0/schemas/catalog.schema.json" }
|
|
138
138
|
]
|
|
139
139
|
}
|
|
140
140
|
```
|
package/SPEC.md
CHANGED
|
@@ -166,9 +166,9 @@ kit: ../kit # optional: the kit the screens are drawn with
|
|
|
166
166
|
samples: { client: "Acme Notes" } # values for catalog parameters, on the page and in videos
|
|
167
167
|
changes: { key: Changes.note } # optional: what the flow changes and what follows, in its users' words; or { missing: <why> }
|
|
168
168
|
task: { key: Authorize.task } # optional: the flow's name as its users know it
|
|
169
|
-
focus: { <state>: <node> }
|
|
169
|
+
focus: { <state>: <node> | [<node>, ..] } # optional: the node that has focus once a step has led into the state; of a list, the first it draws
|
|
170
170
|
nodes: { <node>: { .. } }
|
|
171
|
-
edges: [ { labelledBy: [node, node] }, { triggers: [node, state] }, { returnsFocus: [dialog, node | [node, ..] | opener] } ]
|
|
171
|
+
edges: [ { labelledBy: [node, node] }, { triggers: [node, state] }, { returnsFocus: [dialog, node | [node, ..] | opener], whenGone: node | [node, ..] } ]
|
|
172
172
|
rules: [ { id, rule } ]
|
|
173
173
|
```
|
|
174
174
|
|
|
@@ -187,6 +187,7 @@ rules: [ { id, rule } ]
|
|
|
187
187
|
| `readOnlyIn` | on a field: states where it is shown read-only, keeping its value and its focus and taking no input, as a field does while its form is sent (What a control holds, below) |
|
|
188
188
|
| `emits` | the event the node sends when pressed |
|
|
189
189
|
| `duringStep: true` | in a state that runs a step (`invoke`): the node stays usable while the step runs, and its event is handled once the step ends, by the state the step's outcome leads to (below) |
|
|
190
|
+
| `whenGone` | on a node that sends an event: the node that has focus when it was pressed and the state the flow lands in no longer draws it, or a list of nodes, the first drawn (Focus, a pressed node that is gone, below) |
|
|
190
191
|
| `initialFocus` | on a page: the node that has focus when it opens (Focus, below) |
|
|
191
192
|
| `repeat` | the node is drawn once per item of this data (`request.scopes`): once per row the samples give it (Rows of a repeat, below) |
|
|
192
193
|
| `frame` | for a page: whether it may be framed (`never`) |
|
|
@@ -209,23 +210,31 @@ A `role` is a WAI-ARIA 1.2 role, and `name` is the accessible name that Accessib
|
|
|
209
210
|
|
|
210
211
|
A node is shown in a state when the state is in `in`, not in `unless`, and `when` holds. `edges` records relations the page and the checks use: a node labelled by another, an action that leads to a state, the node a dialog gives the focus back to. `rules` are written but no tool reads them yet; checking them, together with labelled dialogs and confirmation before a destructive action, is [#3](https://github.com/delurio-labs/delurio/issues/3). The focus return of #3 is partly answered: a dialog says where the focus returns with `returnsFocus` (below), and `check` holds that it starts at a dialog and gives the focus to a node shown where the dialog closes. That every dialog says it is still #3. Events handled where shown are answered: `check` holds that a node's event is handled wherever the node is shown enabled (`event-unhandled`, below).
|
|
211
212
|
|
|
212
|
-
**A modal dialog makes the rest of the page absent.** A dialog, a page node whose role is `dialog` or `alertdialog` (Focus, below), is modal unless it says `modal: false`. While a modal dialog is open, the rest of the page is inert: out of the accessibility tree, and out of reach of the pointer and the keyboard, as HTML's `<dialog>` opened with `showModal()` and WAI-ARIA's `aria-modal="true"` make it, and as the dialog pattern of the ARIA Authoring Practices Guide asks. So in a situation (§2) that shows a modal dialog, by its `in`, `unless` and `when`, each node outside it is read as absent, as if the state were not in the node's `in`. A node is outside the modal dialogs when some situation the flow reaches shows it and shows no modal dialog, as the page behind a dialog is shown before the dialog opens; a node shown only where a modal dialog is shown is inside one: the dialog's own heading and buttons, or a notice that several dialogs share. So the page's nodes need not be taken out of the `in` of the states that show a dialog over the page, nor out of the situations in which a drawer drawn by the context is open (a drawer with `when: "detail == 'open'"`). A dialog with `modal: false`, such as a guide's box beside the element it points to, leaves the page as it is. Where two modal dialogs are shown at once, the graph does not say which is on top, and neither makes the other's nodes absent; a graph that stacks dialogs says what the lower one hides by `in` and `when`. A replay does not look for a node that a modal dialog makes absent; under `--absent` it checks that the node is out of the accessibility tree, inert or not there at all (§7), and not that it is out of sight, as the page may still be seen behind the dialog's backdrop. The page draws each state's screen as before, the page behind a dialog included. `check` reads the rule wherever it reasons about what a situation shows, and holds a graph that needs such a node where it is absent as it holds one that needs a node its state does not show: `event-unhandled` (below) does not hold a state to the event of a node that a modal dialog makes absent there, as it cannot be pressed; `focus.<state>` to a node that a modal dialog makes absent in every situation of the state that the flow reaches is `focus-not-shown`; and a tutorial step that presses such a node is `tutorial-mismatch` (§7). Each of the last two is an error, as the graph then says that a node has the focus, or is pressed, where its own screens make it unreachable. Decided on 30 Nov 2026.
|
|
213
|
+
**A modal dialog makes the rest of the page absent.** A dialog, a page node whose role is `dialog` or `alertdialog` (Focus, below), is modal unless it says `modal: false`. While a modal dialog is open, the rest of the page is inert: out of the accessibility tree, and out of reach of the pointer and the keyboard, as HTML's `<dialog>` opened with `showModal()` and WAI-ARIA's `aria-modal="true"` make it, and as the dialog pattern of the ARIA Authoring Practices Guide asks. So in a situation (§2) that shows a modal dialog, by its `in`, `unless` and `when`, each node outside it is read as absent, as if the state were not in the node's `in`. A node is outside the modal dialogs when some situation the flow reaches shows it and shows no modal dialog, as the page behind a dialog is shown before the dialog opens; a node shown only where a modal dialog is shown is inside one: the dialog's own heading and buttons, or a notice that several dialogs share. So the page's nodes need not be taken out of the `in` of the states that show a dialog over the page, nor out of the situations in which a drawer drawn by the context is open (a drawer with `when: "detail == 'open'"`). A dialog with `modal: false`, such as a guide's box beside the element it points to, leaves the page as it is. Where two modal dialogs are shown at once, the graph does not say which is on top, and neither makes the other's nodes absent; a graph that stacks dialogs says what the lower one hides by `in` and `when`. A replay does not look for a node that a modal dialog makes absent; under `--absent` it checks that the node is out of the accessibility tree, inert or not there at all (§7), and not that it is out of sight, as the page may still be seen behind the dialog's backdrop. The page draws each state's screen as before, the page behind a dialog included. `check` reads the rule wherever it reasons about what a situation shows, and holds a graph that needs such a node where it is absent as it holds one that needs a node its state does not show: `event-unhandled` (below) does not hold a state to the event of a node that a modal dialog makes absent there, as it cannot be pressed; `focus.<state>` to a node that a modal dialog makes absent in every situation of the state that the flow reaches (each node of a list) is `focus-not-shown`; and a tutorial step that presses such a node is `tutorial-mismatch` (§7). Each of the last two is an error, as the graph then says that a node has the focus, or is pressed, where its own screens make it unreachable. Decided on 30 Nov 2026.
|
|
213
214
|
|
|
214
215
|
### Focus
|
|
215
216
|
|
|
216
217
|
A page that opens gives the focus to its `initialFocus`. `focus` and `returnsFocus` say where it goes after that, when someone acts or a step ends. A page opens when the flow enters a state that shows it from a state that does not, or starts in a state that shows it, however the browser got there: by a step inside the app, or by loading the page anew (a link from an e-mail, a reload, the way back from another site). Its `initialFocus` holds in both; an app that leaves the focus at the document's start after a load does not meet it. The flow moves from one state it stops in to the next: a state with `always` is passed at once, so the focus is never said there. When the flow moves from one state into another, the node that has focus in the new state is the first of these that applies:
|
|
217
218
|
|
|
218
219
|
1. the node of `{ returnsFocus: [<dialog>, <node>] }` in `edges`, when the dialog closes (the state before shows it and the new one does not) and the node is still drawn in the new state (an opener that is gone, below). The dialog is a page node whose role is `dialog` or `alertdialog`, and the node is usually the one that opened it, as the dialog pattern of the ARIA Authoring Practices Guide asks. Where several nodes open the same dialog, the second item is the list of them, `[<dialog>, [<node>, ..]]`, or `opener`, `[<dialog>, opener]`: the focus goes back to the node that opened the dialog this time, one of those listed for a list (opener, below);
|
|
219
|
-
2. the `
|
|
220
|
-
3.
|
|
220
|
+
2. the edge's `whenGone`, `{ returnsFocus: [<dialog>, <node>], whenGone: <node> }`, when the dialog closes, the node `returnsFocus` names is no longer drawn in the new state, and the new state draws the `whenGone` node, or, for a list, the first of the list it draws (an opener that is gone, and a list of nodes, below);
|
|
221
|
+
3. the node pressed's own `whenGone`, `<node>: { .., emits: <EVENT>, whenGone: <node> }`, when no dialog closes on the move, the node pressed is not drawn in the new state, and the new state draws a node of its `whenGone`: the first such node (a pressed node that is gone, below);
|
|
222
|
+
4. the `initialFocus` of a page that opens and has one; when a dialog opens over a page, the dialog's;
|
|
223
|
+
5. `focus.<state>`, the node that has focus when the flow enters that state from another one: on a page that stays open, the alert a failed step shows, or the status that says a step is done; for a list, the first of the list it draws (a list of nodes, below).
|
|
221
224
|
|
|
222
225
|
When none applies, and when the flow moves from a state to itself, the graph says nothing of the focus. `focusAfter` in `@delurio/cli/graph` gives this order.
|
|
223
226
|
|
|
224
227
|
The node that opened a dialog is the one pressed to open it: a node shown in the state before the dialog opened, whose `emits` is the event of the transition into the state that shows the dialog (past states with `always`). A dialog that edits any of four fields, each with its own Edit button, gives the focus back to the Edit button that was pressed. The graph cannot say which one that was, as the four lead to the same state; a replay knows the node it pressed, and gives it to `focusAfter` as its fourth argument. Without it, `focusAfter` gives the one node of a list that the new state shows, and nothing for `opener` or for a list of which the new state shows several. `opener` is a word of the format, not a node: no node is called `opener`. A replay checks, in each state it stops in, that the node the graph gives has the focus: the browser's focused element is that node, found by its role and name or by its binding (§7).
|
|
225
228
|
|
|
226
|
-
**An opener that is gone.** A step may take away the node the focus would go back to: the "⋯" of a member's row, gone with the row once the member is removed, or a finding's Dismiss button, which a dismissed finding no longer draws. Where the node that `returnsFocus` names is no longer drawn in the state the flow lands in, the first rule does not apply, and the rules after it do: the `initialFocus` of a page that opens, else `focus.<state>`, such as the notice that says the member was removed (`focus: { teamPage: removedNote }`). It is what the dialog pattern of the ARIA Authoring Practices Guide asks when the element that opened a dialog no longer exists: the focus goes to another element that follows from what was done. A node is no longer drawn where the new state does not show it, by its `in`, `unless` and `when`, and, for a node drawn once per row (`repeat`), where its element on the row the dialog was opened from has left the page, as the row a step removes takes its elements with it, while the node still draws the other rows. The graph knows what `in` and `unless` say; a replay knows the rest: it reads `when` over the context it has walked to, and it knows the element it pressed to open the dialog, or opened the pressed node from (a node's `before`, §7), and whether that element is still in the page. `focusAfter` takes as its fifth argument the nodes the walk found no longer drawn there (`gone`), and gives the focus as if the new state did not show them; for a list of which the new state shows none, it gives the rules after the first, with or without the node pressed. Decided on 30 Nov 2026.
|
|
229
|
+
**An opener that is gone.** A step may take away the node the focus would go back to: the "⋯" of a member's row, gone with the row once the member is removed, or a finding's Dismiss button, which a dismissed finding no longer draws. Where the node that `returnsFocus` names is no longer drawn in the state the flow lands in, the first rule does not apply, and the rules after it do: the edge's `whenGone` (below), else the `initialFocus` of a page that opens, else `focus.<state>`, such as the notice that says the member was removed (`focus: { teamPage: removedNote }`). It is what the dialog pattern of the ARIA Authoring Practices Guide asks when the element that opened a dialog no longer exists: the focus goes to another element that follows from what was done. A node is no longer drawn where the new state does not show it, by its `in`, `unless` and `when`, and, for a node drawn once per row (`repeat`), where its element on the row the dialog was opened from has left the page, as the row a step removes takes its elements with it, while the node still draws the other rows. The graph knows what `in` and `unless` say; a replay knows the rest: it reads `when` over the context it has walked to, and it knows the element it pressed to open the dialog, or opened the pressed node from (a node's `before`, §7), and whether that element is still in the page. `focusAfter` takes as its fifth argument the nodes the walk found no longer drawn there (`gone`), and gives the focus as if the new state did not show them; for a list of which the new state shows none, it gives the rules after the first, with or without the node pressed. Decided on 30 Nov 2026.
|
|
227
230
|
|
|
228
|
-
|
|
231
|
+
**Each dialog's own node where its opener is gone.** `focus.<state>` names one node for a state, and several dialogs may close into the same state, each taking away something else: removing a member takes away the member's row, cancelling an invitation takes away the invitation's, and each leaves the focus on what follows from it, the notice that says the member was removed or the one that says the invitation was cancelled. `focus.<state>` can say one of these. So the edge of each dialog says its own: `{ returnsFocus: [removeDialog, memberMenu], whenGone: removedNote }`, beside `{ returnsFocus: [cancelDialog, invitationMenu], whenGone: cancelledNote }`. `whenGone` is a node of the page, or a list of them (below); on an edge, it is only on a `returnsFocus` (a node that sends an event may carry one of its own, a pressed node that is gone, below). When the dialog closes, the focus goes to the node that `returnsFocus` names, if it is still drawn in the new state, as above; else to the edge's `whenGone` node, if the new state draws it: shows it by its `in` and `unless`, and, as for every node, a replay reads its `when` and gives it to `focusAfter` among the nodes `gone` where it does not hold; else the rules after, unchanged: the `initialFocus` of a page that opens, else `focus.<state>`. A dialog whose `returnsFocus` names a list, or `opener`, goes to its `whenGone` wherever the node it would give the focus back to is gone; where the graph cannot say which node that is (`opener`, or a list of which the new state draws several, with no node pressed), it says nothing, as before. `focusAfter` keeps its arguments and gives the `whenGone` node as it gives a `returnsFocus`, from the dialog that closes (`by: 'returnsFocus'`), so a replay that already gives it the nodes it found gone follows; the `whenGone` node, where its `when` does not hold, is one of them. Decided on 1 Dec 2026.
|
|
232
|
+
|
|
233
|
+
**A list of nodes, the first drawn.** A state may be entered in several ways, each leaving the focus on a different node. The members page (`teamPage`) is entered after approving a request to join, declining one, resending an invitation, or finding that the invitation was gone meanwhile, and each draws the note of what just happened, `approvedNote`, `requestDeclinedNote`, `resentNote` or `goneAlert`, each by its own `when` (`when: "notice == 'approved'"`), so that one is drawn; the focus goes to the one drawn. One node cannot say it, so `focus.<state>` and `whenGone`, an edge's or a node's, take a node or a list of nodes: `focus: { teamPage: [goneAlert, approvedNote, requestDeclinedNote, resentNote] }`, `whenGone: [pausedStatus, waitingStatus]`. The focus goes to the first node of the list that the new state draws: the state shows it by its `in` and `unless`, and it is not among the nodes `gone` that a replay gives `focusAfter`, where the replay puts each node whose `when` does not hold over the context it has walked to. A `whenGone` list none of whose nodes is drawn gives way to the rules after it, as a single `whenGone` node does; a `focus.<state>` list none of whose nodes is drawn says nothing of the focus. A single node is read as before. `focusAfter` keeps its arguments. Decided on 1 Dec 2026.
|
|
234
|
+
|
|
235
|
+
**A pressed node that is gone.** A step need not close a dialog to take away the node that was pressed, and the screen then gives the focus to what follows. On the members page, Send again on an invitation that ran out moves its row to the open invitations, and the note that says it was sent takes the focus; Resend on an open invitation runs the same step and leaves the same note, but keeps its row and its button, which keep the focus, so `focus.<state>` cannot tell the two apart. On a review, Replay, pressed with no dialog, gives way to "Replaying…", which takes the focus. So a node that sends an event (`emits`) may say where the focus goes when it was pressed and is gone: `sendAgain: { .., emits: SEND_AGAIN, whenGone: resentNote }`, `replay: { .., emits: REPLAY, whenGone: replayingStatus }`, one node or a list, of which the first drawn (above). It applies when no dialog closes on the move (where one does, the dialog's `returnsFocus` and its edge's `whenGone` say, and the node pressed is the one that opened it, whose own `whenGone` is not read), and the node pressed is not drawn in the state the flow lands in: the state does not show it by its `in` and `unless`, or a replay found it gone, as for an opener that is gone: its `when` does not hold, or, for a node drawn once per row (`repeat`), its element on the row pressed has left the page. Then the focus goes to the first node of its `whenGone` that the new state draws, before the `initialFocus` of a page that opens and `focus.<state>`; where it draws none, those rules apply as before. The node pressed is the one whose press led to the move, through the step the press started: a replay gives it to `focusAfter` as its fourth argument, as it gives the node that opened a dialog, with the nodes it found gone. `focusAfter` keeps its arguments, and gives such a node by `focus`, from the node pressed (`from`). Decided on 1 Dec 2026.
|
|
236
|
+
|
|
237
|
+
A state that `focus` names that is not a state of the flow, and a `whenGone`, an edge's or a node's, that is not a node of the page (or a node of its list that is not), keep the graph from loading; the schema takes a node's `whenGone` only on a node that sends an event. `check` gives an error (`focus-not-shown`) where `focus` gives the focus to a node its state does not show (by `in` and `unless`; a replay reads `when`), a `returnsFocus` to a node no state the dialog closes into shows, unless each of those states shows a node of the edge's `whenGone` or has a `focus`, either of which gives the focus there as the node is gone (the error names those that have neither), a `whenGone` to a node no state the dialog closes into shows, or a node's own `whenGone` to a node that no state its event leads to shows (from each state that shows the node, the states the flow stops in after its event, past states with `always`, and past a step it starts, the states the step's outcomes lead to); and one (`returns-focus-not-dialog`) where a `returnsFocus` starts at a node that is not a dialog. For a list, each node it lists is held so, at its place in the list, whether the list is a `returnsFocus`'s, a `whenGone` or a `focus.<state>`; for `opener`, each node that opens the dialog, and a dialog that no node opens is `focus-not-shown` too.
|
|
229
238
|
|
|
230
239
|
`check` gives an error (`event-unhandled`) where a node that sends an event (`emits`) is shown and enabled in a state that does not handle it: in a situation the checker reaches (§2), the state is in the node's `in` and not in its `unless`, its `when` holds, the state is not in its `disabledIn` (nor, for a field, in its `readOnlyIn`), its `disabledWhen` does not hold, no modal dialog makes it absent there (above), and the state has no transition on the event in its `on`. Pressing the node there sends an event after which the flow says nothing, such as a Save button left enabled while the save runs. Each state that shows such a node disables it or handles its event. Three are not held, by what §2 says of them: a node that sends `NAVIGATE`, the person leaving the page, which is always possible; an exit (`type: final`), which has no transitions, so what a node on its page does is outside the flow (a new run of it, or another flow); and a state with `always`, which is passed at once, so nothing is pressed there. It is given once per node and state, at the node; where the node's `when` or `disabledWhen` decides it, its notes give the way from a start to the first situation that shows it enabled, as for a broken assertion.
|
|
231
240
|
|
package/js/graph.d.ts
CHANGED
|
@@ -114,6 +114,8 @@ export interface UiNode {
|
|
|
114
114
|
readOnlyIn?: string[];
|
|
115
115
|
/** On a dialog: false where it leaves the page behind it as it is; every other dialog is modal (SPEC.md §4). */
|
|
116
116
|
modal?: boolean;
|
|
117
|
+
/** 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, or a list of nodes of which the first drawn has it (SPEC.md §4, a pressed node that is gone). */
|
|
118
|
+
whenGone?: string | string[];
|
|
117
119
|
}
|
|
118
120
|
/** The tones a node may take (SPEC.md §4). */
|
|
119
121
|
export type Tone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
@@ -123,6 +125,8 @@ export interface UiEdge {
|
|
|
123
125
|
labelledBy?: [string, string];
|
|
124
126
|
triggers?: [string, string];
|
|
125
127
|
returnsFocus?: [string, string | string[]];
|
|
128
|
+
/** On a returnsFocus: the node that has focus when the dialog closes and the node returnsFocus names is no longer drawn, where the new state draws it, or a list of nodes of which the first so drawn has it (SPEC.md §4, each dialog's own node where its opener is gone). */
|
|
129
|
+
whenGone?: string | string[];
|
|
126
130
|
}
|
|
127
131
|
export declare const OPENER = "opener";
|
|
128
132
|
export declare const CHECKABLE: readonly ['checkbox', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch'];
|
|
@@ -165,7 +169,8 @@ export interface Ui {
|
|
|
165
169
|
task?: {
|
|
166
170
|
key: string;
|
|
167
171
|
};
|
|
168
|
-
focus
|
|
172
|
+
/** By state: the node that has focus once a step has led into it, or a list of nodes of which the first the state draws has it (SPEC.md §4). */
|
|
173
|
+
focus?: Record<string, string | string[]>;
|
|
169
174
|
edges?: UiEdge[];
|
|
170
175
|
}
|
|
171
176
|
export interface Graph {
|
|
@@ -208,9 +213,11 @@ export declare function thenEntries(then: ScenarioThen | undefined | null, effec
|
|
|
208
213
|
/** What a scenario's `then` names that the graph's flow does not have: an effect, a variable the effect's havoc does not list, a value the variable does not have. Its shape is the binding schema's to say. */
|
|
209
214
|
export declare function thenProblems(g: Graph, then: ScenarioThen): Array<{ path: string[]; message: string }>;
|
|
210
215
|
export declare function catalogWords(g: Graph, key: string, values?: Readonly<Record<string, Scalar>>, locale?: string): string | RegExp | null;
|
|
216
|
+
/** The node that has focus after a move, and which part of ui.yaml gives it: `returnsFocus` (the node it names, or its edge's `whenGone` where that node is gone) from the dialog that closes, the `initialFocus` of the page that opens, or `focus`: `focus.<state>` (the first of its list drawn), or, from the node pressed, that node's own `whenGone` where the move took it away. */
|
|
211
217
|
export interface FocusAfter {
|
|
212
218
|
node: string;
|
|
213
219
|
by: 'returnsFocus' | 'initialFocus' | 'focus';
|
|
220
|
+
/** The dialog that closed, the page that opened, or, by `focus`, the node pressed whose own `whenGone` gave the focus. */
|
|
214
221
|
from?: string;
|
|
215
222
|
}
|
|
216
223
|
export declare function focusAfter(ui: Ui, from: string | null, to: string, pressed?: string, gone?: readonly string[]): FocusAfter | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delurio/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "The open checker and page of delurio-graph/0: check every graph in a project's own CI, offline, with GNU error lines and SARIF.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"elkjs": "0.12.1"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@delurio/cli-linux-x64-gnu": "0.
|
|
51
|
-
"@delurio/cli-linux-x64-musl": "0.
|
|
52
|
-
"@delurio/cli-linux-arm64-gnu": "0.
|
|
53
|
-
"@delurio/cli-linux-arm64-musl": "0.
|
|
54
|
-
"@delurio/cli-darwin-arm64": "0.
|
|
55
|
-
"@delurio/cli-win32-x64-msvc": "0.
|
|
50
|
+
"@delurio/cli-linux-x64-gnu": "0.19.0",
|
|
51
|
+
"@delurio/cli-linux-x64-musl": "0.19.0",
|
|
52
|
+
"@delurio/cli-linux-arm64-gnu": "0.19.0",
|
|
53
|
+
"@delurio/cli-linux-arm64-musl": "0.19.0",
|
|
54
|
+
"@delurio/cli-darwin-arm64": "0.19.0",
|
|
55
|
+
"@delurio/cli-win32-x64-msvc": "0.19.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@napi-rs/cli": "3.10.12"
|
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.",
|
|
@@ -285,6 +292,11 @@
|
|
|
285
292
|
"description": "The event the node sends when pressed: an event of the flow, UPPER_SNAKE.",
|
|
286
293
|
"pattern": "^[A-Z][A-Z0-9_]*$"
|
|
287
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
|
+
},
|
|
288
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." },
|
|
289
301
|
"modal": {
|
|
290
302
|
"type": "boolean",
|
|
@@ -362,6 +374,11 @@
|
|
|
362
374
|
"if": { "required": ["duringStep"], "properties": { "duringStep": { "const": true } } },
|
|
363
375
|
"then": { "required": ["emits"] }
|
|
364
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
|
+
},
|
|
365
382
|
{
|
|
366
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",
|
|
367
384
|
"if": {
|
|
@@ -395,9 +412,9 @@
|
|
|
395
412
|
},
|
|
396
413
|
"edge": {
|
|
397
414
|
"type": "object",
|
|
398
|
-
"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 }`.",
|
|
399
416
|
"minProperties": 1,
|
|
400
|
-
"maxProperties":
|
|
417
|
+
"maxProperties": 2,
|
|
401
418
|
"additionalProperties": false,
|
|
402
419
|
"properties": {
|
|
403
420
|
"labelledBy": {
|
|
@@ -416,7 +433,7 @@
|
|
|
416
433
|
},
|
|
417
434
|
"returnsFocus": {
|
|
418
435
|
"type": "array",
|
|
419
|
-
"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.",
|
|
420
437
|
"prefixItems": [
|
|
421
438
|
{ "$ref": "#/$defs/nodeRef" },
|
|
422
439
|
{
|
|
@@ -428,8 +445,25 @@
|
|
|
428
445
|
],
|
|
429
446
|
"minItems": 2,
|
|
430
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"]]
|
|
431
453
|
}
|
|
432
|
-
}
|
|
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
|
+
]
|
|
433
467
|
},
|
|
434
468
|
"tone": {
|
|
435
469
|
"description": "A tone a node takes (SPEC.md §4): neutral, info, success, warning or danger.",
|