@cratis/stage.runtime 4.170.0 → 4.172.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.
- package/dist/src/index.js +589 -532
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -2,20 +2,22 @@ import "./app.css";
|
|
|
2
2
|
import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
3
|
import { ColorScheme as c, DestinationKind as l, FormGenerationMode as u, FormWidthUnit as d, InteractionTriggerKind as f } from "@cratis/scene.model";
|
|
4
4
|
import { ShellDiagnosticCode as p, ShellOrigin as m, createBindingResolver as h, resolveArgumentSource as g, resolveBehaviors as _, resolveStringsInElement as v, runBindings as y, validateBindingExpression as b } from "@cratis/scene.engine";
|
|
5
|
-
import { CoreToolbarItem as x, InteractionScope as
|
|
6
|
-
import { ApplicationHost as
|
|
5
|
+
import { CoreToolbarItem as x, InteractionScope as S, SceneElementView as C, SceneNavigationContextInternal as w, SliceCommandFieldsProvider as T, SliceInvokerProvider as ee, attachmentFor as te, coreComponents as E, createBrowserDispatcher as D, createHashSceneHistory as ne, useInteractionScope as O, useSceneNavigation as re, useSceneOutlets as ie, useSceneTheme as k } from "@cratis/scene.react";
|
|
6
|
+
import { ApplicationHost as ae, ColorScheme as A, ComponentName as j, LayoutThemeProvider as oe, SlotName as M, blueprintPackageCatalog as se, composeApplicationScreen as ce, defaultBlueprintComponents as le, defaultBlueprintName as ue, defaultBlueprintThemes as de, effectiveShellOf as fe, externalComponent as N, galleryScreenTemplates as pe, layoutModes as me, menuThemes as he, navigationElement as ge, previewComponents as _e, previewProfile as ve, useLayoutConfig as ye } from "@cratis/scene.blueprint.default";
|
|
7
7
|
import "@cratis/scene.blueprint.default/styles.css";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
8
|
+
import { Globals as be } from "@cratis/arc";
|
|
9
|
+
import { ServerSentEventQueryConnection as xe } from "@cratis/arc/queries";
|
|
10
|
+
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
11
|
+
import { Button as I } from "primereact/button";
|
|
12
|
+
import { PrimeDialog as Se, PrimeMessage as Ce, primeReactComponents as we, primeReactPackageManifest as Te } from "@cratis/scene.primereact";
|
|
13
|
+
import { ArcContext as Ee } from "@cratis/arc.react";
|
|
14
|
+
import { Command as De } from "@cratis/arc/commands";
|
|
15
|
+
import { resolveCommand as Oe } from "@cratis/scene.components";
|
|
16
|
+
import { CommandForm as ke } from "@cratis/arc.react/commands";
|
|
17
|
+
import { CalendarField as Ae, CheckboxField as je, InputTextField as Me, NumberField as Ne } from "@cratis/components/CommandForm";
|
|
18
|
+
import Pe from "@primeuix/themes/lara";
|
|
17
19
|
//#region src/stageSource.ts
|
|
18
|
-
function
|
|
20
|
+
function Fe(e) {
|
|
19
21
|
return {
|
|
20
22
|
scene: async () => e.scene,
|
|
21
23
|
routes: async () => e.routes,
|
|
@@ -23,23 +25,23 @@ function Pe(e) {
|
|
|
23
25
|
strings: async (t) => e.strings[t] ?? {}
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
|
-
var
|
|
28
|
+
var Ie = {
|
|
27
29
|
scene: "stage/scene",
|
|
28
30
|
routes: "stage/routes",
|
|
29
31
|
locales: "stage/locales",
|
|
30
32
|
strings: (e) => `stage/strings/${encodeURIComponent(e)}`
|
|
31
|
-
},
|
|
32
|
-
function
|
|
33
|
-
return t(
|
|
33
|
+
}, Le = e(void 0);
|
|
34
|
+
function Re({ source: e, children: n }) {
|
|
35
|
+
return t(Le.Provider, { value: e }, n);
|
|
34
36
|
}
|
|
35
|
-
function
|
|
36
|
-
let e = r(
|
|
37
|
+
function L() {
|
|
38
|
+
let e = r(Le);
|
|
37
39
|
if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
|
|
38
40
|
return e;
|
|
39
41
|
}
|
|
40
|
-
|
|
41
|
-
function
|
|
42
|
-
let e =
|
|
42
|
+
Ie.routes;
|
|
43
|
+
function ze() {
|
|
44
|
+
let e = L(), [t, n] = s({
|
|
43
45
|
routes: void 0,
|
|
44
46
|
ready: !1
|
|
45
47
|
});
|
|
@@ -58,35 +60,35 @@ function Re() {
|
|
|
58
60
|
}), () => t.abort();
|
|
59
61
|
}, [e]), t;
|
|
60
62
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
63
|
+
function Be(e) {
|
|
64
|
+
if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
63
65
|
}
|
|
64
|
-
var
|
|
65
|
-
function
|
|
66
|
+
var Ve = "STAGE-SCENE-ACTION-001", He = "item.";
|
|
67
|
+
function R(e) {
|
|
66
68
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
67
69
|
}
|
|
68
|
-
function
|
|
70
|
+
function Ue(e, t) {
|
|
69
71
|
let n = e;
|
|
70
72
|
for (let e of t.split(".").filter(Boolean)) {
|
|
71
|
-
if (!
|
|
73
|
+
if (!R(n)) return;
|
|
72
74
|
n = n[e];
|
|
73
75
|
}
|
|
74
76
|
return n;
|
|
75
77
|
}
|
|
76
|
-
function
|
|
78
|
+
function We(e) {
|
|
77
79
|
return e === null || [
|
|
78
80
|
"string",
|
|
79
81
|
"number",
|
|
80
82
|
"boolean"
|
|
81
83
|
].includes(typeof e);
|
|
82
84
|
}
|
|
83
|
-
function
|
|
85
|
+
function Ge(e, t) {
|
|
84
86
|
if (typeof e == "number") return t[e];
|
|
85
87
|
if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
86
88
|
}
|
|
87
|
-
function
|
|
89
|
+
function Ke(e, t, n, r) {
|
|
88
90
|
if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
|
|
89
|
-
let i =
|
|
91
|
+
let i = Ge(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
|
|
90
92
|
return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
|
|
91
93
|
}
|
|
92
94
|
switch (t) {
|
|
@@ -101,40 +103,40 @@ function Ge(e, t, n, r) {
|
|
|
101
103
|
default: return;
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
function
|
|
105
|
-
if (
|
|
106
|
+
function z(e, t) {
|
|
107
|
+
if (R(e)) {
|
|
106
108
|
if (e.kind === "comparison") {
|
|
107
|
-
let n =
|
|
108
|
-
if (typeof n != "string" || !n.startsWith(
|
|
109
|
+
let n = Be(e.left);
|
|
110
|
+
if (typeof n != "string" || !n.startsWith(He) || typeof e.operator != "string" || !We(e.right)) return;
|
|
109
111
|
let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
|
|
110
|
-
return
|
|
112
|
+
return Ke(Ue(t, n.slice(5)), e.operator, e.right, r);
|
|
111
113
|
}
|
|
112
114
|
if (e.kind === "logical") {
|
|
113
|
-
let n =
|
|
115
|
+
let n = z(e.left, t), r = z(e.right, t);
|
|
114
116
|
return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
|
-
function
|
|
119
|
-
return e.every((e) =>
|
|
120
|
-
}
|
|
121
|
-
function qe(e, t) {
|
|
122
|
-
if (Ke(e)) return e.findIndex((e) => R(e, t) === !0);
|
|
120
|
+
function qe(e) {
|
|
121
|
+
return e.every((e) => z(e, {}) !== void 0);
|
|
123
122
|
}
|
|
124
123
|
function Je(e, t) {
|
|
125
|
-
if (
|
|
126
|
-
|
|
124
|
+
if (qe(e)) return e.findIndex((e) => z(e, t) === !0);
|
|
125
|
+
}
|
|
126
|
+
function Ye(e, t) {
|
|
127
|
+
if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
|
|
128
|
+
let n = Je(e.alternatives, t);
|
|
127
129
|
if (n !== void 0) {
|
|
128
130
|
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
129
131
|
if (e.kind === "otherwise") return n === -1;
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
function
|
|
133
|
-
if (e.startsWith(
|
|
134
|
+
function B(e, t) {
|
|
135
|
+
if (e.startsWith(He) && R(t)) return Ue(t, e.slice(5));
|
|
134
136
|
}
|
|
135
137
|
//#endregion
|
|
136
138
|
//#region src/stageData.tsx
|
|
137
|
-
var
|
|
139
|
+
var Xe = "cratis.stage.data-changed", Ze = e({
|
|
138
140
|
locale: "",
|
|
139
141
|
locales: [],
|
|
140
142
|
screen: "",
|
|
@@ -154,13 +156,13 @@ var B = "cratis.stage.data-changed", Ye = e({
|
|
|
154
156
|
resolveArgument: () => void 0,
|
|
155
157
|
registerQueryResult: () => void 0,
|
|
156
158
|
refreshVersion: 0
|
|
157
|
-
}),
|
|
159
|
+
}), Qe = [
|
|
158
160
|
500,
|
|
159
161
|
1500,
|
|
160
162
|
3e3
|
|
161
|
-
],
|
|
162
|
-
function
|
|
163
|
-
let [f, p] = s({}), [m, _] = s({}), [v, y] = s(), [x,
|
|
163
|
+
], $e = {};
|
|
164
|
+
function et({ routes: e, routesReady: t = !0, parameters: r = $e, locale: c, locales: l, screen: u, children: d }) {
|
|
165
|
+
let [f, p] = s({}), [m, _] = s({}), [v, y] = s(), [x, S] = s({}), [C, w] = s({}), [T, ee] = s({ version: 0 }), te = n((e, t) => {
|
|
164
166
|
p((n) => {
|
|
165
167
|
if (!t) {
|
|
166
168
|
let { [e]: t, ...r } = n;
|
|
@@ -171,60 +173,60 @@ function Qe({ routes: e, routesReady: t = !0, parameters: r = Ze, locale: c, loc
|
|
|
171
173
|
[e]: t
|
|
172
174
|
};
|
|
173
175
|
});
|
|
174
|
-
}, []),
|
|
176
|
+
}, []), E = n((e, t) => {
|
|
175
177
|
_((n) => ({
|
|
176
178
|
...n,
|
|
177
179
|
[e]: t
|
|
178
180
|
})), y(t ? e : (t) => t === e ? void 0 : t);
|
|
179
|
-
}, []),
|
|
181
|
+
}, []), D = n((e) => {
|
|
180
182
|
_((t) => ({
|
|
181
183
|
...t,
|
|
182
184
|
[e]: void 0
|
|
183
185
|
})), y((t) => t === e ? void 0 : t);
|
|
184
|
-
}, []),
|
|
185
|
-
|
|
186
|
-
let i =
|
|
186
|
+
}, []), ne = n((e, t, n) => {
|
|
187
|
+
w((r) => {
|
|
188
|
+
let i = U(r[e]) ? r[e] : {};
|
|
187
189
|
return {
|
|
188
190
|
...r,
|
|
189
|
-
[e]:
|
|
191
|
+
[e]: ot(i, t.split(".").filter(Boolean), n)
|
|
190
192
|
};
|
|
191
193
|
});
|
|
192
|
-
}, []),
|
|
194
|
+
}, []), O = n((e) => ee((t) => ({
|
|
193
195
|
query: e,
|
|
194
196
|
version: t.version + 1
|
|
195
|
-
})), []),
|
|
196
|
-
|
|
197
|
-
for (let e of
|
|
198
|
-
}, [
|
|
199
|
-
i(() => () =>
|
|
200
|
-
let e = () =>
|
|
201
|
-
return globalThis.addEventListener(
|
|
202
|
-
globalThis.removeEventListener(
|
|
197
|
+
})), []), re = o([]), ie = n(() => {
|
|
198
|
+
O();
|
|
199
|
+
for (let e of Qe) re.current.push(setTimeout(() => O(), e));
|
|
200
|
+
}, [O]);
|
|
201
|
+
i(() => () => re.current.forEach(clearTimeout), []), i(() => {
|
|
202
|
+
let e = () => O(), t = (e) => O(e.detail?.query);
|
|
203
|
+
return globalThis.addEventListener(Xe, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
|
|
204
|
+
globalThis.removeEventListener(Xe, e), globalThis.removeEventListener("cratis.scene.refresh", t);
|
|
203
205
|
};
|
|
204
|
-
}, [
|
|
205
|
-
let
|
|
206
|
+
}, [O]);
|
|
207
|
+
let k = v ? m[v] : void 0, ae = n((e) => {
|
|
206
208
|
if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
|
|
207
|
-
if (typeof e == "string") return
|
|
208
|
-
if (!e.kind) return
|
|
209
|
-
let t =
|
|
209
|
+
if (typeof e == "string") return st(e, k, m, f, x, r, u, c, l);
|
|
210
|
+
if (!e.kind) return st(e.path, k, m, f, x, r, u, c, l);
|
|
211
|
+
let t = rt(k, f, x, C, m), n = b(e, t);
|
|
210
212
|
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), h(t)(e);
|
|
211
213
|
}, [
|
|
212
|
-
|
|
214
|
+
C,
|
|
213
215
|
c,
|
|
214
216
|
l,
|
|
215
217
|
x,
|
|
216
218
|
r,
|
|
217
219
|
f,
|
|
218
220
|
u,
|
|
219
|
-
|
|
221
|
+
k,
|
|
220
222
|
m
|
|
221
|
-
]),
|
|
222
|
-
|
|
223
|
+
]), A = n((e) => e ? g(e, rt(k, f, x, C, m)) : void 0, [
|
|
224
|
+
C,
|
|
223
225
|
x,
|
|
224
226
|
f,
|
|
225
|
-
|
|
227
|
+
k,
|
|
226
228
|
m
|
|
227
|
-
]),
|
|
229
|
+
]), j = a(() => ({
|
|
228
230
|
locale: c,
|
|
229
231
|
locales: l,
|
|
230
232
|
screen: u,
|
|
@@ -232,88 +234,122 @@ function Qe({ routes: e, routesReady: t = !0, parameters: r = Ze, locale: c, loc
|
|
|
232
234
|
routesReady: t,
|
|
233
235
|
parameters: r,
|
|
234
236
|
queries: f,
|
|
235
|
-
selected:
|
|
237
|
+
selected: k,
|
|
236
238
|
selections: m,
|
|
237
|
-
selectRow:
|
|
238
|
-
clearSelection:
|
|
239
|
-
setState: (e, t) =>
|
|
240
|
-
setComponentOutput:
|
|
241
|
-
refreshQuery:
|
|
242
|
-
refreshAfterCommand:
|
|
243
|
-
resolveBinding:
|
|
244
|
-
resolveArgument:
|
|
245
|
-
registerQueryResult:
|
|
246
|
-
refreshVersion:
|
|
247
|
-
refreshQueryName:
|
|
239
|
+
selectRow: E,
|
|
240
|
+
clearSelection: D,
|
|
241
|
+
setState: (e, t) => S((n) => ot(n, e.split(".").filter(Boolean), t)),
|
|
242
|
+
setComponentOutput: ne,
|
|
243
|
+
refreshQuery: O,
|
|
244
|
+
refreshAfterCommand: ie,
|
|
245
|
+
resolveBinding: ae,
|
|
246
|
+
resolveArgument: A,
|
|
247
|
+
registerQueryResult: te,
|
|
248
|
+
refreshVersion: T.version,
|
|
249
|
+
refreshQueryName: T.query
|
|
248
250
|
}), [
|
|
249
|
-
|
|
251
|
+
D,
|
|
250
252
|
c,
|
|
251
253
|
l,
|
|
252
254
|
f,
|
|
255
|
+
ie,
|
|
256
|
+
O,
|
|
257
|
+
T.query,
|
|
258
|
+
T.version,
|
|
259
|
+
te,
|
|
260
|
+
A,
|
|
253
261
|
ae,
|
|
254
|
-
D,
|
|
255
|
-
C.query,
|
|
256
|
-
C.version,
|
|
257
|
-
re,
|
|
258
|
-
k,
|
|
259
|
-
oe,
|
|
260
262
|
e,
|
|
261
263
|
t,
|
|
262
264
|
r,
|
|
263
265
|
u,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
+
E,
|
|
267
|
+
k,
|
|
266
268
|
m,
|
|
267
|
-
|
|
269
|
+
ne
|
|
268
270
|
]);
|
|
269
|
-
return /* @__PURE__ */
|
|
270
|
-
value:
|
|
271
|
+
return /* @__PURE__ */ P(Ze.Provider, {
|
|
272
|
+
value: j,
|
|
271
273
|
children: d
|
|
272
274
|
});
|
|
273
275
|
}
|
|
274
|
-
var V = () => r(
|
|
275
|
-
function
|
|
276
|
+
var V = () => r(Ze);
|
|
277
|
+
function tt(e) {
|
|
276
278
|
let { refreshQueryName: t, refreshVersion: r, registerQueryResult: a } = V(), c = e.publish !== !1, l = n((e, t) => {
|
|
277
279
|
c && a(e, t);
|
|
278
|
-
}, [c, a]), [u, d] = s([]), [f, p] = s(""), [m, h] = s(!1), [g, _] = s(0), v = o(0), y = e.ready ?? !0,
|
|
280
|
+
}, [c, a]), [u, d] = s([]), [f, p] = s(""), [m, h] = s(!1), [g, _] = s(0), v = o(0), y = o(!1), b = e.ready ?? !0, x = !!e.route && b, S = JSON.stringify(e.arguments ?? {});
|
|
279
281
|
return i(() => {
|
|
280
|
-
if (!
|
|
282
|
+
if (!x || !e.route) {
|
|
281
283
|
v.current += 1, d([]), p(""), h(!1), l(e.scope, void 0);
|
|
282
284
|
return;
|
|
283
285
|
}
|
|
284
286
|
let t = v.current + 1;
|
|
285
287
|
v.current = t;
|
|
286
|
-
let n = new AbortController(), r = JSON.parse(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
288
|
+
let n = new AbortController(), r = JSON.parse(S), i = ut(e.route, r);
|
|
289
|
+
h(!0), p("");
|
|
290
|
+
let a = () => {
|
|
291
|
+
fetch(i, {
|
|
292
|
+
headers: { Accept: "application/json" },
|
|
293
|
+
signal: n.signal
|
|
294
|
+
}).then(async (e) => {
|
|
295
|
+
if (!e.ok) throw Error(`The query answered ${e.status}.`);
|
|
296
|
+
return e.json();
|
|
297
|
+
}).then((e) => {
|
|
298
|
+
v.current !== t || n.signal.aborted || (d(gt(e)), p(""));
|
|
299
|
+
}).catch((e) => {
|
|
300
|
+
v.current !== t || n.signal.aborted || (d([]), p(e instanceof Error ? e.message : String(e)));
|
|
301
|
+
}).finally(() => {
|
|
302
|
+
v.current === t && !n.signal.aborted && h(!1);
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
if (pt(e.route)) {
|
|
306
|
+
y.current = !0;
|
|
307
|
+
let e = new xe(new URL(mt(i), globalThis.location.href)), r = !1, o = () => {
|
|
308
|
+
r || v.current !== t || n.signal.aborted || (r = !0, y.current = !1, e.disconnect(), a());
|
|
309
|
+
}, s = be.eventSourceFactory;
|
|
310
|
+
if (!s && typeof EventSource > "u") o();
|
|
311
|
+
else {
|
|
312
|
+
let r;
|
|
313
|
+
be.eventSourceFactory = (e) => r = s ? s(e) : new EventSource(e);
|
|
314
|
+
try {
|
|
315
|
+
e.connect((e) => {
|
|
316
|
+
if (v.current !== t || n.signal.aborted) return;
|
|
317
|
+
let r = ht(e);
|
|
318
|
+
r ? (d([]), p(r)) : (d(gt(e)), p("")), h(!1);
|
|
319
|
+
});
|
|
320
|
+
} finally {
|
|
321
|
+
be.eventSourceFactory = s;
|
|
322
|
+
}
|
|
323
|
+
let i = r;
|
|
324
|
+
if (i) {
|
|
325
|
+
let e = i.onerror;
|
|
326
|
+
i.onerror = function(t) {
|
|
327
|
+
e?.call(this, t), i.readyState === ft && o();
|
|
328
|
+
};
|
|
329
|
+
} else o();
|
|
330
|
+
}
|
|
331
|
+
return () => {
|
|
332
|
+
n.abort(), y.current = !1, e.disconnect();
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
return a(), () => n.abort();
|
|
300
336
|
}, [
|
|
301
|
-
b,
|
|
302
337
|
x,
|
|
338
|
+
S,
|
|
303
339
|
g,
|
|
304
340
|
l,
|
|
305
341
|
e.name,
|
|
306
342
|
e.route,
|
|
307
343
|
e.scope
|
|
308
344
|
]), i(() => {
|
|
309
|
-
r !== 0 && (t && t !== e.name && t !== e.scope || _((e) => e + 1));
|
|
345
|
+
r !== 0 && (t && t !== e.name && t !== e.scope || y.current || _((e) => e + 1));
|
|
310
346
|
}, [
|
|
311
347
|
t,
|
|
312
348
|
r,
|
|
313
349
|
e.name,
|
|
314
350
|
e.scope
|
|
315
351
|
]), i(() => {
|
|
316
|
-
if (!
|
|
352
|
+
if (!x || !e.route) {
|
|
317
353
|
l(e.scope, void 0);
|
|
318
354
|
return;
|
|
319
355
|
}
|
|
@@ -323,11 +359,11 @@ function H(e) {
|
|
|
323
359
|
rows: u,
|
|
324
360
|
loading: m,
|
|
325
361
|
error: f,
|
|
326
|
-
arguments: JSON.parse(
|
|
362
|
+
arguments: JSON.parse(S)
|
|
327
363
|
});
|
|
328
364
|
}, [
|
|
329
|
-
b,
|
|
330
365
|
x,
|
|
366
|
+
S,
|
|
331
367
|
f,
|
|
332
368
|
m,
|
|
333
369
|
l,
|
|
@@ -339,24 +375,26 @@ function H(e) {
|
|
|
339
375
|
rows: u,
|
|
340
376
|
loading: m,
|
|
341
377
|
error: f,
|
|
342
|
-
refresh: () =>
|
|
378
|
+
refresh: () => {
|
|
379
|
+
y.current || _((e) => e + 1);
|
|
380
|
+
}
|
|
343
381
|
};
|
|
344
382
|
}
|
|
345
|
-
function
|
|
346
|
-
globalThis.dispatchEvent(new CustomEvent(
|
|
383
|
+
function nt() {
|
|
384
|
+
globalThis.dispatchEvent(new CustomEvent(Xe));
|
|
347
385
|
}
|
|
348
|
-
function
|
|
386
|
+
function rt(e, t, n, r, i) {
|
|
349
387
|
return {
|
|
350
388
|
dataContext: e,
|
|
351
|
-
queryResults: Object.fromEntries(Object.entries(t).flatMap(([e, t]) => [[e,
|
|
352
|
-
componentOutputs:
|
|
389
|
+
queryResults: Object.fromEntries(Object.entries(t).flatMap(([e, t]) => [[e, it(t.rows)], ...t.name ? [[t.name, it(t.rows)]] : []])),
|
|
390
|
+
componentOutputs: at(r, i),
|
|
353
391
|
state: n
|
|
354
392
|
};
|
|
355
393
|
}
|
|
356
|
-
function
|
|
394
|
+
function it(e) {
|
|
357
395
|
return e.length === 1 ? e[0] : e;
|
|
358
396
|
}
|
|
359
|
-
function
|
|
397
|
+
function at(e, t) {
|
|
360
398
|
let n = { ...e };
|
|
361
399
|
for (let [e, r] of Object.entries(t)) r && (n[e] = {
|
|
362
400
|
...r,
|
|
@@ -364,70 +402,89 @@ function nt(e, t) {
|
|
|
364
402
|
});
|
|
365
403
|
return n;
|
|
366
404
|
}
|
|
367
|
-
function
|
|
405
|
+
function ot(e, t, n) {
|
|
368
406
|
let [r, ...i] = t;
|
|
369
407
|
return r ? i.length === 0 ? {
|
|
370
408
|
...e,
|
|
371
409
|
[r]: n
|
|
372
410
|
} : {
|
|
373
411
|
...e,
|
|
374
|
-
[r]:
|
|
412
|
+
[r]: ot(U(e[r]) ? e[r] : {}, i, n)
|
|
375
413
|
} : e;
|
|
376
414
|
}
|
|
377
|
-
function
|
|
415
|
+
function st(e, t, n, r, i, a, o, s, c) {
|
|
378
416
|
if (!e) return;
|
|
379
417
|
let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
|
|
380
|
-
if (l.length !== 0) return l[0] === "screen" ? l.length === 1 ? { name: o } :
|
|
418
|
+
if (l.length !== 0) return l[0] === "screen" ? l.length === 1 ? { name: o } : H({ name: o }, l.slice(1)) : l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? lt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? ct(l.slice(1).join("."), t, n) : l[0] === "state" ? H(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : H(t, l) ?? lt(r, void 0, l.join(".")) ?? H(i, l);
|
|
381
419
|
}
|
|
382
|
-
function
|
|
420
|
+
function ct(e, t, n) {
|
|
383
421
|
let r = e?.split(".").filter(Boolean) ?? [];
|
|
384
|
-
return r.length > 0 && Object.hasOwn(n, r[0]) ?
|
|
422
|
+
return r.length > 0 && Object.hasOwn(n, r[0]) ? H(n[r[0]], r.slice(1)) : r.length === 0 ? t : H(t, r);
|
|
385
423
|
}
|
|
386
|
-
function
|
|
424
|
+
function lt(e, t, n) {
|
|
387
425
|
let r = Object.entries(e).filter(([e, n]) => !t || n.name === t || e === t).map(([, e]) => e.rows);
|
|
388
426
|
if (r.length === 0) return;
|
|
389
427
|
let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
|
|
390
|
-
return a.length === 0 ? i : i.length === 1 ?
|
|
428
|
+
return a.length === 0 ? i : i.length === 1 ? H(i[0], a) : i.map((e) => H(e, a));
|
|
391
429
|
}
|
|
392
|
-
function
|
|
430
|
+
function ut(e, t) {
|
|
393
431
|
let [n, r = ""] = e.replace(/^\//, "").split("?"), i = new URLSearchParams(r);
|
|
394
432
|
for (let [e, n] of Object.entries(t)) n != null && n !== "" && i.set(e, String(n));
|
|
395
433
|
let a = i.toString();
|
|
396
434
|
return a ? `${n}?${a}` : n;
|
|
397
435
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return
|
|
436
|
+
var dt = "waitForFirstResult", ft = 2;
|
|
437
|
+
function pt(e) {
|
|
438
|
+
return new URLSearchParams(e.split("?")[1] ?? "").get(dt) === "true";
|
|
439
|
+
}
|
|
440
|
+
function mt(e) {
|
|
441
|
+
let [t, n = ""] = e.split("?"), r = new URLSearchParams(n);
|
|
442
|
+
r.delete(dt);
|
|
443
|
+
let i = r.toString();
|
|
444
|
+
return i ? `${t}?${i}` : t;
|
|
401
445
|
}
|
|
402
|
-
function
|
|
446
|
+
function ht(e) {
|
|
447
|
+
if (!U(e)) return "";
|
|
448
|
+
if (e.isAuthorized === !1) return "The query answered 403.";
|
|
449
|
+
if (e.isValid === !1 || e.hasExceptions === !0) {
|
|
450
|
+
let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
|
|
451
|
+
return t.length > 0 ? t.join(" ") : "The query could not be answered.";
|
|
452
|
+
}
|
|
453
|
+
return "";
|
|
454
|
+
}
|
|
455
|
+
function gt(e) {
|
|
456
|
+
let t = U(e) && "data" in e ? e.data : e;
|
|
457
|
+
return Array.isArray(t) ? t.filter(U) : U(t) ? [t] : [];
|
|
458
|
+
}
|
|
459
|
+
function H(e, t) {
|
|
403
460
|
let n = e;
|
|
404
461
|
for (let e of t) {
|
|
405
|
-
if (!
|
|
462
|
+
if (!U(n)) return;
|
|
406
463
|
n = n[e];
|
|
407
464
|
}
|
|
408
465
|
return n;
|
|
409
466
|
}
|
|
410
|
-
function
|
|
467
|
+
function U(e) {
|
|
411
468
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
412
469
|
}
|
|
413
470
|
//#endregion
|
|
414
471
|
//#region src/commandExecutor.ts
|
|
415
|
-
function
|
|
472
|
+
function W(e, t, n) {
|
|
416
473
|
for (let r of [
|
|
417
474
|
t,
|
|
418
475
|
n?.replace(/^\//, ""),
|
|
419
476
|
e
|
|
420
477
|
]) {
|
|
421
478
|
if (!r) continue;
|
|
422
|
-
let t =
|
|
423
|
-
if (
|
|
479
|
+
let t = Oe(r);
|
|
480
|
+
if (_t(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
424
481
|
}
|
|
425
482
|
}
|
|
426
|
-
function
|
|
427
|
-
return typeof e == "function" && e.prototype instanceof
|
|
483
|
+
function _t(e) {
|
|
484
|
+
return typeof e == "function" && e.prototype instanceof De;
|
|
428
485
|
}
|
|
429
|
-
async function
|
|
430
|
-
let r =
|
|
486
|
+
async function vt(e, t, n) {
|
|
487
|
+
let r = W(e);
|
|
431
488
|
if (!r) return {
|
|
432
489
|
isSuccess: !1,
|
|
433
490
|
validationErrors: [],
|
|
@@ -436,9 +493,9 @@ async function ut(e, t, n) {
|
|
|
436
493
|
let i = new r();
|
|
437
494
|
i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath ?? ""), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
438
495
|
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
439
|
-
return
|
|
496
|
+
return yt(e, await i.execute());
|
|
440
497
|
}
|
|
441
|
-
function
|
|
498
|
+
function yt(e, t) {
|
|
442
499
|
let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
|
|
443
500
|
member: t,
|
|
444
501
|
message: e.message
|
|
@@ -454,160 +511,160 @@ function dt(e, t) {
|
|
|
454
511
|
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
455
512
|
};
|
|
456
513
|
}
|
|
457
|
-
function
|
|
458
|
-
let e = r(
|
|
459
|
-
return n((t, n) =>
|
|
514
|
+
function bt() {
|
|
515
|
+
let e = r(Ee);
|
|
516
|
+
return n((t, n) => vt(t, n, e), [e]);
|
|
460
517
|
}
|
|
461
518
|
//#endregion
|
|
462
519
|
//#region src/StageCommandForm.tsx
|
|
463
|
-
function
|
|
464
|
-
let t = V(), n = a(() =>
|
|
520
|
+
function xt({ element: e }) {
|
|
521
|
+
let t = V(), n = a(() => Ct(e), [e]), r = a(() => zt(e), [e]), i = typeof e.properties.schema == "string", o = a(() => n ? wt(n, r) : [], [n, r]), c = n ? W(n.command, K(e, "typeName"), K(e, "route")) : void 0, l = Ot(e, o, t.resolveArgument), u = a(() => Dt(o, t.parameters), [o, t.parameters]), d = a(() => n ? Tt(n, o, r) : void 0, [
|
|
465
522
|
n,
|
|
466
523
|
o,
|
|
467
524
|
r
|
|
468
|
-
]), f = a(() => n ?
|
|
525
|
+
]), f = a(() => n ? Lt(o, r) : [], [
|
|
469
526
|
n,
|
|
470
527
|
o,
|
|
471
528
|
r
|
|
472
|
-
]), p = a(() => n ?
|
|
473
|
-
return n ? !c && !t.routesReady ? /* @__PURE__ */
|
|
529
|
+
]), p = a(() => n ? Rt(n.layout, o) : [], [n, o]), [m, h] = s([]);
|
|
530
|
+
return n ? !c && !t.routesReady ? /* @__PURE__ */ F("p", {
|
|
474
531
|
className: "stage-note",
|
|
475
532
|
children: [
|
|
476
533
|
"The modeled command “",
|
|
477
534
|
n.command,
|
|
478
535
|
"” is waiting for Stage routes."
|
|
479
536
|
]
|
|
480
|
-
}) : c ? o.length === 0 && !i && e.properties.parameterless !== !0 ? /* @__PURE__ */
|
|
537
|
+
}) : c ? o.length === 0 && !i && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(St, {
|
|
481
538
|
form: n,
|
|
482
539
|
messages: [`The modeled command “${n.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
483
|
-
}) : f.length > 0 ? /* @__PURE__ */
|
|
540
|
+
}) : f.length > 0 ? /* @__PURE__ */ P(St, {
|
|
484
541
|
form: n,
|
|
485
542
|
messages: f
|
|
486
|
-
}) : /* @__PURE__ */
|
|
543
|
+
}) : /* @__PURE__ */ P("section", {
|
|
487
544
|
className: "stage-command-form",
|
|
488
545
|
"data-command": n.command,
|
|
489
546
|
"data-generation-mode": n.generationMode,
|
|
490
|
-
children: /* @__PURE__ */
|
|
547
|
+
children: /* @__PURE__ */ F(ke, {
|
|
491
548
|
command: c,
|
|
492
549
|
initialValues: u,
|
|
493
550
|
currentValues: l,
|
|
494
551
|
validateOn: "both",
|
|
495
552
|
validateAllFieldsOnChange: !0,
|
|
496
|
-
onFieldValidate: (e, t, n, i) =>
|
|
553
|
+
onFieldValidate: (e, t, n, i) => It(o, r, t, i),
|
|
497
554
|
onValidationFailure: (e) => h(e.map((e) => e.message)),
|
|
498
555
|
onException: (e) => h(e),
|
|
499
|
-
onFailed: (e) => h(
|
|
556
|
+
onFailed: (e) => h(yt(n.command, e).messages),
|
|
500
557
|
onSuccess: () => {
|
|
501
558
|
h([]), t.refreshAfterCommand();
|
|
502
559
|
},
|
|
503
560
|
children: [
|
|
504
|
-
p.map((e) => /* @__PURE__ */
|
|
561
|
+
p.map((e) => /* @__PURE__ */ P("p", {
|
|
505
562
|
role: "alert",
|
|
506
563
|
className: "stage-form-error",
|
|
507
564
|
children: e
|
|
508
565
|
}, e)),
|
|
509
566
|
d,
|
|
510
|
-
m.map((e) => /* @__PURE__ */
|
|
567
|
+
m.map((e) => /* @__PURE__ */ P("p", {
|
|
511
568
|
role: "alert",
|
|
512
569
|
className: "stage-form-error",
|
|
513
570
|
children: e
|
|
514
571
|
}, e)),
|
|
515
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ F("button", {
|
|
516
573
|
type: "submit",
|
|
517
574
|
children: ["Execute ", n.label]
|
|
518
575
|
})
|
|
519
576
|
]
|
|
520
577
|
})
|
|
521
|
-
}) : /* @__PURE__ */
|
|
578
|
+
}) : /* @__PURE__ */ F("p", {
|
|
522
579
|
className: "stage-note",
|
|
523
580
|
children: [
|
|
524
581
|
"The modeled command “",
|
|
525
582
|
n.command,
|
|
526
583
|
"” is not registered by this Stage."
|
|
527
584
|
]
|
|
528
|
-
}) : /* @__PURE__ */
|
|
585
|
+
}) : /* @__PURE__ */ P("p", {
|
|
529
586
|
className: "stage-note",
|
|
530
587
|
children: "This form is missing its command metadata."
|
|
531
588
|
});
|
|
532
589
|
}
|
|
533
|
-
function
|
|
534
|
-
return /* @__PURE__ */
|
|
590
|
+
function St({ form: e, messages: t }) {
|
|
591
|
+
return /* @__PURE__ */ P("section", {
|
|
535
592
|
className: "stage-command-form",
|
|
536
593
|
"data-command": e.command,
|
|
537
594
|
"data-generation-mode": e.generationMode,
|
|
538
|
-
children: t.map((e) => /* @__PURE__ */
|
|
595
|
+
children: t.map((e) => /* @__PURE__ */ P("p", {
|
|
539
596
|
role: "alert",
|
|
540
597
|
className: "stage-form-error",
|
|
541
598
|
children: e
|
|
542
599
|
}, e))
|
|
543
600
|
});
|
|
544
601
|
}
|
|
545
|
-
function
|
|
546
|
-
let t =
|
|
602
|
+
function Ct(e) {
|
|
603
|
+
let t = K(e, "command");
|
|
547
604
|
if (!t) return;
|
|
548
|
-
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(
|
|
605
|
+
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(q) : [];
|
|
549
606
|
return {
|
|
550
607
|
command: t,
|
|
551
|
-
label:
|
|
608
|
+
label: K(e, "label", t),
|
|
552
609
|
fields: n,
|
|
553
|
-
generationMode:
|
|
554
|
-
layout:
|
|
610
|
+
generationMode: At(e.properties.generationMode),
|
|
611
|
+
layout: jt(e.properties.layout)
|
|
555
612
|
};
|
|
556
613
|
}
|
|
557
|
-
function
|
|
614
|
+
function wt(e, t) {
|
|
558
615
|
return e.generationMode === u.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
559
616
|
name: e.name,
|
|
560
617
|
label: e.name
|
|
561
618
|
}));
|
|
562
619
|
}
|
|
563
|
-
function
|
|
564
|
-
let r = e.layout, i = r ?
|
|
565
|
-
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) =>
|
|
566
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
567
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
568
|
-
columnGap:
|
|
569
|
-
rowGap:
|
|
620
|
+
function Tt(e, t, n) {
|
|
621
|
+
let r = e.layout, i = r ? Mt(r, t) : [];
|
|
622
|
+
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => Et(e, n));
|
|
623
|
+
let a = new Map(t.map((e) => [e.name, e])), o = Nt(r, i), s = {
|
|
624
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => Pt(t + 1, r.columns)).join(" "),
|
|
625
|
+
columnGap: G(r.columnGap),
|
|
626
|
+
rowGap: G(r.rowGap)
|
|
570
627
|
}, c = /* @__PURE__ */ new Set();
|
|
571
|
-
return /* @__PURE__ */
|
|
628
|
+
return /* @__PURE__ */ F("div", {
|
|
572
629
|
className: "stage-command-form__layout",
|
|
573
630
|
style: s,
|
|
574
631
|
children: [i.map((e) => {
|
|
575
632
|
let t = a.get(e.field);
|
|
576
|
-
return t ? (c.add(t.name),
|
|
577
|
-
}), t.filter((e) => !c.has(e.name)).map((e) =>
|
|
633
|
+
return t ? (c.add(t.name), Et(t, n, e)) : null;
|
|
634
|
+
}), t.filter((e) => !c.has(e.name)).map((e) => Et(e, n))]
|
|
578
635
|
});
|
|
579
636
|
}
|
|
580
|
-
function
|
|
637
|
+
function Et(e, t, n) {
|
|
581
638
|
let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
|
|
582
639
|
switch (i?.type ?? "text") {
|
|
583
|
-
case "number": return /* @__PURE__ */
|
|
640
|
+
case "number": return /* @__PURE__ */ P(Ne, {
|
|
584
641
|
value: o,
|
|
585
642
|
fieldName: r,
|
|
586
643
|
title: a,
|
|
587
644
|
required: s
|
|
588
645
|
});
|
|
589
|
-
case "boolean": return /* @__PURE__ */
|
|
646
|
+
case "boolean": return /* @__PURE__ */ P(je, {
|
|
590
647
|
value: o,
|
|
591
648
|
fieldName: r,
|
|
592
649
|
label: a,
|
|
593
650
|
required: s
|
|
594
651
|
});
|
|
595
|
-
case "date": return /* @__PURE__ */
|
|
652
|
+
case "date": return /* @__PURE__ */ P(Ae, {
|
|
596
653
|
value: o,
|
|
597
654
|
fieldName: r,
|
|
598
655
|
title: a,
|
|
599
656
|
required: s,
|
|
600
657
|
showIcon: !0
|
|
601
658
|
});
|
|
602
|
-
default: return /* @__PURE__ */
|
|
659
|
+
default: return /* @__PURE__ */ P(Me, {
|
|
603
660
|
value: o,
|
|
604
661
|
fieldName: r,
|
|
605
662
|
title: a,
|
|
606
663
|
required: s
|
|
607
664
|
});
|
|
608
665
|
}
|
|
609
|
-
})(), l =
|
|
610
|
-
return /* @__PURE__ */
|
|
666
|
+
})(), l = Ft(n);
|
|
667
|
+
return /* @__PURE__ */ P("span", {
|
|
611
668
|
className: "stage-command-form__field",
|
|
612
669
|
"data-field": e.name,
|
|
613
670
|
"data-row": n?.row,
|
|
@@ -617,7 +674,7 @@ function vt(e, t, n) {
|
|
|
617
674
|
children: c
|
|
618
675
|
}, e.name);
|
|
619
676
|
}
|
|
620
|
-
function
|
|
677
|
+
function Dt(e, t) {
|
|
621
678
|
let n = {};
|
|
622
679
|
for (let r of e) {
|
|
623
680
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -625,52 +682,52 @@ function yt(e, t) {
|
|
|
625
682
|
}
|
|
626
683
|
return n;
|
|
627
684
|
}
|
|
628
|
-
function
|
|
629
|
-
let r = a(() =>
|
|
685
|
+
function Ot(e, t, n) {
|
|
686
|
+
let r = a(() => kt(e, t), [e, t]), i = r.map((e) => n(e.source)), o = JSON.stringify(i);
|
|
630
687
|
return a(() => {
|
|
631
688
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
632
689
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
633
690
|
}, [r, o]);
|
|
634
691
|
}
|
|
635
|
-
function
|
|
692
|
+
function kt(e, t) {
|
|
636
693
|
let n = e.properties.arguments;
|
|
637
694
|
if (!Array.isArray(n)) return [];
|
|
638
695
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
639
696
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
640
697
|
}
|
|
641
|
-
function
|
|
698
|
+
function At(e) {
|
|
642
699
|
return e === u.Manual ? u.Manual : u.Auto;
|
|
643
700
|
}
|
|
644
|
-
function
|
|
645
|
-
if (!
|
|
701
|
+
function jt(e) {
|
|
702
|
+
if (!q(e)) return;
|
|
646
703
|
let t = e;
|
|
647
704
|
return {
|
|
648
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
649
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
650
|
-
columnGap:
|
|
651
|
-
rowGap:
|
|
705
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(Ht) : [],
|
|
706
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(Ut) : [],
|
|
707
|
+
columnGap: Wt(t.columnGap) ? t.columnGap : void 0,
|
|
708
|
+
rowGap: Wt(t.rowGap) ? t.rowGap : void 0
|
|
652
709
|
};
|
|
653
710
|
}
|
|
654
|
-
function
|
|
711
|
+
function Mt(e, t) {
|
|
655
712
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
656
|
-
for (let e of t) !n.has(e.name) &&
|
|
713
|
+
for (let e of t) !n.has(e.name) && Ut(e.placement) && n.set(e.name, e.placement);
|
|
657
714
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
658
715
|
}
|
|
659
|
-
function
|
|
716
|
+
function Nt(e, t) {
|
|
660
717
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
661
718
|
}
|
|
662
|
-
function
|
|
663
|
-
let n = t.find((t) => t.index === e), r =
|
|
719
|
+
function Pt(e, t) {
|
|
720
|
+
let n = t.find((t) => t.index === e), r = G(n?.width), i = G(n?.minWidth), a = G(n?.maxWidth);
|
|
664
721
|
return n?.width?.unit === d.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
|
|
665
722
|
}
|
|
666
|
-
function
|
|
723
|
+
function Ft(e) {
|
|
667
724
|
if (e) return {
|
|
668
725
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
669
726
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
670
|
-
width: e.width?.unit === d.Fraction ? void 0 :
|
|
727
|
+
width: e.width?.unit === d.Fraction ? void 0 : G(e.width)
|
|
671
728
|
};
|
|
672
729
|
}
|
|
673
|
-
function
|
|
730
|
+
function G(e) {
|
|
674
731
|
if (e) switch (e.unit) {
|
|
675
732
|
case d.Fraction: return `${e.value ?? 1}fr`;
|
|
676
733
|
case d.Pixels: return `${e.value ?? 0}px`;
|
|
@@ -678,31 +735,31 @@ function K(e) {
|
|
|
678
735
|
case d.Auto: return "auto";
|
|
679
736
|
}
|
|
680
737
|
}
|
|
681
|
-
function
|
|
738
|
+
function It(e, t, n, r) {
|
|
682
739
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n);
|
|
683
740
|
if ((t.find((e) => e.name === n)?.required ?? !0) && (r == null || r === "")) return `${i?.label ?? n} is required`;
|
|
684
741
|
}
|
|
685
|
-
function
|
|
742
|
+
function Lt(e, t) {
|
|
686
743
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
687
744
|
return e.flatMap((e) => {
|
|
688
745
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
689
746
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
690
747
|
});
|
|
691
748
|
}
|
|
692
|
-
function
|
|
749
|
+
function Rt(e, t) {
|
|
693
750
|
if (!e) return [];
|
|
694
|
-
let n =
|
|
751
|
+
let n = Mt(e, t).filter((e) => e.width?.unit === d.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === d.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
|
|
695
752
|
return [...n, ...r];
|
|
696
753
|
}
|
|
697
|
-
function
|
|
698
|
-
return
|
|
754
|
+
function zt(e) {
|
|
755
|
+
return Bt(K(e, "schema"));
|
|
699
756
|
}
|
|
700
|
-
function
|
|
757
|
+
function Bt(e) {
|
|
701
758
|
if (!e) return [];
|
|
702
759
|
try {
|
|
703
760
|
let t = JSON.parse(e), n = Object.prototype.hasOwnProperty.call(t, "required"), r = Array.isArray(t.required) ? new Set(t.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set();
|
|
704
761
|
return Object.entries(t.properties ?? {}).map(([e, t]) => {
|
|
705
|
-
let i =
|
|
762
|
+
let i = Vt(t);
|
|
706
763
|
return {
|
|
707
764
|
name: e,
|
|
708
765
|
type: i.type,
|
|
@@ -714,66 +771,66 @@ function Mt(e) {
|
|
|
714
771
|
return [];
|
|
715
772
|
}
|
|
716
773
|
}
|
|
717
|
-
function
|
|
774
|
+
function Vt(e) {
|
|
718
775
|
let t = e?.type;
|
|
719
776
|
if (Array.isArray(t)) {
|
|
720
777
|
let n = t.filter((e) => e !== "null");
|
|
721
|
-
return n.length === 1 ?
|
|
778
|
+
return n.length === 1 ? Vt({
|
|
722
779
|
...e,
|
|
723
780
|
type: n[0]
|
|
724
781
|
}) : { unsupportedReason: `union type ${JSON.stringify(t)}` };
|
|
725
782
|
}
|
|
726
783
|
return t === "integer" || t === "number" ? { type: "number" } : t === "boolean" ? { type: "boolean" } : e?.format === "date" || e?.format === "date-time" ? { type: "date" } : t === "array" || t === "object" ? { unsupportedReason: `${t} fields are not supported by the native Stage command form` } : t === void 0 || t === "string" ? { type: "text" } : { unsupportedReason: `type ${String(t)}` };
|
|
727
784
|
}
|
|
728
|
-
function
|
|
785
|
+
function K(e, t, n = "") {
|
|
729
786
|
let r = e.properties[t];
|
|
730
787
|
return typeof r == "string" ? r : n;
|
|
731
788
|
}
|
|
732
|
-
function
|
|
733
|
-
return
|
|
789
|
+
function Ht(e) {
|
|
790
|
+
return q(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
734
791
|
}
|
|
735
|
-
function
|
|
736
|
-
return
|
|
792
|
+
function Ut(e) {
|
|
793
|
+
return q(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
737
794
|
}
|
|
738
|
-
function
|
|
739
|
-
return
|
|
795
|
+
function Wt(e) {
|
|
796
|
+
return q(e) && Object.values(d).includes(e.unit);
|
|
740
797
|
}
|
|
741
|
-
function
|
|
798
|
+
function q(e) {
|
|
742
799
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
743
800
|
}
|
|
744
801
|
//#endregion
|
|
745
802
|
//#region src/stageNavigation.ts
|
|
746
|
-
function
|
|
803
|
+
function Gt(e, t = {}) {
|
|
747
804
|
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
748
805
|
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
749
806
|
}
|
|
750
|
-
function
|
|
807
|
+
function J(e, t = {}) {
|
|
751
808
|
if (!globalThis.location) return;
|
|
752
|
-
let n =
|
|
809
|
+
let n = Gt(e, t);
|
|
753
810
|
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
754
811
|
}
|
|
755
|
-
function
|
|
812
|
+
function Kt(e) {
|
|
756
813
|
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && typeof e != "object").map(([e, t]) => [e, String(t)]));
|
|
757
814
|
}
|
|
758
815
|
//#endregion
|
|
759
816
|
//#region src/StageGuardedAction.tsx
|
|
760
|
-
function
|
|
817
|
+
function qt(e) {
|
|
761
818
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
762
819
|
}
|
|
763
|
-
function
|
|
820
|
+
function Y(e, t) {
|
|
764
821
|
let n = e.properties[t];
|
|
765
822
|
return typeof n == "string" ? n : "";
|
|
766
823
|
}
|
|
767
|
-
function
|
|
824
|
+
function Jt(e) {
|
|
768
825
|
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
769
826
|
}
|
|
770
|
-
function
|
|
771
|
-
let t = V(), n =
|
|
827
|
+
function Yt(e) {
|
|
828
|
+
let t = V(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries[n] : void 0) ?? Y(e, "itemRoute"), i = qt(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
772
829
|
for (let [e, n] of Object.entries(i)) {
|
|
773
|
-
let r =
|
|
830
|
+
let r = qt(n) ? t.resolveBinding(n) : n;
|
|
774
831
|
a[e] = r, (r == null || r === "") && (o = !1);
|
|
775
832
|
}
|
|
776
|
-
let s =
|
|
833
|
+
let s = tt({
|
|
777
834
|
scope: `${e.id}:item`,
|
|
778
835
|
name: n || void 0,
|
|
779
836
|
route: r || void 0,
|
|
@@ -786,23 +843,23 @@ function Vt(e) {
|
|
|
786
843
|
item: s.rows.length === 1 ? s.rows[0] : void 0
|
|
787
844
|
};
|
|
788
845
|
}
|
|
789
|
-
function
|
|
790
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e,
|
|
846
|
+
function Xt(e, t) {
|
|
847
|
+
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, B(Be(n) ?? "", t)]));
|
|
791
848
|
}
|
|
792
|
-
function
|
|
793
|
-
let n = V(), r =
|
|
794
|
-
if (!
|
|
795
|
-
let n = r.hasSource ? `${
|
|
796
|
-
return /* @__PURE__ */
|
|
849
|
+
function Zt({ element: e, interactions: t }) {
|
|
850
|
+
let n = V(), r = Yt(e), i = bt(), [o, c] = s([]), [l, u] = s(!1), d = Y(e, "label"), f = a(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = qt(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
851
|
+
if (!qe(m) || !h || !r.hasSource) {
|
|
852
|
+
let n = r.hasSource ? `${Ve}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Ve}: “${d}” has no data subject to evaluate its guard against.`;
|
|
853
|
+
return /* @__PURE__ */ F("div", {
|
|
797
854
|
className: "stage-guarded-action",
|
|
798
855
|
"data-scene-id": e.id,
|
|
799
|
-
children: [/* @__PURE__ */
|
|
856
|
+
children: [/* @__PURE__ */ P(I, {
|
|
800
857
|
type: "button",
|
|
801
858
|
disabled: !0,
|
|
802
859
|
title: n,
|
|
803
860
|
...t,
|
|
804
861
|
children: d
|
|
805
|
-
}), /* @__PURE__ */
|
|
862
|
+
}), /* @__PURE__ */ P("p", {
|
|
806
863
|
role: "alert",
|
|
807
864
|
className: "stage-form-error",
|
|
808
865
|
children: n
|
|
@@ -810,41 +867,41 @@ function Ut({ element: e, interactions: t }) {
|
|
|
810
867
|
});
|
|
811
868
|
}
|
|
812
869
|
if (!r.item) return null;
|
|
813
|
-
let g =
|
|
870
|
+
let g = Je(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
814
871
|
if (!_?.command) return null;
|
|
815
|
-
let v = _.command, y =
|
|
872
|
+
let v = _.command, y = W(v), b = r.item, x = async () => {
|
|
816
873
|
if (!y) return;
|
|
817
874
|
u(!0);
|
|
818
|
-
let t = await i(v,
|
|
875
|
+
let t = await i(v, Xt(_, b));
|
|
819
876
|
if (u(!1), c(t.messages), !t.isSuccess) return;
|
|
820
877
|
n.refreshAfterCommand();
|
|
821
|
-
let r =
|
|
822
|
-
r &&
|
|
878
|
+
let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? B(`item.${a}`, b) : void 0;
|
|
879
|
+
r && J(r, a && o != null ? { [a]: String(o) } : {});
|
|
823
880
|
};
|
|
824
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ F("div", {
|
|
825
882
|
className: "stage-guarded-action",
|
|
826
883
|
"data-scene-id": e.id,
|
|
827
884
|
"data-command": v,
|
|
828
|
-
children: [/* @__PURE__ */
|
|
885
|
+
children: [/* @__PURE__ */ P(I, {
|
|
829
886
|
...t,
|
|
830
887
|
type: "button",
|
|
831
888
|
disabled: !y || l,
|
|
832
889
|
title: y ? void 0 : "This command is not exposed as an API yet",
|
|
833
890
|
onClick: () => void x(),
|
|
834
891
|
children: d
|
|
835
|
-
}), o.map((e) => /* @__PURE__ */
|
|
892
|
+
}), o.map((e) => /* @__PURE__ */ P("p", {
|
|
836
893
|
role: "alert",
|
|
837
894
|
className: "stage-form-error",
|
|
838
895
|
children: e
|
|
839
896
|
}, e))]
|
|
840
897
|
});
|
|
841
898
|
}
|
|
842
|
-
function
|
|
843
|
-
let t =
|
|
899
|
+
function Qt(e) {
|
|
900
|
+
let t = O(), r = o(void 0), s = a(() => _(te(e.id, e.behaviors), f.DoubleClick), [e.behaviors, e.id]);
|
|
844
901
|
i(() => () => clearTimeout(r.current), []);
|
|
845
902
|
let c = n((e) => {
|
|
846
903
|
if (clearTimeout(r.current), r.current = void 0, !t) return;
|
|
847
|
-
let n = (n) => n.path === "$guard" ?
|
|
904
|
+
let n = (n) => n.path === "$guard" ? Ye(n.value, e) : n.path?.startsWith("item.") ? B(n.path, e) : t.context.resolve(n);
|
|
848
905
|
y(s, t.dispatcher, {
|
|
849
906
|
...t.context,
|
|
850
907
|
resolve: n
|
|
@@ -867,8 +924,8 @@ function Wt(e) {
|
|
|
867
924
|
}
|
|
868
925
|
//#endregion
|
|
869
926
|
//#region src/stageComponents.tsx
|
|
870
|
-
var
|
|
871
|
-
function
|
|
927
|
+
var $t = "Stage:commandForm";
|
|
928
|
+
function en(e, t, n = {}) {
|
|
872
929
|
return {
|
|
873
930
|
id: e,
|
|
874
931
|
componentName: "",
|
|
@@ -876,19 +933,19 @@ function Kt(e, t, n = {}) {
|
|
|
876
933
|
slots: n
|
|
877
934
|
};
|
|
878
935
|
}
|
|
879
|
-
function
|
|
936
|
+
function X(e, t, n = "") {
|
|
880
937
|
let r = e.properties[t];
|
|
881
938
|
return typeof r == "string" ? r : n;
|
|
882
939
|
}
|
|
883
|
-
function
|
|
940
|
+
function tn(e, t) {
|
|
884
941
|
let n = e.properties.queryArguments;
|
|
885
|
-
if (!
|
|
942
|
+
if (!on(n)) return {
|
|
886
943
|
values: {},
|
|
887
944
|
ready: !0
|
|
888
945
|
};
|
|
889
946
|
let r = {}, i = !0;
|
|
890
947
|
for (let [e, a] of Object.entries(n)) {
|
|
891
|
-
let n =
|
|
948
|
+
let n = an(a) ? t.resolveBinding(a) : a;
|
|
892
949
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
893
950
|
}
|
|
894
951
|
return {
|
|
@@ -896,7 +953,7 @@ function qt(e, t) {
|
|
|
896
953
|
ready: i
|
|
897
954
|
};
|
|
898
955
|
}
|
|
899
|
-
function
|
|
956
|
+
function nn(e, t) {
|
|
900
957
|
let n = (e.slots.columns ?? []).map((e) => {
|
|
901
958
|
let t = e.properties;
|
|
902
959
|
return {
|
|
@@ -909,20 +966,20 @@ function Jt(e, t) {
|
|
|
909
966
|
}));
|
|
910
967
|
return n.length > 0 ? n : r;
|
|
911
968
|
}
|
|
912
|
-
function
|
|
969
|
+
function Z(e, t) {
|
|
913
970
|
return e[t] ?? e.id ?? e.key;
|
|
914
971
|
}
|
|
915
|
-
function
|
|
916
|
-
let n = V(), r =
|
|
972
|
+
function rn({ element: e, slots: t }) {
|
|
973
|
+
let n = V(), r = X(e, "query", X(e, "typeName", e.id)), o = (X(e, "query") ? n.routes?.queries[X(e, "query")] : void 0) ?? X(e, "route"), s = a(() => tn(e, n), [n, e]), { rows: c, error: l, loading: u } = tt({
|
|
917
974
|
scope: e.id,
|
|
918
975
|
name: r,
|
|
919
976
|
route: o || void 0,
|
|
920
977
|
arguments: s.values,
|
|
921
978
|
ready: s.ready
|
|
922
|
-
}), d =
|
|
979
|
+
}), d = nn(e, c), f = X(e, "navigateOnRowClickToScreen"), p = X(e, "navigateOnRowClickByParameter"), m = X(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = Qt(e);
|
|
923
980
|
i(() => {
|
|
924
981
|
if (!h) return;
|
|
925
|
-
let t =
|
|
982
|
+
let t = Z(h, m), r = t === void 0 ? void 0 : c.find((e) => Z(e, m) === t);
|
|
926
983
|
if (r && r !== h) {
|
|
927
984
|
n.selectRow(e.id, r);
|
|
928
985
|
return;
|
|
@@ -941,8 +998,8 @@ function Yt({ element: e, slots: t }) {
|
|
|
941
998
|
h && n.clearSelection(e.id);
|
|
942
999
|
return;
|
|
943
1000
|
}
|
|
944
|
-
if (h && String(
|
|
945
|
-
let t = c.find((e) => String(
|
|
1001
|
+
if (h && String(Z(h, m)) === g) return;
|
|
1002
|
+
let t = c.find((e) => String(Z(e, m)) === g);
|
|
946
1003
|
t && n.selectRow(e.id, t);
|
|
947
1004
|
}, [
|
|
948
1005
|
n,
|
|
@@ -954,51 +1011,51 @@ function Yt({ element: e, slots: t }) {
|
|
|
954
1011
|
h
|
|
955
1012
|
]);
|
|
956
1013
|
let v = (t) => {
|
|
957
|
-
let r =
|
|
1014
|
+
let r = Z(t, m);
|
|
958
1015
|
if (p && r != null) {
|
|
959
1016
|
let i = {
|
|
960
1017
|
...f && f !== n.screen ? {} : n.parameters,
|
|
961
1018
|
[p]: String(r)
|
|
962
1019
|
};
|
|
963
|
-
(!f || f === n.screen) && n.selectRow(e.id, t),
|
|
1020
|
+
(!f || f === n.screen) && n.selectRow(e.id, t), J(f || n.screen, i);
|
|
964
1021
|
return;
|
|
965
1022
|
}
|
|
966
1023
|
n.selectRow(e.id, t);
|
|
967
1024
|
};
|
|
968
|
-
return o ? /* @__PURE__ */
|
|
1025
|
+
return o ? /* @__PURE__ */ F("section", {
|
|
969
1026
|
className: "stage-table",
|
|
970
1027
|
"data-scene-id": e.id,
|
|
971
1028
|
children: [
|
|
972
|
-
u && /* @__PURE__ */
|
|
973
|
-
element:
|
|
1029
|
+
u && /* @__PURE__ */ P(Ce, {
|
|
1030
|
+
element: en(`${e.id}-loading`, {
|
|
974
1031
|
severity: "info",
|
|
975
1032
|
text: "Loading…"
|
|
976
1033
|
}),
|
|
977
1034
|
slots: {}
|
|
978
1035
|
}),
|
|
979
|
-
l && /* @__PURE__ */
|
|
980
|
-
element:
|
|
1036
|
+
l && /* @__PURE__ */ P(Ce, {
|
|
1037
|
+
element: en(`${e.id}-error`, {
|
|
981
1038
|
severity: "error",
|
|
982
1039
|
text: l
|
|
983
1040
|
}),
|
|
984
1041
|
slots: {}
|
|
985
1042
|
}),
|
|
986
|
-
h && /* @__PURE__ */
|
|
1043
|
+
h && /* @__PURE__ */ P(I, {
|
|
987
1044
|
type: "button",
|
|
988
1045
|
size: "small",
|
|
989
1046
|
onClick: () => {
|
|
990
1047
|
if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
|
|
991
1048
|
let { [p]: t, ...r } = n.parameters;
|
|
992
|
-
|
|
1049
|
+
J(n.screen, r);
|
|
993
1050
|
},
|
|
994
1051
|
children: "Clear selection"
|
|
995
1052
|
}),
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
"aria-label":
|
|
998
|
-
children: [/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ F("table", {
|
|
1054
|
+
"aria-label": X(e, "label", X(e, "typeName", "Results")),
|
|
1055
|
+
children: [/* @__PURE__ */ P("thead", { children: /* @__PURE__ */ P("tr", { children: d.map((e) => /* @__PURE__ */ P("th", {
|
|
999
1056
|
scope: "col",
|
|
1000
1057
|
children: e.label
|
|
1001
|
-
}, e.property)) }) }), /* @__PURE__ */
|
|
1058
|
+
}, e.property)) }) }), /* @__PURE__ */ F("tbody", { children: [c.map((e, t) => /* @__PURE__ */ P("tr", {
|
|
1002
1059
|
"aria-selected": h === e,
|
|
1003
1060
|
tabIndex: 0,
|
|
1004
1061
|
onClick: () => _.click(e, () => v(e)),
|
|
@@ -1006,45 +1063,45 @@ function Yt({ element: e, slots: t }) {
|
|
|
1006
1063
|
onKeyDown: (t) => {
|
|
1007
1064
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
|
|
1008
1065
|
},
|
|
1009
|
-
children: d.map((t) => /* @__PURE__ */
|
|
1010
|
-
}, String(
|
|
1066
|
+
children: d.map((t) => /* @__PURE__ */ P("td", { children: String(e[t.property] ?? "") }, t.property))
|
|
1067
|
+
}, String(Z(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ P("tr", { children: /* @__PURE__ */ P("td", {
|
|
1011
1068
|
colSpan: Math.max(d.length, 1),
|
|
1012
1069
|
children: "No records found"
|
|
1013
1070
|
}) })] })]
|
|
1014
1071
|
})
|
|
1015
1072
|
]
|
|
1016
|
-
}) : /* @__PURE__ */
|
|
1073
|
+
}) : /* @__PURE__ */ F("section", {
|
|
1017
1074
|
className: "stage-table",
|
|
1018
1075
|
"data-scene-id": e.id,
|
|
1019
|
-
children: [/* @__PURE__ */
|
|
1076
|
+
children: [/* @__PURE__ */ F("p", {
|
|
1020
1077
|
className: "stage-note",
|
|
1021
1078
|
children: [
|
|
1022
1079
|
"No query is exposed for ",
|
|
1023
|
-
|
|
1080
|
+
X(e, "typeName", "this read model"),
|
|
1024
1081
|
" yet."
|
|
1025
1082
|
]
|
|
1026
1083
|
}), t.columns]
|
|
1027
1084
|
});
|
|
1028
1085
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1086
|
+
function an(e) {
|
|
1087
|
+
return on(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
1031
1088
|
}
|
|
1032
|
-
function
|
|
1089
|
+
function on(e) {
|
|
1033
1090
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1034
1091
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
1092
|
+
function sn({ element: e, interactions: t, slots: n }) {
|
|
1093
|
+
return Jt(e) ? /* @__PURE__ */ P(Zt, {
|
|
1037
1094
|
element: e,
|
|
1038
1095
|
interactions: t
|
|
1039
|
-
}) : /* @__PURE__ */
|
|
1096
|
+
}) : /* @__PURE__ */ P(cn, {
|
|
1040
1097
|
element: e,
|
|
1041
1098
|
interactions: t,
|
|
1042
1099
|
slots: n
|
|
1043
1100
|
});
|
|
1044
1101
|
}
|
|
1045
|
-
function
|
|
1046
|
-
let n =
|
|
1047
|
-
if (!
|
|
1102
|
+
function cn({ element: e, interactions: t }) {
|
|
1103
|
+
let n = X(e, "label", X(e, "command"));
|
|
1104
|
+
if (!W(X(e, "command"), X(e, "typeName"), X(e, "route"))) return /* @__PURE__ */ P(I, {
|
|
1048
1105
|
type: "button",
|
|
1049
1106
|
"data-scene-id": e.id,
|
|
1050
1107
|
disabled: !0,
|
|
@@ -1052,12 +1109,12 @@ function $t({ element: e, interactions: t }) {
|
|
|
1052
1109
|
...t,
|
|
1053
1110
|
children: n
|
|
1054
1111
|
});
|
|
1055
|
-
let r = /* @__PURE__ */
|
|
1056
|
-
return /* @__PURE__ */
|
|
1112
|
+
let r = /* @__PURE__ */ P(xt, { element: e });
|
|
1113
|
+
return /* @__PURE__ */ P("div", {
|
|
1057
1114
|
className: "stage-action",
|
|
1058
1115
|
"data-scene-id": e.id,
|
|
1059
|
-
children: /* @__PURE__ */
|
|
1060
|
-
element:
|
|
1116
|
+
children: /* @__PURE__ */ P(Se, {
|
|
1117
|
+
element: en(e.id, {
|
|
1061
1118
|
visible: !1,
|
|
1062
1119
|
header: n,
|
|
1063
1120
|
triggerLabel: n
|
|
@@ -1066,38 +1123,38 @@ function $t({ element: e, interactions: t }) {
|
|
|
1066
1123
|
})
|
|
1067
1124
|
});
|
|
1068
1125
|
}
|
|
1069
|
-
function
|
|
1126
|
+
function ln(e) {
|
|
1070
1127
|
let { element: t } = e;
|
|
1071
|
-
if (
|
|
1072
|
-
let n =
|
|
1128
|
+
if (X(t, "kind").toLowerCase() !== "action" || X(t, "slice") !== "") return /* @__PURE__ */ P(x, { ...e });
|
|
1129
|
+
let n = X(t, "name", t.id), r = {
|
|
1073
1130
|
...t,
|
|
1074
1131
|
componentName: "core:action",
|
|
1075
1132
|
properties: {
|
|
1076
|
-
command:
|
|
1077
|
-
label:
|
|
1133
|
+
command: X(t, "target"),
|
|
1134
|
+
label: X(t, "label", n)
|
|
1078
1135
|
}
|
|
1079
1136
|
};
|
|
1080
|
-
return /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ P("span", {
|
|
1081
1138
|
className: "stage-toolbar-action",
|
|
1082
1139
|
"data-scene-toolbar-item": n,
|
|
1083
|
-
children: /* @__PURE__ */
|
|
1140
|
+
children: /* @__PURE__ */ P(sn, {
|
|
1084
1141
|
element: r,
|
|
1085
1142
|
interactions: e.interactions,
|
|
1086
1143
|
slots: e.slots
|
|
1087
1144
|
})
|
|
1088
1145
|
});
|
|
1089
1146
|
}
|
|
1090
|
-
var
|
|
1091
|
-
...
|
|
1092
|
-
"core:table":
|
|
1093
|
-
"core:action":
|
|
1094
|
-
"core:toolbarItem":
|
|
1095
|
-
[
|
|
1147
|
+
var un = {
|
|
1148
|
+
...E,
|
|
1149
|
+
"core:table": rn,
|
|
1150
|
+
"core:action": sn,
|
|
1151
|
+
"core:toolbarItem": ln,
|
|
1152
|
+
[$t]: xt
|
|
1096
1153
|
};
|
|
1097
1154
|
//#endregion
|
|
1098
1155
|
//#region src/useStrings.ts
|
|
1099
|
-
function
|
|
1100
|
-
let e =
|
|
1156
|
+
function dn() {
|
|
1157
|
+
let e = L(), [t, n] = s([]), [r, a] = s(""), [o, c] = s({});
|
|
1101
1158
|
return i(() => {
|
|
1102
1159
|
let t = new AbortController();
|
|
1103
1160
|
return e.locales(t.signal).then((e) => {
|
|
@@ -1114,7 +1171,7 @@ function nn() {
|
|
|
1114
1171
|
dictionary: o
|
|
1115
1172
|
};
|
|
1116
1173
|
}
|
|
1117
|
-
function
|
|
1174
|
+
function fn(e) {
|
|
1118
1175
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1119
1176
|
for (let r of e) for (let e of r.contributions ?? []) {
|
|
1120
1177
|
if (e.contributionPointName !== "Navigation") continue;
|
|
@@ -1127,7 +1184,7 @@ function rn(e) {
|
|
|
1127
1184
|
]);
|
|
1128
1185
|
if (t.has(s)) continue;
|
|
1129
1186
|
t.add(s);
|
|
1130
|
-
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l =
|
|
1187
|
+
let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = hn(r.destination) ? r.destination : void 0;
|
|
1131
1188
|
n.push({
|
|
1132
1189
|
label: i,
|
|
1133
1190
|
targetScreen: a,
|
|
@@ -1135,7 +1192,7 @@ function rn(e) {
|
|
|
1135
1192
|
order: c,
|
|
1136
1193
|
...typeof r.icon == "string" ? { icon: r.icon } : {},
|
|
1137
1194
|
...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
|
|
1138
|
-
...l &&
|
|
1195
|
+
...l && gn(l) ? { destination: l } : {}
|
|
1139
1196
|
});
|
|
1140
1197
|
}
|
|
1141
1198
|
return n.map((e, t) => ({
|
|
@@ -1143,7 +1200,7 @@ function rn(e) {
|
|
|
1143
1200
|
index: t
|
|
1144
1201
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
1145
1202
|
}
|
|
1146
|
-
function
|
|
1203
|
+
function pn(e) {
|
|
1147
1204
|
let t = {
|
|
1148
1205
|
label: "",
|
|
1149
1206
|
children: []
|
|
@@ -1168,21 +1225,21 @@ function an(e) {
|
|
|
1168
1225
|
}
|
|
1169
1226
|
return t.children;
|
|
1170
1227
|
}
|
|
1171
|
-
function
|
|
1228
|
+
function mn(e, t) {
|
|
1172
1229
|
for (let n of e) {
|
|
1173
1230
|
if (n.screen === t) return [n.label];
|
|
1174
|
-
let e =
|
|
1231
|
+
let e = mn(n.children, t);
|
|
1175
1232
|
if (e.length > 0) return [n.label, ...e];
|
|
1176
1233
|
}
|
|
1177
1234
|
return [];
|
|
1178
1235
|
}
|
|
1179
|
-
function
|
|
1236
|
+
function hn(e) {
|
|
1180
1237
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1181
1238
|
}
|
|
1182
|
-
function
|
|
1239
|
+
function gn(e) {
|
|
1183
1240
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
1184
1241
|
}
|
|
1185
|
-
function
|
|
1242
|
+
function _n(e, t, n) {
|
|
1186
1243
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
1187
1244
|
label: e.name,
|
|
1188
1245
|
targetScreen: e.name,
|
|
@@ -1191,77 +1248,77 @@ function ln(e, t, n) {
|
|
|
1191
1248
|
}
|
|
1192
1249
|
//#endregion
|
|
1193
1250
|
//#region src/blueprint.ts
|
|
1194
|
-
var
|
|
1195
|
-
function
|
|
1196
|
-
let t =
|
|
1197
|
-
return n.splice(Math.max(n.indexOf(
|
|
1251
|
+
var vn = "Stage:locale";
|
|
1252
|
+
function yn(e) {
|
|
1253
|
+
let t = ve(e), n = t.packages.filter((e) => e !== "PrimeReact");
|
|
1254
|
+
return n.splice(Math.max(n.indexOf(ue), 0), 0, "PrimeReact"), {
|
|
1198
1255
|
...t,
|
|
1199
1256
|
name: e?.length ? t.name : "Stage",
|
|
1200
1257
|
packages: n
|
|
1201
1258
|
};
|
|
1202
1259
|
}
|
|
1203
|
-
var
|
|
1204
|
-
...
|
|
1205
|
-
PrimeReact:
|
|
1260
|
+
var bn = {
|
|
1261
|
+
...se,
|
|
1262
|
+
PrimeReact: Te.components
|
|
1206
1263
|
};
|
|
1207
|
-
function
|
|
1264
|
+
function xn(e) {
|
|
1208
1265
|
return {
|
|
1209
|
-
...
|
|
1210
|
-
...
|
|
1211
|
-
...
|
|
1212
|
-
...
|
|
1266
|
+
...E,
|
|
1267
|
+
...we,
|
|
1268
|
+
...le,
|
|
1269
|
+
..._e,
|
|
1213
1270
|
...e
|
|
1214
1271
|
};
|
|
1215
1272
|
}
|
|
1216
|
-
function
|
|
1273
|
+
function Sn(e) {
|
|
1217
1274
|
return e ? {
|
|
1218
1275
|
...e,
|
|
1219
|
-
...
|
|
1220
|
-
} :
|
|
1276
|
+
...bn
|
|
1277
|
+
} : bn;
|
|
1221
1278
|
}
|
|
1222
|
-
var
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1279
|
+
var Cn = "Stage:navigationTree";
|
|
1280
|
+
function wn(e, t, n) {
|
|
1281
|
+
return N(e, j.Logo, {
|
|
1225
1282
|
label: t,
|
|
1226
1283
|
initials: t.slice(0, 1).toUpperCase() || "S",
|
|
1227
1284
|
targetScreen: "",
|
|
1228
1285
|
...n ? { lightImageUrl: n } : {}
|
|
1229
1286
|
});
|
|
1230
1287
|
}
|
|
1231
|
-
function
|
|
1232
|
-
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l =
|
|
1288
|
+
function Tn(e, t, n, r, i, a = !1, o = !0) {
|
|
1289
|
+
let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = fn(e), u = _n(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = pn([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => ge({
|
|
1233
1290
|
label: e.name,
|
|
1234
1291
|
targetScreen: e.name,
|
|
1235
1292
|
icon: "pi pi-table",
|
|
1236
1293
|
group: "Screens",
|
|
1237
1294
|
order: n
|
|
1238
|
-
}, t)), p =
|
|
1295
|
+
}, t)), p = mn(pn(l), t), m = e.find((e) => e.name === t)?.path?.length ? mn(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", Cn, {
|
|
1239
1296
|
nodes: d,
|
|
1240
1297
|
activeScreen: t
|
|
1241
|
-
}) :
|
|
1298
|
+
}) : N("menu-screens", j.Menu, {
|
|
1242
1299
|
title: "Screens",
|
|
1243
1300
|
label: "Screens"
|
|
1244
1301
|
}, { items: f }), _ = [];
|
|
1245
|
-
n.length > 1 && _.push(
|
|
1302
|
+
n.length > 1 && _.push(N("topbar-locale", vn, {
|
|
1246
1303
|
locales: n,
|
|
1247
1304
|
locale: r
|
|
1248
|
-
})), _.push(
|
|
1305
|
+
})), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
|
|
1249
1306
|
let v = { regionNavigation: a };
|
|
1250
1307
|
return {
|
|
1251
|
-
[
|
|
1252
|
-
logo: [
|
|
1308
|
+
[M.Topbar]: [N("topbar", j.Topbar, v, {
|
|
1309
|
+
logo: [wn("topbar-logo", c, i?.image)],
|
|
1253
1310
|
end: _
|
|
1254
1311
|
})],
|
|
1255
|
-
[
|
|
1256
|
-
...a ? {} : { [
|
|
1257
|
-
[
|
|
1312
|
+
[M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [wn("sidebar-logo", c, i?.image)] })],
|
|
1313
|
+
...a ? {} : { [M.Menu]: [g] },
|
|
1314
|
+
[M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
|
|
1258
1315
|
homeTargetScreen: s,
|
|
1259
1316
|
items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
|
|
1260
1317
|
})],
|
|
1261
|
-
...o ? { [
|
|
1262
|
-
[
|
|
1318
|
+
...o ? { [M.Footer]: [N("footer", j.Footer, { text: `${c} · rendered from your model` })] } : {},
|
|
1319
|
+
[M.ConfigPanel]: [N(j.ConfigPanel, j.ConfigPanel, {
|
|
1263
1320
|
title: "Settings",
|
|
1264
|
-
themes:
|
|
1321
|
+
themes: de.map((e) => ({
|
|
1265
1322
|
name: e.name,
|
|
1266
1323
|
label: e.name,
|
|
1267
1324
|
isDark: e.isDark ?? !1
|
|
@@ -1269,65 +1326,65 @@ function _n(e, t, n, r, i, a = !1, o = !0) {
|
|
|
1269
1326
|
})]
|
|
1270
1327
|
};
|
|
1271
1328
|
}
|
|
1272
|
-
function
|
|
1329
|
+
function En(e) {
|
|
1273
1330
|
return `#/${encodeURIComponent(e)}`;
|
|
1274
1331
|
}
|
|
1275
1332
|
//#endregion
|
|
1276
1333
|
//#region src/StageChrome.tsx
|
|
1277
|
-
var
|
|
1334
|
+
var Dn = e({
|
|
1278
1335
|
locales: [],
|
|
1279
1336
|
locale: "",
|
|
1280
1337
|
setLocale: () => void 0,
|
|
1281
1338
|
activity: ""
|
|
1282
1339
|
});
|
|
1283
|
-
function
|
|
1284
|
-
return /* @__PURE__ */
|
|
1340
|
+
function On({ state: e, children: t }) {
|
|
1341
|
+
return /* @__PURE__ */ P(Dn.Provider, {
|
|
1285
1342
|
value: e,
|
|
1286
1343
|
children: t
|
|
1287
1344
|
});
|
|
1288
1345
|
}
|
|
1289
|
-
var
|
|
1290
|
-
function
|
|
1291
|
-
let { locales: e, locale: t, setLocale: n } = r(
|
|
1292
|
-
return e.length < 2 ? null : /* @__PURE__ */
|
|
1346
|
+
var kn = "Stage:activity";
|
|
1347
|
+
function An() {
|
|
1348
|
+
let { locales: e, locale: t, setLocale: n } = r(Dn);
|
|
1349
|
+
return e.length < 2 ? null : /* @__PURE__ */ P("select", {
|
|
1293
1350
|
className: "stage-locale",
|
|
1294
1351
|
"aria-label": "Locale",
|
|
1295
1352
|
value: t,
|
|
1296
1353
|
onChange: (e) => n(e.target.value),
|
|
1297
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1354
|
+
children: e.map((e) => /* @__PURE__ */ P("option", {
|
|
1298
1355
|
value: e,
|
|
1299
1356
|
children: e
|
|
1300
1357
|
}, e))
|
|
1301
1358
|
});
|
|
1302
1359
|
}
|
|
1303
|
-
function
|
|
1360
|
+
function jn({ element: e }) {
|
|
1304
1361
|
let t = e.properties ?? {};
|
|
1305
|
-
return /* @__PURE__ */
|
|
1362
|
+
return /* @__PURE__ */ P("nav", {
|
|
1306
1363
|
className: "stage-navigation-tree",
|
|
1307
1364
|
"aria-label": "Navigation",
|
|
1308
1365
|
"data-scene-id": e.id,
|
|
1309
|
-
children: /* @__PURE__ */
|
|
1366
|
+
children: /* @__PURE__ */ P(Mn, {
|
|
1310
1367
|
nodes: t.nodes ?? [],
|
|
1311
1368
|
activeScreen: t.activeScreen
|
|
1312
1369
|
})
|
|
1313
1370
|
});
|
|
1314
1371
|
}
|
|
1315
|
-
function
|
|
1316
|
-
return /* @__PURE__ */
|
|
1372
|
+
function Mn({ nodes: e, activeScreen: t }) {
|
|
1373
|
+
return /* @__PURE__ */ P("ul", {
|
|
1317
1374
|
role: "tree",
|
|
1318
|
-
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */
|
|
1375
|
+
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
|
|
1319
1376
|
role: "treeitem",
|
|
1320
1377
|
"aria-expanded": "true",
|
|
1321
|
-
children: [/* @__PURE__ */
|
|
1378
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1322
1379
|
className: "stage-navigation-group",
|
|
1323
1380
|
children: e.label
|
|
1324
|
-
}), /* @__PURE__ */
|
|
1381
|
+
}), /* @__PURE__ */ P(Mn, {
|
|
1325
1382
|
nodes: e.children,
|
|
1326
1383
|
activeScreen: t
|
|
1327
1384
|
})]
|
|
1328
|
-
}, e.label) : /* @__PURE__ */
|
|
1385
|
+
}, e.label) : /* @__PURE__ */ P("li", {
|
|
1329
1386
|
role: "treeitem",
|
|
1330
|
-
children: /* @__PURE__ */
|
|
1387
|
+
children: /* @__PURE__ */ P(Nn, {
|
|
1331
1388
|
node: e,
|
|
1332
1389
|
screen: e.screen,
|
|
1333
1390
|
activeScreen: t
|
|
@@ -1335,56 +1392,56 @@ function wn({ nodes: e, activeScreen: t }) {
|
|
|
1335
1392
|
}, `${e.screen}:${e.label}`))
|
|
1336
1393
|
});
|
|
1337
1394
|
}
|
|
1338
|
-
function
|
|
1339
|
-
let i = r(
|
|
1395
|
+
function Nn({ node: e, screen: t, activeScreen: n }) {
|
|
1396
|
+
let i = r(w), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s && gn(o) ? (e) => {
|
|
1340
1397
|
e.preventDefault(), i.navigate(o);
|
|
1341
1398
|
} : void 0;
|
|
1342
|
-
return /* @__PURE__ */
|
|
1343
|
-
href: s ? o.route :
|
|
1399
|
+
return /* @__PURE__ */ F("a", {
|
|
1400
|
+
href: s ? o.route : En(t),
|
|
1344
1401
|
rel: s ? "noreferrer" : void 0,
|
|
1345
1402
|
"aria-current": t === n ? "page" : void 0,
|
|
1346
1403
|
"aria-label": a === "icon" ? e.label : void 0,
|
|
1347
1404
|
"data-presentation": e.presentation,
|
|
1348
1405
|
"data-icon": e.icon,
|
|
1349
1406
|
onClick: c,
|
|
1350
|
-
children: [a !== "text" && e.icon && /* @__PURE__ */
|
|
1407
|
+
children: [a !== "text" && e.icon && /* @__PURE__ */ P("span", {
|
|
1351
1408
|
className: "stage-navigation-icon",
|
|
1352
1409
|
"aria-hidden": "true",
|
|
1353
1410
|
"data-icon-name": e.icon
|
|
1354
1411
|
}), a !== "icon" && e.label]
|
|
1355
1412
|
});
|
|
1356
1413
|
}
|
|
1357
|
-
function
|
|
1358
|
-
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(
|
|
1359
|
-
return /* @__PURE__ */
|
|
1414
|
+
function Pn({ element: e }) {
|
|
1415
|
+
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(w), i = ie(), a = V(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
|
|
1416
|
+
return /* @__PURE__ */ F("div", {
|
|
1360
1417
|
"data-scene-outlet": t,
|
|
1361
1418
|
"data-scene-outlet-screen": o,
|
|
1362
|
-
children: [c && o && /* @__PURE__ */
|
|
1419
|
+
children: [c && o && /* @__PURE__ */ P("div", {
|
|
1363
1420
|
className: "scene-outlet-bar",
|
|
1364
|
-
children: /* @__PURE__ */
|
|
1421
|
+
children: /* @__PURE__ */ P("button", {
|
|
1365
1422
|
type: "button",
|
|
1366
1423
|
className: "scene-outlet-close",
|
|
1367
1424
|
"aria-label": "Close",
|
|
1368
1425
|
onClick: () => n?.closeOutlet(t),
|
|
1369
1426
|
children: "Close"
|
|
1370
1427
|
})
|
|
1371
|
-
}), s && i && /* @__PURE__ */
|
|
1428
|
+
}), s && i && /* @__PURE__ */ P(C, {
|
|
1372
1429
|
element: s,
|
|
1373
1430
|
registry: i.registry,
|
|
1374
1431
|
resolveBinding: a.resolveBinding
|
|
1375
1432
|
})]
|
|
1376
1433
|
});
|
|
1377
1434
|
}
|
|
1378
|
-
function
|
|
1379
|
-
let { activity: e } = r(
|
|
1380
|
-
return e ? /* @__PURE__ */
|
|
1435
|
+
function Fn() {
|
|
1436
|
+
let { activity: e } = r(Dn);
|
|
1437
|
+
return e ? /* @__PURE__ */ P("p", {
|
|
1381
1438
|
className: "stage-activity",
|
|
1382
1439
|
role: "status",
|
|
1383
1440
|
children: e
|
|
1384
1441
|
}) : null;
|
|
1385
1442
|
}
|
|
1386
|
-
function
|
|
1387
|
-
let e =
|
|
1443
|
+
function In() {
|
|
1444
|
+
let e = k(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
1388
1445
|
return i(() => {
|
|
1389
1446
|
let r = e?.isDark ? "dark" : "light";
|
|
1390
1447
|
document.documentElement.setAttribute("data-scene-color-scheme", r), document.body.setAttribute("data-scene-color-scheme", r), document.body.style.backgroundColor = t ?? "", document.body.style.color = n ?? "";
|
|
@@ -1394,44 +1451,44 @@ function On() {
|
|
|
1394
1451
|
n
|
|
1395
1452
|
]), null;
|
|
1396
1453
|
}
|
|
1397
|
-
var
|
|
1398
|
-
[
|
|
1399
|
-
[
|
|
1400
|
-
[
|
|
1401
|
-
"core:outlet":
|
|
1402
|
-
},
|
|
1454
|
+
var Ln = {
|
|
1455
|
+
[vn]: An,
|
|
1456
|
+
[Cn]: jn,
|
|
1457
|
+
[kn]: Fn,
|
|
1458
|
+
"core:outlet": Pn
|
|
1459
|
+
}, Rn = [
|
|
1403
1460
|
"navigationMode",
|
|
1404
1461
|
"menuTheme",
|
|
1405
1462
|
"showFooter"
|
|
1406
|
-
],
|
|
1407
|
-
function
|
|
1463
|
+
], zn = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1464
|
+
function Bn(e, t, n = !1) {
|
|
1408
1465
|
let r = [], i = t.options ?? {}, a = {
|
|
1409
1466
|
showFooter: !0,
|
|
1410
1467
|
followsSystem: !1,
|
|
1411
1468
|
problems: r
|
|
1412
1469
|
};
|
|
1413
1470
|
for (let [e, n] of Object.entries(i)) {
|
|
1414
|
-
if (!
|
|
1415
|
-
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${
|
|
1471
|
+
if (!Rn.includes(e)) {
|
|
1472
|
+
r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Rn.join(", ")}.`);
|
|
1416
1473
|
continue;
|
|
1417
1474
|
}
|
|
1418
1475
|
if (e === "navigationMode") {
|
|
1419
|
-
let e =
|
|
1420
|
-
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${
|
|
1476
|
+
let e = me.find((e) => e === n);
|
|
1477
|
+
e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${me.join(", ")}.`);
|
|
1421
1478
|
} else if (e === "menuTheme") {
|
|
1422
|
-
let e =
|
|
1423
|
-
e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${
|
|
1479
|
+
let e = he.find((e) => e === n);
|
|
1480
|
+
e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${he.join(", ")}.`);
|
|
1424
1481
|
} else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
|
|
1425
1482
|
}
|
|
1426
1483
|
let o = e?.appearance;
|
|
1427
1484
|
if (o?.colorScheme !== void 0) {
|
|
1428
1485
|
a.followsSystem = o.colorScheme === c.System;
|
|
1429
1486
|
let e = a.followsSystem ? n : o.colorScheme === c.Dark;
|
|
1430
|
-
a.colorScheme = e ?
|
|
1487
|
+
a.colorScheme = e ? A.Dark : A.Light, a.themeName = de.find((t) => (t.isDark ?? !1) === e)?.name;
|
|
1431
1488
|
}
|
|
1432
|
-
return o?.accent !== void 0 && (
|
|
1489
|
+
return o?.accent !== void 0 && (zn.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
|
|
1433
1490
|
}
|
|
1434
|
-
function
|
|
1491
|
+
function Vn(e, t) {
|
|
1435
1492
|
if (e?.root === void 0) return [];
|
|
1436
1493
|
let n = /* @__PURE__ */ new Set([
|
|
1437
1494
|
p.RootTemplateUnknown,
|
|
@@ -1443,7 +1500,7 @@ function Nn(e, t) {
|
|
|
1443
1500
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
1444
1501
|
return r.length === 0 && t.origin !== m.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
|
|
1445
1502
|
}
|
|
1446
|
-
function
|
|
1503
|
+
function Hn(e) {
|
|
1447
1504
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
1448
1505
|
0,
|
|
1449
1506
|
2,
|
|
@@ -1451,7 +1508,7 @@ function Pn(e) {
|
|
|
1451
1508
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
1452
1509
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
1453
1510
|
}
|
|
1454
|
-
function
|
|
1511
|
+
function Un(e, t) {
|
|
1455
1512
|
if (t === void 0) return e;
|
|
1456
1513
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
1457
1514
|
0,
|
|
@@ -1463,20 +1520,20 @@ function Fn(e, t) {
|
|
|
1463
1520
|
tokens: {
|
|
1464
1521
|
...e.tokens,
|
|
1465
1522
|
"primary.color": t,
|
|
1466
|
-
"primary.contrastColor":
|
|
1523
|
+
"primary.contrastColor": Hn(t),
|
|
1467
1524
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
1468
1525
|
}
|
|
1469
1526
|
}));
|
|
1470
1527
|
}
|
|
1471
1528
|
//#endregion
|
|
1472
1529
|
//#region src/StageShellSettings.tsx
|
|
1473
|
-
var
|
|
1474
|
-
function
|
|
1530
|
+
var Wn = "(prefers-color-scheme: dark)";
|
|
1531
|
+
function Gn() {
|
|
1475
1532
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
1476
1533
|
}
|
|
1477
|
-
function
|
|
1478
|
-
let n = o(
|
|
1479
|
-
n.current =
|
|
1534
|
+
function Kn({ settings: e, onSystemSchemeChange: t }) {
|
|
1535
|
+
let n = o(ye());
|
|
1536
|
+
n.current = ye();
|
|
1480
1537
|
let { mode: r, menuTheme: a, colorScheme: s, themeName: c } = e;
|
|
1481
1538
|
return i(() => {
|
|
1482
1539
|
let { setMode: e, setMenuTheme: t, setColorScheme: i, setThemeName: o } = n.current;
|
|
@@ -1488,16 +1545,16 @@ function Rn({ settings: e, onSystemSchemeChange: t }) {
|
|
|
1488
1545
|
c
|
|
1489
1546
|
]), i(() => {
|
|
1490
1547
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
1491
|
-
let n = globalThis.matchMedia(
|
|
1548
|
+
let n = globalThis.matchMedia(Wn), r = (e) => t(e.matches);
|
|
1492
1549
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
1493
1550
|
}, [e.followsSystem, t]), null;
|
|
1494
1551
|
}
|
|
1495
1552
|
//#endregion
|
|
1496
1553
|
//#region src/stageNavigationModel.ts
|
|
1497
|
-
function
|
|
1554
|
+
function qn(e) {
|
|
1498
1555
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
1499
1556
|
}
|
|
1500
|
-
function
|
|
1557
|
+
function Jn(e) {
|
|
1501
1558
|
let t = /* @__PURE__ */ new Map();
|
|
1502
1559
|
for (let n of e) {
|
|
1503
1560
|
let e = (n.path ?? []).join(".");
|
|
@@ -1510,35 +1567,35 @@ function Bn(e) {
|
|
|
1510
1567
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
1511
1568
|
};
|
|
1512
1569
|
}
|
|
1513
|
-
function
|
|
1570
|
+
function Yn(e) {
|
|
1514
1571
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
1515
1572
|
}
|
|
1516
|
-
function
|
|
1573
|
+
function Xn(e, t) {
|
|
1517
1574
|
return {
|
|
1518
1575
|
structure: e.structure ?? { modules: [] },
|
|
1519
1576
|
navigation: e.navigation ?? {
|
|
1520
1577
|
application: { regions: [] },
|
|
1521
1578
|
modules: []
|
|
1522
1579
|
},
|
|
1523
|
-
screenFor:
|
|
1524
|
-
moduleOf:
|
|
1580
|
+
screenFor: Jn(e.screens),
|
|
1581
|
+
moduleOf: Yn(e.screens),
|
|
1525
1582
|
...t ? { isVisible: t } : {}
|
|
1526
1583
|
};
|
|
1527
1584
|
}
|
|
1528
|
-
var
|
|
1529
|
-
function
|
|
1530
|
-
return
|
|
1585
|
+
var Zn = /* @__PURE__ */ new Set(["core:table"]);
|
|
1586
|
+
function Qn(e) {
|
|
1587
|
+
return $n(e, /* @__PURE__ */ new Map(), void 0);
|
|
1531
1588
|
}
|
|
1532
|
-
function
|
|
1589
|
+
function $n(e, t, n) {
|
|
1533
1590
|
let r = e;
|
|
1534
1591
|
if (!r.slots) return e;
|
|
1535
1592
|
let i = !1, a = {};
|
|
1536
1593
|
for (let [e, o] of Object.entries(r.slots)) {
|
|
1537
1594
|
let r = new Map(t), s = n;
|
|
1538
1595
|
a[e] = o.map((e) => {
|
|
1539
|
-
let t = e, n =
|
|
1596
|
+
let t = e, n = Q(t, "typeName");
|
|
1540
1597
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
1541
|
-
let a =
|
|
1598
|
+
let a = $n(tr(er(t, r), s), r, s);
|
|
1542
1599
|
return a !== e && (i = !0), a;
|
|
1543
1600
|
});
|
|
1544
1601
|
}
|
|
@@ -1547,45 +1604,45 @@ function Gn(e, t, n) {
|
|
|
1547
1604
|
slots: a
|
|
1548
1605
|
} : e;
|
|
1549
1606
|
}
|
|
1550
|
-
function
|
|
1551
|
-
if (!
|
|
1552
|
-
let n =
|
|
1607
|
+
function er(e, t) {
|
|
1608
|
+
if (!Zn.has(e.componentName)) return e;
|
|
1609
|
+
let n = Q(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
1553
1610
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
1554
|
-
let i =
|
|
1555
|
-
return o && (a.query = o),
|
|
1611
|
+
let i = Q(r, "by"), a = { ...e.properties }, o = Q(r, "query");
|
|
1612
|
+
return o && (a.query = o), !Q(e, "route") && Q(r, "route") && (a.route = r.properties.route), i && (a.by = i, a.queryArguments = { [i]: { path: `parameters.${i}` } }), {
|
|
1556
1613
|
...e,
|
|
1557
1614
|
properties: a
|
|
1558
1615
|
};
|
|
1559
1616
|
}
|
|
1560
|
-
function
|
|
1617
|
+
function tr(e, t) {
|
|
1561
1618
|
if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || t.properties?.isCollection === !0 || e.properties.itemQuery !== void 0) return e;
|
|
1562
|
-
let n = { ...e.properties }, r =
|
|
1563
|
-
return r && (n.itemQuery = r),
|
|
1619
|
+
let n = { ...e.properties }, r = Q(t, "query"), i = Q(t, "by");
|
|
1620
|
+
return r && (n.itemQuery = r), Q(t, "route") && (n.itemRoute = t.properties.route), n.itemArguments = i ? { [i]: { path: `parameters.${i}` } } : {}, {
|
|
1564
1621
|
...e,
|
|
1565
1622
|
properties: n
|
|
1566
1623
|
};
|
|
1567
1624
|
}
|
|
1568
|
-
function
|
|
1625
|
+
function Q(e, t) {
|
|
1569
1626
|
let n = e.properties?.[t];
|
|
1570
1627
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
1571
1628
|
}
|
|
1572
1629
|
//#endregion
|
|
1573
1630
|
//#region src/stageSlices.ts
|
|
1574
|
-
function
|
|
1575
|
-
return (t) =>
|
|
1631
|
+
function nr(e) {
|
|
1632
|
+
return (t) => Bt(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0).map((e) => ({
|
|
1576
1633
|
name: e.name,
|
|
1577
1634
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
1578
|
-
label:
|
|
1635
|
+
label: rr(e.name),
|
|
1579
1636
|
required: e.required
|
|
1580
1637
|
}));
|
|
1581
1638
|
}
|
|
1582
|
-
function
|
|
1639
|
+
function rr(e) {
|
|
1583
1640
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
1584
1641
|
}
|
|
1585
|
-
function
|
|
1642
|
+
function ir(e, t, n) {
|
|
1586
1643
|
return { invoke: async (r, i, a) => {
|
|
1587
1644
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
1588
|
-
if (!
|
|
1645
|
+
if (!W(o)) return {
|
|
1589
1646
|
succeeded: !1,
|
|
1590
1647
|
message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
|
|
1591
1648
|
};
|
|
@@ -1603,15 +1660,15 @@ function Xn(e, t, n) {
|
|
|
1603
1660
|
}
|
|
1604
1661
|
//#endregion
|
|
1605
1662
|
//#region src/App.tsx
|
|
1606
|
-
function
|
|
1607
|
-
return
|
|
1663
|
+
function ar(e = {}) {
|
|
1664
|
+
return xn({
|
|
1608
1665
|
...e,
|
|
1609
|
-
...
|
|
1610
|
-
...
|
|
1666
|
+
...un,
|
|
1667
|
+
...Ln
|
|
1611
1668
|
});
|
|
1612
1669
|
}
|
|
1613
|
-
function
|
|
1614
|
-
return
|
|
1670
|
+
function or(e, t) {
|
|
1671
|
+
return N(`form-${e}-${t.name}`, $t, {
|
|
1615
1672
|
command: t.forCommand,
|
|
1616
1673
|
label: t.name,
|
|
1617
1674
|
generationMode: t.generationMode,
|
|
@@ -1619,43 +1676,43 @@ function Qn(e, t) {
|
|
|
1619
1676
|
fields: t.fields
|
|
1620
1677
|
});
|
|
1621
1678
|
}
|
|
1622
|
-
function
|
|
1679
|
+
function sr(e, t) {
|
|
1623
1680
|
let n = e.screens[0];
|
|
1624
|
-
return
|
|
1625
|
-
profile:
|
|
1626
|
-
blueprintTemplates: t?.length ? [...
|
|
1681
|
+
return fe(e, n, {
|
|
1682
|
+
profile: yn(e.uiProfiles),
|
|
1683
|
+
blueprintTemplates: t?.length ? [...pe, ...t] : void 0
|
|
1627
1684
|
});
|
|
1628
1685
|
}
|
|
1629
|
-
function
|
|
1630
|
-
let s =
|
|
1686
|
+
function $(e, t, n, r, i, a, o = !0) {
|
|
1687
|
+
let s = qn(e.navigation), c = e.navigation?.application.logo ? {
|
|
1631
1688
|
title: e.navigation.application.logo.title,
|
|
1632
1689
|
image: e.navigation.application.logo.image || void 0
|
|
1633
1690
|
} : void 0;
|
|
1634
1691
|
return {
|
|
1635
|
-
profile:
|
|
1636
|
-
catalog:
|
|
1637
|
-
blueprintTemplates: a?.length ? [...
|
|
1638
|
-
chrome: (r, i) => i ===
|
|
1639
|
-
form:
|
|
1640
|
-
trailing: [
|
|
1692
|
+
profile: yn(e.uiProfiles),
|
|
1693
|
+
catalog: Sn(r),
|
|
1694
|
+
blueprintTemplates: a?.length ? [...pe, ...a] : void 0,
|
|
1695
|
+
chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Tn(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Tn(e.screens, r.name, t, n, c, s, o),
|
|
1696
|
+
form: or,
|
|
1697
|
+
trailing: [N("activity", kn)],
|
|
1641
1698
|
decorate: (e) => {
|
|
1642
|
-
let t =
|
|
1699
|
+
let t = Qn(e);
|
|
1643
1700
|
return i ? v(t, i) : t;
|
|
1644
1701
|
}
|
|
1645
1702
|
};
|
|
1646
1703
|
}
|
|
1647
|
-
function
|
|
1648
|
-
return
|
|
1704
|
+
function cr(e, t, n, r, i, a) {
|
|
1705
|
+
return ce(e, t, $(e, n, r, i, void 0, a)).element;
|
|
1649
1706
|
}
|
|
1650
|
-
function
|
|
1707
|
+
function lr() {
|
|
1651
1708
|
try {
|
|
1652
1709
|
return globalThis.localStorage ?? null;
|
|
1653
1710
|
} catch {
|
|
1654
1711
|
return null;
|
|
1655
1712
|
}
|
|
1656
1713
|
}
|
|
1657
|
-
function
|
|
1658
|
-
let c =
|
|
1714
|
+
function ur({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: o } = {}) {
|
|
1715
|
+
let c = L(), l = a(() => ar(e), [e]), [u, d] = s(), [f, p] = s(""), m = ze(), h = dn();
|
|
1659
1716
|
return i(() => {
|
|
1660
1717
|
let e = new AbortController();
|
|
1661
1718
|
return c.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -1664,10 +1721,10 @@ function rr({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
1664
1721
|
} : e)).catch((t) => {
|
|
1665
1722
|
e.signal.aborted || p(t instanceof Error ? t.message : String(t));
|
|
1666
1723
|
}), () => e.abort();
|
|
1667
|
-
}, [c, r]), f ? /* @__PURE__ */
|
|
1724
|
+
}, [c, r]), f ? /* @__PURE__ */ F("main", {
|
|
1668
1725
|
className: "stage-message",
|
|
1669
|
-
children: [/* @__PURE__ */
|
|
1670
|
-
}) : u ? /* @__PURE__ */
|
|
1726
|
+
children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
|
|
1727
|
+
}) : u ? /* @__PURE__ */ P(dr, {
|
|
1671
1728
|
scene: u,
|
|
1672
1729
|
registry: l,
|
|
1673
1730
|
routeState: m,
|
|
@@ -1675,21 +1732,21 @@ function rr({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
1675
1732
|
packageCatalog: t,
|
|
1676
1733
|
screenTemplates: n,
|
|
1677
1734
|
isVisible: o
|
|
1678
|
-
}) : /* @__PURE__ */
|
|
1735
|
+
}) : /* @__PURE__ */ P("main", {
|
|
1679
1736
|
className: "stage-message",
|
|
1680
|
-
children: /* @__PURE__ */
|
|
1737
|
+
children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
|
|
1681
1738
|
});
|
|
1682
1739
|
}
|
|
1683
|
-
function
|
|
1684
|
-
let u = a(() =>
|
|
1740
|
+
function dr({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: o, screenTemplates: c, isVisible: l }) {
|
|
1741
|
+
let u = a(() => ne(), []), [d, f] = s(Gn), p = e.screens[0]?.name ?? "", m = a(() => yn(e.uiProfiles), [e]), h = a(() => p ? sr(e, c) : void 0, [
|
|
1685
1742
|
e,
|
|
1686
1743
|
c,
|
|
1687
1744
|
p
|
|
1688
|
-
]), g = a(() => h ?
|
|
1745
|
+
]), g = a(() => h ? Vn(m, h) : [], [m, h]), _ = a(() => h ? Bn(m, h, d) : void 0, [
|
|
1689
1746
|
m,
|
|
1690
1747
|
h,
|
|
1691
1748
|
d
|
|
1692
|
-
]), v = a(() =>
|
|
1749
|
+
]), v = a(() => Un(de, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = a(() => $(e, i.locales, i.locale, o, i.dictionary, c, y), [
|
|
1693
1750
|
e,
|
|
1694
1751
|
i.locales,
|
|
1695
1752
|
i.locale,
|
|
@@ -1697,25 +1754,25 @@ function ir({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
1697
1754
|
o,
|
|
1698
1755
|
c,
|
|
1699
1756
|
y
|
|
1700
|
-
]), x = n((e) => f(e), []),
|
|
1701
|
-
return p ? g.length > 0 ? /* @__PURE__ */
|
|
1757
|
+
]), x = n((e) => f(e), []), S = a(() => Xn(e, l), [e, l]), C = e;
|
|
1758
|
+
return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
|
|
1702
1759
|
className: "stage-message",
|
|
1703
1760
|
role: "alert",
|
|
1704
1761
|
"data-stage-startup-problem": "root-template",
|
|
1705
1762
|
children: [
|
|
1706
|
-
/* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
1763
|
+
/* @__PURE__ */ P("h1", { children: "Unable to start this Stage" }),
|
|
1764
|
+
/* @__PURE__ */ P("p", { children: "The ui profile's root template cannot be the application's shell." }),
|
|
1765
|
+
/* @__PURE__ */ P("ul", { children: g.map((e) => /* @__PURE__ */ P("li", { children: e }, e)) })
|
|
1709
1766
|
]
|
|
1710
|
-
}) : /* @__PURE__ */
|
|
1711
|
-
application:
|
|
1767
|
+
}) : /* @__PURE__ */ P(ae, {
|
|
1768
|
+
application: C,
|
|
1712
1769
|
composition: b,
|
|
1713
|
-
navigationModel:
|
|
1770
|
+
navigationModel: S,
|
|
1714
1771
|
registry: t,
|
|
1715
1772
|
initialScreen: p,
|
|
1716
1773
|
history: u,
|
|
1717
|
-
layoutConfigStorage:
|
|
1718
|
-
scope: (t, n) => /* @__PURE__ */
|
|
1774
|
+
layoutConfigStorage: lr(),
|
|
1775
|
+
scope: (t, n) => /* @__PURE__ */ P(fr, {
|
|
1719
1776
|
scene: e,
|
|
1720
1777
|
routeState: r,
|
|
1721
1778
|
strings: i,
|
|
@@ -1725,24 +1782,24 @@ function ir({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
|
|
|
1725
1782
|
onSystemSchemeChange: x,
|
|
1726
1783
|
children: n
|
|
1727
1784
|
}),
|
|
1728
|
-
renderScreen: (e, n) => /* @__PURE__ */
|
|
1785
|
+
renderScreen: (e, n) => /* @__PURE__ */ P(mr, {
|
|
1729
1786
|
element: e,
|
|
1730
1787
|
configuration: n,
|
|
1731
1788
|
registry: t
|
|
1732
1789
|
}),
|
|
1733
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */
|
|
1790
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(hr, {
|
|
1734
1791
|
template: e,
|
|
1735
1792
|
content: n,
|
|
1736
1793
|
registry: t,
|
|
1737
1794
|
strings: i,
|
|
1738
1795
|
close: () => r.closeDialog()
|
|
1739
1796
|
})
|
|
1740
|
-
}) : /* @__PURE__ */
|
|
1797
|
+
}) : /* @__PURE__ */ F("main", {
|
|
1741
1798
|
className: "stage-message",
|
|
1742
|
-
children: [/* @__PURE__ */
|
|
1799
|
+
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." })]
|
|
1743
1800
|
});
|
|
1744
1801
|
}
|
|
1745
|
-
function
|
|
1802
|
+
function fr({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: c, children: u }) {
|
|
1746
1803
|
let [d, f] = s(""), { navigate: p } = r;
|
|
1747
1804
|
return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
|
|
1748
1805
|
let e = (e) => {
|
|
@@ -1759,22 +1816,22 @@ function ar({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
1759
1816
|
r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? f(`The modeled screen “${r.screen}” is not available.`) : p(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? p(r) : f(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
|
|
1760
1817
|
};
|
|
1761
1818
|
return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
|
|
1762
|
-
}, [p, e]), /* @__PURE__ */
|
|
1819
|
+
}, [p, e]), /* @__PURE__ */ F(oe, {
|
|
1763
1820
|
themes: a,
|
|
1764
1821
|
children: [
|
|
1765
|
-
o && /* @__PURE__ */
|
|
1822
|
+
o && /* @__PURE__ */ P(Kn, {
|
|
1766
1823
|
settings: o,
|
|
1767
1824
|
onSystemSchemeChange: c
|
|
1768
1825
|
}),
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ P(In, {}),
|
|
1827
|
+
/* @__PURE__ */ P(et, {
|
|
1771
1828
|
routes: t.routes,
|
|
1772
1829
|
routesReady: t.ready,
|
|
1773
1830
|
parameters: r.currentParameters,
|
|
1774
1831
|
locale: n.locale,
|
|
1775
1832
|
locales: n.locales,
|
|
1776
1833
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
1777
|
-
children: /* @__PURE__ */
|
|
1834
|
+
children: /* @__PURE__ */ P(pr, {
|
|
1778
1835
|
activity: d,
|
|
1779
1836
|
routesReady: t.ready,
|
|
1780
1837
|
scene: e,
|
|
@@ -1786,14 +1843,14 @@ function ar({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
|
|
|
1786
1843
|
]
|
|
1787
1844
|
});
|
|
1788
1845
|
}
|
|
1789
|
-
function
|
|
1790
|
-
let s = V(), c =
|
|
1846
|
+
function pr({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: o }) {
|
|
1847
|
+
let s = V(), c = re(), u = bt(), d = a(() => ir(u, t, s.refreshAfterCommand), [
|
|
1791
1848
|
u,
|
|
1792
1849
|
t,
|
|
1793
1850
|
s.refreshAfterCommand
|
|
1794
|
-
]), f = a(() =>
|
|
1851
|
+
]), f = a(() => nr(n.commandSchemas), [n.commandSchemas]), p = D({
|
|
1795
1852
|
executeCommand: async (e, n) => {
|
|
1796
|
-
let i =
|
|
1853
|
+
let i = W(e);
|
|
1797
1854
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
1798
1855
|
isSuccess: !1,
|
|
1799
1856
|
validationErrors: []
|
|
@@ -1810,7 +1867,7 @@ function or({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
1810
1867
|
};
|
|
1811
1868
|
},
|
|
1812
1869
|
navigate: (e, t) => {
|
|
1813
|
-
n.screens.some((t) => t.name === e) ?
|
|
1870
|
+
n.screens.some((t) => t.name === e) ? J(e, Kt(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
1814
1871
|
},
|
|
1815
1872
|
navigateBack: () => globalThis.history?.back(),
|
|
1816
1873
|
openDialog: async (e) => {
|
|
@@ -1827,18 +1884,18 @@ function or({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
1827
1884
|
refreshQuery: async (e) => s.refreshQuery(e),
|
|
1828
1885
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
1829
1886
|
});
|
|
1830
|
-
return /* @__PURE__ */
|
|
1887
|
+
return /* @__PURE__ */ P(On, {
|
|
1831
1888
|
state: {
|
|
1832
1889
|
locales: i.locales,
|
|
1833
1890
|
locale: i.locale,
|
|
1834
1891
|
setLocale: i.setLocale,
|
|
1835
1892
|
activity: e
|
|
1836
1893
|
},
|
|
1837
|
-
children: /* @__PURE__ */
|
|
1894
|
+
children: /* @__PURE__ */ P(ee, {
|
|
1838
1895
|
invoker: d,
|
|
1839
|
-
children: /* @__PURE__ */
|
|
1896
|
+
children: /* @__PURE__ */ P(T, {
|
|
1840
1897
|
fieldsFor: f,
|
|
1841
|
-
children: /* @__PURE__ */
|
|
1898
|
+
children: /* @__PURE__ */ P(S, {
|
|
1842
1899
|
dispatcher: p,
|
|
1843
1900
|
context: {
|
|
1844
1901
|
resolve: s.resolveBinding,
|
|
@@ -1852,34 +1909,34 @@ function or({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
1852
1909
|
})
|
|
1853
1910
|
});
|
|
1854
1911
|
}
|
|
1855
|
-
function
|
|
1912
|
+
function mr({ element: e, configuration: t, registry: n }) {
|
|
1856
1913
|
let r = V();
|
|
1857
|
-
return /* @__PURE__ */
|
|
1914
|
+
return /* @__PURE__ */ P(C, {
|
|
1858
1915
|
element: e,
|
|
1859
1916
|
registry: n,
|
|
1860
1917
|
resolveBinding: r.resolveBinding,
|
|
1861
1918
|
configuration: t
|
|
1862
1919
|
});
|
|
1863
1920
|
}
|
|
1864
|
-
function
|
|
1921
|
+
function hr({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
1865
1922
|
let o = V(), s = v(t, r.dictionary);
|
|
1866
1923
|
return i(() => {
|
|
1867
1924
|
let e = (e) => {
|
|
1868
1925
|
e.key === "Escape" && a();
|
|
1869
1926
|
};
|
|
1870
1927
|
return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
|
|
1871
|
-
}, [a]), /* @__PURE__ */
|
|
1928
|
+
}, [a]), /* @__PURE__ */ P("div", {
|
|
1872
1929
|
className: "stage-dialog-backdrop",
|
|
1873
|
-
children: /* @__PURE__ */
|
|
1930
|
+
children: /* @__PURE__ */ F("section", {
|
|
1874
1931
|
role: "dialog",
|
|
1875
1932
|
"aria-modal": "true",
|
|
1876
1933
|
"aria-label": e.displayName ?? e.name,
|
|
1877
1934
|
className: "stage-dialog",
|
|
1878
|
-
children: [/* @__PURE__ */
|
|
1935
|
+
children: [/* @__PURE__ */ P("button", {
|
|
1879
1936
|
type: "button",
|
|
1880
1937
|
onClick: a,
|
|
1881
1938
|
children: "Close"
|
|
1882
|
-
}), /* @__PURE__ */
|
|
1939
|
+
}), /* @__PURE__ */ P(C, {
|
|
1883
1940
|
element: s,
|
|
1884
1941
|
registry: n,
|
|
1885
1942
|
resolveBinding: o.resolveBinding
|
|
@@ -1889,9 +1946,9 @@ function cr({ template: e, content: t, registry: n, strings: r, close: a }) {
|
|
|
1889
1946
|
}
|
|
1890
1947
|
//#endregion
|
|
1891
1948
|
//#region src/stageTheme.ts
|
|
1892
|
-
var
|
|
1893
|
-
preset:
|
|
1894
|
-
options: { darkModeSelector:
|
|
1949
|
+
var gr = "[data-scene-color-scheme='dark']", _r = {
|
|
1950
|
+
preset: Pe,
|
|
1951
|
+
options: { darkModeSelector: gr }
|
|
1895
1952
|
};
|
|
1896
1953
|
//#endregion
|
|
1897
|
-
export {
|
|
1954
|
+
export { ur as App, ur as StageApplication, xt as StageCommandForm, et as StageDataProvider, Zt as StageGuardedAction, Re as StageSourceProvider, cr as composeStageScreen, ir as createStageSliceInvoker, nt as dataChanged, vt as executeRegisteredCommand, W as registeredCommand, nr as sliceFieldsFrom, ar as stageApplicationRegistry, $ as stageComposition, gr as stageDarkSelector, Ie as stageEndpoints, sr as stageShellOf, _r as stageTheme, Fe as staticStageSource, bt as useStageCommandExecutor, V as useStageData, tt as useStageQuery, L as useStageSource };
|