@cratis/pi 7.138.1 → 7.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/skills/cratis-application-slice-conformance/references/worked-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/public-events-and-direction.md +2 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/statemachines-and-workflows.md +12 -1
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/todo-list-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-automations-and-translations/references/translate-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-captures-and-reactions/references/complete-examples.md +4 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/compliance.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/constraints-produces-concurrency.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/date-comparisons.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/described-handlers.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/enum-numbers.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/inline-events.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/operations.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/policy-persona-seed.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/protected-reads.md +2 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/shop-generation.md +4 -0
- package/package/corpus/skills/cratis-screenplay-command-surface/references/uuid-equality.md +6 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/event-naming.md +2 -0
- package/package/corpus/skills/cratis-screenplay-discovery/references/personas-and-causes.md +2 -0
- package/package/corpus/skills/cratis-screenplay-event-modeling/references/invoicing-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/intent-example.md +4 -0
- package/package/corpus/skills/cratis-screenplay-legacy-extraction/references/re-entry-and-passes.md +4 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +2 -0
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +2 -1
- package/package/corpus/skills/cratis-screenplay-model-authoring/references/screen-authoring-workflow.md +28 -25
- package/package/corpus/skills/cratis-screenplay-model-review/references/walkthrough.md +2 -0
- package/package/corpus/skills/cratis-screenplay-model-review/references/worked-example.md +8 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/SKILL.md +5 -1
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/version-migration.md +50 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/references/worked-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-modeling-lifecycle/verification.json +2 -0
- package/package/corpus/skills/cratis-screenplay-projections/references/reducer-identity.md +4 -0
- package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +5 -4
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/worked-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/berth-reservations.md +6 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-design.md +7 -0
- package/package/corpus/skills/cratis-screenplay-scenario-coverage/references/invoicing-dues-example.md +9 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +8 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/command-inventory.md +2 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/field-lineage.md +2 -1
- package/package/corpus/skills/cratis-screenplay-slice-design/references/model-reasoning.md +2 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/read-model-design.md +2 -0
- package/package/corpus/skills/cratis-screenplay-slice-design/references/slicing.md +2 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/concept-rules.md +2 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/examples-and-routes.md +2 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/persona-callers-and-cases.md +2 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/reactions-and-cascades.md +2 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/whitespace-rules.md +4 -0
- package/package/corpus/skills/cratis-screenplay-specifications/references/worked-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +6 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +2 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +8 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/automation-translate-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +6 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostic-arguments.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/diagnostics.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-example.md +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generated-responses-example.md +4 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/generation-strategies-example.md +4 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/language-admission.md +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/pdl-example.md +16 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/production-routes-and-filters.md +2 -0
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.json +6993 -2979
- package/package/corpus/skills/cratis-screenplay-toolchain/references/screenplay-contract.version +1 -1
- package/package/corpus/skills/cratis-screenplay-toolchain/references/sources-and-streams.md +2 -0
- package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +55 -70
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/action-subjects.md +4 -1
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/application-shell.md +304 -136
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/screen-composition-contract.md +46 -31
- package/package/corpus/skills/cratis-screenplay-ui-composition/references/ui-profile-and-theme.md +2 -2
- package/package/corpus/skills/cratis-screenplay-ui-composition/verification.json +9 -9
- package/package/corpus/skills/cratis-specification-by-example/SKILL.md +2 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/case-tables-and-whole-numbers.md +4 -0
- package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/render-example.md +4 -0
- package/package.json +1 -1
package/package/corpus/skills/cratis-screenplay-ui-composition/references/application-shell.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
# The application shell:
|
|
1
|
+
# The application shell: slots, outlets, hooks, template references and sample data
|
|
2
2
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
5
|
- Default shell
|
|
6
|
+
- Slots and outlets
|
|
6
7
|
- One complete shell
|
|
7
|
-
- Navigation
|
|
8
|
-
-
|
|
9
|
-
-
|
|
8
|
+
- Navigation outlets: inherit, extend or override
|
|
9
|
+
- Outlets of actions, filters, tabs and stats
|
|
10
|
+
- Hooks: buttons that start a State Change slice
|
|
11
|
+
- Placement: where a slice's screen opens
|
|
10
12
|
- Template references, categories and blueprints
|
|
11
13
|
- Sample data packs
|
|
12
14
|
- Shapes the compiler refuses
|
|
@@ -14,9 +16,9 @@
|
|
|
14
16
|
- Render and verify
|
|
15
17
|
- Review checklist
|
|
16
18
|
|
|
17
|
-
Requires Screenplay
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
Requires Screenplay 6.0 or later (`screenplay --version`) for slot roles, outlets, hooks, `fits` and `show`. A model
|
|
20
|
+
written for Screenplay 5 runs `screenplay migrate <folder> --from 5 --to 6` first (see `cratis-screenplay-modeling-lifecycle`);
|
|
21
|
+
an old form is an error whose message names that migration, so the code is the version, not the model.
|
|
20
22
|
|
|
21
23
|
Every construct here is authoring syntax. The executable model defers it (`PLAY0269`), Stage plans it from the syntax
|
|
22
24
|
tree, and none of it changes a backend. The Scene designer, the Stage runtime and Studio read the same lines, so the
|
|
@@ -28,24 +30,37 @@ Requires Stage 4.189.3 or later (the CLI that bundles it) for a rendered fronten
|
|
|
28
30
|
`layout` or `ui profile`. Declare a `layout` and a `ui profile` only to customize that shell
|
|
29
31
|
(navigation, logo, templates, sample data), as below.
|
|
30
32
|
|
|
33
|
+
## Slots and outlets
|
|
34
|
+
|
|
35
|
+
Two words, two things. Never use one for the other.
|
|
36
|
+
|
|
37
|
+
- A **slot** is a region content is placed in. Each plain line in a layout or template body declares one, optionally
|
|
38
|
+
followed, in this order, by a role (`page`, `pane` or `panel`), `routed` or `routed by <param>`, `primary` and
|
|
39
|
+
`optional`: `content page routed primary`, `detail pane routed by sku optional`. A component's recursive fill point
|
|
40
|
+
is `slot <name>`, and a navigation target or contribution names one with `slot <name>` / `destination slot <name>`.
|
|
41
|
+
- An **outlet** is a named list of items a layout, screen template or dialog template offers:
|
|
42
|
+
`outlet <name> of actions|filters|tabs|stats|navigation [for item|for screen] [in <slot>]`, with its `default` items.
|
|
43
|
+
`in <slot>` ties the list to the slot that shows it. A module, feature or slice screen changes it with
|
|
44
|
+
`outlet <name> inherits|extends|overrides`, and any module or feature adds to it with `contribute to <name>`.
|
|
45
|
+
|
|
31
46
|
## One complete shell
|
|
32
47
|
|
|
33
48
|
```screenplay
|
|
34
49
|
layout AppShell
|
|
35
50
|
category application
|
|
36
51
|
topbar
|
|
37
|
-
side
|
|
38
|
-
content
|
|
52
|
+
side panel
|
|
53
|
+
content page routed primary
|
|
39
54
|
|
|
40
|
-
navigation topbar
|
|
55
|
+
outlet topbar of navigation in topbar
|
|
41
56
|
logo image "/assets/acme.svg" title "Acme"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
navigation
|
|
45
|
-
|
|
57
|
+
default sales title "Sales" icon receipt target Sales
|
|
58
|
+
default support title "Support" target Support slot content
|
|
59
|
+
outlet sidebar of navigation in side
|
|
60
|
+
default sales title "Sales" icon receipt target Sales
|
|
46
61
|
item orders title "Orders" target Sales.Orders
|
|
47
62
|
item returns title "Returns" target Sales.Orders.Returns slot side
|
|
48
|
-
|
|
63
|
+
default support title "Support" target Support
|
|
49
64
|
|
|
50
65
|
ui profile Desktop
|
|
51
66
|
target platform web
|
|
@@ -71,9 +86,9 @@ sample data NordicDemo
|
|
|
71
86
|
revenue = 98000
|
|
72
87
|
|
|
73
88
|
module Sales
|
|
74
|
-
|
|
89
|
+
outlet sidebar extends
|
|
75
90
|
item customers title "Customers" icon people target Sales.Customers
|
|
76
|
-
|
|
91
|
+
outlet topbar inherits
|
|
77
92
|
|
|
78
93
|
template blueprint Crm Workspace version "^1.4"
|
|
79
94
|
|
|
@@ -89,6 +104,9 @@ module Sales
|
|
|
89
104
|
reason = reason
|
|
90
105
|
event OrderPlaced
|
|
91
106
|
reason String
|
|
107
|
+
screen PlaceOrder
|
|
108
|
+
fits dialog, drawer
|
|
109
|
+
action PlaceOrder for screen
|
|
92
110
|
|
|
93
111
|
slice StateView OrderList
|
|
94
112
|
readmodel OrderRow
|
|
@@ -109,9 +127,9 @@ module Sales
|
|
|
109
127
|
revenue Decimal
|
|
110
128
|
|
|
111
129
|
module Support
|
|
112
|
-
|
|
130
|
+
outlet sidebar overrides
|
|
113
131
|
item tickets title "Tickets" target Support.Tickets
|
|
114
|
-
|
|
132
|
+
outlet topbar inherits
|
|
115
133
|
|
|
116
134
|
feature Tickets
|
|
117
135
|
slice StateView TicketList
|
|
@@ -125,111 +143,228 @@ module Reports
|
|
|
125
143
|
total Decimal
|
|
126
144
|
```
|
|
127
145
|
|
|
128
|
-
This
|
|
129
|
-
|
|
146
|
+
This follows the canonical shell vector (`screen-shell-navigation-positive` in `Cratis.Screenplay.CanonicalCorpus`).
|
|
147
|
+
Start from it; do not invent the syntax.
|
|
130
148
|
|
|
131
|
-
## Navigation
|
|
149
|
+
## Navigation outlets: inherit, extend or override
|
|
132
150
|
|
|
133
|
-
The `layout` declares
|
|
134
|
-
|
|
151
|
+
The `layout` declares each navigation outlet with `outlet <name> of navigation [in <slot>]` and lists the application's
|
|
152
|
+
items as `default` lines. A `module` (or a feature or slice screen, for the screens beneath it) states how it relates to an
|
|
153
|
+
outlet it changes; an outlet it does not mention **inherits** what is above it.
|
|
135
154
|
|
|
136
|
-
|
|
|
155
|
+
| Level says | Items shown | Choose it when |
|
|
137
156
|
| --- | --- | --- |
|
|
138
|
-
| nothing, or `
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
|
|
142
|
-
- Each
|
|
143
|
-
- The
|
|
144
|
-
- `logo image "<path>" title "<text>"` belongs to the layout's
|
|
145
|
-
-
|
|
146
|
-
|
|
157
|
+
| nothing, or `outlet <name> inherits` | The inherited items | The level needs no navigation of its own (the default) |
|
|
158
|
+
| `outlet <name> extends` | The inherited items, then the level's own | It adds items (a sales sidebar that also lists Customers) and keeps the application's |
|
|
159
|
+
| `outlet <name> overrides` | The level's own items only | It replaces the whole list (a support area with its own sidebar) |
|
|
160
|
+
|
|
161
|
+
- Each outlet has its own mode: a module can extend the sidebar and inherit the topbar.
|
|
162
|
+
- The layout declares; it never says `inherits`, `extends` or `overrides`, and `inherits` lists no items (`PLAY0897`).
|
|
163
|
+
- `logo image "<path>" title "<text>"` belongs to the layout's navigation outlet only; a logo below the layout is `PLAY0744`.
|
|
164
|
+
- A navigation item is `<id> title "<text>" [icon <name>] [target <Module>[.<Feature>]] [slot <name>]`, after `default` on
|
|
165
|
+
the layout and after `item` below it; any item nests sub-items as `item` lines. The title is a quoted string or
|
|
147
166
|
`$strings.<key>`.
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
|
|
167
|
+
- An id is unique in the outlet, and an extending level never repeats an inherited id (`PLAY0905`). `hide <id>` drops an
|
|
168
|
+
inherited item; `before <id>` or `after <id>` under an own item places it among the inherited ones (`PLAY0899` when the
|
|
169
|
+
id is not inherited). Own items never move above inherited ones without `before`.
|
|
170
|
+
- `target` names a module (its first feature) or a feature path. An item with no target needs sub-items, and a target the
|
|
171
|
+
document does not declare is `PLAY0748`. A module with no feature warns (`PLAY0751`).
|
|
172
|
+
- `slot` names a layout slot the target renders into; without it the target renders into the layout's primary slot. A slot
|
|
151
173
|
no layout declares is `PLAY0749`.
|
|
152
|
-
- **Hierarchy is sidebar only.** Top-level items target modules and their sub-items target features of that module. A
|
|
153
|
-
topbar item with sub-items is `PLAY0746`.
|
|
154
174
|
- **A module's own items may only target that module** (`PLAY0750`). To link elsewhere, put the item in the layout. This
|
|
155
|
-
matters when switching a module from inherit to override: the
|
|
156
|
-
|
|
157
|
-
|
|
175
|
+
matters when switching a module from inherit to override: retarget the copied items to the module's own features.
|
|
176
|
+
- An `overrides` outlet with no items leaves the list empty and warns (`PLAY0752`).
|
|
177
|
+
|
|
178
|
+
### `contribute to`: one entry from where it belongs
|
|
179
|
+
|
|
180
|
+
```screenplay excerpt
|
|
181
|
+
contribute to Navigation
|
|
182
|
+
navigate to InvoiceList
|
|
183
|
+
label "Invoices"
|
|
184
|
+
order 20
|
|
185
|
+
icon receipt
|
|
186
|
+
destination slot details
|
|
187
|
+
```
|
|
158
188
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
189
|
+
- `contribute to <outlet>` sits directly on a `module` or a `feature` at any depth and works for any outlet kind. Use it
|
|
190
|
+
for one entry a feature owns, next to its screens; use the outlet modes above for a tree or a whole list.
|
|
191
|
+
- `navigate`, `label` and `order` describe one navigation entry, all optional; `id`, `icon`, `presentation` and `group`
|
|
192
|
+
are kept as written. Item lines (`button`, `group`, `filter`, `tab`, `stat`, `item`) add items of the outlet's kind
|
|
193
|
+
after its own (`PLAY0900` otherwise).
|
|
194
|
+
- `destination slot <name>` opens the entry in a recursive slot a template or component declares with `slot <name>`
|
|
195
|
+
(a plain region line does not count), `destination dialog <DialogTemplate>` in a dialog and
|
|
196
|
+
`destination external "<route>"` outside the application; an undeclared slot or dialog is `PLAY0654`. A `navigate to`
|
|
197
|
+
inside it takes the same `route`, `slot` and `parameter` lines as a screen's navigation.
|
|
198
|
+
- `navigate to <Screen> by <param>` is **not** string interpolation; it reuses the typed navigate binding a screen action
|
|
199
|
+
uses.
|
|
200
|
+
- **Resolution:** the contribution's own module's templates first; with no local match, layouts and other modules
|
|
201
|
+
together. Competing matches warn as ambiguous. An outlet nothing declares is `PLAY0903`; a document that uses a
|
|
202
|
+
blueprint is exempt, because the blueprint's templates may declare it.
|
|
203
|
+
|
|
204
|
+
## Outlets of actions, filters, tabs and stats
|
|
205
|
+
|
|
206
|
+
A template offers more than navigation. Each kind takes its own item form, and an item of the wrong kind is `PLAY0900`:
|
|
207
|
+
|
|
208
|
+
| Kind | Item form |
|
|
209
|
+
| --- | --- |
|
|
210
|
+
| `actions` | `button <id> title "…" [slice <Slice>] [emphasis primary\|secondary\|quiet] [icon <name>] [for item\|for screen] [opens dialog\|drawer\|in slot <name>]`, or `group <id> title "…" [icon <name>]` holding `button` lines |
|
|
211
|
+
| `filters` | `filter <id> title "…" sets <Query>.<param>` - the parameter must be a `by` or `filter` parameter (`PLAY0901`) |
|
|
212
|
+
| `tabs` | `tab <id> title "…" shows <Screen>` - shown in the slot the outlet is `in` |
|
|
213
|
+
| `stats` | `stat <id> title "…" value from <Query>.<field>` - the query returns one result (`PLAY0902`) |
|
|
214
|
+
| `navigation` | `item <id> title "…" [icon] [target] [slot]`, as above |
|
|
162
215
|
|
|
163
|
-
|
|
216
|
+
```screenplay
|
|
217
|
+
module Catalog
|
|
218
|
+
screen template ListPage
|
|
219
|
+
category List
|
|
220
|
+
header
|
|
221
|
+
main
|
|
222
|
+
outlet toolbar of actions in header
|
|
223
|
+
default refresh title "Refresh" runs refresh
|
|
224
|
+
default export title "Export"
|
|
225
|
+
outlet filters of filters in header
|
|
226
|
+
outlet stats of stats in header
|
|
227
|
+
|
|
228
|
+
feature Products
|
|
229
|
+
outlet toolbar extends
|
|
230
|
+
hide export
|
|
231
|
+
button add title "Add product" slice DraftProduct emphasis primary icon plus
|
|
232
|
+
before refresh
|
|
233
|
+
outlet filters extends
|
|
234
|
+
filter status title "Status" sets AllProducts.status
|
|
235
|
+
outlet stats extends
|
|
236
|
+
stat drafts title "Drafts" value from ProductStats.drafts
|
|
237
|
+
|
|
238
|
+
slice StateChange DraftProduct
|
|
239
|
+
command DraftProduct
|
|
240
|
+
sku String identifier
|
|
241
|
+
produces ProductDrafted
|
|
242
|
+
for sku
|
|
243
|
+
event ProductDrafted
|
|
244
|
+
sku String
|
|
245
|
+
screen DraftProduct
|
|
246
|
+
fits dialog
|
|
247
|
+
action DraftProduct for screen
|
|
248
|
+
|
|
249
|
+
slice StateView ProductCatalog
|
|
250
|
+
readmodel ProductRow
|
|
251
|
+
sku String
|
|
252
|
+
status String
|
|
253
|
+
readmodel ProductStats
|
|
254
|
+
drafts Int
|
|
255
|
+
query AllProducts => ProductRow[]
|
|
256
|
+
filter status String
|
|
257
|
+
query ProductStats => ProductStats
|
|
258
|
+
screen ProductCatalog
|
|
259
|
+
template ListPage
|
|
260
|
+
outlet toolbar inherits
|
|
261
|
+
```
|
|
164
262
|
|
|
165
|
-
|
|
166
|
-
|
|
263
|
+
- Only a layout, screen template or dialog template declares an outlet (`PLAY0897` elsewhere); declaring or changing one
|
|
264
|
+
twice is `PLAY0904`, and changing one nothing declares is `PLAY0903`.
|
|
265
|
+
- The levels apply in order: the template's defaults, the module, the feature and its parent features, then the screen.
|
|
266
|
+
- A `default` button with no `slice` is a placeholder a lower level fills, so it does not warn. Below the template, a
|
|
267
|
+
button with no `slice` and no `runs` built-in warns (`PLAY0763`); never ship one.
|
|
268
|
+
- A dialog or drawer template declares its buttons as an actions outlet; `runs close`, `runs submit` and `runs refresh`
|
|
269
|
+
are built-ins that need no slice.
|
|
270
|
+
- Choose an outlet on the template when the same actions, filters or tabs belong to many screens: the feature that owns
|
|
271
|
+
the commands `extends` it once instead of repeating a toolbar on each screen. A screen that needs its own buttons keeps
|
|
272
|
+
a screen `toolbar <name>` inside a slot body (Stage refuses a screen mixing a top-level `template` with other
|
|
273
|
+
top-level directives).
|
|
167
274
|
|
|
168
|
-
|
|
169
|
-
- `slice` is a dotted path or any unambiguous suffix (`PLAY0764` when it matches several). It must name a slice the
|
|
170
|
-
document declares (`PLAY0761`) and a **State Change** slice. A State View, Automation or Translate slice is `PLAY0762`;
|
|
171
|
-
a button invokes State Change slices only.
|
|
172
|
-
- A button without a `slice` is legal while designing and warns (`PLAY0763`); never ship one.
|
|
173
|
-
- A button id is unique within the toolbar and shared with `item` names (`PLAY0765`).
|
|
174
|
-
- `item` entries (`action`, `navigate to`, `dialog`) stay valid beside buttons. Use `button` to start a slice, and
|
|
175
|
-
`item ... navigate to` to go to a screen.
|
|
275
|
+
## Hooks: buttons that start a State Change slice
|
|
176
276
|
|
|
177
|
-
|
|
277
|
+
A `button` that names a State Change `slice` is a **hook**. It opens the slice's screen, or runs its command directly.
|
|
178
278
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
`
|
|
182
|
-
|
|
279
|
+
- `slice` is a dotted path or any unambiguous suffix (`PLAY0764` when it matches several). It must name a slice the
|
|
280
|
+
document declares (`PLAY0761`) and a State Change slice. A State View, Automation or Translate slice is `PLAY0762`.
|
|
281
|
+
- `for item` makes the hook wait for a selected row, which supplies the command's identifier; `for screen` acts on the
|
|
282
|
+
screen's own record. Without it the outlet's `for` decides.
|
|
283
|
+
- A `runs` line under the button issues the command without a form. Every input must resolve without one (the
|
|
284
|
+
identifier from the item or screen, generated values) or it is `PLAY0907`. A slice issued only by a `runs` hook needs
|
|
285
|
+
no screen; a screenless slice whose hook cannot run, or names a place, is `PLAY0908`.
|
|
286
|
+
- `enabled when <condition>` reads `item.<field>` of the selected row; a `for screen` hook cannot read `item`
|
|
287
|
+
(`PLAY0915`). `confirm "<text>"` (or `$strings.<key>`) asks first; use it for destructive or hard-to-undo commands.
|
|
288
|
+
- `authorize <Policy>` under a button limits who sees it.
|
|
289
|
+
- A hook counts as issuing its slice's command for `PLAY0533` when it `runs` or opens a slice that has a screen. Once
|
|
290
|
+
the application declares navigation, a State Change screen nothing reaches issues nothing, so give each one a hook
|
|
291
|
+
(or a navigation entry or action that leads to it).
|
|
183
292
|
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
293
|
+
```screenplay
|
|
294
|
+
module Catalog
|
|
295
|
+
screen template ListPage
|
|
296
|
+
category Lists
|
|
297
|
+
main
|
|
298
|
+
detail pane routed by sku optional
|
|
299
|
+
outlet rowActions of actions for item
|
|
300
|
+
|
|
301
|
+
feature Products
|
|
302
|
+
outlet rowActions extends
|
|
303
|
+
button price title "Set price" slice SetProductPrice opens in slot detail
|
|
304
|
+
button withdraw title "Withdraw" slice WithdrawProduct
|
|
305
|
+
runs
|
|
306
|
+
enabled when item.status == "onSale"
|
|
307
|
+
confirm "Withdraw this product?"
|
|
308
|
+
|
|
309
|
+
slice StateChange SetProductPrice
|
|
310
|
+
command SetProductPrice
|
|
311
|
+
sku String identifier
|
|
312
|
+
price Decimal
|
|
313
|
+
produces PriceSet
|
|
314
|
+
for sku
|
|
315
|
+
event PriceSet
|
|
316
|
+
sku String
|
|
317
|
+
screen SetProductPrice
|
|
318
|
+
fits pane, drawer
|
|
319
|
+
action SetProductPrice for screen
|
|
320
|
+
|
|
321
|
+
slice StateChange WithdrawProduct
|
|
322
|
+
command WithdrawProduct
|
|
323
|
+
sku String identifier
|
|
324
|
+
produces ProductWithdrawn
|
|
325
|
+
for sku
|
|
326
|
+
event ProductWithdrawn
|
|
327
|
+
sku String
|
|
328
|
+
|
|
329
|
+
slice StateView ProductCatalog
|
|
330
|
+
readmodel ProductRow
|
|
331
|
+
sku String
|
|
332
|
+
status String
|
|
333
|
+
query AllProducts => ProductRow[]
|
|
334
|
+
screen ProductCatalog
|
|
335
|
+
template ListPage
|
|
336
|
+
main
|
|
337
|
+
table products
|
|
338
|
+
column sku
|
|
339
|
+
column status
|
|
340
|
+
detail
|
|
341
|
+
show ProductDetails by sku from products.selection
|
|
342
|
+
|
|
343
|
+
slice StateView ProductDetails
|
|
344
|
+
readmodel ProductDetail
|
|
345
|
+
sku String
|
|
346
|
+
query ProductBySku => ProductDetail
|
|
347
|
+
by sku String
|
|
348
|
+
screen ProductDetails
|
|
349
|
+
data ProductDetail via query ProductBySku by sku
|
|
194
350
|
```
|
|
195
351
|
|
|
196
|
-
|
|
197
|
-
mixes a top-level `template` directive with other top-level directives.
|
|
198
|
-
|
|
199
|
-
## Feature and module toolbars
|
|
352
|
+
## Placement: where a slice's screen opens
|
|
200
353
|
|
|
201
|
-
|
|
354
|
+
The template offers places, the slice says which it fits, and the hook picks one.
|
|
202
355
|
|
|
203
|
-
A template declares
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
item archive action ArchiveProduct
|
|
216
|
-
label "Archive"
|
|
217
|
-
icon archive
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
- The lines are the ones of a screen toolbar: `item <id> action <Command>` and `button <id> title "<text>" slice <Slice>`, with
|
|
221
|
-
the `PLAY0761`-`PLAY0765` rules above.
|
|
222
|
-
- `confirm "<text>"` (or a `$strings.<key>` token) is an optional child line of an `item` and of a `button`: the user confirms
|
|
223
|
-
before the command runs or before the button's dialog opens. Use it for destructive or hard-to-undo commands, not for every entry.
|
|
224
|
-
- An `item ... action <Command>` must name a command that a slice of the feature (or module) declares; otherwise the compiler
|
|
225
|
-
warns that the command is not the feature's. Fix the name or move the toolbar to the feature that owns the command; never silence the warning.
|
|
226
|
-
- Choose the feature toolbar when the buttons act on the feature as a whole (approve, withdraw, new). A button that needs the row
|
|
227
|
-
the user picked (a row action) stays an `item ... action` on the screen's table or list, because the toolbar has no row.
|
|
228
|
-
- Preview and Play open the command's form dialog for an entry (or run it after the confirmation); Studio's feature editor has a
|
|
229
|
-
Toolbar section that adds a button and links it to a command of the feature. All of it is authoring syntax like every screen
|
|
230
|
-
construct: the printer writes it back where it was written.
|
|
231
|
-
- Verify: `screenplay <model> --warnaserror` is clean (no warning about a command the feature does not declare), then Preview or Play a screen of the feature and see the
|
|
232
|
-
buttons in the template's toolbar; a destructive one asks first.
|
|
356
|
+
- A template declares slots with roles; the page always offers a dialog and a drawer over it.
|
|
357
|
+
- **A slice's screen says what it fits**, in order of preference: `fits dialog, drawer, pane`. The places are `dialog`,
|
|
358
|
+
`drawer`, `pane`, `panel` and `page`; without `fits` it fits anywhere. A malformed `fits` (an unknown or repeated place,
|
|
359
|
+
a second line, or a template's `fits slot <name>` on a screen) is `PLAY0906`.
|
|
360
|
+
- **The hook picks automatically**: it opens the screen in its first fit the page has free. Write `opens dialog`,
|
|
361
|
+
`opens drawer` or `opens in slot <name>` only when this hook needs another place than the automatic one.
|
|
362
|
+
- `opens in slot <name>` needs a slot the template declares (`PLAY0909`), that the hook's screen does not already fill
|
|
363
|
+
(`PLAY0910`), and whose role the slice's screen lists in its `fits` (`PLAY0911`).
|
|
364
|
+
- `show <Screen> by <param> from <element>.selection` in a template slot shows another screen for the row a table or
|
|
365
|
+
component selected. With a routed slot (`detail pane routed by sku`) the selection is in the address, so a shared link
|
|
366
|
+
opens the same row. The line must stand in a template slot and key the screen by a parameter its data is keyed by
|
|
367
|
+
(`PLAY0914`).
|
|
233
368
|
|
|
234
369
|
## Template references, categories and blueprints
|
|
235
370
|
|
|
@@ -260,34 +395,35 @@ module Merchandising
|
|
|
260
395
|
|
|
261
396
|
Each block below is compiled by the verification and must report exactly the code beside it.
|
|
262
397
|
|
|
263
|
-
A module that overrides
|
|
398
|
+
A module that overrides an outlet may not link to another module:
|
|
264
399
|
|
|
265
400
|
```screenplay expect PLAY0750
|
|
266
401
|
layout AppShell
|
|
267
402
|
category application
|
|
268
|
-
content
|
|
403
|
+
content page routed primary
|
|
404
|
+
outlet sidebar of navigation
|
|
269
405
|
|
|
270
406
|
module Sales
|
|
271
407
|
feature Orders
|
|
272
408
|
|
|
273
409
|
module Support
|
|
274
|
-
|
|
410
|
+
outlet sidebar overrides
|
|
275
411
|
item sales title "Sales" target Sales
|
|
276
412
|
feature Tickets
|
|
277
413
|
```
|
|
278
414
|
|
|
279
|
-
An extending
|
|
415
|
+
An extending level may not reuse an inherited item id:
|
|
280
416
|
|
|
281
|
-
```screenplay expect
|
|
417
|
+
```screenplay expect PLAY0905
|
|
282
418
|
layout AppShell
|
|
283
419
|
category application
|
|
284
|
-
content
|
|
420
|
+
content page routed primary
|
|
285
421
|
|
|
286
|
-
|
|
287
|
-
|
|
422
|
+
outlet sidebar of navigation
|
|
423
|
+
default sales title "Sales" target Sales
|
|
288
424
|
|
|
289
425
|
module Sales
|
|
290
|
-
|
|
426
|
+
outlet sidebar extends
|
|
291
427
|
item sales title "Sales again" target Sales.Orders
|
|
292
428
|
|
|
293
429
|
feature Orders
|
|
@@ -307,6 +443,39 @@ module Shop
|
|
|
307
443
|
button refresh title "Refresh" slice OrderList
|
|
308
444
|
```
|
|
309
445
|
|
|
446
|
+
A hook that opens a slice's screen in a slot whose role the screen does not fit:
|
|
447
|
+
|
|
448
|
+
```screenplay expect PLAY0911
|
|
449
|
+
module Catalog
|
|
450
|
+
screen template ListPage
|
|
451
|
+
category Lists
|
|
452
|
+
main
|
|
453
|
+
detail pane
|
|
454
|
+
outlet toolbar of actions in main
|
|
455
|
+
|
|
456
|
+
feature Products
|
|
457
|
+
outlet toolbar extends
|
|
458
|
+
button price title "Set price" slice SetProductPrice opens in slot detail
|
|
459
|
+
|
|
460
|
+
slice StateChange SetProductPrice
|
|
461
|
+
command SetProductPrice
|
|
462
|
+
sku String identifier
|
|
463
|
+
price Decimal
|
|
464
|
+
produces PriceSet
|
|
465
|
+
for sku
|
|
466
|
+
event PriceSet
|
|
467
|
+
sku String
|
|
468
|
+
screen SetProductPrice
|
|
469
|
+
fits dialog
|
|
470
|
+
action SetProductPrice for screen
|
|
471
|
+
|
|
472
|
+
slice StateView ProductCatalog
|
|
473
|
+
readmodel ProductRow
|
|
474
|
+
sku String
|
|
475
|
+
screen ProductCatalog
|
|
476
|
+
template ListPage
|
|
477
|
+
```
|
|
478
|
+
|
|
310
479
|
A blueprint reference needs a readable range and a blueprint a profile lists:
|
|
311
480
|
|
|
312
481
|
```screenplay expect PLAY0721,PLAY0722
|
|
@@ -329,36 +498,35 @@ ui profile Desktop
|
|
|
329
498
|
|
|
330
499
|
## Editing the shell through MCP
|
|
331
500
|
|
|
332
|
-
The shell is typed syntax. `read-ast` returns `
|
|
333
|
-
`
|
|
334
|
-
|
|
335
|
-
pass. Propose, show the difference,
|
|
501
|
+
The shell is typed syntax. `read-ast` returns `OutletSyntax` (on layouts, templates, modules, features and screens) with
|
|
502
|
+
its items, `NavigationItemSyntax`, `NavigationLogoSyntax`, `ToolbarButtonSyntax`, `TemplateAssignmentSyntax`,
|
|
503
|
+
`ScreenTemplateReferenceSyntax` and `SampleDataPackSyntax`; `propose-ast` edits them; a proposal against a revision that
|
|
504
|
+
moved is refused with `StaleRevision`; `apply` writes only after the diagnostics above pass. Propose, show the difference,
|
|
505
|
+
apply, reopen. Resolve member names with `syntax-schema`. Details: `cratis-screenplay-model-authoring`,
|
|
336
506
|
`references/screen-authoring-workflow.md`.
|
|
337
507
|
|
|
338
|
-
- **Switch
|
|
339
|
-
override copies the
|
|
340
|
-
items.
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
- A refusal (`PLAY0750`, `PLAY0762`, `PLAY0722`, `PLAY0714`) is the compiler's own answer: change the proposal, never the
|
|
344
|
-
rule.
|
|
508
|
+
- **Switch an outlet's mode** with a `replace` of the level's outlet. Inherit to extend adds the level's own items;
|
|
509
|
+
inherit to override copies the inherited items, retargeted to the module's features; override or extend to inherit
|
|
510
|
+
clears the items.
|
|
511
|
+
- A refusal (`PLAY0750`, `PLAY0762`, `PLAY0905`, `PLAY0911`, `PLAY0722`, `PLAY0714`) is the compiler's own answer: change
|
|
512
|
+
the proposal, never the rule.
|
|
345
513
|
|
|
346
514
|
## Render and verify
|
|
347
515
|
|
|
348
516
|
- `screenplay <model> --warnaserror` must report no error and no warning first; absent highlighting proves nothing.
|
|
349
|
-
- `cratis render <model> --name <App> --destination <out>` and `cratis run <model>` carry the shell: the
|
|
350
|
-
render, a module's sidebar replaces or extends the application's, a
|
|
351
|
-
and the address reflects the active module and
|
|
517
|
+
- `cratis render <model> --name <App> --destination <out>` and `cratis run <model>` carry the shell: the navigation
|
|
518
|
+
outlets render, a module's sidebar replaces or extends the application's, a hook opens the slice's screen where it
|
|
519
|
+
fits, and the address reflects the active module, feature and routed slots. The sample data pack is not served.
|
|
352
520
|
- Report authoring acceptance, executable admission and runtime rendering separately (see `SKILL.md`).
|
|
353
521
|
|
|
354
522
|
## Review checklist
|
|
355
523
|
|
|
356
|
-
- [ ]
|
|
357
|
-
- [ ]
|
|
358
|
-
- [ ]
|
|
359
|
-
- [ ]
|
|
360
|
-
- [ ] Every
|
|
361
|
-
- [ ]
|
|
362
|
-
- [ ] Buttons shared by every screen of a feature
|
|
524
|
+
- [ ] Slots and outlets are not confused: regions are slots with roles, item lists are outlets of a kind.
|
|
525
|
+
- [ ] Each level's outlet mode is deliberate: inherit by default, extend to add, override only to replace.
|
|
526
|
+
- [ ] No module item targets another module; no id repeats between an extending level and what it inherits.
|
|
527
|
+
- [ ] The logo is declared once, in the layout's navigation outlet.
|
|
528
|
+
- [ ] Every hook names a State Change slice; a `runs` hook's inputs all resolve without a form.
|
|
529
|
+
- [ ] Each State Change screen says what it `fits`; a hook names a place only when it needs one other than the automatic choice.
|
|
530
|
+
- [ ] Buttons shared by every screen of a feature extend the template's actions outlet once, with `confirm` on the destructive ones.
|
|
363
531
|
- [ ] Every template has a `category`; every blueprint reference has a valid range and is listed in a profile's `packages`.
|
|
364
532
|
- [ ] The active sample data pack is selected once, in the `ui profile`, and no sample value sits in a component.
|