@cratis/stage.runtime 4.187.3 → 4.188.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/index.js +115 -89
- package/dist/src/withoutSeededSlots.d.ts +15 -0
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -8,16 +8,16 @@ import "@cratis/scene.blueprint.default/styles.css";
|
|
|
8
8
|
import { Globals as Te } from "@cratis/arc";
|
|
9
9
|
import { ServerSentEventQueryConnection as Ee } from "@cratis/arc/queries";
|
|
10
10
|
import { Fragment as De, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
11
|
-
import { Button as
|
|
12
|
-
import { PrimeDialog as
|
|
13
|
-
import { ArcContext as
|
|
14
|
-
import { Command as
|
|
15
|
-
import { resolveCommand as
|
|
16
|
-
import { CommandForm as
|
|
17
|
-
import { CalendarField as
|
|
18
|
-
import
|
|
11
|
+
import { Button as I } from "primereact/button";
|
|
12
|
+
import { PrimeDialog as Oe, PrimeMessage as ke, primeReactComponents as Ae, primeReactPackageManifest as je } from "@cratis/scene.primereact";
|
|
13
|
+
import { ArcContext as Me } from "@cratis/arc.react";
|
|
14
|
+
import { Command as Ne } from "@cratis/arc/commands";
|
|
15
|
+
import { resolveCommand as Pe } from "@cratis/scene.components";
|
|
16
|
+
import { CommandForm as Fe, asCommandFormField as Ie } from "@cratis/arc.react/commands";
|
|
17
|
+
import { CalendarField as Le, CheckboxField as Re, DropdownField as ze, InputTextField as Be, NumberField as Ve } from "@cratis/components/CommandForm";
|
|
18
|
+
import He from "@primeuix/themes/lara";
|
|
19
19
|
//#region src/stageSource.ts
|
|
20
|
-
function
|
|
20
|
+
function Ue(e) {
|
|
21
21
|
return {
|
|
22
22
|
scene: async () => e.scene,
|
|
23
23
|
routes: async () => e.routes,
|
|
@@ -25,23 +25,23 @@ function We(e) {
|
|
|
25
25
|
strings: async (t) => e.strings[t] ?? {}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var We = {
|
|
29
29
|
scene: "stage/scene",
|
|
30
30
|
routes: "stage/routes",
|
|
31
31
|
locales: "stage/locales",
|
|
32
32
|
strings: (e) => `stage/strings/${encodeURIComponent(e)}`
|
|
33
|
-
},
|
|
34
|
-
function
|
|
35
|
-
return t(
|
|
33
|
+
}, Ge = e(void 0);
|
|
34
|
+
function Ke({ source: e, children: n }) {
|
|
35
|
+
return t(Ge.Provider, { value: e }, n);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let e = r(
|
|
37
|
+
function L() {
|
|
38
|
+
let e = r(Ge);
|
|
39
39
|
if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
|
|
40
40
|
return e;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
let e =
|
|
42
|
+
We.routes;
|
|
43
|
+
function qe() {
|
|
44
|
+
let e = L(), [t, n] = c({
|
|
45
45
|
routes: void 0,
|
|
46
46
|
ready: !1
|
|
47
47
|
});
|
|
@@ -60,35 +60,35 @@ function Je() {
|
|
|
60
60
|
}), () => t.abort();
|
|
61
61
|
}, [e]), t;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
63
|
+
function Je(e) {
|
|
64
|
+
if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
66
|
+
var Ye = "STAGE-SCENE-ACTION-001", Xe = "item.";
|
|
67
|
+
function R(e) {
|
|
68
68
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Ze(e, t) {
|
|
71
71
|
let n = e;
|
|
72
72
|
for (let e of t.split(".").filter(Boolean)) {
|
|
73
|
-
if (!
|
|
73
|
+
if (!R(n)) return;
|
|
74
74
|
n = n[e];
|
|
75
75
|
}
|
|
76
76
|
return n;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Qe(e) {
|
|
79
79
|
return e === null || [
|
|
80
80
|
"string",
|
|
81
81
|
"number",
|
|
82
82
|
"boolean"
|
|
83
83
|
].includes(typeof e);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function $e(e, t) {
|
|
86
86
|
if (typeof e == "number") return t[e];
|
|
87
87
|
if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function et(e, t, n, r) {
|
|
90
90
|
if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
|
|
91
|
-
let i =
|
|
91
|
+
let i = $e(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
|
|
92
92
|
return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
|
|
93
93
|
}
|
|
94
94
|
switch (t) {
|
|
@@ -103,28 +103,28 @@ function tt(e, t, n, r) {
|
|
|
103
103
|
default: return;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
if (
|
|
106
|
+
function tt(e, t) {
|
|
107
|
+
if (R(e)) {
|
|
108
108
|
if (e.kind === "comparison") {
|
|
109
|
-
let n =
|
|
110
|
-
if (typeof n != "string" || !n.startsWith(
|
|
109
|
+
let n = Je(e.left);
|
|
110
|
+
if (typeof n != "string" || !n.startsWith(Xe) || typeof e.operator != "string" || !Qe(e.right)) return;
|
|
111
111
|
let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
|
|
112
|
-
return
|
|
112
|
+
return et(Ze(t, n.slice(5)), e.operator, e.right, r);
|
|
113
113
|
}
|
|
114
114
|
if (e.kind === "logical") {
|
|
115
|
-
let n =
|
|
115
|
+
let n = tt(e.left, t), r = tt(e.right, t);
|
|
116
116
|
return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
function nt(e) {
|
|
121
|
-
return e.every((e) =>
|
|
121
|
+
return e.every((e) => tt(e, {}) !== void 0);
|
|
122
122
|
}
|
|
123
123
|
function rt(e, t) {
|
|
124
|
-
if (nt(e)) return e.findIndex((e) =>
|
|
124
|
+
if (nt(e)) return e.findIndex((e) => tt(e, t) === !0);
|
|
125
125
|
}
|
|
126
126
|
function it(e, t) {
|
|
127
|
-
if (!
|
|
127
|
+
if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
|
|
128
128
|
let n = rt(e.alternatives, t);
|
|
129
129
|
if (n !== void 0) {
|
|
130
130
|
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
@@ -132,7 +132,7 @@ function it(e, t) {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
function at(e, t) {
|
|
135
|
-
if (e.startsWith(
|
|
135
|
+
if (e.startsWith(Xe) && R(t)) return Ze(t, e.slice(5));
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region src/stageSession.ts
|
|
@@ -573,12 +573,12 @@ function U(e, t, n) {
|
|
|
573
573
|
e
|
|
574
574
|
]) {
|
|
575
575
|
if (!r) continue;
|
|
576
|
-
let t =
|
|
576
|
+
let t = Pe(r);
|
|
577
577
|
if (Mt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
function Mt(e) {
|
|
581
|
-
return typeof e == "function" && e.prototype instanceof
|
|
581
|
+
return typeof e == "function" && e.prototype instanceof Ne;
|
|
582
582
|
}
|
|
583
583
|
function Nt() {
|
|
584
584
|
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
@@ -621,7 +621,7 @@ function It(e, t) {
|
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
623
|
function Lt() {
|
|
624
|
-
let e = r(
|
|
624
|
+
let e = r(Me);
|
|
625
625
|
return n((t, n) => Ft(t, n, e), [e]);
|
|
626
626
|
}
|
|
627
627
|
//#endregion
|
|
@@ -735,7 +735,7 @@ function Xt(e) {
|
|
|
735
735
|
}
|
|
736
736
|
//#endregion
|
|
737
737
|
//#region src/StageValueFields.tsx
|
|
738
|
-
var Zt =
|
|
738
|
+
var Zt = Ie((e) => /* @__PURE__ */ P(Qt, {
|
|
739
739
|
descriptor: e.descriptor,
|
|
740
740
|
label: e.title ?? G(e.descriptor.name),
|
|
741
741
|
value: e.value,
|
|
@@ -894,7 +894,7 @@ function an(e) {
|
|
|
894
894
|
//#region src/StageCommandForm.tsx
|
|
895
895
|
var on = e(void 0);
|
|
896
896
|
function sn({ element: e }) {
|
|
897
|
-
let t = z(), n = r(
|
|
897
|
+
let t = z(), n = r(Me), i = r(on), a = o(() => ln(e), [e]), s = o(() => jn(e), [e]), l = typeof e.properties.schema == "string", u = o(() => a ? un(a, s) : [], [a, s]), d = a ? U(a.command, q(e, "typeName"), q(e, "route")) : void 0, f = bn(e, u, t.resolveArgument), p = vn(e, s, t), m = JSON.stringify(p ?? null), h = o(() => p, [m]), g = o(() => ({
|
|
898
898
|
...h,
|
|
899
899
|
...mn(u, s, t.parameters),
|
|
900
900
|
...pn(u, t.parameters)
|
|
@@ -929,7 +929,7 @@ function sn({ element: e }) {
|
|
|
929
929
|
className: "stage-command-form",
|
|
930
930
|
"data-command": a.command,
|
|
931
931
|
"data-generation-mode": a.generationMode,
|
|
932
|
-
children: /* @__PURE__ */ F(
|
|
932
|
+
children: /* @__PURE__ */ F(Fe, {
|
|
933
933
|
command: d,
|
|
934
934
|
initialValues: g,
|
|
935
935
|
currentValues: f,
|
|
@@ -1029,7 +1029,7 @@ function fn(e, t, n) {
|
|
|
1029
1029
|
value: e,
|
|
1030
1030
|
label: G(e)
|
|
1031
1031
|
}));
|
|
1032
|
-
return /* @__PURE__ */ P(
|
|
1032
|
+
return /* @__PURE__ */ P(ze, {
|
|
1033
1033
|
value: o,
|
|
1034
1034
|
fieldName: r,
|
|
1035
1035
|
title: a,
|
|
@@ -1047,26 +1047,26 @@ function fn(e, t, n) {
|
|
|
1047
1047
|
descriptor: i
|
|
1048
1048
|
});
|
|
1049
1049
|
switch (i?.type ?? "text") {
|
|
1050
|
-
case "number": return /* @__PURE__ */ P(
|
|
1050
|
+
case "number": return /* @__PURE__ */ P(Ve, {
|
|
1051
1051
|
value: o,
|
|
1052
1052
|
fieldName: r,
|
|
1053
1053
|
title: a,
|
|
1054
1054
|
required: s
|
|
1055
1055
|
});
|
|
1056
|
-
case "boolean": return /* @__PURE__ */ P(
|
|
1056
|
+
case "boolean": return /* @__PURE__ */ P(Re, {
|
|
1057
1057
|
value: o,
|
|
1058
1058
|
fieldName: r,
|
|
1059
1059
|
label: a,
|
|
1060
1060
|
required: s
|
|
1061
1061
|
});
|
|
1062
|
-
case "date": return /* @__PURE__ */ P(
|
|
1062
|
+
case "date": return /* @__PURE__ */ P(Le, {
|
|
1063
1063
|
value: o,
|
|
1064
1064
|
fieldName: r,
|
|
1065
1065
|
title: a,
|
|
1066
1066
|
required: s,
|
|
1067
1067
|
showIcon: !0
|
|
1068
1068
|
});
|
|
1069
|
-
default: return /* @__PURE__ */ P(
|
|
1069
|
+
default: return /* @__PURE__ */ P(Be, {
|
|
1070
1070
|
value: o,
|
|
1071
1071
|
fieldName: r,
|
|
1072
1072
|
title: a,
|
|
@@ -1258,16 +1258,16 @@ function Ln(e) {
|
|
|
1258
1258
|
};
|
|
1259
1259
|
}
|
|
1260
1260
|
function Rn(e, t) {
|
|
1261
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(
|
|
1261
|
+
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(Je(n) ?? "", t)]));
|
|
1262
1262
|
}
|
|
1263
1263
|
function zn({ element: e, interactions: t }) {
|
|
1264
1264
|
let n = z(), r = Ln(e), i = Lt(), [a, s] = c([]), [l, u] = c(!1), d = Y(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Fn(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1265
1265
|
if (!nt(m) || !h || !r.hasSource) {
|
|
1266
|
-
let n = r.hasSource ? `${
|
|
1266
|
+
let n = r.hasSource ? `${Ye}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Ye}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1267
1267
|
return /* @__PURE__ */ F("div", {
|
|
1268
1268
|
className: "stage-guarded-action",
|
|
1269
1269
|
"data-scene-id": e.id,
|
|
1270
|
-
children: [/* @__PURE__ */ P(
|
|
1270
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1271
1271
|
type: "button",
|
|
1272
1272
|
disabled: !0,
|
|
1273
1273
|
title: n,
|
|
@@ -1296,7 +1296,7 @@ function zn({ element: e, interactions: t }) {
|
|
|
1296
1296
|
className: "stage-guarded-action",
|
|
1297
1297
|
"data-scene-id": e.id,
|
|
1298
1298
|
"data-command": v,
|
|
1299
|
-
children: [/* @__PURE__ */ P(
|
|
1299
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1300
1300
|
...t,
|
|
1301
1301
|
type: "button",
|
|
1302
1302
|
disabled: !y || l,
|
|
@@ -1440,21 +1440,21 @@ function Wn({ element: e, slots: t }) {
|
|
|
1440
1440
|
className: "stage-table",
|
|
1441
1441
|
"data-scene-id": e.id,
|
|
1442
1442
|
children: [
|
|
1443
|
-
u && /* @__PURE__ */ P(
|
|
1443
|
+
u && /* @__PURE__ */ P(ke, {
|
|
1444
1444
|
element: X(`${e.id}-loading`, {
|
|
1445
1445
|
severity: "info",
|
|
1446
1446
|
text: "Loading…"
|
|
1447
1447
|
}),
|
|
1448
1448
|
slots: {}
|
|
1449
1449
|
}),
|
|
1450
|
-
l && /* @__PURE__ */ P(
|
|
1450
|
+
l && /* @__PURE__ */ P(ke, {
|
|
1451
1451
|
element: X(`${e.id}-error`, {
|
|
1452
1452
|
severity: "error",
|
|
1453
1453
|
text: l
|
|
1454
1454
|
}),
|
|
1455
1455
|
slots: {}
|
|
1456
1456
|
}),
|
|
1457
|
-
h && /* @__PURE__ */ P(
|
|
1457
|
+
h && /* @__PURE__ */ P(I, {
|
|
1458
1458
|
type: "button",
|
|
1459
1459
|
size: "small",
|
|
1460
1460
|
onClick: () => {
|
|
@@ -1518,7 +1518,7 @@ function Jn({ element: e, interactions: t }) {
|
|
|
1518
1518
|
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(Yn, {
|
|
1519
1519
|
element: e,
|
|
1520
1520
|
label: n
|
|
1521
|
-
}) : /* @__PURE__ */ P(
|
|
1521
|
+
}) : /* @__PURE__ */ P(I, {
|
|
1522
1522
|
type: "button",
|
|
1523
1523
|
"data-scene-id": e.id,
|
|
1524
1524
|
disabled: !0,
|
|
@@ -1535,7 +1535,7 @@ function Yn({ element: e, label: t }) {
|
|
|
1535
1535
|
return /* @__PURE__ */ P("div", {
|
|
1536
1536
|
className: "stage-action",
|
|
1537
1537
|
"data-scene-id": e.id,
|
|
1538
|
-
children: /* @__PURE__ */ P(
|
|
1538
|
+
children: /* @__PURE__ */ P(Oe, {
|
|
1539
1539
|
element: X(e.id, {
|
|
1540
1540
|
visible: !1,
|
|
1541
1541
|
header: t,
|
|
@@ -1621,7 +1621,7 @@ var Qn = {
|
|
|
1621
1621
|
//#endregion
|
|
1622
1622
|
//#region src/useStrings.ts
|
|
1623
1623
|
function $n() {
|
|
1624
|
-
let e =
|
|
1624
|
+
let e = L(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
|
|
1625
1625
|
return i(() => {
|
|
1626
1626
|
let t = new AbortController();
|
|
1627
1627
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1849,12 +1849,12 @@ function _r(e) {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
var vr = {
|
|
1851
1851
|
...fe,
|
|
1852
|
-
PrimeReact:
|
|
1852
|
+
PrimeReact: je.components
|
|
1853
1853
|
};
|
|
1854
1854
|
function yr(e) {
|
|
1855
1855
|
return {
|
|
1856
1856
|
...E,
|
|
1857
|
-
...
|
|
1857
|
+
...Ae,
|
|
1858
1858
|
...me,
|
|
1859
1859
|
...Se,
|
|
1860
1860
|
...e
|
|
@@ -2205,15 +2205,33 @@ function Zr(e, t, n) {
|
|
|
2205
2205
|
} };
|
|
2206
2206
|
}
|
|
2207
2207
|
//#endregion
|
|
2208
|
+
//#region src/withoutSeededSlots.ts
|
|
2209
|
+
function Qr(e, t) {
|
|
2210
|
+
let n = /* @__PURE__ */ new Map();
|
|
2211
|
+
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2212
|
+
return e.map((e) => {
|
|
2213
|
+
let t = e.screenTemplate === void 0 ? void 0 : n.get(e.screenTemplate);
|
|
2214
|
+
if (t === void 0 || !t.some((t) => e.slotContent[t] !== void 0)) return e;
|
|
2215
|
+
let r = t.filter((t) => e.slotContent[t] === void 0);
|
|
2216
|
+
return r.length === 0 ? e : {
|
|
2217
|
+
...e,
|
|
2218
|
+
slotContent: {
|
|
2219
|
+
...e.slotContent,
|
|
2220
|
+
...Object.fromEntries(r.map((e) => [e, []]))
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
//#endregion
|
|
2208
2226
|
//#region src/App.tsx
|
|
2209
|
-
function
|
|
2227
|
+
function $r(e = {}) {
|
|
2210
2228
|
return yr({
|
|
2211
2229
|
...e,
|
|
2212
2230
|
...Qn,
|
|
2213
2231
|
...Fr
|
|
2214
2232
|
});
|
|
2215
2233
|
}
|
|
2216
|
-
function
|
|
2234
|
+
function ei(e, t) {
|
|
2217
2235
|
return N(`form-${e}-${t.name}`, Vn, {
|
|
2218
2236
|
command: t.forCommand,
|
|
2219
2237
|
label: t.name,
|
|
@@ -2222,14 +2240,14 @@ function $r(e, t) {
|
|
|
2222
2240
|
fields: t.fields
|
|
2223
2241
|
});
|
|
2224
2242
|
}
|
|
2225
|
-
function
|
|
2243
|
+
function ti(e, t) {
|
|
2226
2244
|
let n = e.screens[0];
|
|
2227
2245
|
return _e(e, n, {
|
|
2228
2246
|
profile: _r(e.uiProfiles),
|
|
2229
2247
|
blueprintTemplates: t?.length ? [...ve, ...t] : void 0
|
|
2230
2248
|
});
|
|
2231
2249
|
}
|
|
2232
|
-
function
|
|
2250
|
+
function ni(e, t, n, r, i, a, o = !0) {
|
|
2233
2251
|
let s = Gr(e.navigation), c = e.navigation?.application.logo ? {
|
|
2234
2252
|
title: e.navigation.application.logo.title,
|
|
2235
2253
|
image: e.navigation.application.logo.image || void 0
|
|
@@ -2239,7 +2257,7 @@ function ti(e, t, n, r, i, a, o = !0) {
|
|
|
2239
2257
|
catalog: br(r),
|
|
2240
2258
|
blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
|
|
2241
2259
|
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Cr(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Cr(e.screens, r.name, t, n, c, s, o),
|
|
2242
|
-
form:
|
|
2260
|
+
form: ei,
|
|
2243
2261
|
trailing: [N("activity", Dr)],
|
|
2244
2262
|
decorate: (e) => {
|
|
2245
2263
|
let t = tr(e);
|
|
@@ -2247,18 +2265,18 @@ function ti(e, t, n, r, i, a, o = !0) {
|
|
|
2247
2265
|
}
|
|
2248
2266
|
};
|
|
2249
2267
|
}
|
|
2250
|
-
function
|
|
2251
|
-
return pe(e, t,
|
|
2268
|
+
function ri(e, t, n, r, i, a) {
|
|
2269
|
+
return pe(e, t, ni(e, n, r, i, void 0, a)).element;
|
|
2252
2270
|
}
|
|
2253
|
-
function
|
|
2271
|
+
function ii() {
|
|
2254
2272
|
try {
|
|
2255
2273
|
return globalThis.localStorage ?? null;
|
|
2256
2274
|
} catch {
|
|
2257
2275
|
return null;
|
|
2258
2276
|
}
|
|
2259
2277
|
}
|
|
2260
|
-
function
|
|
2261
|
-
let s =
|
|
2278
|
+
function ai({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
|
|
2279
|
+
let s = L(), l = o(() => $r(e), [e]), [u, d] = c(), [f, p] = c(""), m = qe(), h = $n();
|
|
2262
2280
|
return i(() => {
|
|
2263
2281
|
let e = new AbortController();
|
|
2264
2282
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2270,7 +2288,7 @@ function ii({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2270
2288
|
}, [s, r]), f ? /* @__PURE__ */ F("main", {
|
|
2271
2289
|
className: "stage-message",
|
|
2272
2290
|
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
2273
|
-
}) : u ? /* @__PURE__ */ P(
|
|
2291
|
+
}) : u ? /* @__PURE__ */ P(oi, {
|
|
2274
2292
|
scene: u,
|
|
2275
2293
|
registry: l,
|
|
2276
2294
|
routeState: m,
|
|
@@ -2283,8 +2301,8 @@ function ii({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2283
2301
|
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
2284
2302
|
});
|
|
2285
2303
|
}
|
|
2286
|
-
function
|
|
2287
|
-
let u = o(() => D(), []), [d, f] = c(Ur), p = e.screens[0]?.name ?? "", m = o(() => _r(e.uiProfiles), [e]), h = o(() => p ?
|
|
2304
|
+
function oi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
|
|
2305
|
+
let u = o(() => D(), []), [d, f] = c(Ur), p = e.screens[0]?.name ?? "", m = o(() => _r(e.uiProfiles), [e]), h = o(() => p ? ti(e, s) : void 0, [
|
|
2288
2306
|
e,
|
|
2289
2307
|
s,
|
|
2290
2308
|
p
|
|
@@ -2292,7 +2310,7 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2292
2310
|
m,
|
|
2293
2311
|
h,
|
|
2294
2312
|
d
|
|
2295
|
-
]), v = o(() => Vr(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() =>
|
|
2313
|
+
]), v = o(() => Vr(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => ni(e, i.locales, i.locale, a, i.dictionary, s, y), [
|
|
2296
2314
|
e,
|
|
2297
2315
|
i.locales,
|
|
2298
2316
|
i.locale,
|
|
@@ -2300,7 +2318,15 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2300
2318
|
a,
|
|
2301
2319
|
s,
|
|
2302
2320
|
y
|
|
2303
|
-
]), x = n((e) => f(e), []), S = o(() => Jr(e, l), [e, l]), C =
|
|
2321
|
+
]), x = n((e) => f(e), []), S = o(() => Jr(e, l), [e, l]), C = o(() => ({
|
|
2322
|
+
...e,
|
|
2323
|
+
screens: Qr(e.screens, [
|
|
2324
|
+
...e.screenTemplates,
|
|
2325
|
+
...e.dialogTemplates ?? [],
|
|
2326
|
+
...ve,
|
|
2327
|
+
...s ?? []
|
|
2328
|
+
])
|
|
2329
|
+
}), [e, s]);
|
|
2304
2330
|
return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
|
|
2305
2331
|
className: "stage-message",
|
|
2306
2332
|
role: "alert",
|
|
@@ -2317,8 +2343,8 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2317
2343
|
registry: t,
|
|
2318
2344
|
initialScreen: p,
|
|
2319
2345
|
history: u,
|
|
2320
|
-
layoutConfigStorage:
|
|
2321
|
-
scope: (t, n) => /* @__PURE__ */ P(
|
|
2346
|
+
layoutConfigStorage: ii(),
|
|
2347
|
+
scope: (t, n) => /* @__PURE__ */ P(si, {
|
|
2322
2348
|
scene: e,
|
|
2323
2349
|
routeState: r,
|
|
2324
2350
|
strings: i,
|
|
@@ -2328,13 +2354,13 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2328
2354
|
onSystemSchemeChange: x,
|
|
2329
2355
|
children: n
|
|
2330
2356
|
}),
|
|
2331
|
-
renderScreen: (e, n) => /* @__PURE__ */ P(
|
|
2357
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(li, {
|
|
2332
2358
|
element: e,
|
|
2333
2359
|
configuration: n,
|
|
2334
2360
|
registry: t
|
|
2335
2361
|
}),
|
|
2336
2362
|
renderDialog: () => /* @__PURE__ */ P(Xn, {}),
|
|
2337
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(
|
|
2363
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(ui, {
|
|
2338
2364
|
template: e,
|
|
2339
2365
|
content: n,
|
|
2340
2366
|
registry: t,
|
|
@@ -2346,7 +2372,7 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2346
2372
|
children: [/* @__PURE__ */ P("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ P("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
|
|
2347
2373
|
});
|
|
2348
2374
|
}
|
|
2349
|
-
function
|
|
2375
|
+
function si({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
|
|
2350
2376
|
let [d, f] = c(""), { navigate: p } = r;
|
|
2351
2377
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
2352
2378
|
let e = (e) => {
|
|
@@ -2378,7 +2404,7 @@ function oi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2378
2404
|
locale: n.locale,
|
|
2379
2405
|
locales: n.locales,
|
|
2380
2406
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2381
|
-
children: /* @__PURE__ */ P(
|
|
2407
|
+
children: /* @__PURE__ */ P(ci, {
|
|
2382
2408
|
activity: d,
|
|
2383
2409
|
routesReady: t.ready,
|
|
2384
2410
|
scene: e,
|
|
@@ -2390,7 +2416,7 @@ function oi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2390
2416
|
]
|
|
2391
2417
|
});
|
|
2392
2418
|
}
|
|
2393
|
-
function
|
|
2419
|
+
function ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
2394
2420
|
let s = z(), c = ce(), l = Lt(), d = o(() => Zr(l, t, s.refreshAfterCommand), [
|
|
2395
2421
|
l,
|
|
2396
2422
|
t,
|
|
@@ -2456,7 +2482,7 @@ function si({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2456
2482
|
})
|
|
2457
2483
|
});
|
|
2458
2484
|
}
|
|
2459
|
-
function
|
|
2485
|
+
function li({ element: e, configuration: t, registry: n }) {
|
|
2460
2486
|
let r = z(), i = jt();
|
|
2461
2487
|
return /* @__PURE__ */ F(De, { children: [/* @__PURE__ */ P(lr, { element: e }), /* @__PURE__ */ P(w, {
|
|
2462
2488
|
element: e,
|
|
@@ -2467,7 +2493,7 @@ function ci({ element: e, configuration: t, registry: n }) {
|
|
|
2467
2493
|
configuration: t
|
|
2468
2494
|
})] });
|
|
2469
2495
|
}
|
|
2470
|
-
function
|
|
2496
|
+
function ui({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
2471
2497
|
let o = z(), s = jt(), c = y(t, r.dictionary);
|
|
2472
2498
|
return i(() => {
|
|
2473
2499
|
let e = (e) => {
|
|
@@ -2497,9 +2523,9 @@ function li({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
2497
2523
|
}
|
|
2498
2524
|
//#endregion
|
|
2499
2525
|
//#region src/stageTheme.ts
|
|
2500
|
-
var
|
|
2501
|
-
preset:
|
|
2502
|
-
options: { darkModeSelector:
|
|
2526
|
+
var di = "[data-scene-color-scheme='dark']", fi = {
|
|
2527
|
+
preset: He,
|
|
2528
|
+
options: { darkModeSelector: di }
|
|
2503
2529
|
};
|
|
2504
2530
|
//#endregion
|
|
2505
|
-
export {
|
|
2531
|
+
export { ai as App, ai as StageApplication, sn as StageCommandForm, mt as StageDataProvider, zn as StageGuardedAction, Ke as StageSourceProvider, ri as composeStageScreen, Zr as createStageSliceInvoker, ht as dataChanged, Ft as executeRegisteredCommand, U as registeredCommand, Yr as sliceFieldsFrom, $r as stageApplicationRegistry, ni as stageComposition, di as stageDarkSelector, We as stageEndpoints, ti as stageShellOf, fi as stageTheme, Ue as staticStageSource, Lt as useStageCommandExecutor, z as useStageData, B as useStageQuery, L as useStageSource };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Screen, ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
/**
|
|
3
|
+
* The screens with the slots they do not fill left empty, so a blueprint's own demo copy does not draw in their place.
|
|
4
|
+
*
|
|
5
|
+
* A blueprint template seeds each of its slots with placeholder content - the demo header, search box and empty states of the blueprint's own
|
|
6
|
+
* "Deals" screen. A screen that fills a slot replaces that slot's seed (Cratis/Stage#506), but a screen written in Screenplay fills only the slots it
|
|
7
|
+
* has something for - a list screen fills `header` and `list` - and the seeds of the others drew beside it ("Search deals", "Nothing here yet").
|
|
8
|
+
* A slot the screen does not fill is an explicitly empty fill here, the way the Studio preview draws the same screen (Cratis/Stage#641).
|
|
9
|
+
* A screen that fills no slot at all shows its template as the blueprint ships it (the template gallery, the blueprint-template vector), so it is left alone.
|
|
10
|
+
*
|
|
11
|
+
* @param screens The screens of the scene.
|
|
12
|
+
* @param templates The screen templates in play: the application's own, its dialog templates and the blueprints'.
|
|
13
|
+
* @returns The screens, each with every slot of the template it names filled or explicitly empty.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withoutSeededSlots(screens: readonly Screen[], templates: readonly Pick<ScreenTemplate, 'name' | 'slots'>[]): Screen[];
|