@cratis/stage.runtime 4.215.0 → 4.216.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/App.d.ts +3 -1
- package/dist/src/StageCommandForm.d.ts +3 -1
- package/dist/src/StageReferenceField.d.ts +19 -0
- package/dist/src/app.css +1 -1
- package/dist/src/blueprint.d.ts +10 -1
- package/dist/src/humanize.d.ts +18 -0
- package/dist/src/index.js +1459 -1071
- package/dist/src/navigationTree.d.ts +1 -1
- package/dist/src/readableValue.d.ts +10 -0
- package/dist/src/screenTitle.d.ts +11 -0
- package/dist/src/stageBoardSelection.d.ts +5 -0
- package/dist/src/stageComponentOutputs.d.ts +3 -1
- package/dist/src/stageFormContinuation.d.ts +12 -0
- package/dist/src/stageFormSchema.d.ts +11 -1
- package/dist/src/stageResponseContracts.d.ts +9 -0
- package/dist/src/stageScreenTables.d.ts +7 -6
- package/dist/src/stageShell.d.ts +4 -0
- package/package.json +2 -2
|
@@ -72,6 +72,6 @@ export declare function opensElsewhere(destination: DestinationReference): boole
|
|
|
72
72
|
* @param screens The scene's screens.
|
|
73
73
|
* @param listed The names of the screens an authored entry opens.
|
|
74
74
|
* @param fallback The group a screen with no recorded place goes under.
|
|
75
|
-
* @returns One entry for every unlisted screen, labelled with its
|
|
75
|
+
* @returns One entry for every unlisted screen, labelled with its title (see `screenTitle`).
|
|
76
76
|
*/
|
|
77
77
|
export declare function unlistedNavigationEntries(screens: Screen[], listed: ReadonlySet<string>, fallback: string): NavigationEntry[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value of a table cell the way a person reads it, recognised by its runtime type or its ISO format.
|
|
3
|
+
*
|
|
4
|
+
* A boolean reads Yes or No; an ISO date or date-time reads in the user's locale. Anything else - or a text that only looks like a date
|
|
5
|
+
* but is not one - is left as it is.
|
|
6
|
+
*
|
|
7
|
+
* @param value The value the row carries.
|
|
8
|
+
* @returns The text to show, or undefined when the value is not one this reads.
|
|
9
|
+
*/
|
|
10
|
+
export declare function readableValue(value: unknown): string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Screen } from '@cratis/scene.model';
|
|
2
|
+
/**
|
|
3
|
+
* What a screen is called where the application lists it - in the navigation and the breadcrumb - when the model gave it no label.
|
|
4
|
+
*
|
|
5
|
+
* Only a title at the top of the screen's body names it; a title inside a section or another element names that part, not the screen.
|
|
6
|
+
*
|
|
7
|
+
* @param screen The screen.
|
|
8
|
+
* @returns The text of the first `core:title` among the elements at the top of the screen's body (the `content` or `main` slot first),
|
|
9
|
+
* otherwise the screen's name humanized, without a trailing Screen, Page or Dialog.
|
|
10
|
+
*/
|
|
11
|
+
export declare function screenTitle(screen: Pick<Screen, 'name' | 'slotContent'>): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
/** Whether a component is a blueprint board whose query rows can be selected. */
|
|
3
|
+
export declare function isBoardComponent(name: string): boolean;
|
|
4
|
+
/** Enables the board's native selectedItem output so toolbar actions can act on its original query row. */
|
|
5
|
+
export declare function withBoardSelection(element: SceneElement): SceneElement;
|
|
@@ -7,4 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @returns The callback to hand the tree's `SceneElementView`.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useComponentOutputsPublisher(): (outputs: Record<string, Record<string, unknown>>) => void
|
|
10
|
+
export declare function useComponentOutputsPublisher(): ((outputs: Record<string, Record<string, unknown>>) => void) & {
|
|
11
|
+
readonly scope: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ExternalComponent } from '@cratis/scene.model';
|
|
2
|
+
import type { InteractionScopeValue } from '@cratis/scene.react';
|
|
3
|
+
type Completed = (messages: string[], navigated: boolean) => void;
|
|
4
|
+
type Continuation = {
|
|
5
|
+
messages: string[];
|
|
6
|
+
complete: (response: unknown, completed: Completed) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
/** Admits a form's successful-submit actions before the command can commit, then runs them in an invocation-local Scene response context. */
|
|
9
|
+
export declare function formContinuation(element: ExternalComponent, form: {
|
|
10
|
+
command: string;
|
|
11
|
+
} | undefined, scope: InteractionScopeValue | undefined): Continuation;
|
|
12
|
+
export {};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { humanize } from './humanize';
|
|
2
|
+
/** A modeled list query whose rows supply a reference key and display text; StageRoutes supplies its URL. */
|
|
3
|
+
export interface SchemaReference {
|
|
4
|
+
query: string;
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
1
8
|
/**
|
|
2
9
|
* What a command's presentation schema says about one property, in the terms a form needs: its scalar type, the
|
|
3
10
|
* values an enumeration declares, the members of a record and the element of a collection.
|
|
@@ -6,6 +13,7 @@ export interface SchemaProperty {
|
|
|
6
13
|
name: string;
|
|
7
14
|
/** The identifier concept of a uuid property (`x-concept`) - `BasketId`; what a session holds one value of. */
|
|
8
15
|
identifier?: string;
|
|
16
|
+
reference?: SchemaReference;
|
|
9
17
|
/**
|
|
10
18
|
* Whether this is the identifier the command acts on (`x-identity`) - the basket an add to basket appends to - rather than a reference to
|
|
11
19
|
* another entity, such as the product it adds. Only the schema a task dialog is built from says so.
|
|
@@ -23,13 +31,15 @@ export interface SchemaProperty {
|
|
|
23
31
|
/** Whether a date also carries a time of day. */
|
|
24
32
|
withTime?: boolean;
|
|
25
33
|
}
|
|
34
|
+
/** Whether the command creates an entity whose identity the runtime allocates, rather than acting on a selected row. */
|
|
35
|
+
export declare function createsEntity(schema: string): boolean;
|
|
26
36
|
/**
|
|
27
37
|
* The properties a command's JSON schema declares, with the type the native form gives each and whether it is required. A toolbar
|
|
28
38
|
* slice's task dialog is built from the same reading, so a command is the same fields wherever it is presented.
|
|
29
39
|
*/
|
|
30
40
|
export declare function schemaPropertiesOf(schema: string): SchemaProperty[];
|
|
31
41
|
/** Humanizes a member name the way a field label reads: `postalCode` is “Postal code”. */
|
|
32
|
-
export
|
|
42
|
+
export { humanize };
|
|
33
43
|
/**
|
|
34
44
|
* What is missing from a record or collection a form is about to submit: a member the schema requires that holds nothing.
|
|
35
45
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResponseContract, ResponseValidationContracts, ResponseValueType } from '@cratis/scene.engine';
|
|
2
|
+
/** Typed transport metadata; absence is deliberately not an untyped successful response. */
|
|
3
|
+
export interface StageResponseContracts {
|
|
4
|
+
commands: Record<string, ResponseContract | null>;
|
|
5
|
+
commandInputs: Record<string, Record<string, ResponseValueType | null>>;
|
|
6
|
+
screenInputs: Record<string, Record<string, ResponseValueType | null>>;
|
|
7
|
+
}
|
|
8
|
+
/** Adapts modeled contracts to Scene's validator without resolving or evaluating a response. */
|
|
9
|
+
export declare function stageResponseContracts(metadata?: StageResponseContracts): ResponseValidationContracts;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { SceneElement } from '@cratis/scene.model';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The row-source scopes of one screen, including tables and board card queries nested in its slots. An outlet belongs to another screen, so its children are not visited.
|
|
5
5
|
*
|
|
6
6
|
* @param element The composed screen.
|
|
7
|
-
* @returns The distinct
|
|
7
|
+
* @returns The distinct source scopes, in first-use order, matching the queries and components that publish selectable rows.
|
|
8
8
|
*/
|
|
9
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 }: {
|
|
10
|
+
/** Limits action selection and hidden form identifiers to the tables and boards of this screen, independently of other screens on the page. */
|
|
11
|
+
export declare function StageScreenTables({ element, outputScope, children }: {
|
|
12
12
|
element: SceneElement;
|
|
13
|
+
outputScope?: string;
|
|
13
14
|
children: ReactNode;
|
|
14
15
|
}): import("react").JSX.Element;
|
|
15
16
|
/** Preserves the page-wide selection of a confirmation decision and its form after leaving the list screen. */
|
|
@@ -17,8 +18,8 @@ export declare function StagePageRows({ children }: {
|
|
|
17
18
|
children: ReactNode;
|
|
18
19
|
}): import("react").JSX.Element;
|
|
19
20
|
/**
|
|
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
|
-
*
|
|
21
|
+
* The rows a person could select and has selected in this screen's tables and boards, each carrying the entity keys the command form recognizes.
|
|
22
|
+
* Only a board's card query admits a `binding:` source; unrelated bindings, `data:` declarations and other screens cannot gate an action or fill its identifier.
|
|
22
23
|
* Without a screen provider, direct consumers retain the page-wide behavior.
|
|
23
24
|
*/
|
|
24
25
|
export declare function useScreenRows(): {
|
package/dist/src/stageShell.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export interface StageShellSettings {
|
|
|
9
9
|
menuTheme?: MenuTheme;
|
|
10
10
|
/** Whether the shell draws its footer; the `showFooter` option, drawn unless it is `false`. */
|
|
11
11
|
showFooter: boolean;
|
|
12
|
+
/** Whether the shell offers the theme switcher: the `showThemeSwitcher` option, unless the profile pins a colour scheme, which leaves nothing to switch. */
|
|
13
|
+
showThemeSwitcher: boolean;
|
|
12
14
|
/** The theme the colour scheme selects, by name. */
|
|
13
15
|
themeName?: string;
|
|
14
16
|
/** The colour scheme the sidebar and the page follow. */
|
|
@@ -34,6 +36,8 @@ export declare const knownShellOptions: readonly string[];
|
|
|
34
36
|
* @returns The settings, with every option or value that could not be applied.
|
|
35
37
|
*/
|
|
36
38
|
export declare function stageShellSettings(profile: UiProfile | undefined, shell: EffectiveShell, prefersDark?: boolean): StageShellSettings;
|
|
39
|
+
/** The chrome options the settings ask of the application's composition: whether it draws its footer and offers the theme switcher. Both default to on. */
|
|
40
|
+
export declare function shellChromeOf(settings: StageShellSettings | undefined): Pick<StageShellSettings, 'showFooter' | 'showThemeSwitcher'>;
|
|
37
41
|
/**
|
|
38
42
|
* What stops an application starting with the root template its profile names: the template is unknown, its blueprint is not
|
|
39
43
|
* installed, its version pin is not satisfied or it cannot be a shell. A page that cannot be drawn in the shell it asked for
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/stage.runtime",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.216.0",
|
|
4
4
|
"description": "The Cratis Stage application runtime for Arc and Scene",
|
|
5
5
|
"author": "Cratis",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@cratis/arc": "22.146.0",
|
|
45
45
|
"@cratis/arc.react": "22.146.0",
|
|
46
|
-
"@cratis/components": "4.
|
|
46
|
+
"@cratis/components": "4.38.1",
|
|
47
47
|
"@cratis/fundamentals": "7.27.0",
|
|
48
48
|
"@cratis/scene.blueprint.default": "4.86.0",
|
|
49
49
|
"@cratis/scene.components": "4.86.0",
|