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