@cratis/stage.runtime 4.207.1 → 4.209.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.
@@ -0,0 +1,35 @@
1
+ import type { ExternalComponent } from '@cratis/scene.model';
2
+ import { type SchemaProperty } from './stageFormSchema';
3
+ /**
4
+ * The explicit subject of an action (Screenplay decision 0110, Cratis/Stage#855): `for item` acts on the one selected row, `for screen` on the
5
+ * screen itself. Stage carries it as the scene properties `actionSubject` and `subjectInputs` until Scene ships a typed `ActionSubject`. An
6
+ * omitted subject is `undefined` and keeps every existing behavior.
7
+ */
8
+ export type ActionSubject = 'item' | 'screen';
9
+ /** The rows a screen offers for selecting and the ones that are selected. */
10
+ export interface ScreenRows {
11
+ selectableRows: Record<string, unknown>[];
12
+ selectedRows: Record<string, unknown>[];
13
+ }
14
+ /** What a command form reads of its action's subject: the rows it may use, whether it is a row action and the values bound from the row. */
15
+ export interface SubjectForm extends ScreenRows {
16
+ rowAction: boolean;
17
+ subjectValues: Record<string, unknown>;
18
+ }
19
+ /** The explicit subject an action element names, or nothing when the subject was omitted. */
20
+ export declare function actionSubjectOf(element: ExternalComponent): ActionSubject | undefined;
21
+ /** The one selected row an `item` subject acts on; no subject, a `screen` subject and two or more selected rows name none. */
22
+ export declare function subjectRowOf(subject: ActionSubject | undefined, selectedRows: Record<string, unknown>[]): Record<string, unknown> | undefined;
23
+ /** Whether an action waits, visible and disabled: a `for item` action without its one selected row. */
24
+ export declare function awaitsSubjectRow(subject: ActionSubject | undefined, row: Record<string, unknown> | undefined): boolean;
25
+ /** What a command form reads: a `screen` subject never reads a selection, and values bound from a row arrive with the opened action. */
26
+ export declare function subjectFormOf(element: ExternalComponent, rows: ScreenRows): SubjectForm;
27
+ /** The properties a toolbar item hands the action it becomes: its subject and inputs, and a row action unless the screen is the subject. */
28
+ export declare function subjectActionProperties(element: ExternalComponent, subject: ActionSubject | undefined): Record<string, unknown>;
29
+ /** The command inputs an action binds from the selected row (`with <input> from item.<path>`), by input name. Empty values are dropped. */
30
+ export declare function subjectInputValues(element: ExternalComponent, row: Record<string, unknown>): Record<string, unknown>;
31
+ /**
32
+ * The action an `item` subject opens: a row action whose bound inputs come from the selected row, and whose form asks for neither those inputs
33
+ * nor a required identifier the row carries. A form with no fields of its own starts from every property of the command, so what remains is asked.
34
+ */
35
+ export declare function itemSubjectElement(element: ExternalComponent, schema: SchemaProperty[], row: Record<string, unknown>): ExternalComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/stage.runtime",
3
- "version": "4.207.1",
3
+ "version": "4.209.0",
4
4
  "description": "The Cratis Stage application runtime for Arc and Scene",
5
5
  "author": "Cratis",
6
6
  "type": "module",
@@ -41,8 +41,8 @@
41
41
  "test": "vitest run"
42
42
  },
43
43
  "peerDependencies": {
44
- "@cratis/arc": "22.131.0",
45
- "@cratis/arc.react": "22.131.0",
44
+ "@cratis/arc": "22.143.0",
45
+ "@cratis/arc.react": "22.143.0",
46
46
  "@cratis/components": "4.34.0",
47
47
  "@cratis/fundamentals": "7.26.0",
48
48
  "@cratis/scene.blueprint.default": "4.80.2",