@cratis/event-models 0.313.0 → 0.315.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
- * and the shape to read model mappings that go with it. It is the `sampleData` of Scene's `UiProfile`.
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,10 +1,18 @@
1
1
  {
2
2
  "name": "@cratis/event-models",
3
- "version": "0.313.0",
3
+ "version": "0.315.0",
4
4
  "description": "The Cratis event model board as a configurable React component.",
5
5
  "license": "MIT",
6
6
  "author": "Cratis",
7
7
  "homepage": "https://www.cratis.io",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Cratis/Studio.git",
11
+ "directory": "Source/EventModels"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/Cratis/StudioIssues/issues"
15
+ },
8
16
  "type": "module",
9
17
  "main": "./dist/index.js",
10
18
  "types": "./dist/index.d.ts",
@@ -58,7 +66,7 @@
58
66
  "build": "yarn g:build && yarn run -T tsc -p .frontend/tsconfig.build.json && cp Model/event-model-document.schema.json Theme/theme.css dist/ && rm -f dist/.tsbuildinfo && node ../../scripts/package-build/strip-declaration-stylesheets.mjs dist && yarn build:screen-editor",
59
67
  "build:screen-editor": "yarn run -T vite build --config .frontend/vite.screen-editor.config.ts && yarn run -T tsc -p .frontend/tsconfig.screen-editor.build.json && rm -f dist/screen-editor/.tsbuildinfo && node ../../scripts/package-build/strip-declaration-stylesheets.mjs dist/screen-editor",
60
68
  "guard:boundary": "node ../../scripts/package-guards/boundary-report.mjs --package Source/EventModels --allow eventModels --entry index.ts",
61
- "guard:tarball": "node ../../scripts/package-guards/tarball-guard.mjs --package Source/EventModels --budget 3200000 --must-import @primereact/core/config",
69
+ "guard:tarball": "node ../../scripts/package-guards/tarball-guard.mjs --package Source/EventModels --budget 3300000 --must-import @primereact/core/config",
62
70
  "guard:self-test": "node ../../scripts/package-guards/tarball-guard.mjs --self-test && node ../../scripts/package-guards/boundary-report.mjs --self-test",
63
71
  "guard:screen-editor-boundary": "node ../../scripts/package-guards/boundary-report.mjs --package Source/Editor --allow screenEditor --entry ScreenEditor/index.ts",
64
72
  "guard:peer-floor": "node ../../scripts/package-guards/peer-floor-guard.mjs --self-test && node ../../scripts/package-guards/peer-floor-guard.mjs --package-json package.json --peer @primereact/styles --source ../Editor/ScreenEditor/Host/screenEditorPrimeReactDefaults.ts",
@@ -68,7 +76,7 @@
68
76
  "peerDependencies": {
69
77
  "@cratis/components": "^4.35.0",
70
78
  "@cratis/fundamentals": "^7.22.0",
71
- "@cratis/scene": "^0.313.0",
79
+ "@cratis/scene": "^0.315.0",
72
80
  "@cratis/scene.blueprint.approvals": "^4.12.0",
73
81
  "@cratis/scene.blueprint.bookings": "^4.12.0",
74
82
  "@cratis/scene.blueprint.catalog": "^4.12.0",
@@ -104,7 +112,7 @@
104
112
  "devDependencies": {
105
113
  "@cratis/components": "^4.38.0",
106
114
  "@cratis/fundamentals": "^7.27.0",
107
- "@cratis/scene": "0.313.0",
115
+ "@cratis/scene": "0.315.0",
108
116
  "@cratis/scene.blueprint.approvals": "4.80.2",
109
117
  "@cratis/scene.blueprint.bookings": "4.80.2",
110
118
  "@cratis/scene.blueprint.catalog": "4.80.2",