@cratis/stage.runtime 4.203.0 → 4.205.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/dist/src/StageChrome.d.ts +2 -2
- package/dist/src/app.css +1 -1
- package/dist/src/externalRouteHref.d.ts +2 -0
- package/dist/src/index.js +1060 -927
- package/dist/src/navigationTree.d.ts +8 -0
- package/dist/src/primereact.js +2 -3
- package/dist/src/stageItemChange.d.ts +106 -0
- package/dist/src/stageScreenTables.d.ts +27 -0
- package/dist/{stageDarkSelector-DjqhPYDU.js → stageDarkSelector-DAwb43-P.js} +1 -2
- package/dist/styledPrimeReact.js +1 -2
- package/package.json +2 -2
- package/dist/src/standaloneScreenTemplates.d.ts +0 -15
|
@@ -8,6 +8,10 @@ export interface NavigationEntry {
|
|
|
8
8
|
/** The module and features, outermost first, the entry was declared in. */
|
|
9
9
|
hierarchy: string[];
|
|
10
10
|
order?: number;
|
|
11
|
+
/** The authored identity of the entry: one entry per id, however many screens it arrives on. */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** The section heading the entry is listed under within its feature. */
|
|
14
|
+
group?: string;
|
|
11
15
|
/** The icon the entry was authored with. */
|
|
12
16
|
icon?: string;
|
|
13
17
|
/** How chrome shows the entry - `icon`, `text` or `both`; any other value is a hint the theme may read. */
|
|
@@ -18,6 +22,10 @@ export interface NavigationEntry {
|
|
|
18
22
|
/** A node of the navigation tree: a group (module or feature) with children, or an entry that opens a screen. */
|
|
19
23
|
export interface NavigationNode {
|
|
20
24
|
label: string;
|
|
25
|
+
/** The authored identity of the entry; absent on a group. */
|
|
26
|
+
id?: string;
|
|
27
|
+
/** Whether the node is a heading made from an entry's `group`, rather than a module or feature. */
|
|
28
|
+
section?: true;
|
|
21
29
|
/** The screen the node opens; absent on a group. */
|
|
22
30
|
screen?: string;
|
|
23
31
|
icon?: string;
|
package/dist/src/primereact.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "../stageDarkSelector-
|
|
1
|
+
import { t as e } from "../stageDarkSelector-DAwb43-P.js";
|
|
2
2
|
import { primeReactComponents as t, primeReactPackageManifest as n } from "@cratis/scene.primereact";
|
|
3
3
|
import r from "@primeuix/themes/lara";
|
|
4
|
-
|
|
4
|
+
// src/stageTheme.ts
|
|
5
5
|
var i = {
|
|
6
6
|
preset: r,
|
|
7
7
|
options: { darkModeSelector: e }
|
|
@@ -9,5 +9,4 @@ var i = {
|
|
|
9
9
|
components: t,
|
|
10
10
|
declared: n.components
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { t as primeReactComponents, a as primeReactLibrary, n as primeReactPackageManifest, e as stageDarkSelector, i as stageTheme };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { BindingExpression, ExternalComponent } from '@cratis/scene.model';
|
|
2
|
+
import { type ComponentBindingOutputs, type RegisteredComponentProps } from '@cratis/scene.react';
|
|
3
|
+
/** The binding path `with <input> from value` reads: the value the item changed to. */
|
|
4
|
+
export declare const changedValuePath = "value";
|
|
5
|
+
/** The binding path `with <input> from previous` reads: the value the item had before it changed. */
|
|
6
|
+
export declare const previousValuePath = "previous";
|
|
7
|
+
/** What a component reports for one of its items. */
|
|
8
|
+
export interface ReportedItem {
|
|
9
|
+
id: unknown;
|
|
10
|
+
column: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** The item the user changed, as `item`, `value` and `previous` mean it to a binding. */
|
|
13
|
+
export interface ItemChange {
|
|
14
|
+
/** The item's row, with the changed property already holding its new value. */
|
|
15
|
+
item: Record<string, unknown>;
|
|
16
|
+
/** The value the item changed to. */
|
|
17
|
+
value: unknown;
|
|
18
|
+
/** The value the item had before. */
|
|
19
|
+
previous: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Finds the one item whose value differs between two reports of a component's items.
|
|
23
|
+
*
|
|
24
|
+
* @param before What the component reported before.
|
|
25
|
+
* @param after What it reports now.
|
|
26
|
+
* @returns The changed item and the value it had, or `undefined` when nothing changed or the report is not a list of items.
|
|
27
|
+
*/
|
|
28
|
+
export declare function changedItem(before: unknown, after: unknown): {
|
|
29
|
+
item: ReportedItem;
|
|
30
|
+
previous: unknown;
|
|
31
|
+
} | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Builds the change a binding reads from the rows a component presents.
|
|
34
|
+
*
|
|
35
|
+
* The component's own report names an item by its identifier and the value it changed to. The row the component was
|
|
36
|
+
* given for that item is what the document binds to, so the row is found by `idField` and the property that holds
|
|
37
|
+
* the value (`valueField`) takes the new value.
|
|
38
|
+
*
|
|
39
|
+
* @param rows The rows the component was given.
|
|
40
|
+
* @param changed The item the component reported as changed.
|
|
41
|
+
* @param idField The row property that identifies an item.
|
|
42
|
+
* @param valueField The row property the user changes.
|
|
43
|
+
* @returns The change, or `undefined` when the component presents no row for the item.
|
|
44
|
+
*/
|
|
45
|
+
export declare function itemChangeOf(rows: unknown, changed: {
|
|
46
|
+
item: ReportedItem;
|
|
47
|
+
previous: unknown;
|
|
48
|
+
}, idField: string, valueField: string): ItemChange | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves what a change's bindings read: `item.<field>` from the changed row, `value` and `previous` from the
|
|
51
|
+
* change, and a guarded `when ... otherwise` against the changed row. Everything else is the screen's own.
|
|
52
|
+
*
|
|
53
|
+
* @param change The change.
|
|
54
|
+
* @param fallback Resolves any other binding.
|
|
55
|
+
* @returns The resolver the interaction engine runs the bindings with.
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveChange(change: ItemChange, fallback: (binding: BindingExpression) => unknown): (binding: BindingExpression) => unknown;
|
|
58
|
+
/** What a component that lets the user change its items needs to run the document's `on change`. */
|
|
59
|
+
export interface ItemChangeBinding {
|
|
60
|
+
/** The element the bindings are attached to. */
|
|
61
|
+
element: ExternalComponent;
|
|
62
|
+
/** The property of the element that holds the rows the component presents. */
|
|
63
|
+
rowsProperty: string;
|
|
64
|
+
/** The row property that identifies an item. */
|
|
65
|
+
idField: string;
|
|
66
|
+
/** The row property the user changes. */
|
|
67
|
+
valueField: string;
|
|
68
|
+
}
|
|
69
|
+
/** What the wrapped component is given in place of its own handlers and outputs. */
|
|
70
|
+
export interface ItemChangeHandlers {
|
|
71
|
+
/** Whether the document declares an `on change` for the component. */
|
|
72
|
+
declared: boolean;
|
|
73
|
+
/** Replaces the component's `onChange`: remembers that the next report is the user's. */
|
|
74
|
+
onChange: () => void;
|
|
75
|
+
/** Wraps the outputs the component publishes, running the bindings when the user's change is reported. */
|
|
76
|
+
outputs: ComponentBindingOutputs | undefined;
|
|
77
|
+
/** Changes whenever the component must be shown the data again, because the change was not applied. Use it as the component's `key`. */
|
|
78
|
+
revision: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Runs a component's `on change` for the item the user changed.
|
|
82
|
+
*
|
|
83
|
+
* A component that lets the user change an item (a card dropped in another column) says so through its `onChange`
|
|
84
|
+
* handler and then reports its items through its `value` output. The handler alone carries no item, so the change is
|
|
85
|
+
* the difference between the report before and after. A report that follows no `onChange` is the data changing
|
|
86
|
+
* under the component, which is not the user and so runs nothing.
|
|
87
|
+
*
|
|
88
|
+
* The bindings are the element's own, resolved and run by the Scene interaction engine - the same engine that runs
|
|
89
|
+
* every other interaction. Once they have run the data is read again. A change that no command applied (the
|
|
90
|
+
* `otherwise` branch only notified, or the command was refused) is shown as the data says it is rather than as the
|
|
91
|
+
* user left it: the `revision` changes, and the component, keyed by it, starts again from the data.
|
|
92
|
+
*
|
|
93
|
+
* @param binding What the component is and which of its row properties identify and change an item.
|
|
94
|
+
* @param outputs The outputs the component publishes.
|
|
95
|
+
* @returns The handlers to give the component.
|
|
96
|
+
*/
|
|
97
|
+
export declare function useItemChange(binding: ItemChangeBinding, outputs: ComponentBindingOutputs | undefined): ItemChangeHandlers;
|
|
98
|
+
/**
|
|
99
|
+
* The default blueprint's kanban board, running the document's `on change` for the card the user moved.
|
|
100
|
+
*
|
|
101
|
+
* The board is the blueprint's own; this only gives it what the document's interaction needs: the card, as its row
|
|
102
|
+
* with the column it was dropped in, and that column as `value`.
|
|
103
|
+
*/
|
|
104
|
+
export declare function StageKanbanBoard(props: RegisteredComponentProps): import("react").JSX.Element;
|
|
105
|
+
/** The registry key the default blueprint's kanban board is registered under, which the Stage's own board replaces. */
|
|
106
|
+
export declare const kanbanBoardKey: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { SceneElement } from '@cratis/scene.model';
|
|
3
|
+
/**
|
|
4
|
+
* The table ids of one screen, including tables nested in its slots. An outlet belongs to another screen, so its children are not visited.
|
|
5
|
+
*
|
|
6
|
+
* @param element The composed screen.
|
|
7
|
+
* @returns The distinct table ids, in first-use order, matching the scopes under which tables publish their queries and selections.
|
|
8
|
+
*/
|
|
9
|
+
export declare function screenTablesOf(element: SceneElement): string[];
|
|
10
|
+
/** Limits action selection and hidden form identifiers to the tables of this screen, independently of other screens on the page. */
|
|
11
|
+
export declare function StageScreenTables({ element, children }: {
|
|
12
|
+
element: SceneElement;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** Preserves the page-wide selection of a confirmation decision and its form after leaving the list screen. */
|
|
16
|
+
export declare function StagePageRows({ children }: {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* The rows a person could select and has selected in this screen's tables, each carrying the entity keys the command form recognizes.
|
|
21
|
+
* Queries published for `data:` declarations or `binding:` values and tables on other screens cannot gate an action or fill its identifier.
|
|
22
|
+
* Without a screen provider, direct consumers retain the page-wide behavior.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useScreenRows(): {
|
|
25
|
+
selectableRows: Record<string, unknown>[];
|
|
26
|
+
selectedRows: Record<string, unknown>[];
|
|
27
|
+
};
|
package/dist/styledPrimeReact.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFile as e } from "node:fs/promises";
|
|
2
|
-
|
|
2
|
+
// styledPrimeReact.ts
|
|
3
3
|
var t = /^primereact\/([a-z]+)$/, n = "\0stage-styled-primereact:";
|
|
4
4
|
function r() {
|
|
5
5
|
return {
|
|
@@ -26,5 +26,4 @@ function i(e) {
|
|
|
26
26
|
}
|
|
27
27
|
return [...t];
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { i as exportedNames, r as styledPrimeReact };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/stage.runtime",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.205.0",
|
|
4
4
|
"description": "The Cratis Stage application runtime for Arc and Scene",
|
|
5
5
|
"author": "Cratis",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"primereact": "11.2.0",
|
|
58
58
|
"react": "19.3.0",
|
|
59
59
|
"react-dom": "19.3.0",
|
|
60
|
-
"vite": "8.3.
|
|
60
|
+
"vite": "8.3.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@cratis/scene.primereact": {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
-
/**
|
|
3
|
-
* The blueprint templates with every template that fits a slot of another template placed in the shell's content instead.
|
|
4
|
-
*
|
|
5
|
-
* A blueprint template may declare that it sits inside another one - the default blueprint's `MasterDetailScreen` fits
|
|
6
|
-
* `WorkspaceScreen.moduleContent` - and the shared composition then wraps the screen in that outer template with the outer
|
|
7
|
-
* template's own seeded content. A screen written in Screenplay fills only the slots of the template it names, so in the Stage
|
|
8
|
-
* the outer template only ever draws its seed: the workspace's module navigation, bound to a `ModuleSections` query no
|
|
9
|
-
* application has, drew "Nothing here yet" beside the master/detail and squeezed it into three quarters of the page.
|
|
10
|
-
* Placing the inner template in the content slot composes only the template the screen names, at the full content width.
|
|
11
|
-
*
|
|
12
|
-
* @param templates The blueprint templates in play.
|
|
13
|
-
* @returns The same templates, with a template qualified to another template's slot fitting the shell's content slot.
|
|
14
|
-
*/
|
|
15
|
-
export declare function standaloneScreenTemplates(templates: readonly ScreenTemplate[]): ScreenTemplate[];
|