@cratis/event-models 0.313.0 → 0.314.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.
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import type { SampleDataMapping } from '@cratis/scene.model';
|
|
1
|
+
import type { SampleDataBinding, SampleDataMapping } from '@cratis/scene.model';
|
|
2
2
|
/**
|
|
3
3
|
* The sample data an application uses, chosen once in the UI Profile setup and inherited everywhere: the active pack,
|
|
4
|
-
*
|
|
4
|
+
* the shape to read model mappings that go with it and the read models bound to a pack of their own. It is the `sampleData` of Scene's `UiProfile`.
|
|
5
5
|
*/
|
|
6
6
|
export interface SampleDataSelectionSettings {
|
|
7
7
|
/** The active pack's identifier - an own pack or a blueprint's - or empty for the generated data. */
|
|
8
8
|
activePack: string;
|
|
9
9
|
/** The shapes the pack names that stand in for a read model of another name. */
|
|
10
10
|
mappings: SampleDataMapping[];
|
|
11
|
+
/** The read models bound to a pack of their own, which overrides the active pack for that read model. */
|
|
12
|
+
bindings: SampleDataBinding[];
|
|
11
13
|
}
|
|
12
14
|
/** No pack chosen, no mappings: the generated, deterministic data. */
|
|
13
15
|
export declare const noSampleData: SampleDataSelectionSettings;
|
|
@@ -13,12 +13,12 @@ export declare const sampleDataOf: (settings: Pick<UiProfileSettings, 'sampleDat
|
|
|
13
13
|
*
|
|
14
14
|
* @param left The first choice.
|
|
15
15
|
* @param right The second choice.
|
|
16
|
-
* @returns `true` when the same pack is active with the same mappings, whatever their order.
|
|
16
|
+
* @returns `true` when the same pack is active with the same mappings and bindings, whatever their order.
|
|
17
17
|
*/
|
|
18
18
|
export declare const areSampleDataEqual: (left: SampleDataSelectionSettings, right: SampleDataSelectionSettings) => boolean;
|
|
19
19
|
/**
|
|
20
20
|
* The Scene `sampleData` of a profile for a choice: what Stage, the CLI and the screen editor read to resolve the data, so Studio
|
|
21
|
-
* keeps no separate notion of it. Nothing is returned for the generated data with no mappings - the profile then has no `sampleData`
|
|
21
|
+
* keeps no separate notion of it. Nothing is returned for the generated data with no mappings or bindings - the profile then has no `sampleData`
|
|
22
22
|
* at all, as one declared without it has.
|
|
23
23
|
*
|
|
24
24
|
* @param selection The choice.
|
|
@@ -10037,10 +10037,10 @@ function Fy(e) {
|
|
|
10037
10037
|
n.name
|
|
10038
10038
|
] : [...r, ...t];
|
|
10039
10039
|
}
|
|
10040
|
-
var Ws = (e) => e === void 0 || e.activePack === "" && e.mappings.length === 0 ? void 0 : {
|
|
10040
|
+
var Ws = (e) => e === void 0 || e.activePack === "" && e.mappings.length === 0 && (e.bindings ?? []).length === 0 ? void 0 : {
|
|
10041
10041
|
...e.activePack === "" ? {} : { activePack: e.activePack },
|
|
10042
10042
|
mappings: e.mappings.map((t) => ({ ...t })),
|
|
10043
|
-
bindings: []
|
|
10043
|
+
bindings: (e.bindings ?? []).map((t) => ({ ...t }))
|
|
10044
10044
|
};
|
|
10045
10045
|
function My(e, t) {
|
|
10046
10046
|
return t.filter((n) => Rl(n, e));
|
|
@@ -10202,7 +10202,8 @@ function Gy(e, t, n) {
|
|
|
10202
10202
|
defaultScreenTemplate: e.defaultScreenTemplate,
|
|
10203
10203
|
...t ? { sampleData: {
|
|
10204
10204
|
activePack: t.activePack,
|
|
10205
|
-
mappings: t.mappings.map((a) => ({ ...a }))
|
|
10205
|
+
mappings: t.mappings.map((a) => ({ ...a })),
|
|
10206
|
+
bindings: (t.bindings ?? []).map((a) => ({ ...a }))
|
|
10206
10207
|
} } : {}
|
|
10207
10208
|
};
|
|
10208
10209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/event-models",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.314.0",
|
|
4
4
|
"description": "The Cratis event model board as a configurable React component.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Cratis",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@cratis/components": "^4.35.0",
|
|
70
70
|
"@cratis/fundamentals": "^7.22.0",
|
|
71
|
-
"@cratis/scene": "^0.
|
|
71
|
+
"@cratis/scene": "^0.314.0",
|
|
72
72
|
"@cratis/scene.blueprint.approvals": "^4.12.0",
|
|
73
73
|
"@cratis/scene.blueprint.bookings": "^4.12.0",
|
|
74
74
|
"@cratis/scene.blueprint.catalog": "^4.12.0",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@cratis/components": "^4.38.0",
|
|
106
106
|
"@cratis/fundamentals": "^7.27.0",
|
|
107
|
-
"@cratis/scene": "0.
|
|
107
|
+
"@cratis/scene": "0.314.0",
|
|
108
108
|
"@cratis/scene.blueprint.approvals": "4.80.2",
|
|
109
109
|
"@cratis/scene.blueprint.bookings": "4.80.2",
|
|
110
110
|
"@cratis/scene.blueprint.catalog": "4.80.2",
|