@cratis/stage.runtime 4.188.0 → 4.188.2
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 +123 -90
- 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
|
|
@@ -506,7 +506,14 @@ function bt(e) {
|
|
|
506
506
|
function xt(e, t, n, r, i, a, o, s, c) {
|
|
507
507
|
if (!e) return;
|
|
508
508
|
let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
|
|
509
|
-
if (l.length !== 0)
|
|
509
|
+
if (l.length !== 0) {
|
|
510
|
+
if (l[0] === "screen") {
|
|
511
|
+
if (l.length === 1) return { name: o.name };
|
|
512
|
+
let e = V(o, l.slice(1));
|
|
513
|
+
return e === void 0 && l[1] === "keys" && l.length === 3 ? V(t, [l[2]]) : e;
|
|
514
|
+
}
|
|
515
|
+
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Ct(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? St(l.slice(1).join("."), t, n) : l[0] === "state" ? V(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : V(t, l) ?? Ct(r, void 0, l.join(".")) ?? V(i, l);
|
|
516
|
+
}
|
|
510
517
|
}
|
|
511
518
|
function St(e, t, n) {
|
|
512
519
|
let r = e?.split(".").filter(Boolean) ?? [];
|
|
@@ -573,12 +580,12 @@ function U(e, t, n) {
|
|
|
573
580
|
e
|
|
574
581
|
]) {
|
|
575
582
|
if (!r) continue;
|
|
576
|
-
let t =
|
|
583
|
+
let t = Pe(r);
|
|
577
584
|
if (Mt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
578
585
|
}
|
|
579
586
|
}
|
|
580
587
|
function Mt(e) {
|
|
581
|
-
return typeof e == "function" && e.prototype instanceof
|
|
588
|
+
return typeof e == "function" && e.prototype instanceof Ne;
|
|
582
589
|
}
|
|
583
590
|
function Nt() {
|
|
584
591
|
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
@@ -621,7 +628,7 @@ function It(e, t) {
|
|
|
621
628
|
};
|
|
622
629
|
}
|
|
623
630
|
function Lt() {
|
|
624
|
-
let e = r(
|
|
631
|
+
let e = r(Me);
|
|
625
632
|
return n((t, n) => Ft(t, n, e), [e]);
|
|
626
633
|
}
|
|
627
634
|
//#endregion
|
|
@@ -735,7 +742,7 @@ function Xt(e) {
|
|
|
735
742
|
}
|
|
736
743
|
//#endregion
|
|
737
744
|
//#region src/StageValueFields.tsx
|
|
738
|
-
var Zt =
|
|
745
|
+
var Zt = Ie((e) => /* @__PURE__ */ P(Qt, {
|
|
739
746
|
descriptor: e.descriptor,
|
|
740
747
|
label: e.title ?? G(e.descriptor.name),
|
|
741
748
|
value: e.value,
|
|
@@ -894,7 +901,7 @@ function an(e) {
|
|
|
894
901
|
//#region src/StageCommandForm.tsx
|
|
895
902
|
var on = e(void 0);
|
|
896
903
|
function sn({ element: e }) {
|
|
897
|
-
let t = z(), n = r(
|
|
904
|
+
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
905
|
...h,
|
|
899
906
|
...mn(u, s, t.parameters),
|
|
900
907
|
...pn(u, t.parameters)
|
|
@@ -929,7 +936,7 @@ function sn({ element: e }) {
|
|
|
929
936
|
className: "stage-command-form",
|
|
930
937
|
"data-command": a.command,
|
|
931
938
|
"data-generation-mode": a.generationMode,
|
|
932
|
-
children: /* @__PURE__ */ F(
|
|
939
|
+
children: /* @__PURE__ */ F(Fe, {
|
|
933
940
|
command: d,
|
|
934
941
|
initialValues: g,
|
|
935
942
|
currentValues: f,
|
|
@@ -1029,7 +1036,7 @@ function fn(e, t, n) {
|
|
|
1029
1036
|
value: e,
|
|
1030
1037
|
label: G(e)
|
|
1031
1038
|
}));
|
|
1032
|
-
return /* @__PURE__ */ P(
|
|
1039
|
+
return /* @__PURE__ */ P(ze, {
|
|
1033
1040
|
value: o,
|
|
1034
1041
|
fieldName: r,
|
|
1035
1042
|
title: a,
|
|
@@ -1047,26 +1054,26 @@ function fn(e, t, n) {
|
|
|
1047
1054
|
descriptor: i
|
|
1048
1055
|
});
|
|
1049
1056
|
switch (i?.type ?? "text") {
|
|
1050
|
-
case "number": return /* @__PURE__ */ P(
|
|
1057
|
+
case "number": return /* @__PURE__ */ P(Ve, {
|
|
1051
1058
|
value: o,
|
|
1052
1059
|
fieldName: r,
|
|
1053
1060
|
title: a,
|
|
1054
1061
|
required: s
|
|
1055
1062
|
});
|
|
1056
|
-
case "boolean": return /* @__PURE__ */ P(
|
|
1063
|
+
case "boolean": return /* @__PURE__ */ P(Re, {
|
|
1057
1064
|
value: o,
|
|
1058
1065
|
fieldName: r,
|
|
1059
1066
|
label: a,
|
|
1060
1067
|
required: s
|
|
1061
1068
|
});
|
|
1062
|
-
case "date": return /* @__PURE__ */ P(
|
|
1069
|
+
case "date": return /* @__PURE__ */ P(Le, {
|
|
1063
1070
|
value: o,
|
|
1064
1071
|
fieldName: r,
|
|
1065
1072
|
title: a,
|
|
1066
1073
|
required: s,
|
|
1067
1074
|
showIcon: !0
|
|
1068
1075
|
});
|
|
1069
|
-
default: return /* @__PURE__ */ P(
|
|
1076
|
+
default: return /* @__PURE__ */ P(Be, {
|
|
1070
1077
|
value: o,
|
|
1071
1078
|
fieldName: r,
|
|
1072
1079
|
title: a,
|
|
@@ -1258,16 +1265,16 @@ function Ln(e) {
|
|
|
1258
1265
|
};
|
|
1259
1266
|
}
|
|
1260
1267
|
function Rn(e, t) {
|
|
1261
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(
|
|
1268
|
+
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(Je(n) ?? "", t)]));
|
|
1262
1269
|
}
|
|
1263
1270
|
function zn({ element: e, interactions: t }) {
|
|
1264
1271
|
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
1272
|
if (!nt(m) || !h || !r.hasSource) {
|
|
1266
|
-
let n = r.hasSource ? `${
|
|
1273
|
+
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
1274
|
return /* @__PURE__ */ F("div", {
|
|
1268
1275
|
className: "stage-guarded-action",
|
|
1269
1276
|
"data-scene-id": e.id,
|
|
1270
|
-
children: [/* @__PURE__ */ P(
|
|
1277
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1271
1278
|
type: "button",
|
|
1272
1279
|
disabled: !0,
|
|
1273
1280
|
title: n,
|
|
@@ -1296,7 +1303,7 @@ function zn({ element: e, interactions: t }) {
|
|
|
1296
1303
|
className: "stage-guarded-action",
|
|
1297
1304
|
"data-scene-id": e.id,
|
|
1298
1305
|
"data-command": v,
|
|
1299
|
-
children: [/* @__PURE__ */ P(
|
|
1306
|
+
children: [/* @__PURE__ */ P(I, {
|
|
1300
1307
|
...t,
|
|
1301
1308
|
type: "button",
|
|
1302
1309
|
disabled: !y || l,
|
|
@@ -1440,21 +1447,21 @@ function Wn({ element: e, slots: t }) {
|
|
|
1440
1447
|
className: "stage-table",
|
|
1441
1448
|
"data-scene-id": e.id,
|
|
1442
1449
|
children: [
|
|
1443
|
-
u && /* @__PURE__ */ P(
|
|
1450
|
+
u && /* @__PURE__ */ P(ke, {
|
|
1444
1451
|
element: X(`${e.id}-loading`, {
|
|
1445
1452
|
severity: "info",
|
|
1446
1453
|
text: "Loading…"
|
|
1447
1454
|
}),
|
|
1448
1455
|
slots: {}
|
|
1449
1456
|
}),
|
|
1450
|
-
l && /* @__PURE__ */ P(
|
|
1457
|
+
l && /* @__PURE__ */ P(ke, {
|
|
1451
1458
|
element: X(`${e.id}-error`, {
|
|
1452
1459
|
severity: "error",
|
|
1453
1460
|
text: l
|
|
1454
1461
|
}),
|
|
1455
1462
|
slots: {}
|
|
1456
1463
|
}),
|
|
1457
|
-
h && /* @__PURE__ */ P(
|
|
1464
|
+
h && /* @__PURE__ */ P(I, {
|
|
1458
1465
|
type: "button",
|
|
1459
1466
|
size: "small",
|
|
1460
1467
|
onClick: () => {
|
|
@@ -1518,7 +1525,7 @@ function Jn({ element: e, interactions: t }) {
|
|
|
1518
1525
|
return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(Yn, {
|
|
1519
1526
|
element: e,
|
|
1520
1527
|
label: n
|
|
1521
|
-
}) : /* @__PURE__ */ P(
|
|
1528
|
+
}) : /* @__PURE__ */ P(I, {
|
|
1522
1529
|
type: "button",
|
|
1523
1530
|
"data-scene-id": e.id,
|
|
1524
1531
|
disabled: !0,
|
|
@@ -1535,7 +1542,7 @@ function Yn({ element: e, label: t }) {
|
|
|
1535
1542
|
return /* @__PURE__ */ P("div", {
|
|
1536
1543
|
className: "stage-action",
|
|
1537
1544
|
"data-scene-id": e.id,
|
|
1538
|
-
children: /* @__PURE__ */ P(
|
|
1545
|
+
children: /* @__PURE__ */ P(Oe, {
|
|
1539
1546
|
element: X(e.id, {
|
|
1540
1547
|
visible: !1,
|
|
1541
1548
|
header: t,
|
|
@@ -1621,7 +1628,7 @@ var Qn = {
|
|
|
1621
1628
|
//#endregion
|
|
1622
1629
|
//#region src/useStrings.ts
|
|
1623
1630
|
function $n() {
|
|
1624
|
-
let e =
|
|
1631
|
+
let e = L(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
|
|
1625
1632
|
return i(() => {
|
|
1626
1633
|
let t = new AbortController();
|
|
1627
1634
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1849,12 +1856,12 @@ function _r(e) {
|
|
|
1849
1856
|
}
|
|
1850
1857
|
var vr = {
|
|
1851
1858
|
...fe,
|
|
1852
|
-
PrimeReact:
|
|
1859
|
+
PrimeReact: je.components
|
|
1853
1860
|
};
|
|
1854
1861
|
function yr(e) {
|
|
1855
1862
|
return {
|
|
1856
1863
|
...E,
|
|
1857
|
-
...
|
|
1864
|
+
...Ae,
|
|
1858
1865
|
...me,
|
|
1859
1866
|
...Se,
|
|
1860
1867
|
...e
|
|
@@ -2205,15 +2212,33 @@ function Zr(e, t, n) {
|
|
|
2205
2212
|
} };
|
|
2206
2213
|
}
|
|
2207
2214
|
//#endregion
|
|
2215
|
+
//#region src/withoutSeededSlots.ts
|
|
2216
|
+
function Qr(e, t) {
|
|
2217
|
+
let n = /* @__PURE__ */ new Map();
|
|
2218
|
+
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
2219
|
+
return e.map((e) => {
|
|
2220
|
+
let t = e.screenTemplate === void 0 ? void 0 : n.get(e.screenTemplate);
|
|
2221
|
+
if (t === void 0 || !t.some((t) => e.slotContent[t] !== void 0)) return e;
|
|
2222
|
+
let r = t.filter((t) => e.slotContent[t] === void 0);
|
|
2223
|
+
return r.length === 0 ? e : {
|
|
2224
|
+
...e,
|
|
2225
|
+
slotContent: {
|
|
2226
|
+
...e.slotContent,
|
|
2227
|
+
...Object.fromEntries(r.map((e) => [e, []]))
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
//#endregion
|
|
2208
2233
|
//#region src/App.tsx
|
|
2209
|
-
function
|
|
2234
|
+
function $r(e = {}) {
|
|
2210
2235
|
return yr({
|
|
2211
2236
|
...e,
|
|
2212
2237
|
...Qn,
|
|
2213
2238
|
...Fr
|
|
2214
2239
|
});
|
|
2215
2240
|
}
|
|
2216
|
-
function
|
|
2241
|
+
function ei(e, t) {
|
|
2217
2242
|
return N(`form-${e}-${t.name}`, Vn, {
|
|
2218
2243
|
command: t.forCommand,
|
|
2219
2244
|
label: t.name,
|
|
@@ -2222,14 +2247,14 @@ function $r(e, t) {
|
|
|
2222
2247
|
fields: t.fields
|
|
2223
2248
|
});
|
|
2224
2249
|
}
|
|
2225
|
-
function
|
|
2250
|
+
function ti(e, t) {
|
|
2226
2251
|
let n = e.screens[0];
|
|
2227
2252
|
return _e(e, n, {
|
|
2228
2253
|
profile: _r(e.uiProfiles),
|
|
2229
2254
|
blueprintTemplates: t?.length ? [...ve, ...t] : void 0
|
|
2230
2255
|
});
|
|
2231
2256
|
}
|
|
2232
|
-
function
|
|
2257
|
+
function ni(e, t, n, r, i, a, o = !0) {
|
|
2233
2258
|
let s = Gr(e.navigation), c = e.navigation?.application.logo ? {
|
|
2234
2259
|
title: e.navigation.application.logo.title,
|
|
2235
2260
|
image: e.navigation.application.logo.image || void 0
|
|
@@ -2239,7 +2264,7 @@ function ti(e, t, n, r, i, a, o = !0) {
|
|
|
2239
2264
|
catalog: br(r),
|
|
2240
2265
|
blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
|
|
2241
2266
|
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:
|
|
2267
|
+
form: ei,
|
|
2243
2268
|
trailing: [N("activity", Dr)],
|
|
2244
2269
|
decorate: (e) => {
|
|
2245
2270
|
let t = tr(e);
|
|
@@ -2247,18 +2272,18 @@ function ti(e, t, n, r, i, a, o = !0) {
|
|
|
2247
2272
|
}
|
|
2248
2273
|
};
|
|
2249
2274
|
}
|
|
2250
|
-
function
|
|
2251
|
-
return pe(e, t,
|
|
2275
|
+
function ri(e, t, n, r, i, a) {
|
|
2276
|
+
return pe(e, t, ni(e, n, r, i, void 0, a)).element;
|
|
2252
2277
|
}
|
|
2253
|
-
function
|
|
2278
|
+
function ii() {
|
|
2254
2279
|
try {
|
|
2255
2280
|
return globalThis.localStorage ?? null;
|
|
2256
2281
|
} catch {
|
|
2257
2282
|
return null;
|
|
2258
2283
|
}
|
|
2259
2284
|
}
|
|
2260
|
-
function
|
|
2261
|
-
let s =
|
|
2285
|
+
function ai({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
|
|
2286
|
+
let s = L(), l = o(() => $r(e), [e]), [u, d] = c(), [f, p] = c(""), m = qe(), h = $n();
|
|
2262
2287
|
return i(() => {
|
|
2263
2288
|
let e = new AbortController();
|
|
2264
2289
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -2270,7 +2295,7 @@ function ii({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2270
2295
|
}, [s, r]), f ? /* @__PURE__ */ F("main", {
|
|
2271
2296
|
className: "stage-message",
|
|
2272
2297
|
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
2273
|
-
}) : u ? /* @__PURE__ */ P(
|
|
2298
|
+
}) : u ? /* @__PURE__ */ P(oi, {
|
|
2274
2299
|
scene: u,
|
|
2275
2300
|
registry: l,
|
|
2276
2301
|
routeState: m,
|
|
@@ -2283,8 +2308,8 @@ function ii({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
2283
2308
|
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
2284
2309
|
});
|
|
2285
2310
|
}
|
|
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 ?
|
|
2311
|
+
function oi({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
|
|
2312
|
+
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
2313
|
e,
|
|
2289
2314
|
s,
|
|
2290
2315
|
p
|
|
@@ -2292,7 +2317,7 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2292
2317
|
m,
|
|
2293
2318
|
h,
|
|
2294
2319
|
d
|
|
2295
|
-
]), v = o(() => Vr(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() =>
|
|
2320
|
+
]), v = o(() => Vr(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => ni(e, i.locales, i.locale, a, i.dictionary, s, y), [
|
|
2296
2321
|
e,
|
|
2297
2322
|
i.locales,
|
|
2298
2323
|
i.locale,
|
|
@@ -2300,7 +2325,15 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2300
2325
|
a,
|
|
2301
2326
|
s,
|
|
2302
2327
|
y
|
|
2303
|
-
]), x = n((e) => f(e), []), S = o(() => Jr(e, l), [e, l]), C =
|
|
2328
|
+
]), x = n((e) => f(e), []), S = o(() => Jr(e, l), [e, l]), C = o(() => ({
|
|
2329
|
+
...e,
|
|
2330
|
+
screens: Qr(e.screens, [
|
|
2331
|
+
...e.screenTemplates,
|
|
2332
|
+
...e.dialogTemplates ?? [],
|
|
2333
|
+
...ve,
|
|
2334
|
+
...s ?? []
|
|
2335
|
+
])
|
|
2336
|
+
}), [e, s]);
|
|
2304
2337
|
return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
|
|
2305
2338
|
className: "stage-message",
|
|
2306
2339
|
role: "alert",
|
|
@@ -2317,8 +2350,8 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2317
2350
|
registry: t,
|
|
2318
2351
|
initialScreen: p,
|
|
2319
2352
|
history: u,
|
|
2320
|
-
layoutConfigStorage:
|
|
2321
|
-
scope: (t, n) => /* @__PURE__ */ P(
|
|
2353
|
+
layoutConfigStorage: ii(),
|
|
2354
|
+
scope: (t, n) => /* @__PURE__ */ P(si, {
|
|
2322
2355
|
scene: e,
|
|
2323
2356
|
routeState: r,
|
|
2324
2357
|
strings: i,
|
|
@@ -2328,13 +2361,13 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2328
2361
|
onSystemSchemeChange: x,
|
|
2329
2362
|
children: n
|
|
2330
2363
|
}),
|
|
2331
|
-
renderScreen: (e, n) => /* @__PURE__ */ P(
|
|
2364
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(li, {
|
|
2332
2365
|
element: e,
|
|
2333
2366
|
configuration: n,
|
|
2334
2367
|
registry: t
|
|
2335
2368
|
}),
|
|
2336
2369
|
renderDialog: () => /* @__PURE__ */ P(Xn, {}),
|
|
2337
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(
|
|
2370
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(ui, {
|
|
2338
2371
|
template: e,
|
|
2339
2372
|
content: n,
|
|
2340
2373
|
registry: t,
|
|
@@ -2346,7 +2379,7 @@ function ai({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
2346
2379
|
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
2380
|
});
|
|
2348
2381
|
}
|
|
2349
|
-
function
|
|
2382
|
+
function si({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
|
|
2350
2383
|
let [d, f] = c(""), { navigate: p } = r;
|
|
2351
2384
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
2352
2385
|
let e = (e) => {
|
|
@@ -2378,7 +2411,7 @@ function oi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2378
2411
|
locale: n.locale,
|
|
2379
2412
|
locales: n.locales,
|
|
2380
2413
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
2381
|
-
children: /* @__PURE__ */ P(
|
|
2414
|
+
children: /* @__PURE__ */ P(ci, {
|
|
2382
2415
|
activity: d,
|
|
2383
2416
|
routesReady: t.ready,
|
|
2384
2417
|
scene: e,
|
|
@@ -2390,7 +2423,7 @@ function oi({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
2390
2423
|
]
|
|
2391
2424
|
});
|
|
2392
2425
|
}
|
|
2393
|
-
function
|
|
2426
|
+
function ci({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
2394
2427
|
let s = z(), c = ce(), l = Lt(), d = o(() => Zr(l, t, s.refreshAfterCommand), [
|
|
2395
2428
|
l,
|
|
2396
2429
|
t,
|
|
@@ -2456,7 +2489,7 @@ function si({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
2456
2489
|
})
|
|
2457
2490
|
});
|
|
2458
2491
|
}
|
|
2459
|
-
function
|
|
2492
|
+
function li({ element: e, configuration: t, registry: n }) {
|
|
2460
2493
|
let r = z(), i = jt();
|
|
2461
2494
|
return /* @__PURE__ */ F(De, { children: [/* @__PURE__ */ P(lr, { element: e }), /* @__PURE__ */ P(w, {
|
|
2462
2495
|
element: e,
|
|
@@ -2467,7 +2500,7 @@ function ci({ element: e, configuration: t, registry: n }) {
|
|
|
2467
2500
|
configuration: t
|
|
2468
2501
|
})] });
|
|
2469
2502
|
}
|
|
2470
|
-
function
|
|
2503
|
+
function ui({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
2471
2504
|
let o = z(), s = jt(), c = y(t, r.dictionary);
|
|
2472
2505
|
return i(() => {
|
|
2473
2506
|
let e = (e) => {
|
|
@@ -2497,9 +2530,9 @@ function li({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
2497
2530
|
}
|
|
2498
2531
|
//#endregion
|
|
2499
2532
|
//#region src/stageTheme.ts
|
|
2500
|
-
var
|
|
2501
|
-
preset:
|
|
2502
|
-
options: { darkModeSelector:
|
|
2533
|
+
var di = "[data-scene-color-scheme='dark']", fi = {
|
|
2534
|
+
preset: He,
|
|
2535
|
+
options: { darkModeSelector: di }
|
|
2503
2536
|
};
|
|
2504
2537
|
//#endregion
|
|
2505
|
-
export {
|
|
2538
|
+
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[];
|