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