@cratis/stage.runtime 4.186.0 → 4.187.1
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/StageCommandForm.d.ts +24 -0
- package/dist/src/index.js +741 -681
- package/dist/src/stageComponentOutputs.d.ts +10 -0
- package/dist/src/stageComponents.d.ts +3 -1
- package/dist/src/stageData.d.ts +15 -4
- package/dist/src/stageDataSources.d.ts +3 -3
- package/dist/src/stageFormSchema.d.ts +5 -0
- package/dist/src/stageSession.d.ts +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `onComponentOutputsChanged` of one rendered tree - the screen, or a dialog above it.
|
|
3
|
+
*
|
|
4
|
+
* Scene keeps the outputs of each tree it renders apart and hands over all of them on every change, so a tree publishes under a scope of its own:
|
|
5
|
+
* a dialog that opens publishes beside the screen instead of over it, and when it closes only what it published goes - the row the screen had
|
|
6
|
+
* selected still resolves.
|
|
7
|
+
*
|
|
8
|
+
* @returns The callback to hand the tree's `SceneElementView`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useComponentOutputsPublisher(): (outputs: Record<string, Record<string, unknown>>) => void;
|
|
@@ -24,7 +24,9 @@ export declare function StageAction({ element, interactions, slots }: Registered
|
|
|
24
24
|
/**
|
|
25
25
|
* The task dialog of a toolbar slice button. Scene's own dialog asks for a text, a number, a switch or a date for each property of
|
|
26
26
|
* the command; a command that takes an enumeration, a record or a collection is asked through the command's own form instead - a choice, a
|
|
27
|
-
* group of fields, a list
|
|
27
|
+
* group of fields, a list. The identifier the command acts on - the shopper's basket - is not asked for: the session supplies it, or creates it on
|
|
28
|
+
* submit. A reference to another entity - the product an add to basket is for - is the person's to choose, and is asked for unless the screen's
|
|
29
|
+
* address or the session already supplies it; the form then submits what was not asked by the same rule.
|
|
28
30
|
*/
|
|
29
31
|
export declare function StageSliceDialog(props: Partial<RegisteredProps>): import("react").JSX.Element;
|
|
30
32
|
/**
|
package/dist/src/stageData.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { BindingExpression } from '@cratis/scene.model';
|
|
3
3
|
import type { StageRoutes } from './stageRoutes';
|
|
4
|
-
/** Where a session keeps the identity it acts as, one per identifier concept. */
|
|
5
|
-
export declare const sessionIdentifierPrefix = "stage.session.";
|
|
6
4
|
interface QueryState {
|
|
7
5
|
name?: string;
|
|
8
6
|
/** The read model's name, under which the rows are published to the binding scope as well - where a summary looks them up. */
|
|
@@ -43,7 +41,14 @@ export interface StageDataState {
|
|
|
43
41
|
screen: string;
|
|
44
42
|
routes: StageRoutes | undefined;
|
|
45
43
|
routesReady: boolean;
|
|
44
|
+
/** The parameters the screen's address carries - and nothing else. */
|
|
46
45
|
parameters: Record<string, string>;
|
|
46
|
+
/**
|
|
47
|
+
* The identities the session acts as, by the name a screen parameter gives them (`basketId`). They are not the screen's parameters: only
|
|
48
|
+
* what reads the session on purpose does - a form populating the identity it does not show, the key a `data` declaration is read by
|
|
49
|
+
* when the address does not carry it (`screen.keys.<name>` in a binding), and the query bindings the session narrows.
|
|
50
|
+
*/
|
|
51
|
+
session: Record<string, string>;
|
|
47
52
|
queries: Record<string, QueryState>;
|
|
48
53
|
selected: Record<string, unknown> | undefined;
|
|
49
54
|
selections: Record<string, Record<string, unknown> | undefined>;
|
|
@@ -51,8 +56,14 @@ export interface StageDataState {
|
|
|
51
56
|
clearSelection: (scope: string) => void;
|
|
52
57
|
setState: (key: string, value: unknown) => void;
|
|
53
58
|
setComponentOutput: (componentId: string, path: string, value: unknown) => void;
|
|
54
|
-
/**
|
|
55
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Takes what the components of one rendered tree publish (a list's selected row, a search box's text) so bindings and interactions elsewhere
|
|
61
|
+
* on the page read it. The screen and a dialog above it are each a tree of their own, so each publishes under its own scope and replaces only
|
|
62
|
+
* what it published before; see `useComponentOutputsPublisher`.
|
|
63
|
+
*/
|
|
64
|
+
publishComponentOutputs: (scope: string, outputs: Record<string, Record<string, unknown>>) => void;
|
|
65
|
+
/** Forgets what a rendered tree published, once it is gone - a closed dialog - leaving what every other tree published. */
|
|
66
|
+
withdrawComponentOutputs: (scope: string) => void;
|
|
56
67
|
/** The rows of every query the page has read, by scope and by query name - what a `queryResult` binding resolves against. */
|
|
57
68
|
queryResults: Record<string, unknown>;
|
|
58
69
|
refreshQuery: (query?: string) => void;
|
|
@@ -7,9 +7,9 @@ export declare const dataComponent = "core:data";
|
|
|
7
7
|
* A screen declares its data once - `data CommentsForWorkItem by workItemId` - and the table that follows it in
|
|
8
8
|
* the same section, or any section nested after it, shows that read model. The table itself only names the read
|
|
9
9
|
* model type, so without this it would read the unfiltered collection: every comment of every work item. This
|
|
10
|
-
* carries the declaration's query and its `by` parameter onto the table, bound to the screen
|
|
11
|
-
*
|
|
12
|
-
* no value.
|
|
10
|
+
* carries the declaration's query and its `by` parameter onto the table, bound to the screen's key of the same
|
|
11
|
+
* name - the address's parameter, or the session's identity of that name - so the table reads only what the
|
|
12
|
+
* declaration asked for and reads nothing while that key has no value.
|
|
13
13
|
*
|
|
14
14
|
* @param element The composed screen.
|
|
15
15
|
* @returns The screen with every fed table bound to its declaration.
|
|
@@ -6,6 +6,11 @@ export interface SchemaProperty {
|
|
|
6
6
|
name: string;
|
|
7
7
|
/** The identifier concept of a uuid property (`x-concept`) - `BasketId`; what a session holds one value of. */
|
|
8
8
|
identifier?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 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
|
+
* another entity, such as the product it adds. Only the schema a task dialog is built from says so.
|
|
12
|
+
*/
|
|
13
|
+
identity?: boolean;
|
|
9
14
|
type?: 'text' | 'number' | 'boolean' | 'date';
|
|
10
15
|
required: boolean;
|
|
11
16
|
unsupportedReason?: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Where a session keeps the identity it acts as, one per identifier concept. */
|
|
2
|
+
export declare const sessionIdentifierPrefix = "stage.session.";
|
|
3
|
+
/**
|
|
4
|
+
* The identity the session already holds for an identifier concept - the shopper's basket - without creating one.
|
|
5
|
+
*
|
|
6
|
+
* @param concept The identifier concept, as the command's schema names it: `BasketId`.
|
|
7
|
+
* @returns The identity, or nothing when the session holds none or storage is refused.
|
|
8
|
+
*/
|
|
9
|
+
export declare function heldSessionIdentity(concept: string): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The identity the session acts as for an identifier concept: the one it holds, or a new one it keeps from now on - the same basket for
|
|
12
|
+
* every add, change and checkout in this browser, a different one in another.
|
|
13
|
+
*
|
|
14
|
+
* @param concept The identifier concept, as the command's schema names it: `BasketId`.
|
|
15
|
+
* @returns The identity.
|
|
16
|
+
*/
|
|
17
|
+
export declare function sessionIdentity(concept: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Every identity the session holds, by the name a screen parameter gives it: `stage.session.BasketId` is `basketId`. These are not the
|
|
20
|
+
* screen's parameters - only what reads the session on purpose (a form's hidden identifiers, a `data` declaration the address does not key)
|
|
21
|
+
* reads them.
|
|
22
|
+
*
|
|
23
|
+
* @returns The identities, by parameter name.
|
|
24
|
+
*/
|
|
25
|
+
export declare function sessionIdentities(): Record<string, string>;
|