@cratis/stage.runtime 4.216.0 → 4.217.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1204 -1198
- package/dist/src/screenplayGuard.d.ts +11 -0
- package/dist/src/stageActionSubject.d.ts +2 -0
- package/dist/src/stageData.d.ts +9 -1
- package/dist/src/stageRowInteractions.d.ts +2 -3
- package/package.json +18 -18
- package/dist/src/StageGuardedAction.d.ts +0 -20
- package/dist/src/stageGuards.d.ts +0 -88
package/dist/src/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import "./app.css";
|
|
2
2
|
import { t as e } from "../stageDarkSelector-DAwb43-P.js";
|
|
3
3
|
import { createContext as t, createElement as n, useCallback as r, useContext as i, useEffect as a, useId as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { InteractionStop as
|
|
6
|
-
import { CoreSliceDialog as
|
|
7
|
-
import { ApplicationHost as
|
|
4
|
+
import { BindingSourceKind as d, ColorScheme as f, DestinationKind as p, FormGenerationMode as m, FormWidthUnit as h, GuardOperator as g, InteractionActionKind as _, InteractionTriggerKind as v, LogoKind as y, PackageKind as b, componentIconLibrary as x } from "@cratis/scene.model";
|
|
5
|
+
import { InteractionStop as S, ShellDiagnosticCode as C, ShellOrigin as w, commandResponseContext as T, createBindingResolver as ee, hostProfilePackages as E, resolveArgumentSource as te, resolveBehaviors as D, resolveStringsInElement as O, resolveStringsValue as k, resolveSubjectReference as A, runActions as ne, runBindings as re, validateBindingExpression as ie, validateResponseBindings as ae } from "@cratis/scene.engine";
|
|
6
|
+
import { CoreSliceDialog as oe, CoreToolbarItem as j, IconAdapterProvider as se, InteractionScope as ce, SceneElementView as le, SceneNavigationContextInternal as M, SliceCommandFieldsProvider as ue, SliceDialogView as de, SliceInvokerProvider as fe, attachmentFor as pe, componentRegistryKey as me, coreComponents as he, createBrowserDispatcher as ge, createBrowserSceneHistory as _e, createHashSceneHistory as ve, createIconAdapterRegistry as ye, sliceDialogParameters as be, useInteractionScope as xe, useOptionalSceneNavigation as Se, useSceneNavigation as Ce, useSceneOutlets as we, useSceneTheme as Te } from "@cratis/scene.react";
|
|
7
|
+
import { ApplicationHost as Ee, ColorScheme as N, ComponentName as P, KanbanBoard as De, LayoutThemeProvider as Oe, SlotName as F, blueprintPackageCatalog as ke, composeApplicationScreen as Ae, defaultBlueprintComponents as je, defaultBlueprintName as Me, defaultBlueprintThemes as I, effectiveShellOf as Ne, externalComponent as L, galleryScreenTemplates as Pe, layoutModes as Fe, menuThemes as Ie, navigationElement as Le, previewComponents as Re, previewProfile as ze, useLayoutConfig as Be } from "@cratis/scene.blueprint.default";
|
|
8
8
|
import "@cratis/components/tokens";
|
|
9
9
|
import "@cratis/components/CommandForm/styles";
|
|
10
10
|
import "@cratis/components/Dropdown/styles";
|
|
11
11
|
import "@cratis/components/Common/styles";
|
|
12
12
|
import "@cratis/components/Display/styles";
|
|
13
13
|
import "@cratis/scene.blueprint.default/styles.css";
|
|
14
|
-
import { ArcContext as
|
|
15
|
-
import { ObservableQueryFor as
|
|
16
|
-
import { resolveCommand as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { CommandForm as
|
|
25
|
-
import { CalendarField as
|
|
26
|
-
import { cratisComponents as
|
|
27
|
-
import { dynamicIconImports as
|
|
14
|
+
import { ArcContext as Ve } from "@cratis/arc.react";
|
|
15
|
+
import { ObservableQueryFor as He, Paging as Ue, QueryFor as We } from "@cratis/arc/queries";
|
|
16
|
+
import { resolveCommand as Ge, resolveExactQuery as Ke } from "@cratis/scene.components";
|
|
17
|
+
import { Command as qe } from "@cratis/arc/commands";
|
|
18
|
+
import { DateOnly as Je, Guid as Ye } from "@cratis/fundamentals";
|
|
19
|
+
import { Fragment as Xe, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
20
|
+
import { Button as B } from "@cratis/components/Common";
|
|
21
|
+
import { Dialog as Ze } from "@cratis/components/Dialogs";
|
|
22
|
+
import { Message as Qe } from "@cratis/components/Display";
|
|
23
|
+
import { createPortal as $e } from "react-dom";
|
|
24
|
+
import { CommandForm as et, asCommandFormField as tt, withCommandFormFieldBinding as nt } from "@cratis/arc.react/commands";
|
|
25
|
+
import { CalendarField as rt, CheckboxField as it, DropdownField as at, InputTextField as ot, NumberField as st } from "@cratis/components/CommandForm";
|
|
26
|
+
import { cratisComponents as ct, cratisComponentsPackageManifest as lt } from "@cratis/scene.components/runtime";
|
|
27
|
+
import { dynamicIconImports as ut } from "lucide-react/dynamic";
|
|
28
28
|
// src/stageSource.ts
|
|
29
|
-
function
|
|
29
|
+
function dt(e) {
|
|
30
30
|
return {
|
|
31
31
|
scene: async () => e.scene,
|
|
32
32
|
routes: async () => e.routes,
|
|
@@ -34,23 +34,23 @@ function ot(e) {
|
|
|
34
34
|
strings: async (t) => e.strings[t] ?? {}
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ft = {
|
|
38
38
|
scene: "stage/scene",
|
|
39
39
|
routes: "stage/routes",
|
|
40
40
|
locales: "stage/locales",
|
|
41
41
|
strings: (e) => `stage/strings/${encodeURIComponent(e)}`
|
|
42
|
-
},
|
|
43
|
-
function
|
|
44
|
-
return n(
|
|
42
|
+
}, pt = t(void 0);
|
|
43
|
+
function mt({ source: e, children: t }) {
|
|
44
|
+
return n(pt.Provider, { value: e }, t);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
let e = i(
|
|
46
|
+
function ht() {
|
|
47
|
+
let e = i(pt);
|
|
48
48
|
if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
|
|
49
49
|
return e;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
let e =
|
|
51
|
+
ft.routes;
|
|
52
|
+
function gt() {
|
|
53
|
+
let e = ht(), [t, n] = u({
|
|
54
54
|
routes: void 0,
|
|
55
55
|
ready: !1
|
|
56
56
|
});
|
|
@@ -70,24 +70,24 @@ function dt() {
|
|
|
70
70
|
}, [e]), t;
|
|
71
71
|
}
|
|
72
72
|
// src/applyQueryChangeSet.ts
|
|
73
|
-
function
|
|
73
|
+
function _t(e) {
|
|
74
74
|
return typeof e == "object" && e && "id" in e ? e.id : void 0;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function vt(e) {
|
|
77
77
|
if (typeof e != "object" || !e) return e;
|
|
78
78
|
let t = e.toString();
|
|
79
79
|
return t === "[object Object]" ? JSON.stringify(e) : t;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) :
|
|
81
|
+
function yt(e, t) {
|
|
82
|
+
return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : vt(e) === vt(t);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
if (t.removed.length > 0 ?
|
|
84
|
+
function bt(e, t) {
|
|
85
|
+
if (t.removed.length > 0 ? _t(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => yt(_t(e), _t(t)))).map((e) => t.replaced.find((t) => yt(_t(t), _t(e))) ?? e), ...t.added];
|
|
86
86
|
let n = new Set(t.removed.map((e) => JSON.stringify(e)));
|
|
87
87
|
return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
|
|
88
88
|
}
|
|
89
89
|
// src/hostedBasePath.ts
|
|
90
|
-
function
|
|
90
|
+
function xt() {
|
|
91
91
|
let e = globalThis.document?.baseURI ?? globalThis.location?.href;
|
|
92
92
|
if (!e) return "";
|
|
93
93
|
try {
|
|
@@ -96,125 +96,51 @@ function gt() {
|
|
|
96
96
|
return "";
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return e ||
|
|
99
|
+
function St(e) {
|
|
100
|
+
return e || xt();
|
|
101
101
|
}
|
|
102
102
|
// src/queryExecutor.ts
|
|
103
|
-
var
|
|
104
|
-
function
|
|
105
|
-
|
|
103
|
+
var Ct;
|
|
104
|
+
function wt(e) {
|
|
105
|
+
Ct = e;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
let n =
|
|
109
|
-
return n === "ambiguous" && t && (n =
|
|
107
|
+
function Tt(e, t) {
|
|
108
|
+
let n = Ke(e);
|
|
109
|
+
return n === "ambiguous" && t && (n = Ke(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), Et(n) ? n : t ? Ct?.(t) : void 0;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
return typeof e == "function" && (e.prototype instanceof
|
|
111
|
+
function Et(e) {
|
|
112
|
+
return typeof e == "function" && (e.prototype instanceof We || e.prototype instanceof He);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
e.setMicroservice(t.microservice), e.setApiBasePath(
|
|
114
|
+
function Dt(e, t) {
|
|
115
|
+
e.setMicroservice(t.microservice), e.setApiBasePath(St(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Ue.noPaging;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Ot(e, t, n) {
|
|
118
118
|
let r = new e();
|
|
119
|
-
return
|
|
119
|
+
return Dt(r, n), r.perform(t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function kt(e, t, n, r) {
|
|
122
122
|
let i = new e();
|
|
123
|
-
if (i instanceof
|
|
124
|
-
}
|
|
125
|
-
function Tt(e) {
|
|
126
|
-
if (Ot(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
|
|
127
|
-
}
|
|
128
|
-
var Et = "STAGE-SCENE-ACTION-001", Dt = "item.";
|
|
129
|
-
function Ot(e) {
|
|
130
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
131
|
-
}
|
|
132
|
-
function kt(e, t) {
|
|
133
|
-
let n = e;
|
|
134
|
-
for (let e of t.split(".").filter(Boolean)) {
|
|
135
|
-
if (!Ot(n)) return;
|
|
136
|
-
n = n[e];
|
|
137
|
-
}
|
|
138
|
-
return n;
|
|
139
|
-
}
|
|
140
|
-
function At(e) {
|
|
141
|
-
return e === null || [
|
|
142
|
-
"string",
|
|
143
|
-
"number",
|
|
144
|
-
"boolean"
|
|
145
|
-
].includes(typeof e);
|
|
146
|
-
}
|
|
147
|
-
function jt(e, t) {
|
|
148
|
-
if (typeof e == "number") return t[e];
|
|
149
|
-
if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
|
|
150
|
-
}
|
|
151
|
-
function Mt(e, t, n, r) {
|
|
152
|
-
if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
|
|
153
|
-
let i = jt(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
|
|
154
|
-
return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
|
|
155
|
-
}
|
|
156
|
-
switch (t) {
|
|
157
|
-
case "Equal": return e != null && e === n;
|
|
158
|
-
case "NotEqual": return e != null && e !== n;
|
|
159
|
-
case "GreaterThan": return typeof e == "number" && typeof n == "number" && e > n;
|
|
160
|
-
case "GreaterThanOrEqual": return typeof e == "number" && typeof n == "number" && e >= n;
|
|
161
|
-
case "LessThan": return typeof e == "number" && typeof n == "number" && e < n;
|
|
162
|
-
case "LessThanOrEqual": return typeof e == "number" && typeof n == "number" && e <= n;
|
|
163
|
-
case "Contains": return typeof n == "string" && (typeof e == "string" || Array.isArray(e)) && e.includes(n);
|
|
164
|
-
case "StartsWith": return typeof e == "string" && typeof n == "string" && e.startsWith(n);
|
|
165
|
-
default: return;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function Nt(e, t) {
|
|
169
|
-
if (Ot(e)) {
|
|
170
|
-
if (e.kind === "comparison") {
|
|
171
|
-
let n = Tt(e.left);
|
|
172
|
-
if (typeof n != "string" || !n.startsWith(Dt) || typeof e.operator != "string" || !At(e.right)) return;
|
|
173
|
-
let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
|
|
174
|
-
return Mt(kt(t, n.slice(5)), e.operator, e.right, r);
|
|
175
|
-
}
|
|
176
|
-
if (e.kind === "logical") {
|
|
177
|
-
let n = Nt(e.left, t), r = Nt(e.right, t);
|
|
178
|
-
return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function Pt(e) {
|
|
183
|
-
return e.every((e) => Nt(e, {}) !== void 0);
|
|
184
|
-
}
|
|
185
|
-
function Ft(e, t) {
|
|
186
|
-
if (Pt(e)) return e.findIndex((e) => Nt(e, t) === !0);
|
|
187
|
-
}
|
|
188
|
-
function It(e, t) {
|
|
189
|
-
if (!Ot(e) || !Array.isArray(e.alternatives) || !Ot(t)) return;
|
|
190
|
-
let n = Ft(e.alternatives, t);
|
|
191
|
-
if (n !== void 0) {
|
|
192
|
-
if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
|
|
193
|
-
if (e.kind === "otherwise") return n === -1;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
function Lt(e, t) {
|
|
197
|
-
if (e.startsWith(Dt) && Ot(t)) return kt(t, e.slice(5));
|
|
123
|
+
if (i instanceof He) return Dt(i, n), i.subscribe(r, t);
|
|
198
124
|
}
|
|
199
125
|
// src/stageSession.ts
|
|
200
|
-
var
|
|
201
|
-
function
|
|
126
|
+
var At = "stage.session.";
|
|
127
|
+
function jt(e) {
|
|
202
128
|
try {
|
|
203
129
|
return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
|
|
204
130
|
} catch {
|
|
205
131
|
return;
|
|
206
132
|
}
|
|
207
133
|
}
|
|
208
|
-
function
|
|
209
|
-
let t =
|
|
134
|
+
function Mt(e) {
|
|
135
|
+
let t = jt(e);
|
|
210
136
|
if (t) return t;
|
|
211
137
|
let n = globalThis.crypto.randomUUID();
|
|
212
138
|
try {
|
|
213
|
-
globalThis.localStorage?.setItem(`${
|
|
139
|
+
globalThis.localStorage?.setItem(`${At}${e}`, n);
|
|
214
140
|
} catch {}
|
|
215
141
|
return n;
|
|
216
142
|
}
|
|
217
|
-
function
|
|
143
|
+
function Nt() {
|
|
218
144
|
let e = {};
|
|
219
145
|
try {
|
|
220
146
|
let t = globalThis.localStorage;
|
|
@@ -227,8 +153,202 @@ function Vt() {
|
|
|
227
153
|
} catch {}
|
|
228
154
|
return e;
|
|
229
155
|
}
|
|
156
|
+
// src/commandExecutor.ts
|
|
157
|
+
function V(e, t, n) {
|
|
158
|
+
for (let r of [
|
|
159
|
+
t,
|
|
160
|
+
n?.replace(/^\//, ""),
|
|
161
|
+
e
|
|
162
|
+
]) {
|
|
163
|
+
if (!r) continue;
|
|
164
|
+
let t = Ge(r);
|
|
165
|
+
if (Pt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function Pt(e) {
|
|
169
|
+
return typeof e == "function" && e.prototype instanceof qe;
|
|
170
|
+
}
|
|
171
|
+
function Ft(e, t) {
|
|
172
|
+
return e.setApiBasePath(St(t)), e;
|
|
173
|
+
}
|
|
174
|
+
async function It(e, t, n) {
|
|
175
|
+
let r = V(e);
|
|
176
|
+
if (!r) return {
|
|
177
|
+
isSuccess: !1,
|
|
178
|
+
validationErrors: [],
|
|
179
|
+
messages: [`The modeled command “${e}” is not registered by this Stage.`]
|
|
180
|
+
};
|
|
181
|
+
let i = new r();
|
|
182
|
+
i.setMicroservice(n.microservice), i.setApiBasePath(St(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
183
|
+
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
184
|
+
return Lt(e, await i.execute());
|
|
185
|
+
}
|
|
186
|
+
function Lt(e, t) {
|
|
187
|
+
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) => ({
|
|
188
|
+
member: t,
|
|
189
|
+
message: e.message
|
|
190
|
+
}))), i = n ? [] : [
|
|
191
|
+
...t.validationResults.map((e) => e.message),
|
|
192
|
+
...t.exceptionMessages,
|
|
193
|
+
...t.isAuthorized ? [] : [t.authorizationFailureReason || `“${e}” was not accepted.`]
|
|
194
|
+
];
|
|
195
|
+
return {
|
|
196
|
+
isSuccess: n,
|
|
197
|
+
response: n ? t.response : void 0,
|
|
198
|
+
validationErrors: r,
|
|
199
|
+
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function Rt() {
|
|
203
|
+
let e = i(Ve);
|
|
204
|
+
return r((t, n) => It(t, n, e), [e]);
|
|
205
|
+
}
|
|
206
|
+
// src/stageNavigation.ts
|
|
207
|
+
function zt(e, t = {}) {
|
|
208
|
+
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
209
|
+
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
210
|
+
}
|
|
211
|
+
function H(e, t = {}) {
|
|
212
|
+
if (!globalThis.location) return;
|
|
213
|
+
if (Bt === "path") {
|
|
214
|
+
let n = Ht(e, t);
|
|
215
|
+
if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
|
|
216
|
+
globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
let n = zt(e, t);
|
|
220
|
+
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
221
|
+
}
|
|
222
|
+
var Bt = "hash";
|
|
223
|
+
function Vt(e) {
|
|
224
|
+
Bt = e;
|
|
225
|
+
}
|
|
226
|
+
function Ht(e, t = {}) {
|
|
227
|
+
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
228
|
+
return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
|
|
229
|
+
}
|
|
230
|
+
function Ut(e) {
|
|
231
|
+
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ye)).map(([e, t]) => [e, String(t)]));
|
|
232
|
+
}
|
|
233
|
+
// src/screenplayGuard.ts
|
|
234
|
+
function Wt(...[e, t, n]) {
|
|
235
|
+
let r = n.subject?.() ?? n.resolve({ path: "item" });
|
|
236
|
+
return re(e.map((e) => ({
|
|
237
|
+
...e,
|
|
238
|
+
binding: qt(e.binding, r)
|
|
239
|
+
})), t, n);
|
|
240
|
+
}
|
|
241
|
+
function Gt(e, t) {
|
|
242
|
+
return Yt(e) ? e.kind === "logical" ? {
|
|
243
|
+
...e,
|
|
244
|
+
left: Gt(e.left, t),
|
|
245
|
+
right: Gt(e.right, t)
|
|
246
|
+
} : e.kind !== "comparison" || e.operator !== g.Contains || typeof Jt(e.left, t) == "string" && typeof e.right == "string" ? e : {
|
|
247
|
+
...e,
|
|
248
|
+
left: { subject: "" }
|
|
249
|
+
} : e;
|
|
250
|
+
}
|
|
251
|
+
function Kt(e, t) {
|
|
252
|
+
return Array.isArray(e) ? e.map((e) => Yt(e) ? {
|
|
253
|
+
...e,
|
|
254
|
+
condition: Gt(e.condition, t)
|
|
255
|
+
} : e) : e;
|
|
256
|
+
}
|
|
257
|
+
function qt(e, t) {
|
|
258
|
+
return {
|
|
259
|
+
...e,
|
|
260
|
+
alternatives: Kt(e.alternatives, t)
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function Jt(e, t) {
|
|
264
|
+
return Yt(e) && typeof e.subject == "string" ? A({ subject: e.subject }, t) : void 0;
|
|
265
|
+
}
|
|
266
|
+
function Yt(e) {
|
|
267
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
268
|
+
}
|
|
230
269
|
// src/stageData.tsx
|
|
231
|
-
var
|
|
270
|
+
var Xt = "cratis.stage.data-changed", Zt = t(() => () => void 0), Qt = he["core:guarded-action"];
|
|
271
|
+
function $t(e) {
|
|
272
|
+
return e.componentName === "core:guarded-action" || e.componentName === "core:action" && Array.isArray(e.properties.alternatives);
|
|
273
|
+
}
|
|
274
|
+
function en(e) {
|
|
275
|
+
let { dispatcher: t, attachments: n } = tn(), { item: r, refused: i, error: a } = nn(e.element);
|
|
276
|
+
if (i) return /* @__PURE__ */ z("span", {
|
|
277
|
+
role: "alert",
|
|
278
|
+
children: ["STAGE-SCENE-ACTION-001: The action's data subject or command scope is unavailable.", a]
|
|
279
|
+
});
|
|
280
|
+
let o = {
|
|
281
|
+
kind: d.Literal,
|
|
282
|
+
path: "",
|
|
283
|
+
value: r
|
|
284
|
+
};
|
|
285
|
+
return /* @__PURE__ */ R(ce, {
|
|
286
|
+
dispatcher: t,
|
|
287
|
+
attachments: n,
|
|
288
|
+
children: /* @__PURE__ */ R(Qt, {
|
|
289
|
+
...e,
|
|
290
|
+
slots: e.slots ?? {},
|
|
291
|
+
element: {
|
|
292
|
+
...e.element,
|
|
293
|
+
properties: {
|
|
294
|
+
...e.element.properties,
|
|
295
|
+
item: o,
|
|
296
|
+
alternatives: qt({ alternatives: e.element.properties.alternatives }, r).alternatives
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
})
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function tn() {
|
|
303
|
+
let e = U(), t = xe(), n = Rt();
|
|
304
|
+
return {
|
|
305
|
+
dispatcher: t?.dispatcher ?? ge({
|
|
306
|
+
executeCommand: async (t, r) => {
|
|
307
|
+
let i = await n(t, r);
|
|
308
|
+
return i.isSuccess && e.refreshAfterCommand(), {
|
|
309
|
+
isSuccess: i.isSuccess,
|
|
310
|
+
response: i.response,
|
|
311
|
+
validationErrors: i.validationErrors,
|
|
312
|
+
exceptionMessages: i.messages
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
navigate: (e, t) => H(e, Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)])))
|
|
316
|
+
}),
|
|
317
|
+
attachments: t?.attachments ?? []
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
function nn(e) {
|
|
321
|
+
let t = U(), n = rn(e, t), r = W(n), i = e.properties.itemSelection === !0, a = i ? Object.values(t.selections).filter((e) => e !== void 0) : r.rows;
|
|
322
|
+
return {
|
|
323
|
+
item: a.length === 1 ? a[0] : void 0,
|
|
324
|
+
refused: !cn(n) && !i || !!r.error,
|
|
325
|
+
error: r.error
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function rn(e, t) {
|
|
329
|
+
let n = e.properties, r = an(n.itemQuery), i = t.routes?.queries?.[r ?? ""] ?? an(n.itemRoute), a = K(n.itemArguments) ? n.itemArguments : {}, o = Object.fromEntries(Object.entries(a).map(([e, n]) => [e, on(n, t.resolveBinding)]));
|
|
330
|
+
return {
|
|
331
|
+
scope: `${e.id}:item`,
|
|
332
|
+
name: r,
|
|
333
|
+
route: i,
|
|
334
|
+
arguments: o,
|
|
335
|
+
ready: n.itemSelection !== !0 && Object.values(o).every(sn),
|
|
336
|
+
publish: !1
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function an(e) {
|
|
340
|
+
return typeof e == "string" ? e : void 0;
|
|
341
|
+
}
|
|
342
|
+
function on(e, t) {
|
|
343
|
+
return K(e) && typeof e.path == "string" ? t({ path: e.path }) : e;
|
|
344
|
+
}
|
|
345
|
+
function sn(e) {
|
|
346
|
+
return e != null && e !== "";
|
|
347
|
+
}
|
|
348
|
+
function cn(e) {
|
|
349
|
+
return !!(e.name || e.route);
|
|
350
|
+
}
|
|
351
|
+
var ln = t({
|
|
232
352
|
locale: "",
|
|
233
353
|
locales: [],
|
|
234
354
|
screen: "",
|
|
@@ -253,16 +373,16 @@ var Ht = "cratis.stage.data-changed", Ut = t(() => () => void 0), Wt = t({
|
|
|
253
373
|
resolveArgument: () => void 0,
|
|
254
374
|
registerQueryResult: () => void 0,
|
|
255
375
|
refreshVersion: 0
|
|
256
|
-
}),
|
|
376
|
+
}), un = [
|
|
257
377
|
500,
|
|
258
378
|
1500,
|
|
259
379
|
3e3,
|
|
260
380
|
6e3,
|
|
261
381
|
1e4,
|
|
262
382
|
15e3
|
|
263
|
-
],
|
|
264
|
-
function
|
|
265
|
-
let [d, f] = u({}), [p, m] = u(0), [h, g] = u({}), [_, v] = u(), [y, b] = u({}), [x, S] = u({}), [C,
|
|
383
|
+
], dn = {};
|
|
384
|
+
function fn({ routes: e, routesReady: t = !0, parameters: n = dn, locale: i, locales: o, screen: s, children: l }) {
|
|
385
|
+
let [d, f] = u({}), [p, m] = u(0), [h, g] = u({}), [_, v] = u(), [y, b] = u({}), [x, S] = u({}), [C, w] = u({}), [T, E] = u({ version: 0 }), D = c(() => Sn(C), [C]), O = r((e, t) => {
|
|
266
386
|
f((n) => {
|
|
267
387
|
if (!t) {
|
|
268
388
|
let { [e]: t, ...r } = n;
|
|
@@ -273,148 +393,148 @@ function qt({ routes: e, routesReady: t = !0, parameters: n = Kt, locale: i, loc
|
|
|
273
393
|
[e]: t
|
|
274
394
|
};
|
|
275
395
|
});
|
|
276
|
-
}, []),
|
|
396
|
+
}, []), k = n, A = c(() => Nt(), [p]), ne = c(() => ({
|
|
277
397
|
name: s,
|
|
278
398
|
keys: {
|
|
279
|
-
...
|
|
399
|
+
...A,
|
|
280
400
|
...n
|
|
281
401
|
}
|
|
282
402
|
}), [
|
|
283
403
|
n,
|
|
284
404
|
s,
|
|
285
|
-
|
|
286
|
-
]),
|
|
405
|
+
A
|
|
406
|
+
]), re = r((e, t) => {
|
|
287
407
|
g((n) => ({
|
|
288
408
|
...n,
|
|
289
409
|
[e]: t
|
|
290
410
|
})), v(t ? e : (t) => t === e ? void 0 : t);
|
|
291
|
-
}, []),
|
|
411
|
+
}, []), ae = r((e) => {
|
|
292
412
|
g((t) => ({
|
|
293
413
|
...t,
|
|
294
414
|
[e]: void 0
|
|
295
415
|
})), v((t) => t === e ? void 0 : t);
|
|
296
|
-
}, []),
|
|
416
|
+
}, []), oe = r((e, t, n) => {
|
|
297
417
|
S((r) => {
|
|
298
|
-
let i =
|
|
418
|
+
let i = K(r[e]) ? r[e] : {};
|
|
299
419
|
return {
|
|
300
420
|
...r,
|
|
301
|
-
[e]:
|
|
421
|
+
[e]: xn(i, t.split(".").filter(Boolean), n)
|
|
302
422
|
};
|
|
303
423
|
});
|
|
304
|
-
}, []),
|
|
424
|
+
}, []), j = r((e) => E((t) => ({
|
|
305
425
|
query: e,
|
|
306
426
|
version: t.version + 1
|
|
307
|
-
})), []), { settling:
|
|
427
|
+
})), []), { settling: se, refreshAfterCommand: ce, registerAwaitingQuery: le } = pn(j, m);
|
|
308
428
|
a(() => {
|
|
309
|
-
let e = () =>
|
|
310
|
-
return globalThis.addEventListener(
|
|
311
|
-
globalThis.removeEventListener(
|
|
429
|
+
let e = () => j(), t = (e) => j(e.detail?.query);
|
|
430
|
+
return globalThis.addEventListener(Xt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
|
|
431
|
+
globalThis.removeEventListener(Xt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
|
|
312
432
|
};
|
|
313
|
-
}, [
|
|
314
|
-
let
|
|
315
|
-
if (e === void 0
|
|
316
|
-
if (typeof e == "string") return
|
|
317
|
-
let t =
|
|
318
|
-
...
|
|
433
|
+
}, [j]);
|
|
434
|
+
let M = _ ? h[_] : void 0, ue = r((e) => {
|
|
435
|
+
if (e === void 0) return;
|
|
436
|
+
if (typeof e == "string") return Cn(e, M, h, d, y, k, ne, i, o);
|
|
437
|
+
let t = vn(M, d, y, {
|
|
438
|
+
...D,
|
|
319
439
|
...x
|
|
320
440
|
}, h);
|
|
321
|
-
if (!e.kind && e.path.startsWith("component.")) return
|
|
322
|
-
if (!e.kind) return
|
|
323
|
-
let n =
|
|
324
|
-
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`),
|
|
441
|
+
if (!e.kind && e.path.startsWith("component.")) return te(e.path, t);
|
|
442
|
+
if (!e.kind) return Cn(e.path, M, h, d, y, k, ne, i, o);
|
|
443
|
+
let n = ie(e, t);
|
|
444
|
+
return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), ee(t)(e);
|
|
325
445
|
}, [
|
|
326
446
|
x,
|
|
327
447
|
i,
|
|
328
448
|
o,
|
|
329
449
|
y,
|
|
330
|
-
A,
|
|
331
450
|
k,
|
|
451
|
+
D,
|
|
332
452
|
d,
|
|
453
|
+
ne,
|
|
333
454
|
M,
|
|
334
|
-
P,
|
|
335
455
|
h
|
|
336
|
-
]),
|
|
337
|
-
...
|
|
456
|
+
]), de = r((e) => e ? te(e, vn(M, d, y, {
|
|
457
|
+
...D,
|
|
338
458
|
...x
|
|
339
459
|
}, h)) : void 0, [
|
|
340
460
|
x,
|
|
341
461
|
y,
|
|
342
|
-
|
|
462
|
+
D,
|
|
343
463
|
d,
|
|
344
|
-
|
|
464
|
+
M,
|
|
345
465
|
h
|
|
346
|
-
]),
|
|
466
|
+
]), fe = r((e, t) => w((n) => ({
|
|
347
467
|
...n,
|
|
348
468
|
[e]: t
|
|
349
|
-
})), []),
|
|
469
|
+
})), []), pe = r((e) => w((t) => {
|
|
350
470
|
if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
|
|
351
471
|
let n = { ...t };
|
|
352
472
|
return delete n[e], n;
|
|
353
|
-
}), []),
|
|
473
|
+
}), []), me = c(() => vn(void 0, d, {}, {}, {}).queryResults, [d]), he = c(() => ({
|
|
354
474
|
locale: i,
|
|
355
475
|
locales: o,
|
|
356
476
|
screen: s,
|
|
357
477
|
routes: e,
|
|
358
478
|
routesReady: t,
|
|
359
|
-
parameters:
|
|
360
|
-
session:
|
|
479
|
+
parameters: k,
|
|
480
|
+
session: A,
|
|
361
481
|
queries: d,
|
|
362
|
-
selected:
|
|
482
|
+
selected: M,
|
|
363
483
|
selections: h,
|
|
364
|
-
selectRow:
|
|
365
|
-
clearSelection:
|
|
366
|
-
setState: (e, t) => b((n) =>
|
|
367
|
-
setComponentOutput:
|
|
368
|
-
publishComponentOutputs:
|
|
369
|
-
withdrawComponentOutputs:
|
|
370
|
-
queryResults:
|
|
371
|
-
refreshQuery:
|
|
372
|
-
refreshAfterCommand:
|
|
373
|
-
settling:
|
|
374
|
-
resolveBinding:
|
|
375
|
-
resolveArgument:
|
|
376
|
-
registerQueryResult:
|
|
377
|
-
refreshVersion:
|
|
378
|
-
refreshQueryName:
|
|
484
|
+
selectRow: re,
|
|
485
|
+
clearSelection: ae,
|
|
486
|
+
setState: (e, t) => b((n) => xn(n, e.split(".").filter(Boolean), t)),
|
|
487
|
+
setComponentOutput: oe,
|
|
488
|
+
publishComponentOutputs: fe,
|
|
489
|
+
withdrawComponentOutputs: pe,
|
|
490
|
+
queryResults: me,
|
|
491
|
+
refreshQuery: j,
|
|
492
|
+
refreshAfterCommand: ce,
|
|
493
|
+
settling: se,
|
|
494
|
+
resolveBinding: ue,
|
|
495
|
+
resolveArgument: de,
|
|
496
|
+
registerQueryResult: O,
|
|
497
|
+
refreshVersion: T.version,
|
|
498
|
+
refreshQueryName: T.query
|
|
379
499
|
}), [
|
|
380
|
-
|
|
500
|
+
ae,
|
|
381
501
|
i,
|
|
382
502
|
o,
|
|
383
503
|
d,
|
|
384
|
-
oe,
|
|
385
|
-
ae,
|
|
386
|
-
N,
|
|
387
|
-
D.query,
|
|
388
|
-
D.version,
|
|
389
|
-
ee,
|
|
390
|
-
ue,
|
|
391
|
-
de,
|
|
392
|
-
fe,
|
|
393
|
-
le,
|
|
394
504
|
ce,
|
|
505
|
+
se,
|
|
506
|
+
j,
|
|
507
|
+
T.query,
|
|
508
|
+
T.version,
|
|
509
|
+
O,
|
|
510
|
+
fe,
|
|
511
|
+
pe,
|
|
512
|
+
me,
|
|
513
|
+
de,
|
|
514
|
+
ue,
|
|
395
515
|
e,
|
|
396
516
|
t,
|
|
517
|
+
k,
|
|
397
518
|
A,
|
|
398
|
-
j,
|
|
399
519
|
s,
|
|
400
|
-
|
|
401
|
-
|
|
520
|
+
re,
|
|
521
|
+
M,
|
|
402
522
|
h,
|
|
403
|
-
|
|
523
|
+
oe
|
|
404
524
|
]);
|
|
405
|
-
return /* @__PURE__ */
|
|
406
|
-
value:
|
|
407
|
-
children: /* @__PURE__ */
|
|
408
|
-
value:
|
|
525
|
+
return /* @__PURE__ */ R(ln.Provider, {
|
|
526
|
+
value: he,
|
|
527
|
+
children: /* @__PURE__ */ R(Zt.Provider, {
|
|
528
|
+
value: le,
|
|
409
529
|
children: l
|
|
410
530
|
})
|
|
411
531
|
});
|
|
412
532
|
}
|
|
413
|
-
function
|
|
533
|
+
function pn(e, t) {
|
|
414
534
|
let n = l([]), i = l(0), o = l(0), s = l(/* @__PURE__ */ new Set()), [c, d] = u(!1), f = r(() => (o.current += 1, () => {
|
|
415
535
|
--o.current, o.current === 0 && s.current.forEach((e) => e());
|
|
416
536
|
}), []), p = r(() => {
|
|
417
|
-
t((e) => e + 1), e(), i.current += 1, d(!0), n.current.push(...
|
|
537
|
+
t((e) => e + 1), e(), i.current += 1, d(!0), n.current.push(...mn(e, s.current, () => {
|
|
418
538
|
--i.current, i.current === 0 && d(!1);
|
|
419
539
|
}, () => o.current > 0));
|
|
420
540
|
}, [e, t]);
|
|
@@ -424,20 +544,20 @@ function Jt(e, t) {
|
|
|
424
544
|
registerAwaitingQuery: f
|
|
425
545
|
};
|
|
426
546
|
}
|
|
427
|
-
function
|
|
547
|
+
function mn(e, t, n, r) {
|
|
428
548
|
let i = [], a = () => {
|
|
429
549
|
i.forEach(clearTimeout), t.delete(a), n();
|
|
430
|
-
}, o =
|
|
431
|
-
for (let n of
|
|
550
|
+
}, o = un[un.length - 1];
|
|
551
|
+
for (let n of un) i.push(setTimeout(() => {
|
|
432
552
|
e(), n === 3e3 && (t.add(a), r() || a()), n === o && a();
|
|
433
553
|
}, n));
|
|
434
554
|
return i;
|
|
435
555
|
}
|
|
436
|
-
var U = () => i(
|
|
556
|
+
var U = () => i(ln);
|
|
437
557
|
function W(e) {
|
|
438
|
-
let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o, settling: s } = U(), c = i(
|
|
558
|
+
let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o, settling: s } = U(), c = i(Ve), d = e.publish !== !1, f = r((e, t) => {
|
|
439
559
|
d && o(e, t);
|
|
440
|
-
}, [d, o]), p = e.ready ?? !0, m =
|
|
560
|
+
}, [d, o]), p = e.ready ?? !0, m = cn(e) && p, [h, g] = u([]), [_, v] = u(""), [y, b] = u(m), [x, S] = u(0), C = l(0), w = l(!1), T = JSON.stringify(e.arguments ?? {});
|
|
441
561
|
return a(() => {
|
|
442
562
|
if (!m) {
|
|
443
563
|
C.current += 1, g([]), v(""), b(!1), f(e.scope, void 0);
|
|
@@ -445,17 +565,17 @@ function W(e) {
|
|
|
445
565
|
}
|
|
446
566
|
let t = C.current + 1;
|
|
447
567
|
C.current = t;
|
|
448
|
-
let n = new AbortController(), r = JSON.parse(T), i =
|
|
568
|
+
let n = new AbortController(), r = JSON.parse(T), i = Tt(e.name ?? "", e.route);
|
|
449
569
|
b(!0), v("");
|
|
450
570
|
let a = (e) => {
|
|
451
571
|
C.current !== t || n.signal.aborted || (w.current = !1, g([]), v(e instanceof Error ? e.message : String(e)), b(!1));
|
|
452
572
|
}, o = [], s = (e) => {
|
|
453
573
|
if (C.current !== t || n.signal.aborted) return;
|
|
454
|
-
let r =
|
|
455
|
-
r ? a(Error(r)) : e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ?
|
|
574
|
+
let r = En(e);
|
|
575
|
+
r ? a(Error(r)) : e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? bt(o, e.changeSet) : e.data, g(Dn(o)), v(""), b(!1));
|
|
456
576
|
};
|
|
457
577
|
if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
|
|
458
|
-
let l = i.prototype instanceof
|
|
578
|
+
let l = i.prototype instanceof He, u = () => Promise.resolve().then(() => Ot(i, l ? {
|
|
459
579
|
...r,
|
|
460
580
|
waitForFirstResult: !0
|
|
461
581
|
} : r, c)).then(s).catch(a);
|
|
@@ -465,7 +585,7 @@ function W(e) {
|
|
|
465
585
|
C.current !== t || n.signal.aborted || (w.current = !1, d?.unsubscribe(), d = void 0, u());
|
|
466
586
|
}, 15e3);
|
|
467
587
|
try {
|
|
468
|
-
d =
|
|
588
|
+
d = kt(i, r, c, (e) => {
|
|
469
589
|
e.isReady !== !1 && globalThis.clearTimeout(p), s(e);
|
|
470
590
|
});
|
|
471
591
|
} catch {
|
|
@@ -516,47 +636,47 @@ function W(e) {
|
|
|
516
636
|
]), {
|
|
517
637
|
rows: h,
|
|
518
638
|
loading: y,
|
|
519
|
-
awaitingCommand:
|
|
639
|
+
awaitingCommand: hn(m, h, _, s),
|
|
520
640
|
error: _,
|
|
521
641
|
refresh: () => {
|
|
522
642
|
w.current || S((e) => e + 1);
|
|
523
643
|
}
|
|
524
644
|
};
|
|
525
645
|
}
|
|
526
|
-
function
|
|
646
|
+
function hn(e, t, n, r) {
|
|
527
647
|
let o = l(!1);
|
|
528
648
|
t.length > 0 && (o.current = !0);
|
|
529
|
-
let s = i(
|
|
649
|
+
let s = i(Zt), c = gn(e, t, n, r) && !o.current;
|
|
530
650
|
return a(() => {
|
|
531
651
|
if (c) return s();
|
|
532
652
|
}, [c, s]), c;
|
|
533
653
|
}
|
|
534
|
-
function
|
|
654
|
+
function gn(e, t, n, r) {
|
|
535
655
|
return !(!e || !r || n || t.length !== 0);
|
|
536
656
|
}
|
|
537
|
-
function
|
|
538
|
-
globalThis.dispatchEvent(new CustomEvent(
|
|
657
|
+
function _n() {
|
|
658
|
+
globalThis.dispatchEvent(new CustomEvent(Xt));
|
|
539
659
|
}
|
|
540
|
-
function
|
|
660
|
+
function vn(e, t, n, r, i) {
|
|
541
661
|
let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
|
|
542
662
|
return {
|
|
543
663
|
dataContext: e,
|
|
544
664
|
queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
|
|
545
|
-
let n = t.list ? t.rows :
|
|
665
|
+
let n = t.list ? t.rows : yn(t.rows);
|
|
546
666
|
return [
|
|
547
667
|
[e, n],
|
|
548
668
|
...t.name ? [[t.name, n]] : [],
|
|
549
669
|
...t.alias ? [[t.alias, n]] : []
|
|
550
670
|
];
|
|
551
671
|
})),
|
|
552
|
-
componentOutputs:
|
|
672
|
+
componentOutputs: bn(r, i),
|
|
553
673
|
state: n
|
|
554
674
|
};
|
|
555
675
|
}
|
|
556
|
-
function
|
|
676
|
+
function yn(e) {
|
|
557
677
|
return e.length === 1 ? e[0] : e;
|
|
558
678
|
}
|
|
559
|
-
function
|
|
679
|
+
function bn(e, t) {
|
|
560
680
|
let n = { ...e };
|
|
561
681
|
for (let [e, r] of Object.entries(t)) r && (n[e] = {
|
|
562
682
|
...r,
|
|
@@ -564,17 +684,17 @@ function tn(e, t) {
|
|
|
564
684
|
});
|
|
565
685
|
return n;
|
|
566
686
|
}
|
|
567
|
-
function
|
|
687
|
+
function xn(e, t, n) {
|
|
568
688
|
let [r, ...i] = t;
|
|
569
689
|
return r ? i.length === 0 ? {
|
|
570
690
|
...e,
|
|
571
691
|
[r]: n
|
|
572
692
|
} : {
|
|
573
693
|
...e,
|
|
574
|
-
[r]:
|
|
694
|
+
[r]: xn(K(e[r]) ? e[r] : {}, i, n)
|
|
575
695
|
} : e;
|
|
576
696
|
}
|
|
577
|
-
function
|
|
697
|
+
function Sn(e) {
|
|
578
698
|
let t = {};
|
|
579
699
|
for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
|
|
580
700
|
...t[e],
|
|
@@ -582,7 +702,7 @@ function rn(e) {
|
|
|
582
702
|
};
|
|
583
703
|
return t;
|
|
584
704
|
}
|
|
585
|
-
function
|
|
705
|
+
function Cn(e, t, n, r, i, a, o, s, c) {
|
|
586
706
|
if (!e) return;
|
|
587
707
|
let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
|
|
588
708
|
if (l.length !== 0) {
|
|
@@ -591,21 +711,21 @@ function an(e, t, n, r, i, a, o, s, c) {
|
|
|
591
711
|
let e = G(o, l.slice(1));
|
|
592
712
|
return e === void 0 && l[1] === "keys" && l.length === 3 ? G(t, [l[2]]) : e;
|
|
593
713
|
}
|
|
594
|
-
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ?
|
|
714
|
+
return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Tn(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? wn(l.slice(1).join("."), t, n) : l[0] === "state" ? G(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : G(t, l) ?? Tn(r, void 0, l.join(".")) ?? G(i, l);
|
|
595
715
|
}
|
|
596
716
|
}
|
|
597
|
-
function
|
|
717
|
+
function wn(e, t, n) {
|
|
598
718
|
let r = e?.split(".").filter(Boolean) ?? [];
|
|
599
719
|
return r.length > 0 && Object.hasOwn(n, r[0]) ? G(n[r[0]], r.slice(1)) : r.length === 0 ? t : G(t, r);
|
|
600
720
|
}
|
|
601
|
-
function
|
|
721
|
+
function Tn(e, t, n) {
|
|
602
722
|
let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
|
|
603
723
|
if (r.length === 0) return;
|
|
604
724
|
let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
|
|
605
725
|
return a.length === 0 ? i : i.length === 1 ? G(i[0], a) : i.map((e) => G(e, a));
|
|
606
726
|
}
|
|
607
|
-
function
|
|
608
|
-
if (!
|
|
727
|
+
function En(e) {
|
|
728
|
+
if (!K(e)) return "";
|
|
609
729
|
if (e.isAuthorized === !1) return "The query answered 403.";
|
|
610
730
|
if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
|
|
611
731
|
let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
|
|
@@ -613,22 +733,22 @@ function cn(e) {
|
|
|
613
733
|
}
|
|
614
734
|
return "";
|
|
615
735
|
}
|
|
616
|
-
function
|
|
617
|
-
return Array.isArray(e) ? e.filter(
|
|
736
|
+
function Dn(e) {
|
|
737
|
+
return Array.isArray(e) ? e.filter(K) : K(e) ? [e] : [];
|
|
618
738
|
}
|
|
619
739
|
function G(e, t) {
|
|
620
740
|
let n = e;
|
|
621
741
|
for (let e of t) {
|
|
622
|
-
if (!
|
|
742
|
+
if (!K(n)) return;
|
|
623
743
|
n = n[e];
|
|
624
744
|
}
|
|
625
745
|
return n;
|
|
626
746
|
}
|
|
627
|
-
function
|
|
747
|
+
function K(e) {
|
|
628
748
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
629
749
|
}
|
|
630
750
|
// src/stageComponentOutputs.ts
|
|
631
|
-
function
|
|
751
|
+
function On() {
|
|
632
752
|
let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n, selectRow: i, clearSelection: s } = U(), c = l({});
|
|
633
753
|
a(() => () => {
|
|
634
754
|
n(e), Object.keys(c.current).forEach((t) => s(`${e}:${t}`));
|
|
@@ -639,7 +759,7 @@ function dn() {
|
|
|
639
759
|
]);
|
|
640
760
|
let u = r((n) => {
|
|
641
761
|
t(e, n);
|
|
642
|
-
let r =
|
|
762
|
+
let r = kn(n), a = /* @__PURE__ */ new Set([...Object.keys(c.current), ...Object.keys(r)]);
|
|
643
763
|
for (let t of a) c.current[t] !== r[t] && i(`${e}:${t}`, r[t]);
|
|
644
764
|
c.current = r;
|
|
645
765
|
}, [
|
|
@@ -649,24 +769,24 @@ function dn() {
|
|
|
649
769
|
]);
|
|
650
770
|
return Object.assign(u, { scope: e });
|
|
651
771
|
}
|
|
652
|
-
function
|
|
772
|
+
function kn(e) {
|
|
653
773
|
let t = {};
|
|
654
774
|
for (let [n, r] of Object.entries(e)) {
|
|
655
775
|
let e = r.selectedItem;
|
|
656
|
-
|
|
776
|
+
An(e) && (t[n] = e);
|
|
657
777
|
}
|
|
658
778
|
return t;
|
|
659
779
|
}
|
|
660
|
-
function
|
|
780
|
+
function An(e) {
|
|
661
781
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
662
782
|
}
|
|
663
783
|
// src/stageBoardSelection.ts
|
|
664
|
-
var
|
|
665
|
-
function
|
|
666
|
-
return
|
|
784
|
+
var jn = /* @__PURE__ */ new Set(["kanbanBoard", "Cratis.Blueprint.Default:kanbanBoard"]);
|
|
785
|
+
function Mn(e) {
|
|
786
|
+
return jn.has(e);
|
|
667
787
|
}
|
|
668
|
-
function
|
|
669
|
-
let t = e, n = Object.fromEntries(Object.entries(t.slots ?? {}).map(([e, t]) => [e, t.map(
|
|
788
|
+
function Nn(e) {
|
|
789
|
+
let t = e, n = Object.fromEntries(Object.entries(t.slots ?? {}).map(([e, t]) => [e, t.map(Nn)])), r = Mn(t.componentName) ? {
|
|
670
790
|
...t.properties,
|
|
671
791
|
selectionMode: "single"
|
|
672
792
|
} : t.properties;
|
|
@@ -677,23 +797,23 @@ function gn(e) {
|
|
|
677
797
|
};
|
|
678
798
|
}
|
|
679
799
|
// src/humanize.ts
|
|
680
|
-
var
|
|
800
|
+
var Pn = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+/g, Fn = /* @__PURE__ */ new Set([
|
|
681
801
|
"Screen",
|
|
682
802
|
"Page",
|
|
683
803
|
"Dialog"
|
|
684
804
|
]);
|
|
685
|
-
function
|
|
805
|
+
function In(e) {
|
|
686
806
|
return e.map((e, t) => e.length > 1 && e === e.toUpperCase() && /[A-Z]/.test(e) ? e : t === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e.toLowerCase()).join(" ");
|
|
687
807
|
}
|
|
688
|
-
function
|
|
689
|
-
let t = e.match(
|
|
690
|
-
return t ?
|
|
808
|
+
function q(e) {
|
|
809
|
+
let t = e.match(Pn);
|
|
810
|
+
return t ? In(t) : e;
|
|
691
811
|
}
|
|
692
|
-
function
|
|
693
|
-
let t = e.match(
|
|
694
|
-
return t ?
|
|
812
|
+
function Ln(e) {
|
|
813
|
+
let t = e.match(Pn);
|
|
814
|
+
return t ? In(t.length > 1 && Fn.has(t[t.length - 1]) ? t.slice(0, -1) : t) : e;
|
|
695
815
|
}
|
|
696
|
-
function
|
|
816
|
+
function Rn(e, t) {
|
|
697
817
|
switch (e.toLowerCase()) {
|
|
698
818
|
case "primary": return "solid";
|
|
699
819
|
case "secondary": return "outline";
|
|
@@ -702,41 +822,41 @@ function xn(e, t) {
|
|
|
702
822
|
}
|
|
703
823
|
}
|
|
704
824
|
// src/stageFormSchema.ts
|
|
705
|
-
var
|
|
706
|
-
function
|
|
825
|
+
var zn = 8;
|
|
826
|
+
function Bn(e) {
|
|
707
827
|
if (!e) return !1;
|
|
708
828
|
try {
|
|
709
829
|
let t = JSON.parse(e);
|
|
710
|
-
return
|
|
830
|
+
return Y(t) && t["x-creates"] === !0;
|
|
711
831
|
} catch {
|
|
712
832
|
return !1;
|
|
713
833
|
}
|
|
714
834
|
}
|
|
715
|
-
function
|
|
835
|
+
function J(e) {
|
|
716
836
|
if (!e) return [];
|
|
717
837
|
try {
|
|
718
|
-
return
|
|
838
|
+
return Vn(JSON.parse(e), 0);
|
|
719
839
|
} catch {
|
|
720
840
|
return [];
|
|
721
841
|
}
|
|
722
842
|
}
|
|
723
|
-
function
|
|
724
|
-
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 =
|
|
725
|
-
return Object.entries(i).map(([e, i]) =>
|
|
843
|
+
function Vn(e, t) {
|
|
844
|
+
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 = Y(e.properties) ? e.properties : {};
|
|
845
|
+
return Object.entries(i).map(([e, i]) => Hn(e, i, !n || r.has(e), t));
|
|
726
846
|
}
|
|
727
|
-
function
|
|
728
|
-
let i =
|
|
847
|
+
function Hn(e, t, n, r) {
|
|
848
|
+
let i = Un(t?.["x-reference"]);
|
|
729
849
|
return {
|
|
730
850
|
name: e,
|
|
731
851
|
identifier: (t?.format === "uuid" || i) && typeof t?.["x-concept"] == "string" ? t["x-concept"] : void 0,
|
|
732
852
|
...i ? { reference: i } : {},
|
|
733
853
|
...t?.["x-identity"] === !0 ? { identity: !0 } : {},
|
|
734
854
|
required: n,
|
|
735
|
-
...
|
|
855
|
+
...Wn(t, r)
|
|
736
856
|
};
|
|
737
857
|
}
|
|
738
|
-
function
|
|
739
|
-
if (!
|
|
858
|
+
function Un(e) {
|
|
859
|
+
if (!Y(e)) return;
|
|
740
860
|
let { query: t, value: n, label: r } = e;
|
|
741
861
|
return typeof t == "string" && t.length > 0 && typeof n == "string" && n.length > 0 && typeof r == "string" && r.length > 0 ? {
|
|
742
862
|
query: t,
|
|
@@ -744,11 +864,11 @@ function En(e) {
|
|
|
744
864
|
label: r
|
|
745
865
|
} : void 0;
|
|
746
866
|
}
|
|
747
|
-
function
|
|
867
|
+
function Wn(e, t) {
|
|
748
868
|
let n = e?.type;
|
|
749
869
|
if (Array.isArray(n)) {
|
|
750
870
|
let r = n.filter((e) => e !== "null");
|
|
751
|
-
return r.length === 1 ?
|
|
871
|
+
return r.length === 1 ? Wn({
|
|
752
872
|
...e,
|
|
753
873
|
type: r[0]
|
|
754
874
|
}, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
|
|
@@ -759,8 +879,8 @@ function Dn(e, t) {
|
|
|
759
879
|
type: "date",
|
|
760
880
|
withTime: e.format === "date-time"
|
|
761
881
|
};
|
|
762
|
-
if (n === "array") return
|
|
763
|
-
if (n === "object") return
|
|
882
|
+
if (n === "array") return Gn(e, t);
|
|
883
|
+
if (n === "object") return Kn(e, t);
|
|
764
884
|
if (n === void 0 || n === "string") {
|
|
765
885
|
let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
|
|
766
886
|
return t.length > 0 ? {
|
|
@@ -770,75 +890,78 @@ function Dn(e, t) {
|
|
|
770
890
|
}
|
|
771
891
|
return { unsupportedReason: `type ${String(n)}` };
|
|
772
892
|
}
|
|
773
|
-
function
|
|
893
|
+
function Gn(e, t) {
|
|
774
894
|
let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
|
|
775
|
-
if (t >=
|
|
776
|
-
let r =
|
|
895
|
+
if (t >= zn || e?.items === void 0) return n;
|
|
896
|
+
let r = Hn("", e.items, !0, t + 1);
|
|
777
897
|
return r.unsupportedReason || r.item ? n : { item: r };
|
|
778
898
|
}
|
|
779
|
-
function
|
|
899
|
+
function Kn(e, t) {
|
|
780
900
|
let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
|
|
781
|
-
if (t >=
|
|
782
|
-
let r =
|
|
901
|
+
if (t >= zn || !Y(e?.properties) || Object.keys(e.properties).length === 0) return n;
|
|
902
|
+
let r = Vn(e, t + 1), i = r.find((e) => e.unsupportedReason);
|
|
783
903
|
return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
|
|
784
904
|
}
|
|
785
|
-
function
|
|
905
|
+
function qn(e, t, n) {
|
|
786
906
|
if (t != null) {
|
|
787
|
-
if (e.members &&
|
|
788
|
-
let e = t[r.name], i =
|
|
789
|
-
if (
|
|
907
|
+
if (e.members && Y(t)) for (let r of e.members) {
|
|
908
|
+
let e = t[r.name], i = q(r.name);
|
|
909
|
+
if (Jn(e)) {
|
|
790
910
|
if (r.required) return `${n}: ${i} is required`;
|
|
791
911
|
continue;
|
|
792
912
|
}
|
|
793
|
-
let a =
|
|
913
|
+
let a = qn(r, e, `${n} ${i.toLowerCase()}`);
|
|
794
914
|
if (a) return a;
|
|
795
915
|
}
|
|
796
916
|
if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
|
|
797
|
-
let t =
|
|
917
|
+
let t = Jn(i) ? `${n} ${r + 1} is required` : qn(e.item, i, `${n} ${r + 1}`);
|
|
798
918
|
if (t) return t;
|
|
799
919
|
}
|
|
800
920
|
}
|
|
801
921
|
}
|
|
802
|
-
function
|
|
922
|
+
function Jn(e) {
|
|
803
923
|
return e == null || e === "";
|
|
804
924
|
}
|
|
805
|
-
function
|
|
806
|
-
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 &&
|
|
925
|
+
function Yn(e, t) {
|
|
926
|
+
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 && Y(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
|
|
807
927
|
let r = e.members?.find((e) => e.name === t);
|
|
808
|
-
return [t, r ?
|
|
809
|
-
})) : e.item && Array.isArray(t) ? t.map((t) =>
|
|
928
|
+
return [t, r ? Yn(r, n) : n];
|
|
929
|
+
})) : e.item && Array.isArray(t) ? t.map((t) => Yn(e.item, t)) : t;
|
|
810
930
|
}
|
|
811
|
-
function
|
|
931
|
+
function Y(e) {
|
|
812
932
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
813
933
|
}
|
|
814
934
|
// src/stageActionSubject.ts
|
|
815
|
-
var
|
|
935
|
+
var Xn = /^item\.(.+)$/, Zn = [
|
|
816
936
|
void 0,
|
|
817
937
|
null,
|
|
818
938
|
""
|
|
819
939
|
];
|
|
820
|
-
function
|
|
940
|
+
function Qn(e) {
|
|
821
941
|
let t = e.properties.actionSubject;
|
|
822
942
|
return t === "item" || t === "screen" ? t : void 0;
|
|
823
943
|
}
|
|
824
|
-
function
|
|
944
|
+
function $n(e, t) {
|
|
945
|
+
return Qn(e) === void 0 && (t ? Bn(t) : e.properties.createsEntity === !0);
|
|
946
|
+
}
|
|
947
|
+
function er(e, t) {
|
|
825
948
|
return e === "item" && t.length === 1 ? t[0] : void 0;
|
|
826
949
|
}
|
|
827
|
-
function
|
|
950
|
+
function tr(e, t) {
|
|
828
951
|
return e === "item" && !t;
|
|
829
952
|
}
|
|
830
|
-
function
|
|
831
|
-
let n =
|
|
953
|
+
function nr(e, t) {
|
|
954
|
+
let n = Qn(e), r = e.properties.subjectValues;
|
|
832
955
|
return {
|
|
833
956
|
...n === "screen" ? {
|
|
834
957
|
selectableRows: [],
|
|
835
958
|
selectedRows: []
|
|
836
959
|
} : t,
|
|
837
960
|
rowAction: e.properties.rowAction === !0 || n === "item",
|
|
838
|
-
subjectValues:
|
|
961
|
+
subjectValues: dr(r) ? r : {}
|
|
839
962
|
};
|
|
840
963
|
}
|
|
841
|
-
function
|
|
964
|
+
function rr(e, t) {
|
|
842
965
|
return {
|
|
843
966
|
...t === "screen" ? {} : { rowAction: !0 },
|
|
844
967
|
...t === void 0 ? {} : {
|
|
@@ -847,12 +970,12 @@ function Bn(e, t) {
|
|
|
847
970
|
}
|
|
848
971
|
};
|
|
849
972
|
}
|
|
850
|
-
function
|
|
851
|
-
let n = Object.entries(
|
|
852
|
-
return Object.fromEntries(n.filter(([, e]) => !
|
|
973
|
+
function ir(e, t) {
|
|
974
|
+
let n = Object.entries(cr(e)).map(([e, n]) => [e, ur(t, n)]);
|
|
975
|
+
return Object.fromEntries(n.filter(([, e]) => !Zn.includes(e)));
|
|
853
976
|
}
|
|
854
|
-
function
|
|
855
|
-
let r = new Set(Object.keys(
|
|
977
|
+
function ar(e, t, n) {
|
|
978
|
+
let r = new Set(Object.keys(cr(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = or(e, t).filter((e) => !a.has(sr(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
|
|
856
979
|
fields: o,
|
|
857
980
|
generationMode: "manual"
|
|
858
981
|
} : {}, c = Object.fromEntries(i.map((e) => [e, n[e]]));
|
|
@@ -863,139 +986,62 @@ function Hn(e, t, n) {
|
|
|
863
986
|
rowAction: !0,
|
|
864
987
|
subjectValues: {
|
|
865
988
|
...c,
|
|
866
|
-
...
|
|
989
|
+
...ir(e, n)
|
|
867
990
|
},
|
|
868
991
|
...s
|
|
869
992
|
}
|
|
870
993
|
};
|
|
871
994
|
}
|
|
872
|
-
function
|
|
995
|
+
function or(e, t) {
|
|
873
996
|
let n = e.properties.fields;
|
|
874
997
|
return Array.isArray(n) ? n : t.map((e) => ({
|
|
875
998
|
name: e.name,
|
|
876
|
-
label:
|
|
999
|
+
label: q(e.name)
|
|
877
1000
|
}));
|
|
878
1001
|
}
|
|
879
|
-
function
|
|
1002
|
+
function sr(e) {
|
|
880
1003
|
let t = e.sourceProperty || e.name;
|
|
881
1004
|
return typeof t == "string" ? t : "";
|
|
882
1005
|
}
|
|
883
|
-
function
|
|
884
|
-
let t = e.properties.subjectInputs, n = (
|
|
1006
|
+
function cr(e) {
|
|
1007
|
+
let t = e.properties.subjectInputs, n = (dr(t) ? Object.entries(t) : []).map(([e, t]) => [e, lr(t)]);
|
|
885
1008
|
return Object.fromEntries(n.filter((e) => e[1] !== void 0));
|
|
886
1009
|
}
|
|
887
|
-
function
|
|
888
|
-
let t =
|
|
889
|
-
return typeof t == "string" ?
|
|
1010
|
+
function lr(e) {
|
|
1011
|
+
let t = dr(e) ? e.subject : void 0;
|
|
1012
|
+
return typeof t == "string" ? Xn.exec(t)?.[1] : void 0;
|
|
890
1013
|
}
|
|
891
|
-
function
|
|
892
|
-
return t.split(".").reduce((e, t) =>
|
|
1014
|
+
function ur(e, t) {
|
|
1015
|
+
return t.split(".").reduce((e, t) => dr(e) ? e[t] : void 0, e);
|
|
893
1016
|
}
|
|
894
|
-
function
|
|
1017
|
+
function dr(e) {
|
|
895
1018
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
896
1019
|
}
|
|
897
|
-
// src/commandExecutor.ts
|
|
898
|
-
function J(e, t, n) {
|
|
899
|
-
for (let r of [
|
|
900
|
-
t,
|
|
901
|
-
n?.replace(/^\//, ""),
|
|
902
|
-
e
|
|
903
|
-
]) {
|
|
904
|
-
if (!r) continue;
|
|
905
|
-
let t = Be(r);
|
|
906
|
-
if (Yn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
function Yn(e) {
|
|
910
|
-
return typeof e == "function" && e.prototype instanceof Je;
|
|
911
|
-
}
|
|
912
|
-
function Xn(e, t) {
|
|
913
|
-
return e.setApiBasePath(_t(t)), e;
|
|
914
|
-
}
|
|
915
|
-
async function Zn(e, t, n) {
|
|
916
|
-
let r = J(e);
|
|
917
|
-
if (!r) return {
|
|
918
|
-
isSuccess: !1,
|
|
919
|
-
validationErrors: [],
|
|
920
|
-
messages: [`The modeled command “${e}” is not registered by this Stage.`]
|
|
921
|
-
};
|
|
922
|
-
let i = new r();
|
|
923
|
-
i.setMicroservice(n.microservice), i.setApiBasePath(_t(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
|
|
924
|
-
for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
|
|
925
|
-
return Qn(e, await i.execute());
|
|
926
|
-
}
|
|
927
|
-
function Qn(e, t) {
|
|
928
|
-
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) => ({
|
|
929
|
-
member: t,
|
|
930
|
-
message: e.message
|
|
931
|
-
}))), i = n ? [] : [
|
|
932
|
-
...t.validationResults.map((e) => e.message),
|
|
933
|
-
...t.exceptionMessages,
|
|
934
|
-
...t.isAuthorized ? [] : [t.authorizationFailureReason || `“${e}” was not accepted.`]
|
|
935
|
-
];
|
|
936
|
-
return {
|
|
937
|
-
isSuccess: n,
|
|
938
|
-
response: n ? t.response : void 0,
|
|
939
|
-
validationErrors: r,
|
|
940
|
-
messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
function $n() {
|
|
944
|
-
let e = i(Ie);
|
|
945
|
-
return r((t, n) => Zn(t, n, e), [e]);
|
|
946
|
-
}
|
|
947
|
-
// src/stageNavigation.ts
|
|
948
|
-
function er(e, t = {}) {
|
|
949
|
-
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
950
|
-
return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
|
|
951
|
-
}
|
|
952
|
-
function tr(e, t = {}) {
|
|
953
|
-
if (!globalThis.location) return;
|
|
954
|
-
if (nr === "path") {
|
|
955
|
-
let n = ir(e, t);
|
|
956
|
-
if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
|
|
957
|
-
globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
let n = er(e, t);
|
|
961
|
-
globalThis.location.hash !== n && (globalThis.location.hash = n);
|
|
962
|
-
}
|
|
963
|
-
var nr = "hash";
|
|
964
|
-
function rr(e) {
|
|
965
|
-
nr = e;
|
|
966
|
-
}
|
|
967
|
-
function ir(e, t = {}) {
|
|
968
|
-
let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
|
|
969
|
-
return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
|
|
970
|
-
}
|
|
971
|
-
function ar(e) {
|
|
972
|
-
return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof qe)).map(([e, t]) => [e, String(t)]));
|
|
973
|
-
}
|
|
974
1020
|
// src/StageValueFields.tsx
|
|
975
|
-
var
|
|
1021
|
+
var fr = tt((e) => /* @__PURE__ */ R(pr, {
|
|
976
1022
|
descriptor: e.descriptor,
|
|
977
|
-
label: e.title ??
|
|
1023
|
+
label: e.title ?? q(e.descriptor.name),
|
|
978
1024
|
value: e.value,
|
|
979
1025
|
onChange: e.onChange,
|
|
980
1026
|
onBlur: e.onBlur,
|
|
981
1027
|
invalid: e.invalid
|
|
982
1028
|
}), { defaultValue: void 0 });
|
|
983
|
-
function
|
|
984
|
-
return e.members ? /* @__PURE__ */
|
|
1029
|
+
function pr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
1030
|
+
return e.members ? /* @__PURE__ */ R(mr, {
|
|
985
1031
|
descriptor: e,
|
|
986
1032
|
label: t,
|
|
987
1033
|
value: n,
|
|
988
1034
|
onChange: r,
|
|
989
1035
|
onBlur: i,
|
|
990
1036
|
invalid: a
|
|
991
|
-
}) : e.item ? /* @__PURE__ */
|
|
1037
|
+
}) : e.item ? /* @__PURE__ */ R(hr, {
|
|
992
1038
|
descriptor: e,
|
|
993
1039
|
label: t,
|
|
994
1040
|
value: n,
|
|
995
1041
|
onChange: r,
|
|
996
1042
|
onBlur: i,
|
|
997
1043
|
invalid: a
|
|
998
|
-
}) : /* @__PURE__ */
|
|
1044
|
+
}) : /* @__PURE__ */ R(gr, {
|
|
999
1045
|
descriptor: e,
|
|
1000
1046
|
label: t,
|
|
1001
1047
|
value: n,
|
|
@@ -1004,14 +1050,14 @@ function sr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
1004
1050
|
invalid: a
|
|
1005
1051
|
});
|
|
1006
1052
|
}
|
|
1007
|
-
function
|
|
1008
|
-
let o =
|
|
1009
|
-
return /* @__PURE__ */
|
|
1053
|
+
function mr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
1054
|
+
let o = yr(n) ? n : {};
|
|
1055
|
+
return /* @__PURE__ */ z("fieldset", {
|
|
1010
1056
|
className: "stage-record-field",
|
|
1011
1057
|
"data-invalid": a ? "true" : void 0,
|
|
1012
|
-
children: [/* @__PURE__ */
|
|
1058
|
+
children: [/* @__PURE__ */ R("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ R(pr, {
|
|
1013
1059
|
descriptor: e,
|
|
1014
|
-
label:
|
|
1060
|
+
label: q(e.name),
|
|
1015
1061
|
value: o[e.name],
|
|
1016
1062
|
onBlur: i,
|
|
1017
1063
|
onChange: (t) => r({
|
|
@@ -1021,74 +1067,74 @@ function cr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
1021
1067
|
}, e.name))]
|
|
1022
1068
|
});
|
|
1023
1069
|
}
|
|
1024
|
-
function
|
|
1070
|
+
function hr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
1025
1071
|
let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
|
|
1026
|
-
return /* @__PURE__ */
|
|
1072
|
+
return /* @__PURE__ */ z("fieldset", {
|
|
1027
1073
|
className: "stage-list-field",
|
|
1028
1074
|
"data-invalid": a ? "true" : void 0,
|
|
1029
1075
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
s.length === 0 && /* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ R("legend", { children: t }),
|
|
1077
|
+
s.length === 0 && /* @__PURE__ */ R("p", {
|
|
1032
1078
|
className: "stage-note",
|
|
1033
1079
|
children: "Nothing added yet."
|
|
1034
1080
|
}),
|
|
1035
|
-
s.map((e, n) => /* @__PURE__ */
|
|
1081
|
+
s.map((e, n) => /* @__PURE__ */ z("div", {
|
|
1036
1082
|
className: "stage-list-field__row",
|
|
1037
|
-
children: [/* @__PURE__ */
|
|
1083
|
+
children: [/* @__PURE__ */ R(pr, {
|
|
1038
1084
|
descriptor: o,
|
|
1039
1085
|
label: `${t} ${n + 1}`,
|
|
1040
1086
|
value: e,
|
|
1041
1087
|
onBlur: i,
|
|
1042
1088
|
onChange: (e) => c(s.map((t, r) => r === n ? e : t))
|
|
1043
|
-
}), /* @__PURE__ */
|
|
1089
|
+
}), /* @__PURE__ */ R("button", {
|
|
1044
1090
|
type: "button",
|
|
1045
1091
|
"aria-label": `Remove ${t} ${n + 1}`,
|
|
1046
1092
|
onClick: () => c(s.filter((e, t) => t !== n)),
|
|
1047
1093
|
children: "Remove"
|
|
1048
1094
|
})]
|
|
1049
1095
|
}, n)),
|
|
1050
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ R("button", {
|
|
1051
1097
|
type: "button",
|
|
1052
1098
|
"aria-label": `Add ${t}`,
|
|
1053
|
-
onClick: () => c([...s,
|
|
1099
|
+
onClick: () => c([...s, _r(o)]),
|
|
1054
1100
|
children: "Add"
|
|
1055
1101
|
})
|
|
1056
1102
|
]
|
|
1057
1103
|
});
|
|
1058
1104
|
}
|
|
1059
|
-
function
|
|
1105
|
+
function gr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
|
|
1060
1106
|
let o = {
|
|
1061
1107
|
"aria-invalid": a ? !0 : void 0,
|
|
1062
1108
|
onBlur: i
|
|
1063
1109
|
};
|
|
1064
|
-
if (e.options) return /* @__PURE__ */
|
|
1110
|
+
if (e.options) return /* @__PURE__ */ z("label", {
|
|
1065
1111
|
className: "stage-value-field",
|
|
1066
|
-
children: [/* @__PURE__ */
|
|
1112
|
+
children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ z("select", {
|
|
1067
1113
|
...o,
|
|
1068
1114
|
value: typeof n == "string" ? n : "",
|
|
1069
1115
|
onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
|
|
1070
|
-
children: [/* @__PURE__ */
|
|
1116
|
+
children: [/* @__PURE__ */ R("option", {
|
|
1071
1117
|
value: "",
|
|
1072
1118
|
children: ""
|
|
1073
|
-
}), e.options.map((e) => /* @__PURE__ */
|
|
1119
|
+
}), e.options.map((e) => /* @__PURE__ */ R("option", {
|
|
1074
1120
|
value: e,
|
|
1075
|
-
children:
|
|
1121
|
+
children: q(e)
|
|
1076
1122
|
}, e))]
|
|
1077
1123
|
})]
|
|
1078
1124
|
});
|
|
1079
1125
|
switch (e.type) {
|
|
1080
|
-
case "boolean": return /* @__PURE__ */
|
|
1126
|
+
case "boolean": return /* @__PURE__ */ z("label", {
|
|
1081
1127
|
className: "stage-value-field stage-value-field--check",
|
|
1082
|
-
children: [/* @__PURE__ */
|
|
1128
|
+
children: [/* @__PURE__ */ R("input", {
|
|
1083
1129
|
...o,
|
|
1084
1130
|
type: "checkbox",
|
|
1085
1131
|
checked: n === !0,
|
|
1086
1132
|
onChange: (e) => r(e.target.checked)
|
|
1087
|
-
}), /* @__PURE__ */
|
|
1133
|
+
}), /* @__PURE__ */ R("span", { children: t })]
|
|
1088
1134
|
});
|
|
1089
|
-
case "number": return /* @__PURE__ */
|
|
1135
|
+
case "number": return /* @__PURE__ */ z("label", {
|
|
1090
1136
|
className: "stage-value-field",
|
|
1091
|
-
children: [/* @__PURE__ */
|
|
1137
|
+
children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
|
|
1092
1138
|
...o,
|
|
1093
1139
|
type: "number",
|
|
1094
1140
|
step: "any",
|
|
@@ -1096,18 +1142,18 @@ function ur({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
1096
1142
|
onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
|
|
1097
1143
|
})]
|
|
1098
1144
|
});
|
|
1099
|
-
case "date": return /* @__PURE__ */
|
|
1145
|
+
case "date": return /* @__PURE__ */ z("label", {
|
|
1100
1146
|
className: "stage-value-field",
|
|
1101
|
-
children: [/* @__PURE__ */
|
|
1147
|
+
children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
|
|
1102
1148
|
...o,
|
|
1103
1149
|
type: e.withTime ? "datetime-local" : "date",
|
|
1104
1150
|
value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
|
|
1105
|
-
onChange: (t) => r(t.target.value === "" ? void 0 :
|
|
1151
|
+
onChange: (t) => r(t.target.value === "" ? void 0 : vr(t.target.value, e.withTime === !0))
|
|
1106
1152
|
})]
|
|
1107
1153
|
});
|
|
1108
|
-
default: return /* @__PURE__ */
|
|
1154
|
+
default: return /* @__PURE__ */ z("label", {
|
|
1109
1155
|
className: "stage-value-field",
|
|
1110
|
-
children: [/* @__PURE__ */
|
|
1156
|
+
children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
|
|
1111
1157
|
...o,
|
|
1112
1158
|
type: "text",
|
|
1113
1159
|
value: typeof n == "string" ? n : "",
|
|
@@ -1116,55 +1162,55 @@ function ur({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
|
|
|
1116
1162
|
});
|
|
1117
1163
|
}
|
|
1118
1164
|
}
|
|
1119
|
-
function
|
|
1165
|
+
function _r(e) {
|
|
1120
1166
|
return e.members ? {} : void 0;
|
|
1121
1167
|
}
|
|
1122
|
-
function
|
|
1168
|
+
function vr(e, t) {
|
|
1123
1169
|
if (!t) return e;
|
|
1124
1170
|
let n = new Date(e);
|
|
1125
1171
|
return Number.isNaN(n.getTime()) ? e : n.toISOString();
|
|
1126
1172
|
}
|
|
1127
|
-
function
|
|
1173
|
+
function yr(e) {
|
|
1128
1174
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1129
1175
|
}
|
|
1130
1176
|
// src/stageScreenTables.tsx
|
|
1131
|
-
function
|
|
1177
|
+
function br(e) {
|
|
1132
1178
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1133
1179
|
let r = e;
|
|
1134
1180
|
if (r.componentName !== "core:outlet") {
|
|
1135
|
-
|
|
1181
|
+
xr(r).forEach((e) => t.add(e));
|
|
1136
1182
|
for (let e of Object.values(r.slots ?? {})) e.forEach(n);
|
|
1137
1183
|
}
|
|
1138
1184
|
};
|
|
1139
1185
|
return n(e), [...t];
|
|
1140
1186
|
}
|
|
1141
|
-
function
|
|
1187
|
+
function xr(e) {
|
|
1142
1188
|
if (e.componentName === "core:table") return [e.id];
|
|
1143
|
-
if (!
|
|
1189
|
+
if (!Mn(e.componentName)) return [];
|
|
1144
1190
|
let t = e.properties.cards, n = t?.kind === "queryResult" && typeof t.query == "string" ? [`binding:${t.query}`] : [];
|
|
1145
1191
|
return [e.id, ...n];
|
|
1146
1192
|
}
|
|
1147
|
-
var
|
|
1148
|
-
function
|
|
1149
|
-
let r = c(() => new Set(
|
|
1150
|
-
return /* @__PURE__ */
|
|
1193
|
+
var Sr = t(void 0);
|
|
1194
|
+
function Cr({ element: e, outputScope: t, children: n }) {
|
|
1195
|
+
let r = c(() => new Set(br(e).flatMap((e) => t ? [e, `${t}:${e}`] : [e])), [e, t]);
|
|
1196
|
+
return /* @__PURE__ */ R(Sr.Provider, {
|
|
1151
1197
|
value: r,
|
|
1152
1198
|
children: n
|
|
1153
1199
|
});
|
|
1154
1200
|
}
|
|
1155
|
-
function
|
|
1156
|
-
return /* @__PURE__ */
|
|
1201
|
+
function wr({ children: e }) {
|
|
1202
|
+
return /* @__PURE__ */ R(Sr.Provider, {
|
|
1157
1203
|
value: void 0,
|
|
1158
1204
|
children: e
|
|
1159
1205
|
});
|
|
1160
1206
|
}
|
|
1161
|
-
function
|
|
1162
|
-
let e = i(
|
|
1207
|
+
function Tr() {
|
|
1208
|
+
let e = i(Sr), { queries: t, selections: n } = U();
|
|
1163
1209
|
return c(() => {
|
|
1164
1210
|
let r = e ? Object.fromEntries(Object.entries(t).filter(([t]) => e.has(t))) : t, i = e ? Object.fromEntries(Object.entries(n).filter(([t]) => e.has(t))) : n;
|
|
1165
1211
|
return {
|
|
1166
|
-
selectableRows:
|
|
1167
|
-
selectedRows:
|
|
1212
|
+
selectableRows: ai(r),
|
|
1213
|
+
selectedRows: oi(i, r)
|
|
1168
1214
|
};
|
|
1169
1215
|
}, [
|
|
1170
1216
|
t,
|
|
@@ -1173,7 +1219,7 @@ function yr() {
|
|
|
1173
1219
|
]);
|
|
1174
1220
|
}
|
|
1175
1221
|
// src/StageReferenceField.tsx
|
|
1176
|
-
function
|
|
1222
|
+
function Er(e) {
|
|
1177
1223
|
let t = o(), { routes: n, routesReady: r } = U(), i = n?.queries?.[e.reference.query], a = r && !!i, s = W({
|
|
1178
1224
|
scope: t,
|
|
1179
1225
|
name: e.reference.query,
|
|
@@ -1181,7 +1227,7 @@ function br(e) {
|
|
|
1181
1227
|
ready: a,
|
|
1182
1228
|
publish: !1
|
|
1183
1229
|
}), c = typeof e.value == "string" ? e.value : "";
|
|
1184
|
-
return !a || s.error ? /* @__PURE__ */
|
|
1230
|
+
return !a || s.error ? /* @__PURE__ */ z(Xe, { children: [/* @__PURE__ */ R("input", {
|
|
1185
1231
|
id: e.id,
|
|
1186
1232
|
"aria-label": e.title,
|
|
1187
1233
|
"aria-invalid": e.invalid,
|
|
@@ -1190,17 +1236,17 @@ function br(e) {
|
|
|
1190
1236
|
onBlur: e.onBlur,
|
|
1191
1237
|
required: e.required,
|
|
1192
1238
|
disabled: e.disabled
|
|
1193
|
-
}), s.error && /* @__PURE__ */
|
|
1239
|
+
}), s.error && /* @__PURE__ */ R("span", {
|
|
1194
1240
|
role: "alert",
|
|
1195
1241
|
children: s.error
|
|
1196
|
-
})] }) : /* @__PURE__ */
|
|
1242
|
+
})] }) : /* @__PURE__ */ R(Or, {
|
|
1197
1243
|
...e,
|
|
1198
1244
|
selected: c,
|
|
1199
|
-
choices:
|
|
1245
|
+
choices: Dr(s.rows, e.reference),
|
|
1200
1246
|
loading: s.loading
|
|
1201
1247
|
});
|
|
1202
1248
|
}
|
|
1203
|
-
function
|
|
1249
|
+
function Dr(e, t) {
|
|
1204
1250
|
return e.flatMap((e) => {
|
|
1205
1251
|
let n = e[t.value];
|
|
1206
1252
|
return typeof n == "string" ? [{
|
|
@@ -1209,19 +1255,19 @@ function xr(e, t) {
|
|
|
1209
1255
|
}] : [];
|
|
1210
1256
|
});
|
|
1211
1257
|
}
|
|
1212
|
-
function
|
|
1258
|
+
function Or({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a, disabled: o, selected: s, choices: c, loading: l }) {
|
|
1213
1259
|
let [d, f] = u(""), p = c.filter((e) => e.key === s || e.label.toLocaleLowerCase().includes(d.toLocaleLowerCase())), m = s !== "" && !c.some((e) => e.key === s);
|
|
1214
|
-
return /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ z("div", {
|
|
1215
1261
|
className: "stage-reference-field",
|
|
1216
1262
|
children: [
|
|
1217
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ R("input", {
|
|
1218
1264
|
type: "search",
|
|
1219
1265
|
"aria-label": `Filter ${i}`,
|
|
1220
1266
|
value: d,
|
|
1221
1267
|
onChange: (e) => f(e.target.value),
|
|
1222
1268
|
disabled: o || l
|
|
1223
1269
|
}),
|
|
1224
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ z("select", {
|
|
1225
1271
|
id: e,
|
|
1226
1272
|
"aria-label": i,
|
|
1227
1273
|
"aria-invalid": r,
|
|
@@ -1231,48 +1277,48 @@ function Sr({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a,
|
|
|
1231
1277
|
required: a,
|
|
1232
1278
|
disabled: o || l,
|
|
1233
1279
|
children: [
|
|
1234
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ z("option", {
|
|
1235
1281
|
value: "",
|
|
1236
1282
|
children: ["Choose ", i]
|
|
1237
1283
|
}),
|
|
1238
|
-
m && /* @__PURE__ */
|
|
1284
|
+
m && /* @__PURE__ */ R("option", {
|
|
1239
1285
|
value: s,
|
|
1240
1286
|
children: s
|
|
1241
1287
|
}),
|
|
1242
|
-
p.map((e) => /* @__PURE__ */
|
|
1288
|
+
p.map((e) => /* @__PURE__ */ R("option", {
|
|
1243
1289
|
value: e.key,
|
|
1244
1290
|
children: e.label
|
|
1245
1291
|
}, e.key))
|
|
1246
1292
|
]
|
|
1247
1293
|
}),
|
|
1248
|
-
/* @__PURE__ */
|
|
1294
|
+
/* @__PURE__ */ R(kr, {
|
|
1249
1295
|
loading: l,
|
|
1250
1296
|
empty: c.length === 0
|
|
1251
1297
|
})
|
|
1252
1298
|
]
|
|
1253
1299
|
});
|
|
1254
1300
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return e ? /* @__PURE__ */
|
|
1301
|
+
function kr({ loading: e, empty: t }) {
|
|
1302
|
+
return e ? /* @__PURE__ */ R("span", {
|
|
1257
1303
|
role: "status",
|
|
1258
1304
|
children: "Loading choices…"
|
|
1259
|
-
}) : t ? /* @__PURE__ */
|
|
1305
|
+
}) : t ? /* @__PURE__ */ R("span", { children: "No choices available" }) : null;
|
|
1260
1306
|
}
|
|
1261
|
-
function
|
|
1262
|
-
return e?.reference ? /* @__PURE__ */
|
|
1307
|
+
function Ar(e, t, n) {
|
|
1308
|
+
return e?.reference ? /* @__PURE__ */ R(jr, {
|
|
1263
1309
|
...t,
|
|
1264
1310
|
reference: e.reference
|
|
1265
1311
|
}) : n;
|
|
1266
1312
|
}
|
|
1267
|
-
var
|
|
1313
|
+
var jr = tt(Er, { defaultValue: "" }), Mr = {
|
|
1268
1314
|
messages: [],
|
|
1269
1315
|
complete: async (e, t) => t([], !1)
|
|
1270
1316
|
};
|
|
1271
|
-
function
|
|
1317
|
+
function Nr(e, t, n) {
|
|
1272
1318
|
let r = e.properties.onSubmit;
|
|
1273
|
-
if (!r?.length) return
|
|
1319
|
+
if (!r?.length) return Mr;
|
|
1274
1320
|
if (!n) return {
|
|
1275
|
-
...
|
|
1321
|
+
...Mr,
|
|
1276
1322
|
messages: ["The form submit continuation requires an interaction scope."]
|
|
1277
1323
|
};
|
|
1278
1324
|
let i = t?.command ?? "", a = n.context.responseContracts ?? {
|
|
@@ -1280,96 +1326,107 @@ function Dr(e, t, n) {
|
|
|
1280
1326
|
targetType: () => void 0
|
|
1281
1327
|
};
|
|
1282
1328
|
return {
|
|
1283
|
-
messages:
|
|
1329
|
+
messages: ae({
|
|
1284
1330
|
kind: "form",
|
|
1285
1331
|
command: i,
|
|
1286
1332
|
onSubmit: r
|
|
1287
1333
|
}, a).map((e) => e.message),
|
|
1288
1334
|
complete: async (e, t) => {
|
|
1289
|
-
let a =
|
|
1290
|
-
o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop ===
|
|
1335
|
+
let a = T(n.context, i, e), o = await ne(r, n.dispatcher, a);
|
|
1336
|
+
o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === S.Navigated);
|
|
1291
1337
|
}
|
|
1292
1338
|
};
|
|
1293
1339
|
}
|
|
1294
1340
|
// src/StageCommandForm.tsx
|
|
1295
|
-
var
|
|
1296
|
-
function
|
|
1297
|
-
return
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1341
|
+
var Pr = t(void 0), Fr = t(null);
|
|
1342
|
+
function Ir(e, t, n) {
|
|
1343
|
+
return $n(e, n) ? {
|
|
1344
|
+
...nr(e, {
|
|
1345
|
+
selectableRows: [],
|
|
1346
|
+
selectedRows: []
|
|
1347
|
+
}),
|
|
1348
|
+
rowAction: !1
|
|
1349
|
+
} : nr(e, t);
|
|
1350
|
+
}
|
|
1351
|
+
function Lr(e, t) {
|
|
1352
|
+
let n = X(e, "schema") || t?.commandSchemas?.[X(e, "command")];
|
|
1353
|
+
return {
|
|
1354
|
+
schemaText: n,
|
|
1355
|
+
schema: c(() => J(n ?? ""), [n]),
|
|
1356
|
+
hasSchemaMetadata: typeof n == "string"
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
function Rr({ element: e, cancellable: t }) {
|
|
1360
|
+
let n = U(), r = i(Ve), a = i(Pr), o = i(Fr), s = l(null), d = c(() => Ur(e), [e]), f = Nr(e, d, xe()), { schemaText: p, schema: m, hasSchemaMetadata: h } = Lr(e, n.routes), g = c(() => d ? Wr(d, m) : [], [d, m]), _ = d ? V(d.command, X(e, "typeName"), X(e, "route")) : void 0, v = zr(e, d), y = di(e, g, n.resolveArgument), b = li(e, m, n), x = JSON.stringify(b ?? null), S = c(() => b, [x]), { selectableRows: C, selectedRows: w, rowAction: T, subjectValues: ee } = Ir(e, Tr(), p), E = c(() => Zr(m, n.parameters, w, ee), [
|
|
1361
|
+
m,
|
|
1362
|
+
w,
|
|
1306
1363
|
n.parameters,
|
|
1307
|
-
|
|
1308
|
-
]),
|
|
1309
|
-
...
|
|
1310
|
-
...
|
|
1364
|
+
ee
|
|
1365
|
+
]), te = c(() => Qr(g, E), [g, E]), D = c(() => ({
|
|
1366
|
+
...S,
|
|
1367
|
+
...Xr(g, m, n.parameters, w, C, T),
|
|
1311
1368
|
...E,
|
|
1312
|
-
...
|
|
1313
|
-
...
|
|
1369
|
+
...ee,
|
|
1370
|
+
...Yr(g, n.parameters)
|
|
1314
1371
|
}), [
|
|
1315
|
-
x,
|
|
1316
|
-
h,
|
|
1317
|
-
p,
|
|
1318
|
-
n.parameters,
|
|
1319
|
-
C,
|
|
1320
1372
|
S,
|
|
1373
|
+
g,
|
|
1374
|
+
m,
|
|
1375
|
+
n.parameters,
|
|
1321
1376
|
w,
|
|
1377
|
+
C,
|
|
1378
|
+
T,
|
|
1322
1379
|
E,
|
|
1323
|
-
|
|
1324
|
-
]),
|
|
1325
|
-
...Object.fromEntries(Object.keys(E).map((e) => [e,
|
|
1326
|
-
...
|
|
1380
|
+
ee
|
|
1381
|
+
]), O = c(() => ({
|
|
1382
|
+
...Object.fromEntries(Object.keys(E).map((e) => [e, D[e]])),
|
|
1383
|
+
...y
|
|
1327
1384
|
}), [
|
|
1328
1385
|
E,
|
|
1329
|
-
O,
|
|
1330
|
-
v
|
|
1331
|
-
]), ee = c(() => d ? Rr(d, D, p) : void 0, [
|
|
1332
|
-
d,
|
|
1333
1386
|
D,
|
|
1334
|
-
|
|
1335
|
-
]),
|
|
1387
|
+
y
|
|
1388
|
+
]), k = c(() => d ? Gr(d, te, m) : void 0, [
|
|
1336
1389
|
d,
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
]),
|
|
1340
|
-
|
|
1390
|
+
te,
|
|
1391
|
+
m
|
|
1392
|
+
]), A = c(() => d ? Si(g, m) : [], [
|
|
1393
|
+
d,
|
|
1394
|
+
g,
|
|
1395
|
+
m
|
|
1396
|
+
]), ne = c(() => d ? Ci(d.layout, g) : [], [d, g]), [re, ie] = u([]);
|
|
1397
|
+
return d ? !_ && !n.routesReady ? /* @__PURE__ */ z("p", {
|
|
1341
1398
|
className: "stage-note",
|
|
1342
1399
|
children: [
|
|
1343
1400
|
"The modeled command “",
|
|
1344
1401
|
d.command,
|
|
1345
1402
|
"” is waiting for Stage routes."
|
|
1346
1403
|
]
|
|
1347
|
-
}) :
|
|
1404
|
+
}) : _ ? g.length === 0 && !h && e.properties.parameterless !== !0 ? /* @__PURE__ */ R(Hr, {
|
|
1348
1405
|
form: d,
|
|
1349
1406
|
messages: [`The modeled command “${d.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
|
|
1350
|
-
}) : A.length + f.messages.length > 0 ? /* @__PURE__ */
|
|
1407
|
+
}) : A.length + f.messages.length > 0 ? /* @__PURE__ */ R(Hr, {
|
|
1351
1408
|
form: d,
|
|
1352
1409
|
messages: [...A, ...f.messages]
|
|
1353
|
-
}) : /* @__PURE__ */
|
|
1410
|
+
}) : /* @__PURE__ */ R("section", {
|
|
1354
1411
|
ref: s,
|
|
1355
1412
|
className: "stage-command-form",
|
|
1356
1413
|
"data-command": d.command,
|
|
1357
1414
|
"data-generation-mode": d.generationMode,
|
|
1358
|
-
children: /* @__PURE__ */
|
|
1359
|
-
command:
|
|
1360
|
-
initialValues:
|
|
1361
|
-
currentValues:
|
|
1415
|
+
children: /* @__PURE__ */ z(et, {
|
|
1416
|
+
command: _,
|
|
1417
|
+
initialValues: D,
|
|
1418
|
+
currentValues: O,
|
|
1362
1419
|
validateOn: "both",
|
|
1363
1420
|
validateAllFieldsOnChange: !0,
|
|
1364
|
-
onBeforeExecute: (e) =>
|
|
1365
|
-
onFieldValidate: (e, t, n, r) =>
|
|
1366
|
-
onValidationFailure: (e) =>
|
|
1367
|
-
onException: (e) =>
|
|
1368
|
-
onFailed: (e) =>
|
|
1421
|
+
onBeforeExecute: (e) => Ft(e, r.apiBasePath),
|
|
1422
|
+
onFieldValidate: (e, t, n, r) => xi(g, m, t, r),
|
|
1423
|
+
onValidationFailure: (e) => ie(bi(g, e)),
|
|
1424
|
+
onException: (e) => ie(e),
|
|
1425
|
+
onFailed: (e) => ie(Lt(d.command, e).messages),
|
|
1369
1426
|
onSuccess: async (t) => {
|
|
1370
1427
|
n.refreshAfterCommand();
|
|
1371
1428
|
let r = (t, n) => {
|
|
1372
|
-
|
|
1429
|
+
ie(t), t.length || Vr(e, n, a);
|
|
1373
1430
|
};
|
|
1374
1431
|
try {
|
|
1375
1432
|
await f.complete(t, r);
|
|
@@ -1378,51 +1435,51 @@ function jr({ element: e, cancellable: t }) {
|
|
|
1378
1435
|
}
|
|
1379
1436
|
},
|
|
1380
1437
|
children: [
|
|
1381
|
-
|
|
1438
|
+
ne.map((e) => /* @__PURE__ */ R("p", {
|
|
1382
1439
|
role: "alert",
|
|
1383
1440
|
className: "stage-form-error",
|
|
1384
1441
|
children: e
|
|
1385
1442
|
}, e)),
|
|
1386
|
-
|
|
1387
|
-
|
|
1443
|
+
k,
|
|
1444
|
+
re.map((e) => /* @__PURE__ */ R("p", {
|
|
1388
1445
|
role: "alert",
|
|
1389
1446
|
className: "stage-form-error",
|
|
1390
1447
|
children: e
|
|
1391
1448
|
}, e)),
|
|
1392
|
-
o ?
|
|
1449
|
+
o ? $e(/* @__PURE__ */ R(B, {
|
|
1393
1450
|
type: "button",
|
|
1394
1451
|
className: "scene-slice-dialog-submit",
|
|
1395
1452
|
onClick: () => s.current?.querySelector("form")?.requestSubmit(),
|
|
1396
|
-
children:
|
|
1397
|
-
}), o) : /* @__PURE__ */
|
|
1398
|
-
submitLabel:
|
|
1453
|
+
children: v
|
|
1454
|
+
}), o) : /* @__PURE__ */ R(Br, {
|
|
1455
|
+
submitLabel: v,
|
|
1399
1456
|
cancellable: t
|
|
1400
1457
|
})
|
|
1401
1458
|
]
|
|
1402
|
-
},
|
|
1403
|
-
}) : /* @__PURE__ */
|
|
1459
|
+
}, x)
|
|
1460
|
+
}) : /* @__PURE__ */ z("p", {
|
|
1404
1461
|
className: "stage-note",
|
|
1405
1462
|
children: [
|
|
1406
1463
|
"The modeled command “",
|
|
1407
1464
|
d.command,
|
|
1408
1465
|
"” is not registered by this Stage."
|
|
1409
1466
|
]
|
|
1410
|
-
}) : /* @__PURE__ */
|
|
1467
|
+
}) : /* @__PURE__ */ R("p", {
|
|
1411
1468
|
className: "stage-note",
|
|
1412
1469
|
children: "This form is missing its command metadata."
|
|
1413
1470
|
});
|
|
1414
1471
|
}
|
|
1415
|
-
function
|
|
1416
|
-
return
|
|
1472
|
+
function zr(e, t) {
|
|
1473
|
+
return X(e, "submitLabel") || t?.label || "Submit";
|
|
1417
1474
|
}
|
|
1418
|
-
function
|
|
1419
|
-
let n = i(
|
|
1420
|
-
return /* @__PURE__ */
|
|
1475
|
+
function Br({ submitLabel: e, cancellable: t }) {
|
|
1476
|
+
let n = i(Pr);
|
|
1477
|
+
return /* @__PURE__ */ z("div", {
|
|
1421
1478
|
className: "stage-command-form__actions",
|
|
1422
|
-
children: [/* @__PURE__ */ B
|
|
1479
|
+
children: [/* @__PURE__ */ R(B, {
|
|
1423
1480
|
type: "submit",
|
|
1424
1481
|
children: e
|
|
1425
|
-
}), t && n && /* @__PURE__ */ B
|
|
1482
|
+
}), t && n && /* @__PURE__ */ R(B, {
|
|
1426
1483
|
type: "button",
|
|
1427
1484
|
variant: "outline",
|
|
1428
1485
|
onClick: n,
|
|
@@ -1430,59 +1487,59 @@ function Nr({ submitLabel: e, cancellable: t }) {
|
|
|
1430
1487
|
})]
|
|
1431
1488
|
});
|
|
1432
1489
|
}
|
|
1433
|
-
function
|
|
1434
|
-
let r =
|
|
1435
|
-
r && !t &&
|
|
1490
|
+
function Vr(e, t, n) {
|
|
1491
|
+
let r = X(e, "navigateToScreen");
|
|
1492
|
+
r && !t && H(r, {}), n?.();
|
|
1436
1493
|
}
|
|
1437
|
-
function
|
|
1438
|
-
return /* @__PURE__ */
|
|
1494
|
+
function Hr({ form: e, messages: t }) {
|
|
1495
|
+
return /* @__PURE__ */ R("section", {
|
|
1439
1496
|
className: "stage-command-form",
|
|
1440
1497
|
"data-command": e.command,
|
|
1441
1498
|
"data-generation-mode": e.generationMode,
|
|
1442
|
-
children: t.map((e) => /* @__PURE__ */
|
|
1499
|
+
children: t.map((e) => /* @__PURE__ */ R("p", {
|
|
1443
1500
|
role: "alert",
|
|
1444
1501
|
className: "stage-form-error",
|
|
1445
1502
|
children: e
|
|
1446
1503
|
}, e))
|
|
1447
1504
|
});
|
|
1448
1505
|
}
|
|
1449
|
-
function
|
|
1450
|
-
let t =
|
|
1506
|
+
function Ur(e) {
|
|
1507
|
+
let t = X(e, "command");
|
|
1451
1508
|
if (!t) return;
|
|
1452
|
-
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(
|
|
1509
|
+
let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(Z) : [];
|
|
1453
1510
|
return {
|
|
1454
1511
|
command: t,
|
|
1455
|
-
label:
|
|
1512
|
+
label: X(e, "label") || q(t),
|
|
1456
1513
|
fields: n,
|
|
1457
|
-
generationMode:
|
|
1458
|
-
layout:
|
|
1514
|
+
generationMode: pi(e.properties.generationMode),
|
|
1515
|
+
layout: mi(e.properties.layout)
|
|
1459
1516
|
};
|
|
1460
1517
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return e.generationMode ===
|
|
1518
|
+
function Wr(e, t) {
|
|
1519
|
+
return e.generationMode === m.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
1463
1520
|
name: e.name,
|
|
1464
|
-
label:
|
|
1521
|
+
label: q(e.name)
|
|
1465
1522
|
}));
|
|
1466
1523
|
}
|
|
1467
|
-
function
|
|
1468
|
-
let r = e.layout, i = r ?
|
|
1469
|
-
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) =>
|
|
1470
|
-
let a = new Map(t.map((e) => [e.name, e])), o =
|
|
1471
|
-
gridTemplateColumns: Array.from({ length: o }, (e, t) =>
|
|
1472
|
-
columnGap:
|
|
1473
|
-
rowGap:
|
|
1524
|
+
function Gr(e, t, n) {
|
|
1525
|
+
let r = e.layout, i = r ? hi(r, t) : [];
|
|
1526
|
+
if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => Kr(e, n));
|
|
1527
|
+
let a = new Map(t.map((e) => [e.name, e])), o = gi(r, i), s = {
|
|
1528
|
+
gridTemplateColumns: Array.from({ length: o }, (e, t) => _i(t + 1, r.columns)).join(" "),
|
|
1529
|
+
columnGap: yi(r.columnGap),
|
|
1530
|
+
rowGap: yi(r.rowGap)
|
|
1474
1531
|
}, c = /* @__PURE__ */ new Set();
|
|
1475
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ z("div", {
|
|
1476
1533
|
className: "stage-command-form__layout",
|
|
1477
1534
|
style: s,
|
|
1478
1535
|
children: [i.map((e) => {
|
|
1479
1536
|
let t = a.get(e.field);
|
|
1480
|
-
return t ? (c.add(t.name),
|
|
1481
|
-
}), t.filter((e) => !c.has(e.name)).map((e) =>
|
|
1537
|
+
return t ? (c.add(t.name), Kr(t, n, e)) : null;
|
|
1538
|
+
}), t.filter((e) => !c.has(e.name)).map((e) => Kr(e, n))]
|
|
1482
1539
|
});
|
|
1483
1540
|
}
|
|
1484
|
-
function
|
|
1485
|
-
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 =
|
|
1541
|
+
function Kr(e, t, n) {
|
|
1542
|
+
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 = Ar(i, {
|
|
1486
1543
|
value: o,
|
|
1487
1544
|
fieldName: r,
|
|
1488
1545
|
title: a,
|
|
@@ -1491,9 +1548,9 @@ function zr(e, t, n) {
|
|
|
1491
1548
|
if (i?.options) {
|
|
1492
1549
|
let e = i.options.map((e) => ({
|
|
1493
1550
|
value: e,
|
|
1494
|
-
label:
|
|
1551
|
+
label: q(e)
|
|
1495
1552
|
}));
|
|
1496
|
-
return /* @__PURE__ */
|
|
1553
|
+
return /* @__PURE__ */ R(at, {
|
|
1497
1554
|
value: o,
|
|
1498
1555
|
fieldName: r,
|
|
1499
1556
|
title: a,
|
|
@@ -1503,7 +1560,7 @@ function zr(e, t, n) {
|
|
|
1503
1560
|
optionLabel: "label"
|
|
1504
1561
|
});
|
|
1505
1562
|
}
|
|
1506
|
-
if (i?.members || i?.item) return /* @__PURE__ */
|
|
1563
|
+
if (i?.members || i?.item) return /* @__PURE__ */ R(fr, {
|
|
1507
1564
|
value: o,
|
|
1508
1565
|
fieldName: r,
|
|
1509
1566
|
title: a,
|
|
@@ -1511,19 +1568,19 @@ function zr(e, t, n) {
|
|
|
1511
1568
|
descriptor: i
|
|
1512
1569
|
});
|
|
1513
1570
|
switch (i?.type ?? "text") {
|
|
1514
|
-
case "number": return /* @__PURE__ */
|
|
1571
|
+
case "number": return /* @__PURE__ */ R(st, {
|
|
1515
1572
|
value: o,
|
|
1516
1573
|
fieldName: r,
|
|
1517
1574
|
title: a,
|
|
1518
1575
|
required: s
|
|
1519
1576
|
});
|
|
1520
|
-
case "boolean": return /* @__PURE__ */
|
|
1577
|
+
case "boolean": return /* @__PURE__ */ R(it, {
|
|
1521
1578
|
value: o,
|
|
1522
1579
|
fieldName: r,
|
|
1523
1580
|
label: a,
|
|
1524
1581
|
required: s
|
|
1525
1582
|
});
|
|
1526
|
-
case "date": return /* @__PURE__ */
|
|
1583
|
+
case "date": return /* @__PURE__ */ R(qr, {
|
|
1527
1584
|
value: o,
|
|
1528
1585
|
fieldName: r,
|
|
1529
1586
|
title: a,
|
|
@@ -1532,15 +1589,15 @@ function zr(e, t, n) {
|
|
|
1532
1589
|
isNonModal: !0,
|
|
1533
1590
|
showTime: i?.withTime
|
|
1534
1591
|
});
|
|
1535
|
-
default: return /* @__PURE__ */
|
|
1592
|
+
default: return /* @__PURE__ */ R(ot, {
|
|
1536
1593
|
value: o,
|
|
1537
1594
|
fieldName: r,
|
|
1538
1595
|
title: a,
|
|
1539
1596
|
required: s
|
|
1540
1597
|
});
|
|
1541
1598
|
}
|
|
1542
|
-
})()), l =
|
|
1543
|
-
return /* @__PURE__ */
|
|
1599
|
+
})()), l = vi(n);
|
|
1600
|
+
return /* @__PURE__ */ R("span", {
|
|
1544
1601
|
className: "stage-command-form__field",
|
|
1545
1602
|
"data-field": e.name,
|
|
1546
1603
|
"data-row": n?.row,
|
|
@@ -1550,21 +1607,21 @@ function zr(e, t, n) {
|
|
|
1550
1607
|
children: c
|
|
1551
1608
|
}, e.name);
|
|
1552
1609
|
}
|
|
1553
|
-
var
|
|
1610
|
+
var qr = nt((e) => /* @__PURE__ */ R(rt, {
|
|
1554
1611
|
...e,
|
|
1555
|
-
currentValue: e.showTime ? e.currentValue :
|
|
1556
|
-
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ?
|
|
1612
|
+
currentValue: e.showTime ? e.currentValue : Jr(e.currentValue),
|
|
1613
|
+
onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Je.fromDate(t) : t)
|
|
1557
1614
|
}));
|
|
1558
|
-
function
|
|
1559
|
-
if (e instanceof
|
|
1615
|
+
function Jr(e) {
|
|
1616
|
+
if (e instanceof Je) return e.toDate();
|
|
1560
1617
|
if (typeof e != "string") return e;
|
|
1561
1618
|
try {
|
|
1562
|
-
return
|
|
1619
|
+
return Je.parse(e).toDate();
|
|
1563
1620
|
} catch {
|
|
1564
1621
|
return null;
|
|
1565
1622
|
}
|
|
1566
1623
|
}
|
|
1567
|
-
function
|
|
1624
|
+
function Yr(e, t) {
|
|
1568
1625
|
let n = {};
|
|
1569
1626
|
for (let r of e) {
|
|
1570
1627
|
let e = r.sourceProperty ?? r.name, i = t[e];
|
|
@@ -1572,47 +1629,47 @@ function Hr(e, t) {
|
|
|
1572
1629
|
}
|
|
1573
1630
|
return n;
|
|
1574
1631
|
}
|
|
1575
|
-
function
|
|
1632
|
+
function Xr(e, t, n, r = [], i = [], a = !1) {
|
|
1576
1633
|
let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
|
|
1577
1634
|
for (let e of t) {
|
|
1578
1635
|
if (!e.identifier || !e.required || o.has(e.name)) continue;
|
|
1579
|
-
if (a &&
|
|
1580
|
-
let t = n[e.name] ||
|
|
1636
|
+
if (a && ni(e, i)) {
|
|
1637
|
+
let t = n[e.name] || ti(e, r);
|
|
1581
1638
|
t && (c[e.name] = t);
|
|
1582
1639
|
continue;
|
|
1583
1640
|
}
|
|
1584
|
-
let t = n[e.name] ||
|
|
1641
|
+
let t = n[e.name] || ti(e, r) || jt(e.identifier) || (e.identity || !s && !ni(e, i) ? Mt(e.identifier) : void 0);
|
|
1585
1642
|
t !== void 0 && (c[e.name] = t);
|
|
1586
1643
|
}
|
|
1587
1644
|
return c;
|
|
1588
1645
|
}
|
|
1589
|
-
function
|
|
1646
|
+
function Zr(e, t, n, r) {
|
|
1590
1647
|
return Object.fromEntries(e.filter((e) => e.reference).flatMap((e) => {
|
|
1591
|
-
let i = t[e.name] || r[e.name] ||
|
|
1648
|
+
let i = t[e.name] || r[e.name] || ti(e, n) || ($r({
|
|
1592
1649
|
...e,
|
|
1593
1650
|
required: !0
|
|
1594
|
-
}, t) ?
|
|
1651
|
+
}, t) ? ei(e, t) : void 0);
|
|
1595
1652
|
return i === void 0 ? [] : [[e.name, i]];
|
|
1596
1653
|
}));
|
|
1597
1654
|
}
|
|
1598
|
-
function
|
|
1655
|
+
function Qr(e, t) {
|
|
1599
1656
|
return e.filter((e) => !Object.hasOwn(t, e.sourceProperty ?? e.name));
|
|
1600
1657
|
}
|
|
1601
|
-
function
|
|
1602
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 ||
|
|
1658
|
+
function $r(e, t) {
|
|
1659
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || ei(e, t) !== void 0;
|
|
1603
1660
|
}
|
|
1604
|
-
function
|
|
1605
|
-
if (e.identifier) return t[e.name] ||
|
|
1661
|
+
function ei(e, t) {
|
|
1662
|
+
if (e.identifier) return t[e.name] || jt(e.identifier);
|
|
1606
1663
|
}
|
|
1607
|
-
function
|
|
1664
|
+
function ti(e, t) {
|
|
1608
1665
|
if (!e.identifier) return;
|
|
1609
1666
|
let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
|
|
1610
1667
|
return n.size === 1 ? [...n][0] : void 0;
|
|
1611
1668
|
}
|
|
1612
|
-
function
|
|
1669
|
+
function ni(e, t) {
|
|
1613
1670
|
return t.some((t) => Object.hasOwn(t, e.name));
|
|
1614
1671
|
}
|
|
1615
|
-
function
|
|
1672
|
+
function ri(e, t) {
|
|
1616
1673
|
let n = e.id;
|
|
1617
1674
|
if (typeof n != "string" || n === "") return e;
|
|
1618
1675
|
let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
|
|
@@ -1621,253 +1678,165 @@ function Xr(e, t) {
|
|
|
1621
1678
|
...e
|
|
1622
1679
|
};
|
|
1623
1680
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return Object.values(e).flatMap((e) => e.rows.map((t) => [t,
|
|
1681
|
+
function ii(e) {
|
|
1682
|
+
return Object.values(e).flatMap((e) => e.rows.map((t) => [t, ri(t, e)]));
|
|
1626
1683
|
}
|
|
1627
|
-
function
|
|
1628
|
-
return
|
|
1684
|
+
function ai(e) {
|
|
1685
|
+
return ii(e).map(([, e]) => e);
|
|
1629
1686
|
}
|
|
1630
|
-
function
|
|
1631
|
-
let n = new Map(
|
|
1687
|
+
function oi(e, t) {
|
|
1688
|
+
let n = new Map(ii(t));
|
|
1632
1689
|
return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
|
|
1633
1690
|
}
|
|
1634
|
-
function
|
|
1635
|
-
return e.filter((e) => e.identifier && e.required &&
|
|
1691
|
+
function si(e, t, n, r) {
|
|
1692
|
+
return e.filter((e) => e.identifier && e.required && ni(e, r)).filter((e) => !t[e.name] && ti(e, n) === void 0).map((e) => e.name);
|
|
1636
1693
|
}
|
|
1637
|
-
function
|
|
1694
|
+
function ci(e) {
|
|
1638
1695
|
let t = e.properties.populateSource;
|
|
1639
|
-
return
|
|
1696
|
+
return Z(t) ? t : void 0;
|
|
1640
1697
|
}
|
|
1641
|
-
function
|
|
1642
|
-
let r =
|
|
1643
|
-
scope: `populate:${
|
|
1698
|
+
function li(e, t, n) {
|
|
1699
|
+
let r = ci(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, ui(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), s = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = W({
|
|
1700
|
+
scope: `populate:${X(e, "command")}`,
|
|
1644
1701
|
name: i,
|
|
1645
1702
|
route: i ? n.routes?.queries?.[i] : void 0,
|
|
1646
1703
|
arguments: o,
|
|
1647
1704
|
ready: s,
|
|
1648
1705
|
publish: !1
|
|
1649
|
-
}), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] :
|
|
1706
|
+
}), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : Z(u) ? u : void 0;
|
|
1650
1707
|
return c(() => {
|
|
1651
1708
|
if (!d) return;
|
|
1652
1709
|
let e = {};
|
|
1653
1710
|
for (let n of t) {
|
|
1654
1711
|
let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
|
|
1655
|
-
t != null && (e[n.name] =
|
|
1712
|
+
t != null && (e[n.name] = Yn(n, t));
|
|
1656
1713
|
}
|
|
1657
1714
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1658
1715
|
}, [d, t]);
|
|
1659
1716
|
}
|
|
1660
|
-
function
|
|
1717
|
+
function ui(e, t, n, r) {
|
|
1661
1718
|
let i = r.parameters[t] ?? r.parameters[e];
|
|
1662
1719
|
if (i) return i;
|
|
1663
1720
|
let a = n.find((n) => n.name === t || n.name === e)?.identifier;
|
|
1664
|
-
if (a) return
|
|
1721
|
+
if (a) return Mt(a);
|
|
1665
1722
|
let o = r.resolveBinding({ path: t });
|
|
1666
1723
|
return typeof o == "string" || typeof o == "number" ? o : void 0;
|
|
1667
1724
|
}
|
|
1668
|
-
function
|
|
1669
|
-
let r = c(() =>
|
|
1725
|
+
function di(e, t, n) {
|
|
1726
|
+
let r = c(() => fi(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
|
|
1670
1727
|
return c(() => {
|
|
1671
1728
|
let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
|
|
1672
1729
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
1673
1730
|
}, [r, a]);
|
|
1674
1731
|
}
|
|
1675
|
-
function
|
|
1732
|
+
function fi(e, t) {
|
|
1676
1733
|
let n = e.properties.arguments;
|
|
1677
1734
|
if (!Array.isArray(n)) return [];
|
|
1678
1735
|
let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
|
|
1679
1736
|
return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
|
|
1680
1737
|
}
|
|
1681
|
-
function
|
|
1682
|
-
return e ===
|
|
1738
|
+
function pi(e) {
|
|
1739
|
+
return e === m.Manual ? m.Manual : m.Auto;
|
|
1683
1740
|
}
|
|
1684
|
-
function
|
|
1685
|
-
if (!
|
|
1741
|
+
function mi(e) {
|
|
1742
|
+
if (!Z(e)) return;
|
|
1686
1743
|
let t = e;
|
|
1687
1744
|
return {
|
|
1688
|
-
columns: Array.isArray(t.columns) ? t.columns.filter(
|
|
1689
|
-
placements: Array.isArray(t.placements) ? t.placements.filter(
|
|
1690
|
-
columnGap:
|
|
1691
|
-
rowGap:
|
|
1745
|
+
columns: Array.isArray(t.columns) ? t.columns.filter(wi) : [],
|
|
1746
|
+
placements: Array.isArray(t.placements) ? t.placements.filter(Ti) : [],
|
|
1747
|
+
columnGap: Ei(t.columnGap) ? t.columnGap : void 0,
|
|
1748
|
+
rowGap: Ei(t.rowGap) ? t.rowGap : void 0
|
|
1692
1749
|
};
|
|
1693
1750
|
}
|
|
1694
|
-
function
|
|
1751
|
+
function hi(e, t) {
|
|
1695
1752
|
let n = new Map(e.placements.map((e) => [e.field, e]));
|
|
1696
|
-
for (let e of t) !n.has(e.name) &&
|
|
1753
|
+
for (let e of t) !n.has(e.name) && Ti(e.placement) && n.set(e.name, e.placement);
|
|
1697
1754
|
return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
|
|
1698
1755
|
}
|
|
1699
|
-
function
|
|
1756
|
+
function gi(e, t) {
|
|
1700
1757
|
return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
|
|
1701
1758
|
}
|
|
1702
|
-
function
|
|
1703
|
-
let n = t.find((t) => t.index === e), r =
|
|
1704
|
-
return n?.width?.unit ===
|
|
1759
|
+
function _i(e, t) {
|
|
1760
|
+
let n = t.find((t) => t.index === e), r = yi(n?.width), i = yi(n?.minWidth), a = yi(n?.maxWidth);
|
|
1761
|
+
return n?.width?.unit === h.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
|
|
1705
1762
|
}
|
|
1706
|
-
function
|
|
1763
|
+
function vi(e) {
|
|
1707
1764
|
if (e) return {
|
|
1708
1765
|
gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
|
|
1709
1766
|
gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
|
|
1710
|
-
width: e.width?.unit ===
|
|
1767
|
+
width: e.width?.unit === h.Fraction ? void 0 : yi(e.width)
|
|
1711
1768
|
};
|
|
1712
1769
|
}
|
|
1713
|
-
function
|
|
1770
|
+
function yi(e) {
|
|
1714
1771
|
if (e) switch (e.unit) {
|
|
1715
|
-
case
|
|
1716
|
-
case
|
|
1717
|
-
case
|
|
1718
|
-
case
|
|
1772
|
+
case h.Fraction: return `${e.value ?? 1}fr`;
|
|
1773
|
+
case h.Pixels: return `${e.value ?? 0}px`;
|
|
1774
|
+
case h.Percent: return `${e.value ?? 100}%`;
|
|
1775
|
+
case h.Auto: return "auto";
|
|
1719
1776
|
}
|
|
1720
1777
|
}
|
|
1721
|
-
function
|
|
1778
|
+
function bi(e, t) {
|
|
1722
1779
|
let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
|
|
1723
1780
|
return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
|
|
1724
1781
|
}
|
|
1725
|
-
function
|
|
1782
|
+
function xi(e, t, n, r) {
|
|
1726
1783
|
let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
|
|
1727
|
-
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ?
|
|
1784
|
+
if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? qn(a, r, i?.label ?? n) : void 0;
|
|
1728
1785
|
}
|
|
1729
|
-
function
|
|
1786
|
+
function Si(e, t) {
|
|
1730
1787
|
let n = new Map(t.map((e) => [e.name, e]));
|
|
1731
1788
|
return e.flatMap((e) => {
|
|
1732
1789
|
let t = n.get(e.sourceProperty ?? e.name);
|
|
1733
1790
|
return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
|
|
1734
1791
|
});
|
|
1735
1792
|
}
|
|
1736
|
-
function
|
|
1793
|
+
function Ci(e, t) {
|
|
1737
1794
|
if (!e) return [];
|
|
1738
|
-
let n =
|
|
1795
|
+
let n = hi(e, t).filter((e) => e.width?.unit === h.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 === h.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.`);
|
|
1739
1796
|
return [...n, ...r];
|
|
1740
1797
|
}
|
|
1741
|
-
function
|
|
1742
|
-
return q(Y(e, "schema"));
|
|
1743
|
-
}
|
|
1744
|
-
function Y(e, t, n = "") {
|
|
1798
|
+
function X(e, t, n = "") {
|
|
1745
1799
|
let r = e.properties[t];
|
|
1746
1800
|
return typeof r == "string" ? r : n;
|
|
1747
1801
|
}
|
|
1748
|
-
function
|
|
1749
|
-
return
|
|
1802
|
+
function wi(e) {
|
|
1803
|
+
return Z(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
|
|
1750
1804
|
}
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1805
|
+
function Ti(e) {
|
|
1806
|
+
return Z(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
|
|
1753
1807
|
}
|
|
1754
|
-
function
|
|
1755
|
-
return
|
|
1808
|
+
function Ei(e) {
|
|
1809
|
+
return Z(e) && Object.values(h).includes(e.unit);
|
|
1756
1810
|
}
|
|
1757
|
-
function
|
|
1811
|
+
function Z(e) {
|
|
1758
1812
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1759
1813
|
}
|
|
1760
1814
|
// src/readableValue.ts
|
|
1761
|
-
var
|
|
1762
|
-
function
|
|
1815
|
+
var Di = /^(\d{4})-(\d{2})-(\d{2})$/, Oi = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
|
|
1816
|
+
function ki(e) {
|
|
1763
1817
|
if (typeof e == "boolean") return e ? "Yes" : "No";
|
|
1764
|
-
if (typeof e == "string") return
|
|
1818
|
+
if (typeof e == "string") return Ai(e) ?? ji(e);
|
|
1765
1819
|
}
|
|
1766
|
-
function
|
|
1767
|
-
let t =
|
|
1820
|
+
function Ai(e) {
|
|
1821
|
+
let t = Di.exec(e);
|
|
1768
1822
|
if (!t) return;
|
|
1769
1823
|
let n = new Date(2e3, Number(t[2]) - 1, Number(t[3]));
|
|
1770
1824
|
return n.setFullYear(Number(t[1])), Number.isNaN(n.getTime()) || n.getMonth() !== Number(t[2]) - 1 ? void 0 : n.toLocaleDateString();
|
|
1771
1825
|
}
|
|
1772
|
-
function
|
|
1773
|
-
if (!
|
|
1826
|
+
function ji(e) {
|
|
1827
|
+
if (!Oi.test(e)) return;
|
|
1774
1828
|
let t = new Date(e);
|
|
1775
1829
|
return Number.isNaN(t.getTime()) ? void 0 : t.toLocaleString();
|
|
1776
1830
|
}
|
|
1777
|
-
// src/StageGuardedAction.tsx
|
|
1778
|
-
function Ei(e) {
|
|
1779
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1780
|
-
}
|
|
1781
|
-
function Di(e, t) {
|
|
1782
|
-
let n = e.properties[t];
|
|
1783
|
-
return typeof n == "string" ? n : "";
|
|
1784
|
-
}
|
|
1785
|
-
function Oi(e) {
|
|
1786
|
-
return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
|
|
1787
|
-
}
|
|
1788
|
-
function ki(e) {
|
|
1789
|
-
let t = U(), n = Di(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Di(e, "itemRoute"), i = Ei(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
|
|
1790
|
-
for (let [e, n] of Object.entries(i)) {
|
|
1791
|
-
let r = Ei(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
|
|
1792
|
-
a[e] = r, (r == null || r === "") && (o = !1);
|
|
1793
|
-
}
|
|
1794
|
-
let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = W({
|
|
1795
|
-
scope: `${e.id}:item`,
|
|
1796
|
-
name: n || void 0,
|
|
1797
|
-
route: r || void 0,
|
|
1798
|
-
arguments: a,
|
|
1799
|
-
ready: o && !s,
|
|
1800
|
-
publish: !1
|
|
1801
|
-
});
|
|
1802
|
-
return s ? {
|
|
1803
|
-
hasSource: !0,
|
|
1804
|
-
item: c.length === 1 ? c[0] : void 0
|
|
1805
|
-
} : {
|
|
1806
|
-
hasSource: !!n || !!r,
|
|
1807
|
-
item: l.rows.length === 1 ? l.rows[0] : void 0
|
|
1808
|
-
};
|
|
1809
|
-
}
|
|
1810
|
-
function Ai(e, t) {
|
|
1811
|
-
return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Lt(Tt(n) ?? "", t)]));
|
|
1812
|
-
}
|
|
1813
|
-
function ji({ element: e, interactions: t }) {
|
|
1814
|
-
let n = U(), r = ki(e), i = $n(), [a, o] = u([]), [s, l] = u(!1), d = Di(e, "label"), f = c(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Ei(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
|
|
1815
|
-
if (!Pt(m) || !h || !r.hasSource) {
|
|
1816
|
-
let n = r.hasSource ? `${Et}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Et}: “${d}” has no data subject to evaluate its guard against.`;
|
|
1817
|
-
return /* @__PURE__ */ V("div", {
|
|
1818
|
-
className: "stage-guarded-action",
|
|
1819
|
-
"data-scene-id": e.id,
|
|
1820
|
-
children: [/* @__PURE__ */ B(H, {
|
|
1821
|
-
type: "button",
|
|
1822
|
-
disabled: !0,
|
|
1823
|
-
title: n,
|
|
1824
|
-
...t,
|
|
1825
|
-
children: d
|
|
1826
|
-
}), /* @__PURE__ */ B("p", {
|
|
1827
|
-
role: "alert",
|
|
1828
|
-
className: "stage-form-error",
|
|
1829
|
-
children: n
|
|
1830
|
-
})]
|
|
1831
|
-
});
|
|
1832
|
-
}
|
|
1833
|
-
if (!r.item) return null;
|
|
1834
|
-
let g = Ft(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
|
|
1835
|
-
if (!_?.command) return null;
|
|
1836
|
-
let v = _.command, y = J(v), b = r.item, x = async () => {
|
|
1837
|
-
if (!y) return;
|
|
1838
|
-
l(!0);
|
|
1839
|
-
let t = await i(v, Ai(_, b));
|
|
1840
|
-
if (l(!1), o(t.messages), !t.isSuccess) return;
|
|
1841
|
-
n.refreshAfterCommand();
|
|
1842
|
-
let r = Di(e, "navigateToScreen"), a = Di(e, "navigateByParameter"), s = a ? Lt(`item.${a}`, b) : void 0;
|
|
1843
|
-
r && tr(r, a && s != null ? { [a]: String(s) } : {});
|
|
1844
|
-
};
|
|
1845
|
-
return /* @__PURE__ */ V("div", {
|
|
1846
|
-
className: "stage-guarded-action",
|
|
1847
|
-
"data-scene-id": e.id,
|
|
1848
|
-
"data-command": v,
|
|
1849
|
-
children: [/* @__PURE__ */ B(H, {
|
|
1850
|
-
...t,
|
|
1851
|
-
type: "button",
|
|
1852
|
-
disabled: !y || s,
|
|
1853
|
-
title: y ? void 0 : "This command is not exposed as an API yet",
|
|
1854
|
-
onClick: () => void x(),
|
|
1855
|
-
children: d
|
|
1856
|
-
}), a.map((e) => /* @__PURE__ */ B("p", {
|
|
1857
|
-
role: "alert",
|
|
1858
|
-
className: "stage-form-error",
|
|
1859
|
-
children: e
|
|
1860
|
-
}, e))]
|
|
1861
|
-
});
|
|
1862
|
-
}
|
|
1863
1831
|
function Mi(e) {
|
|
1864
|
-
let t =
|
|
1832
|
+
let t = xe(), n = l(void 0), i = c(() => D(pe(e.id, e.behaviors), v.DoubleClick), [e.behaviors, e.id]);
|
|
1865
1833
|
a(() => () => clearTimeout(n.current), []);
|
|
1866
1834
|
let o = r((e) => {
|
|
1867
1835
|
if (clearTimeout(n.current), n.current = void 0, !t) return;
|
|
1868
|
-
let r = (n) => n.path
|
|
1869
|
-
|
|
1836
|
+
let r = (n) => n.path?.startsWith("item.") ? A({ subject: n.path }, e) : t.context.resolve(n);
|
|
1837
|
+
Wt(i, t.dispatcher, {
|
|
1870
1838
|
...t.context,
|
|
1839
|
+
subject: () => e,
|
|
1871
1840
|
resolve: r
|
|
1872
1841
|
}).then((e) => {
|
|
1873
1842
|
e.findings.length > 0 && t.onFindings?.(e.findings);
|
|
@@ -1888,7 +1857,7 @@ function Fi(e, t) {
|
|
|
1888
1857
|
let n = new Set(t.map((e) => e.name));
|
|
1889
1858
|
return e.map((t) => {
|
|
1890
1859
|
if (t.screenTemplate !== Pi || n.has(Pi)) return t;
|
|
1891
|
-
let r = Ii(t), i = e.find((e) => e.name !== t.name)?.name, a =
|
|
1860
|
+
let r = Ii(t), i = e.find((e) => e.name !== t.name)?.name, a = L(`confirm-dialog-${t.name}`, Ni, {
|
|
1892
1861
|
title: t.name,
|
|
1893
1862
|
decisions: r,
|
|
1894
1863
|
home: i
|
|
@@ -1927,23 +1896,23 @@ function Ri(e) {
|
|
|
1927
1896
|
}
|
|
1928
1897
|
// src/StageConfirmDialog.tsx
|
|
1929
1898
|
function zi({ element: e }) {
|
|
1930
|
-
let { routes: t, parameters: n, queries: r, selections: i } = U(), [o, s] = u(), c = l(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h =
|
|
1931
|
-
return a(() => c.current?.focus(), []), /* @__PURE__ */
|
|
1899
|
+
let { routes: t, parameters: n, queries: r, selections: i } = U(), [o, s] = u(), c = l(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = oi(i, r);
|
|
1900
|
+
return a(() => c.current?.focus(), []), /* @__PURE__ */ z("section", {
|
|
1932
1901
|
className: "scene-slice-dialog stage-confirm-dialog",
|
|
1933
1902
|
role: "dialog",
|
|
1934
|
-
"aria-label":
|
|
1903
|
+
"aria-label": q(d),
|
|
1935
1904
|
"data-stage-component": Ni,
|
|
1936
1905
|
children: [
|
|
1937
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ R("header", {
|
|
1938
1907
|
className: "scene-slice-dialog-header",
|
|
1939
|
-
children: /* @__PURE__ */
|
|
1908
|
+
children: /* @__PURE__ */ R("h2", {
|
|
1940
1909
|
className: "scene-slice-dialog-title",
|
|
1941
|
-
children:
|
|
1910
|
+
children: q(d)
|
|
1942
1911
|
})
|
|
1943
1912
|
}),
|
|
1944
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ R("div", {
|
|
1945
1914
|
className: "stage-confirm-dialog__decisions",
|
|
1946
|
-
children: f.map((e, t) => /* @__PURE__ */
|
|
1915
|
+
children: f.map((e, t) => /* @__PURE__ */ R("button", {
|
|
1947
1916
|
ref: t === 0 ? c : void 0,
|
|
1948
1917
|
type: "button",
|
|
1949
1918
|
className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
|
|
@@ -1953,10 +1922,10 @@ function zi({ element: e }) {
|
|
|
1953
1922
|
children: Vi(e)
|
|
1954
1923
|
}, e.command))
|
|
1955
1924
|
}),
|
|
1956
|
-
m && /* @__PURE__ */
|
|
1957
|
-
/* @__PURE__ */
|
|
1925
|
+
m && /* @__PURE__ */ R(wr, { children: /* @__PURE__ */ R(Rr, { element: Wi(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command) }),
|
|
1926
|
+
/* @__PURE__ */ R("footer", {
|
|
1958
1927
|
className: "scene-slice-dialog-footer",
|
|
1959
|
-
children: /* @__PURE__ */
|
|
1928
|
+
children: /* @__PURE__ */ R("button", {
|
|
1960
1929
|
type: "button",
|
|
1961
1930
|
className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
|
|
1962
1931
|
onClick: () => Bi(f, p),
|
|
@@ -1968,13 +1937,13 @@ function zi({ element: e }) {
|
|
|
1968
1937
|
}
|
|
1969
1938
|
function Bi(e, t) {
|
|
1970
1939
|
let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
|
|
1971
|
-
r &&
|
|
1940
|
+
r && H(r, {});
|
|
1972
1941
|
}
|
|
1973
1942
|
function Vi(e) {
|
|
1974
|
-
return e.label ??
|
|
1943
|
+
return e.label ?? q(e.command);
|
|
1975
1944
|
}
|
|
1976
1945
|
function Hi(e, t, n) {
|
|
1977
|
-
return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] ||
|
|
1946
|
+
return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || ti(e, n) !== void 0;
|
|
1978
1947
|
}
|
|
1979
1948
|
function Ui(e, t, n, r) {
|
|
1980
1949
|
let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
|
|
@@ -1983,11 +1952,11 @@ function Ui(e, t, n, r) {
|
|
|
1983
1952
|
})), o = new Set(t.filter((e) => Hi(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
|
|
1984
1953
|
return [...s, ...l.map((e) => ({
|
|
1985
1954
|
name: e.name,
|
|
1986
|
-
label:
|
|
1955
|
+
label: q(e.name)
|
|
1987
1956
|
}))];
|
|
1988
1957
|
}
|
|
1989
1958
|
function Wi(e, t, n, r) {
|
|
1990
|
-
let i = Ui(e,
|
|
1959
|
+
let i = Ui(e, J(t), n, r);
|
|
1991
1960
|
return {
|
|
1992
1961
|
id: `confirm-${e.command}`,
|
|
1993
1962
|
componentName: Ni,
|
|
@@ -1999,7 +1968,7 @@ function Wi(e, t, n, r) {
|
|
|
1999
1968
|
route: e.route,
|
|
2000
1969
|
navigateToScreen: e.navigateToScreen,
|
|
2001
1970
|
schema: t || void 0,
|
|
2002
|
-
generationMode: i.length === 0 ?
|
|
1971
|
+
generationMode: i.length === 0 ? m.Manual : e.form?.generationMode,
|
|
2003
1972
|
layout: e.form?.layout,
|
|
2004
1973
|
populateSource: e.form?.populateSource,
|
|
2005
1974
|
fields: i
|
|
@@ -2037,38 +2006,40 @@ function qi(e, t, n, r) {
|
|
|
2037
2006
|
};
|
|
2038
2007
|
}
|
|
2039
2008
|
function Ji(e, t) {
|
|
2040
|
-
|
|
2009
|
+
let n = ee({ dataContext: { item: e.item } });
|
|
2010
|
+
return (r) => r.path === "value" ? e.value : r.path === "previous" ? e.previous : r.path === "item" || r.path?.startsWith("item.") ? n(r) : t(r);
|
|
2041
2011
|
}
|
|
2042
2012
|
function Yi(e, t) {
|
|
2043
|
-
let n =
|
|
2013
|
+
let n = xe(), i = U(), { element: a, rowsProperty: o, idField: s, valueField: d } = e, f = c(() => D(pe(a.id, a.behaviors), v.Change), [a.behaviors, a.id]), p = l(void 0), m = l(!1), [h, g] = u(0), _ = l({
|
|
2044
2014
|
scope: n,
|
|
2045
2015
|
data: i,
|
|
2046
2016
|
element: a,
|
|
2047
2017
|
bindings: f
|
|
2048
2018
|
});
|
|
2049
|
-
|
|
2019
|
+
_.current = {
|
|
2050
2020
|
scope: n,
|
|
2051
2021
|
data: i,
|
|
2052
2022
|
element: a,
|
|
2053
2023
|
bindings: f
|
|
2054
2024
|
};
|
|
2055
2025
|
let y = r((e, t) => {
|
|
2056
|
-
let { scope: n, data: r, element: i, bindings: a } =
|
|
2026
|
+
let { scope: n, data: r, element: i, bindings: a } = _.current, c = Ki(e, t);
|
|
2057
2027
|
if (!n || a.length === 0 || c === void 0) return;
|
|
2058
2028
|
let l = qi(i.properties[o], c, s, d);
|
|
2059
2029
|
if (l === void 0) return;
|
|
2060
2030
|
let u = {
|
|
2061
2031
|
...n.context,
|
|
2032
|
+
subject: () => l.item,
|
|
2062
2033
|
resolve: Ji(l, n.context.resolve)
|
|
2063
|
-
}, f = !1, p = !1
|
|
2034
|
+
}, f = !1, p = !1;
|
|
2035
|
+
Wt(a, {
|
|
2064
2036
|
...n.dispatcher,
|
|
2065
2037
|
executeCommand: async (e, t) => {
|
|
2066
2038
|
let r = await n.dispatcher.executeCommand(e, t);
|
|
2067
2039
|
return r?.isSuccess ? f = !0 : p = !0, r;
|
|
2068
2040
|
}
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
e.findings.length > 0 && n.onFindings?.(e.findings), r.refreshAfterCommand(), (!f || p) && _((e) => e + 1);
|
|
2041
|
+
}, u).then((e) => {
|
|
2042
|
+
e.findings.length > 0 && n.onFindings?.(e.findings), r.refreshAfterCommand(), (!f || p) && g((e) => e + 1);
|
|
2072
2043
|
});
|
|
2073
2044
|
}, [
|
|
2074
2045
|
o,
|
|
@@ -2097,17 +2068,17 @@ function Xi(e) {
|
|
|
2097
2068
|
rowsProperty: "cards",
|
|
2098
2069
|
idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
|
|
2099
2070
|
valueField: n
|
|
2100
|
-
}, e.bindingOutputs), i =
|
|
2101
|
-
return r.declared ? /* @__PURE__ */
|
|
2071
|
+
}, e.bindingOutputs), i = De;
|
|
2072
|
+
return r.declared ? /* @__PURE__ */ R(i, {
|
|
2102
2073
|
...e,
|
|
2103
2074
|
interactions: {
|
|
2104
2075
|
...e.interactions,
|
|
2105
2076
|
onChange: r.onChange
|
|
2106
2077
|
},
|
|
2107
2078
|
bindingOutputs: r.outputs
|
|
2108
|
-
}, r.revision) : /* @__PURE__ */
|
|
2079
|
+
}, r.revision) : /* @__PURE__ */ R(i, { ...e });
|
|
2109
2080
|
}
|
|
2110
|
-
var Zi =
|
|
2081
|
+
var Zi = me(Me, P.KanbanBoard), Qi = "Stage:commandForm";
|
|
2111
2082
|
function $i(e, t, n = {}) {
|
|
2112
2083
|
return {
|
|
2113
2084
|
id: e,
|
|
@@ -2116,23 +2087,23 @@ function $i(e, t, n = {}) {
|
|
|
2116
2087
|
slots: n
|
|
2117
2088
|
};
|
|
2118
2089
|
}
|
|
2119
|
-
function
|
|
2090
|
+
function Q(e, t, n = "") {
|
|
2120
2091
|
let r = e.properties[t];
|
|
2121
2092
|
return typeof r == "string" ? r : n;
|
|
2122
2093
|
}
|
|
2123
2094
|
function ea(e, t, n) {
|
|
2124
2095
|
let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
|
|
2125
|
-
return typeof r == "string" && t?.includes(r) ?
|
|
2096
|
+
return typeof r == "string" && t?.includes(r) ? q(r) : ki(e) ?? String(e ?? "");
|
|
2126
2097
|
}
|
|
2127
2098
|
function ta(e, t) {
|
|
2128
2099
|
let n = e.properties.queryArguments;
|
|
2129
|
-
if (!
|
|
2100
|
+
if (!sa(n)) return {
|
|
2130
2101
|
values: {},
|
|
2131
2102
|
ready: !0
|
|
2132
2103
|
};
|
|
2133
2104
|
let r = {}, i = !0;
|
|
2134
2105
|
for (let [e, a] of Object.entries(n)) {
|
|
2135
|
-
let n =
|
|
2106
|
+
let n = oa(a) ? t.resolveBinding(a) : a;
|
|
2136
2107
|
r[e] = n, (n == null || n === "") && (i = !1);
|
|
2137
2108
|
}
|
|
2138
2109
|
return {
|
|
@@ -2155,20 +2126,20 @@ function na(e, t) {
|
|
|
2155
2126
|
}));
|
|
2156
2127
|
return n.length > 0 ? n : r;
|
|
2157
2128
|
}
|
|
2158
|
-
function
|
|
2129
|
+
function ra(e, t) {
|
|
2159
2130
|
return e[t] ?? e.id ?? e.key;
|
|
2160
2131
|
}
|
|
2161
|
-
function
|
|
2162
|
-
let n = U(), r =
|
|
2132
|
+
function ia({ element: e, slots: t }) {
|
|
2133
|
+
let n = U(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), o = c(() => ta(e, n), [n, e]), { rows: s, error: l, loading: u, awaitingCommand: d } = W({
|
|
2163
2134
|
scope: e.id,
|
|
2164
2135
|
name: r,
|
|
2165
2136
|
route: i || void 0,
|
|
2166
2137
|
arguments: o.values,
|
|
2167
2138
|
ready: o.ready
|
|
2168
|
-
}), f = na(e, s), p =
|
|
2139
|
+
}), f = na(e, s), p = Q(e, "navigateOnRowClickToScreen"), m = Q(e, "navigateOnRowClickByParameter"), h = Q(e, "dataKey") || m || "id", g = n.selections[e.id], _ = m ? n.parameters[m] : void 0, v = Mi(e);
|
|
2169
2140
|
a(() => {
|
|
2170
2141
|
if (!g) return;
|
|
2171
|
-
let t =
|
|
2142
|
+
let t = ra(g, h), r = t === void 0 ? void 0 : s.find((e) => ra(e, h) === t);
|
|
2172
2143
|
r && r !== g ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
|
|
2173
2144
|
}, [
|
|
2174
2145
|
n,
|
|
@@ -2183,8 +2154,8 @@ function ra({ element: e, slots: t }) {
|
|
|
2183
2154
|
g && n.clearSelection(e.id);
|
|
2184
2155
|
return;
|
|
2185
2156
|
}
|
|
2186
|
-
if (g && String(
|
|
2187
|
-
let t = s.find((e) => String(
|
|
2157
|
+
if (g && String(ra(g, h)) === _) return;
|
|
2158
|
+
let t = s.find((e) => String(ra(e, h)) === _);
|
|
2188
2159
|
t && n.selectRow(e.id, t);
|
|
2189
2160
|
}, [
|
|
2190
2161
|
n,
|
|
@@ -2196,54 +2167,54 @@ function ra({ element: e, slots: t }) {
|
|
|
2196
2167
|
g
|
|
2197
2168
|
]);
|
|
2198
2169
|
let y = (t) => {
|
|
2199
|
-
let r =
|
|
2170
|
+
let r = ra(t, h);
|
|
2200
2171
|
if (m && r != null) {
|
|
2201
2172
|
let i = {
|
|
2202
2173
|
...p && p !== n.screen ? {} : n.parameters,
|
|
2203
2174
|
[m]: String(r)
|
|
2204
2175
|
};
|
|
2205
|
-
p && p !== n.screen || n.selectRow(e.id, t),
|
|
2176
|
+
p && p !== n.screen || n.selectRow(e.id, t), H(p || n.screen, i);
|
|
2206
2177
|
} else n.selectRow(e.id, t);
|
|
2207
2178
|
};
|
|
2208
|
-
return !
|
|
2179
|
+
return !Q(e, "query") && !i && !Tt(r) ? /* @__PURE__ */ z("section", {
|
|
2209
2180
|
className: "stage-table",
|
|
2210
2181
|
"data-scene-id": e.id,
|
|
2211
|
-
children: [/* @__PURE__ */
|
|
2182
|
+
children: [/* @__PURE__ */ z("p", {
|
|
2212
2183
|
className: "stage-note",
|
|
2213
2184
|
children: [
|
|
2214
2185
|
"No query is exposed for ",
|
|
2215
|
-
|
|
2186
|
+
Q(e, "typeName", "this read model"),
|
|
2216
2187
|
" yet."
|
|
2217
2188
|
]
|
|
2218
2189
|
}), t.columns]
|
|
2219
|
-
}) : /* @__PURE__ */
|
|
2190
|
+
}) : /* @__PURE__ */ z("section", {
|
|
2220
2191
|
className: "stage-table",
|
|
2221
2192
|
"data-scene-id": e.id,
|
|
2222
2193
|
children: [
|
|
2223
|
-
(u || d) && /* @__PURE__ */
|
|
2194
|
+
(u || d) && /* @__PURE__ */ R(Qe, {
|
|
2224
2195
|
severity: "info",
|
|
2225
2196
|
text: "Loading…"
|
|
2226
2197
|
}),
|
|
2227
|
-
l && /* @__PURE__ */
|
|
2198
|
+
l && /* @__PURE__ */ R(Qe, {
|
|
2228
2199
|
severity: "error",
|
|
2229
2200
|
text: l
|
|
2230
2201
|
}),
|
|
2231
|
-
g && /* @__PURE__ */ B
|
|
2202
|
+
g && /* @__PURE__ */ R(B, {
|
|
2232
2203
|
type: "button",
|
|
2233
2204
|
size: "small",
|
|
2234
2205
|
onClick: () => {
|
|
2235
2206
|
if (n.clearSelection(e.id), !m || n.parameters[m] === void 0) return;
|
|
2236
2207
|
let { [m]: t, ...r } = n.parameters;
|
|
2237
|
-
|
|
2208
|
+
H(n.screen, r);
|
|
2238
2209
|
},
|
|
2239
2210
|
children: "Clear selection"
|
|
2240
2211
|
}),
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
"aria-label":
|
|
2243
|
-
children: [/* @__PURE__ */
|
|
2212
|
+
/* @__PURE__ */ z("table", {
|
|
2213
|
+
"aria-label": Q(e, "label", Q(e, "typeName", "Results")),
|
|
2214
|
+
children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ R("tr", { children: f.map((e) => /* @__PURE__ */ R("th", {
|
|
2244
2215
|
scope: "col",
|
|
2245
2216
|
children: e.label
|
|
2246
|
-
}, e.property)) }) }), /* @__PURE__ */
|
|
2217
|
+
}, e.property)) }) }), /* @__PURE__ */ z("tbody", { children: [s.map((e, t) => /* @__PURE__ */ R("tr", {
|
|
2247
2218
|
"aria-selected": g === e,
|
|
2248
2219
|
tabIndex: 0,
|
|
2249
2220
|
onClick: () => v.click(e, () => y(e)),
|
|
@@ -2251,8 +2222,8 @@ function ra({ element: e, slots: t }) {
|
|
|
2251
2222
|
onKeyDown: (t) => {
|
|
2252
2223
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), y(e));
|
|
2253
2224
|
},
|
|
2254
|
-
children: f.map((t) => /* @__PURE__ */
|
|
2255
|
-
}, String(
|
|
2225
|
+
children: f.map((t) => /* @__PURE__ */ R("td", { children: ea(e[t.property], t.options, t.optionValues) }, t.property))
|
|
2226
|
+
}, String(ra(e, h) ?? t))), /* @__PURE__ */ R(aa, {
|
|
2256
2227
|
rowCount: s.length,
|
|
2257
2228
|
columnCount: f.length,
|
|
2258
2229
|
loading: u,
|
|
@@ -2262,82 +2233,116 @@ function ra({ element: e, slots: t }) {
|
|
|
2262
2233
|
]
|
|
2263
2234
|
});
|
|
2264
2235
|
}
|
|
2265
|
-
function
|
|
2266
|
-
return e !== 0 || n || r ? null : /* @__PURE__ */
|
|
2236
|
+
function aa({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
|
|
2237
|
+
return e !== 0 || n || r ? null : /* @__PURE__ */ R("tr", { children: /* @__PURE__ */ R("td", {
|
|
2267
2238
|
colSpan: Math.max(t, 1),
|
|
2268
2239
|
children: "No records found"
|
|
2269
2240
|
}) });
|
|
2270
2241
|
}
|
|
2271
|
-
function aa(e) {
|
|
2272
|
-
return oa(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
2273
|
-
}
|
|
2274
2242
|
function oa(e) {
|
|
2243
|
+
return sa(e) && (typeof e.path == "string" || typeof e.kind == "string");
|
|
2244
|
+
}
|
|
2245
|
+
function sa(e) {
|
|
2275
2246
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2276
2247
|
}
|
|
2277
|
-
function
|
|
2278
|
-
return
|
|
2248
|
+
function ca({ element: e, interactions: t, slots: n }) {
|
|
2249
|
+
return $t(e) ? /* @__PURE__ */ R(en, {
|
|
2279
2250
|
element: e,
|
|
2280
2251
|
interactions: t
|
|
2281
|
-
}) : /* @__PURE__ */
|
|
2252
|
+
}) : /* @__PURE__ */ R(fa, {
|
|
2282
2253
|
element: e,
|
|
2283
2254
|
interactions: t,
|
|
2284
2255
|
slots: n
|
|
2285
2256
|
});
|
|
2286
2257
|
}
|
|
2287
|
-
function
|
|
2288
|
-
let n =
|
|
2289
|
-
return
|
|
2258
|
+
function la(e) {
|
|
2259
|
+
let { routes: t, parameters: n } = U(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = c(() => J(r ?? ""), [r]), a = Qn(e), o = $n(e, r), { selectableRows: s, selectedRows: l } = Tr(), u = Q(e, "generationMode").toLowerCase() !== "manual", d = ua(e, a, o, u), f = u ? da(e, r, i, n, a, o ? [] : s) : {};
|
|
2260
|
+
return {
|
|
2261
|
+
element: {
|
|
2262
|
+
...e,
|
|
2263
|
+
properties: {
|
|
2264
|
+
...e.properties,
|
|
2265
|
+
...f,
|
|
2266
|
+
...r ? { schema: r } : {},
|
|
2267
|
+
createsEntity: o,
|
|
2268
|
+
rowAction: d
|
|
2269
|
+
}
|
|
2270
|
+
},
|
|
2271
|
+
subject: a,
|
|
2272
|
+
properties: i,
|
|
2273
|
+
selectedRows: l
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
function ua(e, t, n, r) {
|
|
2277
|
+
return n || t !== void 0 ? !1 : r || e.properties.rowAction === !0;
|
|
2278
|
+
}
|
|
2279
|
+
function da(e, t, n, r, i, a) {
|
|
2280
|
+
let o = e.properties.fields;
|
|
2281
|
+
if (!Array.isArray(o) || o.length === 0) return Ca(t, n, r, i, a);
|
|
2282
|
+
if (a.length === 0 || i === "screen" || i === void 0 && e.properties.rowAction !== !0 && n.filter((e) => e.identifier).length > 1) return {};
|
|
2283
|
+
let s = new Set(n.filter((e) => xa(e, i, a)).map((e) => e.name));
|
|
2284
|
+
return {
|
|
2285
|
+
fields: o.filter((e) => !s.has(ha(e))),
|
|
2286
|
+
generationMode: "manual"
|
|
2287
|
+
};
|
|
2288
|
+
}
|
|
2289
|
+
function fa({ element: e, interactions: t }) {
|
|
2290
|
+
let { element: n, subject: r, properties: i, selectedRows: a } = la(e), o = Q(n, "label") || q(Q(n, "command")), s = V(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = pa(n, r), l = er(r, a);
|
|
2291
|
+
return s ? c.length > 0 || tr(r, l) ? /* @__PURE__ */ R(B, {
|
|
2290
2292
|
type: "button",
|
|
2291
|
-
"data-scene-id":
|
|
2293
|
+
"data-scene-id": n.id,
|
|
2292
2294
|
disabled: !0,
|
|
2293
2295
|
title: "Select a row first",
|
|
2294
2296
|
...t,
|
|
2295
|
-
children:
|
|
2296
|
-
}) : /* @__PURE__ */
|
|
2297
|
-
element:
|
|
2298
|
-
label:
|
|
2299
|
-
}) : /* @__PURE__ */ B
|
|
2297
|
+
children: o
|
|
2298
|
+
}) : /* @__PURE__ */ R(_a, {
|
|
2299
|
+
element: l ? ar(n, i, l) : n,
|
|
2300
|
+
label: o
|
|
2301
|
+
}) : /* @__PURE__ */ R(B, {
|
|
2300
2302
|
type: "button",
|
|
2301
|
-
"data-scene-id":
|
|
2303
|
+
"data-scene-id": n.id,
|
|
2302
2304
|
disabled: !0,
|
|
2303
2305
|
title: "This command is not exposed as an API yet",
|
|
2304
2306
|
...t,
|
|
2305
|
-
children:
|
|
2307
|
+
children: o
|
|
2306
2308
|
});
|
|
2307
2309
|
}
|
|
2308
|
-
function
|
|
2309
|
-
let { parameters: n } = U(), r =
|
|
2310
|
-
return !
|
|
2310
|
+
function pa(e, t) {
|
|
2311
|
+
let { parameters: n } = U(), r = Q(e, "schema"), i = e.properties.fields, a = c(() => J(r), [r]), { selectableRows: o, selectedRows: s } = Tr(), l = Array.isArray(i) ? i : [], u = ma(e, l) ? new Set(l.map(ha).filter((e) => e !== "")) : void 0;
|
|
2312
|
+
return !u || t !== void 0 || $n(e, r) ? [] : si(a.filter((e) => !u.has(e.name)), n, s, o);
|
|
2313
|
+
}
|
|
2314
|
+
function ma(e, t) {
|
|
2315
|
+
return t.length > 0 || e.properties.rowAction === !0 || Q(e, "generationMode").toLowerCase() === "manual";
|
|
2311
2316
|
}
|
|
2312
|
-
function
|
|
2313
|
-
return
|
|
2317
|
+
function ha(e) {
|
|
2318
|
+
return sa(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
|
|
2314
2319
|
}
|
|
2315
|
-
function
|
|
2320
|
+
function ga(e) {
|
|
2316
2321
|
let t = (e?.parentElement?.classList.contains("stage-toolbar-action") ? e.parentElement : e)?.previousElementSibling;
|
|
2317
2322
|
return t?.classList.contains("stage-action") === !0 || t?.classList.contains("stage-toolbar-action") === !0;
|
|
2318
2323
|
}
|
|
2319
|
-
function
|
|
2324
|
+
function _a({ element: e, label: t }) {
|
|
2320
2325
|
let [n, i] = u(0), [a, o] = u(!1), [c, d] = u(!1), f = l(null);
|
|
2321
|
-
s(() => d(
|
|
2326
|
+
s(() => d(ga(f.current)));
|
|
2322
2327
|
let p = r(() => {
|
|
2323
2328
|
o(!1), i((e) => e + 1);
|
|
2324
|
-
}, []), m = /* @__PURE__ */
|
|
2329
|
+
}, []), m = /* @__PURE__ */ R(Pr.Provider, {
|
|
2325
2330
|
value: p,
|
|
2326
|
-
children: /* @__PURE__ */
|
|
2331
|
+
children: /* @__PURE__ */ R(Rr, {
|
|
2327
2332
|
element: e,
|
|
2328
2333
|
cancellable: !0
|
|
2329
2334
|
}, n)
|
|
2330
2335
|
});
|
|
2331
|
-
return /* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ z("div", {
|
|
2332
2337
|
className: "stage-action",
|
|
2333
2338
|
"data-scene-id": e.id,
|
|
2334
2339
|
ref: f,
|
|
2335
|
-
children: [/* @__PURE__ */ B
|
|
2340
|
+
children: [/* @__PURE__ */ R(B, {
|
|
2336
2341
|
type: "button",
|
|
2337
|
-
variant:
|
|
2342
|
+
variant: Rn(Q(e, "emphasis"), c),
|
|
2338
2343
|
onClick: () => o(!0),
|
|
2339
2344
|
children: t
|
|
2340
|
-
}), /* @__PURE__ */
|
|
2345
|
+
}), /* @__PURE__ */ R(Ze, {
|
|
2341
2346
|
title: t,
|
|
2342
2347
|
visible: a,
|
|
2343
2348
|
onClose: () => o(!1),
|
|
@@ -2348,45 +2353,45 @@ function fa({ element: e, label: t }) {
|
|
|
2348
2353
|
})]
|
|
2349
2354
|
});
|
|
2350
2355
|
}
|
|
2351
|
-
function
|
|
2352
|
-
let t = e.element ?? $i("slice-dialog", {}), n =
|
|
2353
|
-
if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */
|
|
2356
|
+
function va(e) {
|
|
2357
|
+
let t = e.element ?? $i("slice-dialog", {}), n = Se(), { routes: i, parameters: a } = U(), o = be(n?.currentDialogParameters), s = Q(t, "command") || o?.command || Q(t, "slice") || "", l = Q(t, "title") || o?.title || q(s), d = i?.commandSchemas?.[s], f = c(() => J(d ?? ""), [d]), { selectableRows: p, selectedRows: m } = Tr(), h = r(() => n?.closeDialog(), [n]), [g, _] = u(null), v = (e) => e.identifier && e.required && ni(e, p) && ti(e, m) !== void 0;
|
|
2358
|
+
if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ R(oe, {
|
|
2354
2359
|
element: e.element,
|
|
2355
2360
|
slots: e.slots ?? {}
|
|
2356
|
-
}) : /* @__PURE__ */
|
|
2357
|
-
let y = f.filter((e) =>
|
|
2361
|
+
}) : /* @__PURE__ */ R(de, {});
|
|
2362
|
+
let y = f.filter((e) => !$r(e, a) && !v(e)), b = $i(`slice-dialog-${s}`, {
|
|
2358
2363
|
command: s,
|
|
2359
2364
|
label: l,
|
|
2360
2365
|
schema: d,
|
|
2361
2366
|
fields: y.map((e) => ({
|
|
2362
2367
|
name: e.name,
|
|
2363
|
-
label:
|
|
2368
|
+
label: q(e.name)
|
|
2364
2369
|
})),
|
|
2365
2370
|
generationMode: "manual"
|
|
2366
2371
|
});
|
|
2367
|
-
return /* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ z("section", {
|
|
2368
2373
|
className: "scene-slice-dialog",
|
|
2369
|
-
"data-scene-slice-dialog":
|
|
2374
|
+
"data-scene-slice-dialog": Q(t, "slice") || o?.slice,
|
|
2370
2375
|
"data-scene-command": s,
|
|
2371
2376
|
children: [
|
|
2372
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ R("header", {
|
|
2373
2378
|
className: "scene-slice-dialog-header",
|
|
2374
|
-
children: /* @__PURE__ */
|
|
2379
|
+
children: /* @__PURE__ */ R("h2", {
|
|
2375
2380
|
className: "scene-slice-dialog-title",
|
|
2376
2381
|
children: l
|
|
2377
2382
|
})
|
|
2378
2383
|
}),
|
|
2379
|
-
/* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ R(Pr.Provider, {
|
|
2380
2385
|
value: h,
|
|
2381
|
-
children: /* @__PURE__ */
|
|
2386
|
+
children: /* @__PURE__ */ R(Fr.Provider, {
|
|
2382
2387
|
value: g,
|
|
2383
|
-
children: /* @__PURE__ */
|
|
2388
|
+
children: /* @__PURE__ */ R(Rr, { element: b })
|
|
2384
2389
|
})
|
|
2385
2390
|
}),
|
|
2386
|
-
/* @__PURE__ */
|
|
2391
|
+
/* @__PURE__ */ R("footer", {
|
|
2387
2392
|
ref: _,
|
|
2388
2393
|
className: "scene-slice-dialog-footer",
|
|
2389
|
-
children: /* @__PURE__ */
|
|
2394
|
+
children: /* @__PURE__ */ R("button", {
|
|
2390
2395
|
type: "button",
|
|
2391
2396
|
className: "scene-slice-dialog-cancel",
|
|
2392
2397
|
onClick: h,
|
|
@@ -2396,18 +2401,18 @@ function pa(e) {
|
|
|
2396
2401
|
]
|
|
2397
2402
|
});
|
|
2398
2403
|
}
|
|
2399
|
-
function
|
|
2404
|
+
function ya(e) {
|
|
2400
2405
|
let { element: t } = e;
|
|
2401
|
-
return
|
|
2406
|
+
return Q(t, "slice") === "" ? Q(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ R(Sa, { ...e }) : /* @__PURE__ */ R(j, { ...e }) : /* @__PURE__ */ R(ba, { ...e });
|
|
2402
2407
|
}
|
|
2403
|
-
function
|
|
2404
|
-
let { element: t } = e, { routes: n, parameters: r } = U(), i =
|
|
2405
|
-
if (
|
|
2406
|
-
let d =
|
|
2407
|
-
return /* @__PURE__ */
|
|
2408
|
+
function ba(e) {
|
|
2409
|
+
let { element: t } = e, { routes: n, parameters: r } = U(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], s = c(() => J(o ?? ""), [o]), { selectableRows: l, selectedRows: u } = Tr();
|
|
2410
|
+
if ((Bn(o ?? "") ? [] : si(s, r, u, l)).length === 0) return /* @__PURE__ */ R(j, { ...e });
|
|
2411
|
+
let d = Q(t, "label", Q(t, "name", t.id));
|
|
2412
|
+
return /* @__PURE__ */ R("span", {
|
|
2408
2413
|
className: "stage-toolbar-action",
|
|
2409
|
-
"data-scene-toolbar-item":
|
|
2410
|
-
children: /* @__PURE__ */ B
|
|
2414
|
+
"data-scene-toolbar-item": Q(t, "name", t.id),
|
|
2415
|
+
children: /* @__PURE__ */ R(B, {
|
|
2411
2416
|
type: "button",
|
|
2412
2417
|
"data-scene-id": t.id,
|
|
2413
2418
|
disabled: !0,
|
|
@@ -2417,61 +2422,62 @@ function ha(e) {
|
|
|
2417
2422
|
})
|
|
2418
2423
|
});
|
|
2419
2424
|
}
|
|
2420
|
-
function
|
|
2421
|
-
return t !== "screen" && !!e.identifier && e.required &&
|
|
2425
|
+
function xa(e, t, n) {
|
|
2426
|
+
return t !== "screen" && !!e.identifier && e.required && ni(e, n);
|
|
2422
2427
|
}
|
|
2423
|
-
function
|
|
2424
|
-
let { element: t } = e, { routes: n, parameters: r } = U(), i =
|
|
2428
|
+
function Sa(e) {
|
|
2429
|
+
let { element: t } = e, { routes: n, parameters: r } = U(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], l = c(() => J(s ?? ""), [s]), u = Qn(t), d = c(() => u === void 0 && Bn(s ?? ""), [s, u]), { selectableRows: f, selectedRows: p } = Tr(), m = d ? [] : f, h = u === void 0 && !d ? si(l, r, p, m) : [], g = Ca(s, l, r, u, m), _ = d ? { createsEntity: !0 } : rr(t, u), v = {
|
|
2425
2430
|
...t,
|
|
2426
2431
|
componentName: "core:action",
|
|
2427
2432
|
properties: {
|
|
2428
2433
|
command: a,
|
|
2429
2434
|
label: o,
|
|
2430
|
-
emphasis:
|
|
2435
|
+
emphasis: Q(t, "emphasis"),
|
|
2431
2436
|
...g,
|
|
2432
2437
|
..._
|
|
2433
2438
|
}
|
|
2434
2439
|
};
|
|
2435
|
-
return /* @__PURE__ */
|
|
2440
|
+
return /* @__PURE__ */ R("span", {
|
|
2436
2441
|
className: "stage-toolbar-action",
|
|
2437
2442
|
"data-scene-toolbar-item": i,
|
|
2438
|
-
children: h.length > 0 ? /* @__PURE__ */ B
|
|
2443
|
+
children: h.length > 0 ? /* @__PURE__ */ R(B, {
|
|
2439
2444
|
type: "button",
|
|
2440
2445
|
"data-scene-id": t.id,
|
|
2441
2446
|
disabled: !0,
|
|
2442
2447
|
title: "Select a row first",
|
|
2443
2448
|
...e.interactions,
|
|
2444
2449
|
children: o
|
|
2445
|
-
}) : /* @__PURE__ */
|
|
2450
|
+
}) : /* @__PURE__ */ R(ca, {
|
|
2446
2451
|
element: v,
|
|
2447
2452
|
interactions: e.interactions,
|
|
2448
2453
|
slots: e.slots
|
|
2449
2454
|
})
|
|
2450
2455
|
});
|
|
2451
2456
|
}
|
|
2452
|
-
function
|
|
2457
|
+
function Ca(e, t, n, r, i) {
|
|
2453
2458
|
return e ? {
|
|
2454
2459
|
schema: e,
|
|
2455
|
-
fields: t.filter((e) =>
|
|
2460
|
+
fields: t.filter((e) => !$r(e, n) && !xa(e, r, i)).map((e) => ({
|
|
2456
2461
|
name: e.name,
|
|
2457
|
-
label:
|
|
2462
|
+
label: q(e.name)
|
|
2458
2463
|
})),
|
|
2459
2464
|
generationMode: "manual"
|
|
2460
2465
|
} : {};
|
|
2461
2466
|
}
|
|
2462
|
-
var
|
|
2463
|
-
...
|
|
2464
|
-
"core:table":
|
|
2465
|
-
"core:action":
|
|
2466
|
-
"core:
|
|
2467
|
-
"core:
|
|
2468
|
-
|
|
2467
|
+
var wa = {
|
|
2468
|
+
...he,
|
|
2469
|
+
"core:table": ia,
|
|
2470
|
+
"core:action": ca,
|
|
2471
|
+
"core:guarded-action": en,
|
|
2472
|
+
"core:toolbarItem": ya,
|
|
2473
|
+
"core:sliceDialog": va,
|
|
2474
|
+
[Qi]: Rr,
|
|
2469
2475
|
[Ni]: zi,
|
|
2470
2476
|
[Zi]: Xi
|
|
2471
2477
|
};
|
|
2472
2478
|
// src/useStrings.ts
|
|
2473
|
-
function
|
|
2474
|
-
let e =
|
|
2479
|
+
function Ta() {
|
|
2480
|
+
let e = ht(), [t, n] = u([]), [r, i] = u(""), [o, s] = u({});
|
|
2475
2481
|
return a(() => {
|
|
2476
2482
|
let t = new AbortController();
|
|
2477
2483
|
return e.locales(t.signal).then((e) => {
|
|
@@ -2492,11 +2498,11 @@ function ba() {
|
|
|
2492
2498
|
dictionary: o
|
|
2493
2499
|
};
|
|
2494
2500
|
}
|
|
2495
|
-
var
|
|
2496
|
-
function
|
|
2497
|
-
return
|
|
2501
|
+
var Ea = /* @__PURE__ */ new Set(["core:table"]);
|
|
2502
|
+
function Da(e) {
|
|
2503
|
+
return Oa(e, /* @__PURE__ */ new Map(), void 0);
|
|
2498
2504
|
}
|
|
2499
|
-
function
|
|
2505
|
+
function Oa(e, t, n) {
|
|
2500
2506
|
let r = e;
|
|
2501
2507
|
if (!r.slots) return e;
|
|
2502
2508
|
let i = !1, a = {};
|
|
@@ -2505,7 +2511,7 @@ function Ca(e, t, n) {
|
|
|
2505
2511
|
a[e] = o.map((e) => {
|
|
2506
2512
|
let t = e, n = $(t, "typeName");
|
|
2507
2513
|
t.componentName === "core:data" && n && (r.set(n, t), s = t);
|
|
2508
|
-
let a =
|
|
2514
|
+
let a = Oa(Aa(ka(t, r), s), r, s);
|
|
2509
2515
|
return a !== e && (i = !0), a;
|
|
2510
2516
|
});
|
|
2511
2517
|
}
|
|
@@ -2514,8 +2520,8 @@ function Ca(e, t, n) {
|
|
|
2514
2520
|
slots: a
|
|
2515
2521
|
} : e;
|
|
2516
2522
|
}
|
|
2517
|
-
function
|
|
2518
|
-
if (!
|
|
2523
|
+
function ka(e, t) {
|
|
2524
|
+
if (!Ea.has(e.componentName)) return e;
|
|
2519
2525
|
let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
|
|
2520
2526
|
if (!r || e.properties.queryArguments !== void 0) return e;
|
|
2521
2527
|
let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
|
|
@@ -2524,8 +2530,8 @@ function wa(e, t) {
|
|
|
2524
2530
|
properties: a
|
|
2525
2531
|
};
|
|
2526
2532
|
}
|
|
2527
|
-
function
|
|
2528
|
-
if (
|
|
2533
|
+
function Aa(e, t) {
|
|
2534
|
+
if (!["core:guarded-action", "core:action"].includes(e.componentName) || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
|
|
2529
2535
|
let n = { ...e.properties };
|
|
2530
2536
|
if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
|
|
2531
2537
|
...e,
|
|
@@ -2542,7 +2548,7 @@ function $(e, t) {
|
|
|
2542
2548
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
2543
2549
|
}
|
|
2544
2550
|
// src/stageQueryBindings.tsx
|
|
2545
|
-
function
|
|
2551
|
+
function ja(e) {
|
|
2546
2552
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
2547
2553
|
if (Array.isArray(e)) {
|
|
2548
2554
|
e.forEach(n);
|
|
@@ -2558,7 +2564,7 @@ function Ea(e) {
|
|
|
2558
2564
|
};
|
|
2559
2565
|
return r(e), [...t];
|
|
2560
2566
|
}
|
|
2561
|
-
function
|
|
2567
|
+
function Ma(e) {
|
|
2562
2568
|
let t = /* @__PURE__ */ new Map(), n = (e, t) => {
|
|
2563
2569
|
let n = e.properties?.[t];
|
|
2564
2570
|
return typeof n == "string" && n.length > 0 ? n : void 0;
|
|
@@ -2577,7 +2583,7 @@ function Da(e) {
|
|
|
2577
2583
|
};
|
|
2578
2584
|
return r(e), [...t.values()];
|
|
2579
2585
|
}
|
|
2580
|
-
function
|
|
2586
|
+
function Na({ source: e }) {
|
|
2581
2587
|
let { routes: t, routesReady: n, parameters: r, session: i } = U(), a = e.by ? r[e.by] || i[e.by] : void 0, o = c(() => e.by ? a ? { [e.by]: a } : {} : {
|
|
2582
2588
|
...i,
|
|
2583
2589
|
...r
|
|
@@ -2597,7 +2603,7 @@ function Oa({ source: e }) {
|
|
|
2597
2603
|
list: !0
|
|
2598
2604
|
}), null;
|
|
2599
2605
|
}
|
|
2600
|
-
function
|
|
2606
|
+
function Pa({ name: e }) {
|
|
2601
2607
|
let { routes: t, routesReady: n, parameters: r, session: i } = U(), a = c(() => ({
|
|
2602
2608
|
...i,
|
|
2603
2609
|
...r
|
|
@@ -2611,59 +2617,59 @@ function ka({ name: e }) {
|
|
|
2611
2617
|
list: !0
|
|
2612
2618
|
}), null;
|
|
2613
2619
|
}
|
|
2614
|
-
function
|
|
2615
|
-
let t = c(() =>
|
|
2616
|
-
return /* @__PURE__ */
|
|
2620
|
+
function Fa({ element: e }) {
|
|
2621
|
+
let t = c(() => ja(e), [e]), n = c(() => Ma(e), [e]);
|
|
2622
|
+
return /* @__PURE__ */ z(Xe, { children: [t.map((e) => /* @__PURE__ */ R(Pa, { name: e }, e)), n.map((e) => /* @__PURE__ */ R(Na, { source: e }, e.typeName))] });
|
|
2617
2623
|
}
|
|
2618
2624
|
// src/stageThemeChoice.ts
|
|
2619
|
-
var
|
|
2620
|
-
function
|
|
2625
|
+
var Ia = "cratis.stage.theme";
|
|
2626
|
+
function La() {
|
|
2621
2627
|
try {
|
|
2622
2628
|
return globalThis.localStorage ?? null;
|
|
2623
2629
|
} catch {
|
|
2624
2630
|
return null;
|
|
2625
2631
|
}
|
|
2626
2632
|
}
|
|
2627
|
-
function
|
|
2633
|
+
function Ra() {
|
|
2628
2634
|
try {
|
|
2629
|
-
return
|
|
2635
|
+
return La()?.getItem("cratis.stage.theme") || void 0;
|
|
2630
2636
|
} catch {
|
|
2631
2637
|
return;
|
|
2632
2638
|
}
|
|
2633
2639
|
}
|
|
2634
|
-
function
|
|
2640
|
+
function za(e) {
|
|
2635
2641
|
try {
|
|
2636
|
-
|
|
2642
|
+
La()?.setItem(Ia, e);
|
|
2637
2643
|
} catch {}
|
|
2638
2644
|
}
|
|
2639
2645
|
// src/screenTitle.ts
|
|
2640
|
-
var
|
|
2641
|
-
function
|
|
2646
|
+
var Ba = "core:title", Va = ["content", "main"];
|
|
2647
|
+
function Ha(e) {
|
|
2642
2648
|
let t = e;
|
|
2643
|
-
if (t.componentName !==
|
|
2649
|
+
if (t.componentName !== Ba) return;
|
|
2644
2650
|
let n = t.properties?.text;
|
|
2645
2651
|
return typeof n == "string" && n.trim().length > 0 ? n : void 0;
|
|
2646
2652
|
}
|
|
2647
|
-
function
|
|
2653
|
+
function Ua(e) {
|
|
2648
2654
|
for (let t of e ?? []) {
|
|
2649
|
-
let e =
|
|
2655
|
+
let e = Ha(t);
|
|
2650
2656
|
if (e !== void 0) return e;
|
|
2651
2657
|
}
|
|
2652
2658
|
}
|
|
2653
|
-
function
|
|
2654
|
-
let t = e.slotContent ?? {}, n = [...
|
|
2659
|
+
function Wa(e) {
|
|
2660
|
+
let t = e.slotContent ?? {}, n = [...Va, ...Object.keys(t).filter((e) => !Va.includes(e))];
|
|
2655
2661
|
for (let e of n) {
|
|
2656
|
-
let n =
|
|
2662
|
+
let n = Ua(t[e]);
|
|
2657
2663
|
if (n !== void 0) return n;
|
|
2658
2664
|
}
|
|
2659
|
-
return
|
|
2665
|
+
return Ln(e.name);
|
|
2660
2666
|
}
|
|
2661
|
-
function
|
|
2667
|
+
function Ga(e) {
|
|
2662
2668
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2663
2669
|
for (let r of e.flatMap((e) => e.contributions ?? [])) {
|
|
2664
|
-
let e =
|
|
2670
|
+
let e = qa(r);
|
|
2665
2671
|
if (!e) continue;
|
|
2666
|
-
let i =
|
|
2672
|
+
let i = Ya(e);
|
|
2667
2673
|
t.has(i) || (t.add(i), n.push(e));
|
|
2668
2674
|
}
|
|
2669
2675
|
return n.map((e, t) => ({
|
|
@@ -2671,47 +2677,47 @@ function Ba(e) {
|
|
|
2671
2677
|
index: t
|
|
2672
2678
|
})).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
|
|
2673
2679
|
}
|
|
2674
|
-
function
|
|
2680
|
+
function Ka(e) {
|
|
2675
2681
|
let t = {
|
|
2676
2682
|
label: "",
|
|
2677
2683
|
children: []
|
|
2678
2684
|
};
|
|
2679
2685
|
for (let n of e) {
|
|
2680
|
-
let e = n.hierarchy.reduce((e, t) =>
|
|
2681
|
-
(n.group ?
|
|
2686
|
+
let e = n.hierarchy.reduce((e, t) => Xa(e, t, !1), t);
|
|
2687
|
+
(n.group ? Xa(e, n.group, !0) : e).children.push(Za(n));
|
|
2682
2688
|
}
|
|
2683
2689
|
return t.children;
|
|
2684
2690
|
}
|
|
2685
|
-
function
|
|
2691
|
+
function qa(e) {
|
|
2686
2692
|
if (e.contributionPointName !== "Navigation") return;
|
|
2687
2693
|
let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
|
|
2688
2694
|
if (typeof n != "string" || typeof r != "string") return;
|
|
2689
|
-
let i =
|
|
2695
|
+
let i = Ja(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
|
|
2690
2696
|
return {
|
|
2691
2697
|
label: n,
|
|
2692
2698
|
targetScreen: r,
|
|
2693
2699
|
hierarchy: i,
|
|
2694
2700
|
order: a,
|
|
2695
|
-
|
|
2696
|
-
id:
|
|
2697
|
-
group:
|
|
2698
|
-
icon:
|
|
2699
|
-
presentation:
|
|
2700
|
-
destination:
|
|
2701
|
+
...$a({
|
|
2702
|
+
id: Qa(t.id),
|
|
2703
|
+
group: Qa(t.group),
|
|
2704
|
+
icon: Qa(t.icon),
|
|
2705
|
+
presentation: Qa(t.presentation),
|
|
2706
|
+
destination: to(o) && no(o) ? o : void 0
|
|
2701
2707
|
})
|
|
2702
2708
|
};
|
|
2703
2709
|
}
|
|
2704
|
-
function
|
|
2710
|
+
function Ja(e) {
|
|
2705
2711
|
return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
|
|
2706
2712
|
}
|
|
2707
|
-
function
|
|
2713
|
+
function Ya(e) {
|
|
2708
2714
|
return e.id === void 0 ? JSON.stringify([
|
|
2709
2715
|
e.hierarchy,
|
|
2710
2716
|
e.targetScreen,
|
|
2711
2717
|
e.label
|
|
2712
2718
|
]) : JSON.stringify(["id", e.id]);
|
|
2713
2719
|
}
|
|
2714
|
-
function
|
|
2720
|
+
function Xa(e, t, n) {
|
|
2715
2721
|
let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
|
|
2716
2722
|
if (r) return r;
|
|
2717
2723
|
let i = n ? {
|
|
@@ -2724,12 +2730,12 @@ function Ga(e, t, n) {
|
|
|
2724
2730
|
};
|
|
2725
2731
|
return e.children.push(i), i;
|
|
2726
2732
|
}
|
|
2727
|
-
function
|
|
2733
|
+
function Za(e) {
|
|
2728
2734
|
return {
|
|
2729
2735
|
label: e.label,
|
|
2730
|
-
|
|
2736
|
+
...$a({ id: e.id || void 0 }),
|
|
2731
2737
|
screen: e.targetScreen,
|
|
2732
|
-
|
|
2738
|
+
...$a({
|
|
2733
2739
|
icon: e.icon || void 0,
|
|
2734
2740
|
presentation: e.presentation || void 0,
|
|
2735
2741
|
destination: e.destination
|
|
@@ -2737,82 +2743,82 @@ function Ka(e) {
|
|
|
2737
2743
|
children: []
|
|
2738
2744
|
};
|
|
2739
2745
|
}
|
|
2740
|
-
function
|
|
2746
|
+
function Qa(e) {
|
|
2741
2747
|
return typeof e == "string" ? e : void 0;
|
|
2742
2748
|
}
|
|
2743
|
-
function
|
|
2749
|
+
function $a(e) {
|
|
2744
2750
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
2745
2751
|
}
|
|
2746
|
-
function
|
|
2752
|
+
function eo(e, t) {
|
|
2747
2753
|
for (let n of e) {
|
|
2748
2754
|
if (n.screen === t) return [n.label];
|
|
2749
|
-
let e =
|
|
2755
|
+
let e = eo(n.children, t);
|
|
2750
2756
|
if (e.length > 0) return n.section ? e : [n.label, ...e];
|
|
2751
2757
|
}
|
|
2752
2758
|
return [];
|
|
2753
2759
|
}
|
|
2754
|
-
function
|
|
2760
|
+
function to(e) {
|
|
2755
2761
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2756
2762
|
}
|
|
2757
|
-
function
|
|
2763
|
+
function no(e) {
|
|
2758
2764
|
return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
|
|
2759
2765
|
}
|
|
2760
|
-
function
|
|
2766
|
+
function ro(e, t, n) {
|
|
2761
2767
|
return e.filter((e) => !t.has(e.name)).map((e) => ({
|
|
2762
|
-
label:
|
|
2768
|
+
label: Wa(e),
|
|
2763
2769
|
targetScreen: e.name,
|
|
2764
2770
|
hierarchy: e.path && e.path.length > 0 ? [...e.path] : [n]
|
|
2765
2771
|
}));
|
|
2766
2772
|
}
|
|
2767
2773
|
// src/blueprint.ts
|
|
2768
|
-
var
|
|
2769
|
-
function
|
|
2770
|
-
return
|
|
2774
|
+
var io = "Stage:locale", ao = "Stage:themeToggle", oo = "Cratis.Components", so = "PrimeReact", co = /* @__PURE__ */ new Map();
|
|
2775
|
+
function lo(e) {
|
|
2776
|
+
return ze(e).packages.includes(so);
|
|
2771
2777
|
}
|
|
2772
|
-
function
|
|
2773
|
-
|
|
2778
|
+
function uo(e, t) {
|
|
2779
|
+
co.set(e, t);
|
|
2774
2780
|
}
|
|
2775
|
-
function
|
|
2776
|
-
let t =
|
|
2781
|
+
function fo(e) {
|
|
2782
|
+
let t = ze(e);
|
|
2777
2783
|
return {
|
|
2778
2784
|
...t,
|
|
2779
2785
|
name: e?.length ? t.name : "Stage",
|
|
2780
|
-
packages:
|
|
2781
|
-
baseline:
|
|
2782
|
-
catalog: { [
|
|
2786
|
+
packages: E(t.packages, {
|
|
2787
|
+
baseline: oo,
|
|
2788
|
+
catalog: { [Me]: b.Blueprint }
|
|
2783
2789
|
})
|
|
2784
2790
|
};
|
|
2785
2791
|
}
|
|
2786
|
-
var
|
|
2787
|
-
...
|
|
2788
|
-
[
|
|
2792
|
+
var po = {
|
|
2793
|
+
...ke,
|
|
2794
|
+
[oo]: lt.components
|
|
2789
2795
|
};
|
|
2790
|
-
function
|
|
2791
|
-
let t = [...
|
|
2796
|
+
function mo(e) {
|
|
2797
|
+
let t = [...co.values()].reduce((e, t) => ({
|
|
2792
2798
|
...e,
|
|
2793
2799
|
...t.components
|
|
2794
2800
|
}), {});
|
|
2795
2801
|
return {
|
|
2796
|
-
...
|
|
2797
|
-
...
|
|
2802
|
+
...he,
|
|
2803
|
+
...ct,
|
|
2798
2804
|
...t,
|
|
2799
|
-
...
|
|
2800
|
-
...
|
|
2805
|
+
...je,
|
|
2806
|
+
...Re,
|
|
2801
2807
|
...e
|
|
2802
2808
|
};
|
|
2803
2809
|
}
|
|
2804
|
-
function
|
|
2805
|
-
let t = Object.fromEntries([...
|
|
2810
|
+
function ho(e) {
|
|
2811
|
+
let t = Object.fromEntries([...co].map(([e, t]) => [e, t.declared]));
|
|
2806
2812
|
return {
|
|
2807
2813
|
...e,
|
|
2808
|
-
...
|
|
2814
|
+
...po,
|
|
2809
2815
|
...t
|
|
2810
2816
|
};
|
|
2811
2817
|
}
|
|
2812
|
-
var
|
|
2813
|
-
function
|
|
2818
|
+
var go = "Stage:navigationTree";
|
|
2819
|
+
function _o(e, t, n) {
|
|
2814
2820
|
let r = t?.title ?? "Cratis Stage";
|
|
2815
|
-
return
|
|
2821
|
+
return L(e, P.Logo, {
|
|
2816
2822
|
label: r,
|
|
2817
2823
|
initials: r.slice(0, 1).toUpperCase() || "S",
|
|
2818
2824
|
targetScreen: n,
|
|
@@ -2821,42 +2827,42 @@ function fo(e, t, n) {
|
|
|
2821
2827
|
...t?.showName === void 0 ? {} : { showName: t.showName }
|
|
2822
2828
|
});
|
|
2823
2829
|
}
|
|
2824
|
-
function
|
|
2830
|
+
function vo(e, t, n) {
|
|
2825
2831
|
let r = [];
|
|
2826
|
-
return e.length > 1 && r.push(
|
|
2832
|
+
return e.length > 1 && r.push(L("topbar-locale", io, {
|
|
2827
2833
|
locales: e,
|
|
2828
2834
|
locale: t
|
|
2829
|
-
})), n && r.push(
|
|
2835
|
+
})), n && r.push(L("topbar-theme", ao, {})), r;
|
|
2830
2836
|
}
|
|
2831
|
-
function
|
|
2832
|
-
let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d =
|
|
2833
|
-
label:
|
|
2837
|
+
function yo(e, t, n, r, i, a = {}) {
|
|
2838
|
+
let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d = Ga(e), f = ro(e, new Set(d.map((e) => e.targetScreen)), "Other screens"), p = Ka([...d, ...d.length > 0 ? f : []]), m = e.map((e, n) => Le({
|
|
2839
|
+
label: Wa(e),
|
|
2834
2840
|
targetScreen: e.name,
|
|
2835
2841
|
icon: "pi pi-table",
|
|
2836
2842
|
group: "Screens",
|
|
2837
2843
|
order: n
|
|
2838
|
-
}, t)), h = e.find((e) => e.name === t), g = h ?
|
|
2844
|
+
}, t)), h = e.find((e) => e.name === t), g = h ? Wa(h) : Ln(t), _ = eo(Ka(d), t), v = e.find((e) => e.name === t)?.path?.length ? eo(p, t) : [], y = _.length > 0 ? _ : v, b = d.length > 0 ? L("menu-hierarchy", go, {
|
|
2839
2845
|
nodes: p,
|
|
2840
2846
|
activeScreen: t
|
|
2841
|
-
}) :
|
|
2847
|
+
}) : L("menu-screens", P.Menu, {
|
|
2842
2848
|
title: "Screens",
|
|
2843
2849
|
label: "Screens"
|
|
2844
|
-
}, { items: m }), x =
|
|
2850
|
+
}, { items: m }), x = vo(n, r, c), S = { regionNavigation: o };
|
|
2845
2851
|
return {
|
|
2846
|
-
[
|
|
2847
|
-
logo: [
|
|
2852
|
+
[F.Topbar]: [L("topbar", P.Topbar, S, {
|
|
2853
|
+
logo: [_o("topbar-logo", i, l)],
|
|
2848
2854
|
end: x
|
|
2849
2855
|
})],
|
|
2850
|
-
[
|
|
2851
|
-
...o ? {} : { [
|
|
2852
|
-
[
|
|
2856
|
+
[F.Sidebar]: [L("sidebar", P.Sidebar, S, { logo: [_o("sidebar-logo", i, l)] })],
|
|
2857
|
+
...o ? {} : { [F.Menu]: [b] },
|
|
2858
|
+
[F.Breadcrumb]: [L("breadcrumb", P.Breadcrumb, {
|
|
2853
2859
|
homeTargetScreen: l,
|
|
2854
2860
|
items: (y.length > 0 ? y : [g]).map((e) => ({ label: e }))
|
|
2855
2861
|
})],
|
|
2856
|
-
...s ? { [
|
|
2857
|
-
[
|
|
2862
|
+
...s ? { [F.Footer]: [L("footer", P.Footer, { text: u })] } : {},
|
|
2863
|
+
[F.ConfigPanel]: [L(P.ConfigPanel, P.ConfigPanel, {
|
|
2858
2864
|
title: "Settings",
|
|
2859
|
-
themes:
|
|
2865
|
+
themes: I.map((e) => ({
|
|
2860
2866
|
name: e.name,
|
|
2861
2867
|
label: e.name,
|
|
2862
2868
|
isDark: e.isDark ?? !1
|
|
@@ -2864,11 +2870,11 @@ function mo(e, t, n, r, i, a = {}) {
|
|
|
2864
2870
|
})]
|
|
2865
2871
|
};
|
|
2866
2872
|
}
|
|
2867
|
-
function
|
|
2873
|
+
function bo(e) {
|
|
2868
2874
|
return `#/${encodeURIComponent(e)}`;
|
|
2869
2875
|
}
|
|
2870
2876
|
// src/externalRouteHref.ts
|
|
2871
|
-
function
|
|
2877
|
+
function xo(e) {
|
|
2872
2878
|
try {
|
|
2873
2879
|
let t = new URL(e ?? "");
|
|
2874
2880
|
return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
|
|
@@ -2877,48 +2883,48 @@ function go(e) {
|
|
|
2877
2883
|
}
|
|
2878
2884
|
}
|
|
2879
2885
|
// src/StageChrome.tsx
|
|
2880
|
-
var
|
|
2886
|
+
var So = t({
|
|
2881
2887
|
locales: [],
|
|
2882
2888
|
locale: "",
|
|
2883
2889
|
setLocale: () => void 0,
|
|
2884
2890
|
activity: ""
|
|
2885
2891
|
});
|
|
2886
|
-
function
|
|
2887
|
-
return /* @__PURE__ */
|
|
2892
|
+
function Co({ state: e, children: t }) {
|
|
2893
|
+
return /* @__PURE__ */ R(So.Provider, {
|
|
2888
2894
|
value: e,
|
|
2889
2895
|
children: t
|
|
2890
2896
|
});
|
|
2891
2897
|
}
|
|
2892
|
-
var
|
|
2893
|
-
function
|
|
2894
|
-
let { locales: e, locale: t, setLocale: n } = i(
|
|
2895
|
-
return e.length < 2 ? null : /* @__PURE__ */
|
|
2898
|
+
var wo = "Stage:activity";
|
|
2899
|
+
function To() {
|
|
2900
|
+
let { locales: e, locale: t, setLocale: n } = i(So);
|
|
2901
|
+
return e.length < 2 ? null : /* @__PURE__ */ R("select", {
|
|
2896
2902
|
className: "stage-locale",
|
|
2897
2903
|
"aria-label": "Locale",
|
|
2898
2904
|
value: t,
|
|
2899
2905
|
onChange: (e) => n(e.target.value),
|
|
2900
|
-
children: e.map((e) => /* @__PURE__ */
|
|
2906
|
+
children: e.map((e) => /* @__PURE__ */ R("option", {
|
|
2901
2907
|
value: e,
|
|
2902
2908
|
children: e
|
|
2903
2909
|
}, e))
|
|
2904
2910
|
});
|
|
2905
2911
|
}
|
|
2906
|
-
function
|
|
2907
|
-
let { config: t, setThemeName: n, setColorScheme: r } =
|
|
2912
|
+
function Eo({ element: e }) {
|
|
2913
|
+
let { config: t, setThemeName: n, setColorScheme: r } = Be(), i = I.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === N.Dark, a = I.find((e) => (e.isDark ?? !1) !== i);
|
|
2908
2914
|
if (!a) return null;
|
|
2909
2915
|
let o = i ? "Switch to a light theme" : "Switch to a dark theme";
|
|
2910
|
-
return /* @__PURE__ */
|
|
2916
|
+
return /* @__PURE__ */ R("div", {
|
|
2911
2917
|
className: "stage-theme-toggle",
|
|
2912
2918
|
"data-scene-id": e.id,
|
|
2913
|
-
children: /* @__PURE__ */
|
|
2919
|
+
children: /* @__PURE__ */ R("button", {
|
|
2914
2920
|
type: "button",
|
|
2915
2921
|
className: "stage-theme-toggle__button",
|
|
2916
2922
|
"aria-label": o,
|
|
2917
2923
|
title: o,
|
|
2918
2924
|
onClick: () => {
|
|
2919
|
-
|
|
2925
|
+
za(a.name), n(a.name), r(a.isDark ? N.Dark : N.Light);
|
|
2920
2926
|
},
|
|
2921
|
-
children: /* @__PURE__ */
|
|
2927
|
+
children: /* @__PURE__ */ R("svg", {
|
|
2922
2928
|
width: "18",
|
|
2923
2929
|
height: "18",
|
|
2924
2930
|
viewBox: "0 0 24 24",
|
|
@@ -2928,43 +2934,43 @@ function xo({ element: e }) {
|
|
|
2928
2934
|
strokeLinecap: "round",
|
|
2929
2935
|
strokeLinejoin: "round",
|
|
2930
2936
|
"aria-hidden": "true",
|
|
2931
|
-
children: i ? /* @__PURE__ */
|
|
2937
|
+
children: i ? /* @__PURE__ */ z(Xe, { children: [/* @__PURE__ */ R("circle", {
|
|
2932
2938
|
cx: "12",
|
|
2933
2939
|
cy: "12",
|
|
2934
2940
|
r: "4"
|
|
2935
|
-
}), /* @__PURE__ */
|
|
2941
|
+
}), /* @__PURE__ */ R("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ R("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
2936
2942
|
})
|
|
2937
2943
|
})
|
|
2938
2944
|
});
|
|
2939
2945
|
}
|
|
2940
|
-
function
|
|
2946
|
+
function Do({ element: e }) {
|
|
2941
2947
|
let t = e.properties ?? {};
|
|
2942
|
-
return /* @__PURE__ */
|
|
2948
|
+
return /* @__PURE__ */ R("nav", {
|
|
2943
2949
|
className: "stage-navigation-tree",
|
|
2944
2950
|
"aria-label": "Navigation",
|
|
2945
2951
|
"data-scene-id": e.id,
|
|
2946
|
-
children: /* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ R(Oo, {
|
|
2947
2953
|
nodes: t.nodes ?? [],
|
|
2948
2954
|
activeScreen: t.activeScreen
|
|
2949
2955
|
})
|
|
2950
2956
|
});
|
|
2951
2957
|
}
|
|
2952
|
-
function
|
|
2953
|
-
return /* @__PURE__ */
|
|
2958
|
+
function Oo({ nodes: e, activeScreen: t }) {
|
|
2959
|
+
return /* @__PURE__ */ R("ul", {
|
|
2954
2960
|
role: "tree",
|
|
2955
|
-
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */
|
|
2961
|
+
children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ z("li", {
|
|
2956
2962
|
role: "treeitem",
|
|
2957
2963
|
"aria-expanded": "true",
|
|
2958
|
-
children: [/* @__PURE__ */
|
|
2964
|
+
children: [/* @__PURE__ */ R("span", {
|
|
2959
2965
|
className: "stage-navigation-group",
|
|
2960
2966
|
children: e.label
|
|
2961
|
-
}), /* @__PURE__ */
|
|
2967
|
+
}), /* @__PURE__ */ R(Oo, {
|
|
2962
2968
|
nodes: e.children,
|
|
2963
2969
|
activeScreen: t
|
|
2964
2970
|
})]
|
|
2965
|
-
}, e.label) : /* @__PURE__ */
|
|
2971
|
+
}, e.label) : /* @__PURE__ */ R("li", {
|
|
2966
2972
|
role: "treeitem",
|
|
2967
|
-
children: /* @__PURE__ */
|
|
2973
|
+
children: /* @__PURE__ */ R(ko, {
|
|
2968
2974
|
node: e,
|
|
2969
2975
|
screen: e.screen,
|
|
2970
2976
|
activeScreen: t
|
|
@@ -2972,11 +2978,11 @@ function Co({ nodes: e, activeScreen: t }) {
|
|
|
2972
2978
|
}, `${e.screen}:${e.label}`))
|
|
2973
2979
|
});
|
|
2974
2980
|
}
|
|
2975
|
-
function
|
|
2976
|
-
let r = i(
|
|
2981
|
+
function ko({ node: e, screen: t, activeScreen: n }) {
|
|
2982
|
+
let r = i(M), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s && no(o) ? (e) => {
|
|
2977
2983
|
e.preventDefault(), r.navigate(o);
|
|
2978
|
-
} : void 0, l = s ?
|
|
2979
|
-
return /* @__PURE__ */
|
|
2984
|
+
} : void 0, l = s ? xo(o.route) : bo(t), u = s && l === void 0;
|
|
2985
|
+
return /* @__PURE__ */ z("a", {
|
|
2980
2986
|
href: l,
|
|
2981
2987
|
rel: s && !u ? "noreferrer" : void 0,
|
|
2982
2988
|
"aria-disabled": u ? "true" : void 0,
|
|
@@ -2985,30 +2991,30 @@ function wo({ node: e, screen: t, activeScreen: n }) {
|
|
|
2985
2991
|
"data-presentation": e.presentation,
|
|
2986
2992
|
"data-icon": e.icon,
|
|
2987
2993
|
onClick: c,
|
|
2988
|
-
children: [a !== "text" && e.icon && /* @__PURE__ */
|
|
2994
|
+
children: [a !== "text" && e.icon && /* @__PURE__ */ R("span", {
|
|
2989
2995
|
className: "stage-navigation-icon",
|
|
2990
2996
|
"aria-hidden": "true",
|
|
2991
2997
|
"data-icon-name": e.icon
|
|
2992
2998
|
}), a !== "icon" && e.label]
|
|
2993
2999
|
});
|
|
2994
3000
|
}
|
|
2995
|
-
function
|
|
2996
|
-
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(
|
|
2997
|
-
return /* @__PURE__ */
|
|
3001
|
+
function Ao({ element: e }) {
|
|
3002
|
+
let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(M), r = we(), a = U(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
|
|
3003
|
+
return /* @__PURE__ */ z("div", {
|
|
2998
3004
|
"data-scene-outlet": t,
|
|
2999
3005
|
"data-scene-outlet-screen": o,
|
|
3000
|
-
children: [c && o && /* @__PURE__ */
|
|
3006
|
+
children: [c && o && /* @__PURE__ */ R("div", {
|
|
3001
3007
|
className: "scene-outlet-bar",
|
|
3002
|
-
children: /* @__PURE__ */
|
|
3008
|
+
children: /* @__PURE__ */ R("button", {
|
|
3003
3009
|
type: "button",
|
|
3004
3010
|
className: "scene-outlet-close",
|
|
3005
3011
|
"aria-label": "Close",
|
|
3006
3012
|
onClick: () => n?.closeOutlet(t),
|
|
3007
3013
|
children: "Close"
|
|
3008
3014
|
})
|
|
3009
|
-
}), s && r && /* @__PURE__ */
|
|
3015
|
+
}), s && r && /* @__PURE__ */ R(Cr, {
|
|
3010
3016
|
element: s,
|
|
3011
|
-
children: /* @__PURE__ */
|
|
3017
|
+
children: /* @__PURE__ */ R(le, {
|
|
3012
3018
|
element: s,
|
|
3013
3019
|
registry: r.registry,
|
|
3014
3020
|
resolveBinding: a.resolveBinding
|
|
@@ -3016,16 +3022,16 @@ function To({ element: e }) {
|
|
|
3016
3022
|
})]
|
|
3017
3023
|
});
|
|
3018
3024
|
}
|
|
3019
|
-
function
|
|
3020
|
-
let { activity: e } = i(
|
|
3021
|
-
return e ? /* @__PURE__ */
|
|
3025
|
+
function jo() {
|
|
3026
|
+
let { activity: e } = i(So);
|
|
3027
|
+
return e ? /* @__PURE__ */ R("p", {
|
|
3022
3028
|
className: "stage-activity",
|
|
3023
3029
|
role: "status",
|
|
3024
3030
|
children: e
|
|
3025
3031
|
}) : null;
|
|
3026
3032
|
}
|
|
3027
|
-
function
|
|
3028
|
-
let e =
|
|
3033
|
+
function Mo() {
|
|
3034
|
+
let e = Te(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
|
|
3029
3035
|
return a(() => {
|
|
3030
3036
|
let r = e?.isDark ? "dark" : "light";
|
|
3031
3037
|
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 ?? "";
|
|
@@ -3035,39 +3041,39 @@ function Do() {
|
|
|
3035
3041
|
n
|
|
3036
3042
|
]), null;
|
|
3037
3043
|
}
|
|
3038
|
-
var
|
|
3039
|
-
[
|
|
3040
|
-
[
|
|
3041
|
-
[
|
|
3042
|
-
[
|
|
3043
|
-
"core:outlet":
|
|
3044
|
+
var No = {
|
|
3045
|
+
[io]: To,
|
|
3046
|
+
[ao]: Eo,
|
|
3047
|
+
[go]: Do,
|
|
3048
|
+
[wo]: jo,
|
|
3049
|
+
"core:outlet": Ao
|
|
3044
3050
|
};
|
|
3045
3051
|
// src/stageResponseContracts.ts
|
|
3046
|
-
function
|
|
3052
|
+
function Po(e) {
|
|
3047
3053
|
return {
|
|
3048
3054
|
commandResponse: (t) => e?.commands[t] ?? void 0,
|
|
3049
|
-
targetType: (t, n) =>
|
|
3055
|
+
targetType: (t, n) => Fo(e, t, n)
|
|
3050
3056
|
};
|
|
3051
3057
|
}
|
|
3052
|
-
function
|
|
3058
|
+
function Fo(e, t, n) {
|
|
3053
3059
|
if (n.kind === "message") return { kind: "string" };
|
|
3054
|
-
if (n.kind === "argument") return
|
|
3060
|
+
if (n.kind === "argument") return Io(e, t, n.name);
|
|
3055
3061
|
}
|
|
3056
|
-
function
|
|
3062
|
+
function Io(e, t, n) {
|
|
3057
3063
|
switch (t.kind) {
|
|
3058
|
-
case
|
|
3059
|
-
case
|
|
3064
|
+
case _.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
|
|
3065
|
+
case _.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
|
|
3060
3066
|
default: return;
|
|
3061
3067
|
}
|
|
3062
3068
|
}
|
|
3063
3069
|
// src/stageShell.ts
|
|
3064
|
-
var
|
|
3070
|
+
var Lo = [
|
|
3065
3071
|
"navigationMode",
|
|
3066
3072
|
"menuTheme",
|
|
3067
3073
|
"showFooter",
|
|
3068
3074
|
"showThemeSwitcher"
|
|
3069
|
-
],
|
|
3070
|
-
function
|
|
3075
|
+
], Ro = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
3076
|
+
function zo(e, t, n = !1) {
|
|
3071
3077
|
let r = [], i = {
|
|
3072
3078
|
showFooter: !0,
|
|
3073
3079
|
showThemeSwitcher: !0,
|
|
@@ -3075,54 +3081,54 @@ function Po(e, t, n = !1) {
|
|
|
3075
3081
|
problems: r
|
|
3076
3082
|
};
|
|
3077
3083
|
for (let [e, n] of Object.entries(t.options ?? {})) {
|
|
3078
|
-
let a =
|
|
3084
|
+
let a = Bo(i, t.name, e, n);
|
|
3079
3085
|
a && r.push(a);
|
|
3080
3086
|
}
|
|
3081
|
-
return
|
|
3087
|
+
return Ho(i, e?.appearance, n), i;
|
|
3082
3088
|
}
|
|
3083
|
-
function
|
|
3084
|
-
if (!
|
|
3085
|
-
if (n === "navigationMode") return
|
|
3089
|
+
function Bo(e, t, n, r) {
|
|
3090
|
+
if (!Lo.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${Lo.join(", ")}.`;
|
|
3091
|
+
if (n === "navigationMode") return Vo(n, r, Fe, (t) => {
|
|
3086
3092
|
e.mode = t;
|
|
3087
3093
|
});
|
|
3088
|
-
if (n === "menuTheme") return
|
|
3094
|
+
if (n === "menuTheme") return Vo(n, r, Ie, (t) => {
|
|
3089
3095
|
e.menuTheme = t;
|
|
3090
3096
|
});
|
|
3091
3097
|
if (typeof r != "boolean") return `Option '${n}' is '${String(r)}'; expected true or false.`;
|
|
3092
3098
|
n === "showFooter" ? e.showFooter = r : e.showThemeSwitcher = r;
|
|
3093
3099
|
}
|
|
3094
|
-
function
|
|
3100
|
+
function Vo(e, t, n, r) {
|
|
3095
3101
|
let i = n.find((e) => e === t);
|
|
3096
3102
|
if (!i) return `Option '${e}' is '${String(t)}'; expected one of ${n.join(", ")}.`;
|
|
3097
3103
|
r(i);
|
|
3098
3104
|
}
|
|
3099
|
-
function
|
|
3105
|
+
function Ho(e, t, n) {
|
|
3100
3106
|
if (t?.colorScheme !== void 0) {
|
|
3101
|
-
e.followsSystem = t.colorScheme ===
|
|
3102
|
-
let r = e.followsSystem ? n : t.colorScheme ===
|
|
3103
|
-
e.colorScheme = r ?
|
|
3107
|
+
e.followsSystem = t.colorScheme === f.System;
|
|
3108
|
+
let r = e.followsSystem ? n : t.colorScheme === f.Dark;
|
|
3109
|
+
e.colorScheme = r ? N.Dark : N.Light, e.themeName = I.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
|
|
3104
3110
|
}
|
|
3105
|
-
t?.accent !== void 0 && (
|
|
3111
|
+
t?.accent !== void 0 && (Ro.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
|
|
3106
3112
|
}
|
|
3107
|
-
function
|
|
3113
|
+
function Uo(e) {
|
|
3108
3114
|
return {
|
|
3109
3115
|
showFooter: e?.showFooter ?? !0,
|
|
3110
3116
|
showThemeSwitcher: e?.showThemeSwitcher ?? !0
|
|
3111
3117
|
};
|
|
3112
3118
|
}
|
|
3113
|
-
function
|
|
3119
|
+
function Wo(e, t) {
|
|
3114
3120
|
if (e?.root === void 0) return [];
|
|
3115
3121
|
let n = /* @__PURE__ */ new Set([
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
+
C.RootTemplateUnknown,
|
|
3123
|
+
C.RootTemplateVersionNotSatisfied,
|
|
3124
|
+
C.RootTemplateNotApplicable,
|
|
3125
|
+
C.RootTemplateMissingContentSlot,
|
|
3126
|
+
C.RootTemplateCycle,
|
|
3127
|
+
C.RootTemplateBlueprintNotInstalled
|
|
3122
3128
|
]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
|
|
3123
|
-
return r.length === 0 && t.origin !==
|
|
3129
|
+
return r.length === 0 && t.origin !== w.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;
|
|
3124
3130
|
}
|
|
3125
|
-
function
|
|
3131
|
+
function Go(e) {
|
|
3126
3132
|
let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
|
|
3127
3133
|
0,
|
|
3128
3134
|
2,
|
|
@@ -3130,7 +3136,7 @@ function Bo(e) {
|
|
|
3130
3136
|
].map((e) => parseInt(t.slice(e, e + 2), 16));
|
|
3131
3137
|
return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
|
|
3132
3138
|
}
|
|
3133
|
-
function
|
|
3139
|
+
function Ko(e, t) {
|
|
3134
3140
|
if (t === void 0) return e;
|
|
3135
3141
|
let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
|
|
3136
3142
|
0,
|
|
@@ -3142,25 +3148,25 @@ function Vo(e, t) {
|
|
|
3142
3148
|
tokens: {
|
|
3143
3149
|
...e.tokens,
|
|
3144
3150
|
"primary.color": t,
|
|
3145
|
-
"primary.contrastColor":
|
|
3151
|
+
"primary.contrastColor": Go(t),
|
|
3146
3152
|
"focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
|
|
3147
3153
|
}
|
|
3148
3154
|
}));
|
|
3149
3155
|
}
|
|
3150
3156
|
// src/StageShellSettings.tsx
|
|
3151
|
-
var
|
|
3152
|
-
function
|
|
3157
|
+
var qo = "(prefers-color-scheme: dark)";
|
|
3158
|
+
function Jo() {
|
|
3153
3159
|
return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
|
|
3154
3160
|
}
|
|
3155
|
-
function
|
|
3156
|
-
let n = l(
|
|
3157
|
-
n.current =
|
|
3161
|
+
function Yo({ settings: e, onSystemSchemeChange: t }) {
|
|
3162
|
+
let n = l(Be());
|
|
3163
|
+
n.current = Be();
|
|
3158
3164
|
let { mode: r, menuTheme: i, colorScheme: o, themeName: s } = e;
|
|
3159
3165
|
return a(() => {
|
|
3160
3166
|
let { setMode: e, setMenuTheme: t, setColorScheme: a, setThemeName: c } = n.current;
|
|
3161
3167
|
r !== void 0 && e(r), i !== void 0 && t(i);
|
|
3162
|
-
let l =
|
|
3163
|
-
l ? (c(l.name), a(l.isDark ?
|
|
3168
|
+
let l = I.find((e) => e.name === Ra());
|
|
3169
|
+
l ? (c(l.name), a(l.isDark ? N.Dark : N.Light)) : (o !== void 0 && a(o), s !== void 0 && c(s));
|
|
3164
3170
|
}, [
|
|
3165
3171
|
r,
|
|
3166
3172
|
i,
|
|
@@ -3168,15 +3174,15 @@ function Wo({ settings: e, onSystemSchemeChange: t }) {
|
|
|
3168
3174
|
s
|
|
3169
3175
|
]), a(() => {
|
|
3170
3176
|
if (!e.followsSystem || !globalThis.matchMedia || !t) return;
|
|
3171
|
-
let n = globalThis.matchMedia(
|
|
3177
|
+
let n = globalThis.matchMedia(qo), r = (e) => t(e.matches);
|
|
3172
3178
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
3173
3179
|
}, [e.followsSystem, t]), null;
|
|
3174
3180
|
}
|
|
3175
3181
|
// src/stageNavigationModel.ts
|
|
3176
|
-
function
|
|
3182
|
+
function Xo(e) {
|
|
3177
3183
|
return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
|
|
3178
3184
|
}
|
|
3179
|
-
function
|
|
3185
|
+
function Zo(e) {
|
|
3180
3186
|
let t = /* @__PURE__ */ new Map();
|
|
3181
3187
|
for (let n of e) {
|
|
3182
3188
|
let e = (n.path ?? []).join(".");
|
|
@@ -3189,41 +3195,41 @@ function Ko(e) {
|
|
|
3189
3195
|
return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
|
|
3190
3196
|
};
|
|
3191
3197
|
}
|
|
3192
|
-
function
|
|
3198
|
+
function Qo(e) {
|
|
3193
3199
|
return (t) => e.find((e) => e.name === t)?.path?.[0];
|
|
3194
3200
|
}
|
|
3195
|
-
function
|
|
3201
|
+
function $o(e, t, n) {
|
|
3196
3202
|
let r = e.navigation ?? {
|
|
3197
3203
|
application: { regions: [] },
|
|
3198
3204
|
modules: []
|
|
3199
3205
|
};
|
|
3200
3206
|
return {
|
|
3201
3207
|
structure: e.structure ?? { modules: [] },
|
|
3202
|
-
navigation: n ?
|
|
3203
|
-
screenFor:
|
|
3204
|
-
moduleOf:
|
|
3208
|
+
navigation: n ? es(r, n) : r,
|
|
3209
|
+
screenFor: Zo(e.screens),
|
|
3210
|
+
moduleOf: Qo(e.screens),
|
|
3205
3211
|
...t ? { isVisible: t } : {}
|
|
3206
3212
|
};
|
|
3207
3213
|
}
|
|
3208
|
-
function
|
|
3209
|
-
return typeof e == "string" ? k(e, t) : Array.isArray(e) ? e.map((e) =>
|
|
3214
|
+
function es(e, t) {
|
|
3215
|
+
return typeof e == "string" ? k(e, t) : Array.isArray(e) ? e.map((e) => es(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, es(n, t)])) : e;
|
|
3210
3216
|
}
|
|
3211
3217
|
// src/stageSlices.ts
|
|
3212
|
-
function
|
|
3213
|
-
return (t) =>
|
|
3218
|
+
function ts(e) {
|
|
3219
|
+
return (t) => J(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
|
|
3214
3220
|
name: e.name,
|
|
3215
3221
|
type: e.type === "text" || e.type === void 0 ? "string" : e.type,
|
|
3216
|
-
label:
|
|
3222
|
+
label: ns(e.name),
|
|
3217
3223
|
required: e.required
|
|
3218
3224
|
}));
|
|
3219
3225
|
}
|
|
3220
|
-
function
|
|
3226
|
+
function ns(e) {
|
|
3221
3227
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
|
|
3222
3228
|
}
|
|
3223
|
-
function
|
|
3229
|
+
function rs(e, t, n) {
|
|
3224
3230
|
return { invoke: async (r, i, a) => {
|
|
3225
3231
|
let o = a ?? r.slice(r.lastIndexOf(".") + 1);
|
|
3226
|
-
if (!
|
|
3232
|
+
if (!V(o)) return {
|
|
3227
3233
|
succeeded: !1,
|
|
3228
3234
|
message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
|
|
3229
3235
|
};
|
|
@@ -3240,7 +3246,7 @@ function Qo(e, t, n) {
|
|
|
3240
3246
|
} };
|
|
3241
3247
|
}
|
|
3242
3248
|
// src/withoutSeededSlots.ts
|
|
3243
|
-
function
|
|
3249
|
+
function is(e, t) {
|
|
3244
3250
|
let n = /* @__PURE__ */ new Map();
|
|
3245
3251
|
for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
|
|
3246
3252
|
return e.map((e) => {
|
|
@@ -3257,7 +3263,7 @@ function $o(e, t) {
|
|
|
3257
3263
|
});
|
|
3258
3264
|
}
|
|
3259
3265
|
// src/stageIcons.ts
|
|
3260
|
-
var
|
|
3266
|
+
var as = /* @__PURE__ */ new Map([
|
|
3261
3267
|
["chart", "chart-column"],
|
|
3262
3268
|
["add", "plus"],
|
|
3263
3269
|
["dollar", "dollar-sign"],
|
|
@@ -3265,23 +3271,23 @@ var es = /* @__PURE__ */ new Map([
|
|
|
3265
3271
|
["refresh", "refresh-cw"],
|
|
3266
3272
|
["invoice", "receipt-text"],
|
|
3267
3273
|
["batch", "layers"]
|
|
3268
|
-
]),
|
|
3269
|
-
library:
|
|
3274
|
+
]), os = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), ss = ye([{
|
|
3275
|
+
library: x,
|
|
3270
3276
|
loadGlyph: async ({ key: e }) => {
|
|
3271
|
-
let t =
|
|
3272
|
-
if (Object.hasOwn(
|
|
3277
|
+
let t = os(e), n = as.get(t) ?? t;
|
|
3278
|
+
if (Object.hasOwn(ut, n)) return (await ut[n]())?.default;
|
|
3273
3279
|
}
|
|
3274
3280
|
}]);
|
|
3275
3281
|
// src/App.tsx
|
|
3276
|
-
function
|
|
3277
|
-
return
|
|
3282
|
+
function cs(e = {}) {
|
|
3283
|
+
return mo({
|
|
3278
3284
|
...e,
|
|
3279
|
-
...
|
|
3280
|
-
...
|
|
3285
|
+
...wa,
|
|
3286
|
+
...No
|
|
3281
3287
|
});
|
|
3282
3288
|
}
|
|
3283
|
-
function
|
|
3284
|
-
return
|
|
3289
|
+
function ls(e, t) {
|
|
3290
|
+
return L(`form-${e}-${t.name}`, Qi, {
|
|
3285
3291
|
command: t.forCommand,
|
|
3286
3292
|
label: t.name,
|
|
3287
3293
|
generationMode: t.generationMode,
|
|
@@ -3290,71 +3296,71 @@ function is(e, t) {
|
|
|
3290
3296
|
onSubmit: t.onSubmit
|
|
3291
3297
|
});
|
|
3292
3298
|
}
|
|
3293
|
-
function
|
|
3299
|
+
function us(e, t) {
|
|
3294
3300
|
let n = e.screens[0];
|
|
3295
|
-
return
|
|
3296
|
-
profile:
|
|
3297
|
-
blueprintTemplates: t?.length ? [...
|
|
3301
|
+
return Ne(e, n, {
|
|
3302
|
+
profile: fo(e.uiProfiles),
|
|
3303
|
+
blueprintTemplates: t?.length ? [...Pe, ...t] : Pe
|
|
3298
3304
|
});
|
|
3299
3305
|
}
|
|
3300
|
-
function
|
|
3306
|
+
function ds(e, t) {
|
|
3301
3307
|
return t ? e.map((e) => ({
|
|
3302
3308
|
...e,
|
|
3303
3309
|
slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => O(e, t))]))
|
|
3304
3310
|
})) : e;
|
|
3305
3311
|
}
|
|
3306
|
-
function
|
|
3312
|
+
function fs(e, t, n, r, i, a, o = !0, s = !0) {
|
|
3307
3313
|
let c = {
|
|
3308
|
-
regions:
|
|
3314
|
+
regions: Xo(e.navigation),
|
|
3309
3315
|
showFooter: o,
|
|
3310
3316
|
showThemeSwitcher: s
|
|
3311
|
-
}, l =
|
|
3317
|
+
}, l = ds(e.screens, i), u = ps(e);
|
|
3312
3318
|
return {
|
|
3313
|
-
profile:
|
|
3314
|
-
catalog:
|
|
3315
|
-
blueprintTemplates: a?.length ? [...
|
|
3319
|
+
profile: fo(e.uiProfiles),
|
|
3320
|
+
catalog: ho(r),
|
|
3321
|
+
blueprintTemplates: a?.length ? [...Pe, ...a] : Pe,
|
|
3316
3322
|
namedTemplateOnly: !0,
|
|
3317
|
-
chrome: (e, r) => r ===
|
|
3318
|
-
form:
|
|
3319
|
-
trailing: [
|
|
3323
|
+
chrome: (e, r) => r === P.FullPageShell ? { [F.ConfigPanel]: yo(l, e.name, t, n, u, c)[F.ConfigPanel] } : yo(l, e.name, t, n, u, c),
|
|
3324
|
+
form: ls,
|
|
3325
|
+
trailing: [L("activity", wo)],
|
|
3320
3326
|
decorate: (e) => {
|
|
3321
|
-
let t =
|
|
3327
|
+
let t = Da(Nn(e));
|
|
3322
3328
|
return i ? O(t, i) : t;
|
|
3323
3329
|
}
|
|
3324
3330
|
};
|
|
3325
3331
|
}
|
|
3326
|
-
function
|
|
3332
|
+
function ps(e) {
|
|
3327
3333
|
let t = e.navigation?.application.logo;
|
|
3328
3334
|
if (t) return {
|
|
3329
3335
|
title: t.title,
|
|
3330
3336
|
image: t.image || void 0
|
|
3331
3337
|
};
|
|
3332
|
-
let n =
|
|
3338
|
+
let n = fo(e.uiProfiles).identity;
|
|
3333
3339
|
if (!n?.name) return;
|
|
3334
3340
|
let r = n.logo;
|
|
3335
3341
|
return {
|
|
3336
3342
|
title: n.name,
|
|
3337
|
-
image: r?.kind ===
|
|
3338
|
-
icon: r?.kind ===
|
|
3343
|
+
image: r?.kind === y.Image && r.image || void 0,
|
|
3344
|
+
icon: r?.kind === y.Icon ? r.icon : void 0,
|
|
3339
3345
|
showName: n.showName
|
|
3340
3346
|
};
|
|
3341
3347
|
}
|
|
3342
|
-
function
|
|
3343
|
-
let [o] = Fi([t],
|
|
3344
|
-
return
|
|
3348
|
+
function ms(e, t, n, r, i, a) {
|
|
3349
|
+
let [o] = Fi([t], hs(e));
|
|
3350
|
+
return Ae(e, o, fs(e, n, r, i, void 0, a)).element;
|
|
3345
3351
|
}
|
|
3346
|
-
function
|
|
3352
|
+
function hs(e) {
|
|
3347
3353
|
return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
|
|
3348
3354
|
}
|
|
3349
|
-
function
|
|
3355
|
+
function gs() {
|
|
3350
3356
|
try {
|
|
3351
3357
|
return globalThis.localStorage ?? null;
|
|
3352
3358
|
} catch {
|
|
3353
3359
|
return null;
|
|
3354
3360
|
}
|
|
3355
3361
|
}
|
|
3356
|
-
function
|
|
3357
|
-
let s =
|
|
3362
|
+
function _s({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
|
|
3363
|
+
let s = ht(), [l, d] = u(), [f, p] = u(""), m = c(() => cs(e), [e, l]), h = gt(), g = Ta();
|
|
3358
3364
|
return a(() => {
|
|
3359
3365
|
let e = new AbortController();
|
|
3360
3366
|
return s.scene(e.signal).then((e) => d(r?.length ? {
|
|
@@ -3363,10 +3369,10 @@ function fs({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
3363
3369
|
} : e)).catch((t) => {
|
|
3364
3370
|
e.signal.aborted || p(t instanceof Error ? t.message : String(t));
|
|
3365
3371
|
}), () => e.abort();
|
|
3366
|
-
}, [s, r]), f ? /* @__PURE__ */
|
|
3372
|
+
}, [s, r]), f ? /* @__PURE__ */ z("main", {
|
|
3367
3373
|
className: "stage-message",
|
|
3368
|
-
children: [/* @__PURE__ */
|
|
3369
|
-
}) : l ? /* @__PURE__ */
|
|
3374
|
+
children: [/* @__PURE__ */ R("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ R("p", { children: f })]
|
|
3375
|
+
}) : l ? /* @__PURE__ */ R(vs, {
|
|
3370
3376
|
scene: l,
|
|
3371
3377
|
registry: m,
|
|
3372
3378
|
routing: o,
|
|
@@ -3375,25 +3381,25 @@ function fs({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
|
|
|
3375
3381
|
packageCatalog: t,
|
|
3376
3382
|
screenTemplates: n,
|
|
3377
3383
|
isVisible: i
|
|
3378
|
-
}) : /* @__PURE__ */
|
|
3384
|
+
}) : /* @__PURE__ */ R("main", {
|
|
3379
3385
|
className: "stage-message",
|
|
3380
|
-
children: /* @__PURE__ */
|
|
3386
|
+
children: /* @__PURE__ */ R("h1", { children: "Preparing the Stage" })
|
|
3381
3387
|
});
|
|
3382
3388
|
}
|
|
3383
|
-
function
|
|
3389
|
+
function vs({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: s, isVisible: l }) {
|
|
3384
3390
|
let d = c(() => {
|
|
3385
|
-
if (
|
|
3391
|
+
if (Vt(n), n === "hash") return ve();
|
|
3386
3392
|
let e = /^#\/(.+)$/.exec(globalThis.location.hash);
|
|
3387
|
-
return e && globalThis.history.replaceState(null, "", `/${e[1]}`),
|
|
3388
|
-
}, [n]), [f, p] = u(
|
|
3393
|
+
return e && globalThis.history.replaceState(null, "", `/${e[1]}`), _e(window, "/");
|
|
3394
|
+
}, [n]), [f, p] = u(Jo), m = e.screens[0]?.name ?? "", h = c(() => fo(e.uiProfiles), [e]), g = c(() => m ? us(e, s) : void 0, [
|
|
3389
3395
|
e,
|
|
3390
3396
|
s,
|
|
3391
3397
|
m
|
|
3392
|
-
]), _ = c(() => g ?
|
|
3398
|
+
]), _ = c(() => g ? Wo(h, g) : [], [h, g]), v = c(() => g ? zo(h, g, f) : void 0, [
|
|
3393
3399
|
h,
|
|
3394
3400
|
g,
|
|
3395
3401
|
f
|
|
3396
|
-
]), y = c(() =>
|
|
3402
|
+
]), y = c(() => Ko(I, v?.accent), [v?.accent]), { showFooter: b, showThemeSwitcher: x } = Uo(v), S = c(() => fs(e, a.locales, a.locale, o, a.dictionary, s, b, x), [
|
|
3397
3403
|
e,
|
|
3398
3404
|
a.locales,
|
|
3399
3405
|
a.locale,
|
|
@@ -3402,37 +3408,37 @@ function ps({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
|
|
|
3402
3408
|
s,
|
|
3403
3409
|
b,
|
|
3404
3410
|
x
|
|
3405
|
-
]), C = r((e) => p(e), []), w = c(() =>
|
|
3411
|
+
]), C = r((e) => p(e), []), w = c(() => $o(e, l, a.dictionary), [
|
|
3406
3412
|
e,
|
|
3407
3413
|
l,
|
|
3408
3414
|
a.dictionary
|
|
3409
3415
|
]), T = c(() => ({
|
|
3410
3416
|
...e,
|
|
3411
|
-
screens: Fi(
|
|
3417
|
+
screens: Fi(is(e.screens, [
|
|
3412
3418
|
...e.screenTemplates,
|
|
3413
3419
|
...e.dialogTemplates ?? [],
|
|
3414
|
-
...
|
|
3420
|
+
...Pe,
|
|
3415
3421
|
...s ?? []
|
|
3416
|
-
]),
|
|
3422
|
+
]), hs(e))
|
|
3417
3423
|
}), [e, s]);
|
|
3418
|
-
return m ? _.length > 0 ? /* @__PURE__ */
|
|
3424
|
+
return m ? _.length > 0 ? /* @__PURE__ */ z("main", {
|
|
3419
3425
|
className: "stage-message",
|
|
3420
3426
|
role: "alert",
|
|
3421
3427
|
"data-stage-startup-problem": "root-template",
|
|
3422
3428
|
children: [
|
|
3423
|
-
/* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ R("h1", { children: "Unable to start this Stage" }),
|
|
3430
|
+
/* @__PURE__ */ R("p", { children: "The ui profile's root template cannot be the application's shell." }),
|
|
3431
|
+
/* @__PURE__ */ R("ul", { children: _.map((e) => /* @__PURE__ */ R("li", { children: e }, e)) })
|
|
3426
3432
|
]
|
|
3427
|
-
}) : /* @__PURE__ */
|
|
3433
|
+
}) : /* @__PURE__ */ R(Ee, {
|
|
3428
3434
|
application: T,
|
|
3429
3435
|
composition: S,
|
|
3430
3436
|
navigationModel: w,
|
|
3431
3437
|
registry: t,
|
|
3432
3438
|
initialScreen: m,
|
|
3433
3439
|
history: d,
|
|
3434
|
-
layoutConfigStorage:
|
|
3435
|
-
scope: (t, n) => /* @__PURE__ */
|
|
3440
|
+
layoutConfigStorage: gs(),
|
|
3441
|
+
scope: (t, n) => /* @__PURE__ */ R(ys, {
|
|
3436
3442
|
scene: e,
|
|
3437
3443
|
routeState: i,
|
|
3438
3444
|
strings: a,
|
|
@@ -3442,26 +3448,26 @@ function ps({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
|
|
|
3442
3448
|
onSystemSchemeChange: C,
|
|
3443
3449
|
children: n
|
|
3444
3450
|
}),
|
|
3445
|
-
renderScreen: (e, n) => /* @__PURE__ */
|
|
3451
|
+
renderScreen: (e, n) => /* @__PURE__ */ R(xs, {
|
|
3446
3452
|
element: e,
|
|
3447
3453
|
configuration: n,
|
|
3448
3454
|
registry: t
|
|
3449
3455
|
}),
|
|
3450
|
-
renderDialog: () => /* @__PURE__ */
|
|
3451
|
-
renderDialogTemplate: (e, n, r) => /* @__PURE__ */
|
|
3456
|
+
renderDialog: () => /* @__PURE__ */ R(va, {}),
|
|
3457
|
+
renderDialogTemplate: (e, n, r) => /* @__PURE__ */ R(Ss, {
|
|
3452
3458
|
template: e,
|
|
3453
3459
|
content: n,
|
|
3454
3460
|
registry: t,
|
|
3455
3461
|
strings: a,
|
|
3456
3462
|
close: () => r.closeDialog()
|
|
3457
3463
|
})
|
|
3458
|
-
}) : /* @__PURE__ */
|
|
3464
|
+
}) : /* @__PURE__ */ z("main", {
|
|
3459
3465
|
className: "stage-message",
|
|
3460
|
-
children: [/* @__PURE__ */
|
|
3466
|
+
children: [/* @__PURE__ */ R("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ R("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
|
|
3461
3467
|
});
|
|
3462
3468
|
}
|
|
3463
|
-
function
|
|
3464
|
-
let [l, d] = u(""), { navigate:
|
|
3469
|
+
function ys({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
|
|
3470
|
+
let [l, d] = u(""), { navigate: f } = r;
|
|
3465
3471
|
return a(() => d(""), [r.currentScreen, r.currentDialog]), a(() => {
|
|
3466
3472
|
let e = (e) => {
|
|
3467
3473
|
let t = e.detail;
|
|
@@ -3471,30 +3477,30 @@ function ms({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
3471
3477
|
}, []), a(() => {
|
|
3472
3478
|
let t = (t) => {
|
|
3473
3479
|
let n = t.detail, r = n.destination ?? (n.dialog ? {
|
|
3474
|
-
kind:
|
|
3480
|
+
kind: p.Dialog,
|
|
3475
3481
|
dialog: n.dialog
|
|
3476
3482
|
} : n.targetScreen ? { screen: n.targetScreen } : void 0);
|
|
3477
|
-
r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? d(`The modeled screen “${r.screen}” is not available.`) :
|
|
3483
|
+
r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? d(`The modeled screen “${r.screen}” is not available.`) : f(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? f(r) : d(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
|
|
3478
3484
|
};
|
|
3479
3485
|
return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
|
|
3480
|
-
}, [
|
|
3481
|
-
registry:
|
|
3482
|
-
children: /* @__PURE__ */
|
|
3486
|
+
}, [f, e]), /* @__PURE__ */ R(se, {
|
|
3487
|
+
registry: ss,
|
|
3488
|
+
children: /* @__PURE__ */ z(Oe, {
|
|
3483
3489
|
themes: i,
|
|
3484
3490
|
children: [
|
|
3485
|
-
o && /* @__PURE__ */
|
|
3491
|
+
o && /* @__PURE__ */ R(Yo, {
|
|
3486
3492
|
settings: o,
|
|
3487
3493
|
onSystemSchemeChange: s
|
|
3488
3494
|
}),
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3495
|
+
/* @__PURE__ */ R(Mo, {}),
|
|
3496
|
+
/* @__PURE__ */ R(fn, {
|
|
3491
3497
|
routes: t.routes,
|
|
3492
3498
|
routesReady: t.ready,
|
|
3493
3499
|
parameters: r.currentParameters,
|
|
3494
3500
|
locale: n.locale,
|
|
3495
3501
|
locales: n.locales,
|
|
3496
3502
|
screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
|
|
3497
|
-
children: /* @__PURE__ */
|
|
3503
|
+
children: /* @__PURE__ */ R(bs, {
|
|
3498
3504
|
activity: l,
|
|
3499
3505
|
routesReady: t.ready,
|
|
3500
3506
|
scene: e,
|
|
@@ -3507,14 +3513,14 @@ function ms({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
|
|
|
3507
3513
|
})
|
|
3508
3514
|
});
|
|
3509
3515
|
}
|
|
3510
|
-
function
|
|
3511
|
-
let o = U(), s =
|
|
3516
|
+
function bs({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
|
|
3517
|
+
let o = U(), s = Ce(), l = Rt(), u = c(() => rs(l, t, o.refreshAfterCommand), [
|
|
3512
3518
|
l,
|
|
3513
3519
|
t,
|
|
3514
3520
|
o.refreshAfterCommand
|
|
3515
|
-
]), d = c(() =>
|
|
3521
|
+
]), d = c(() => ts(n.commandSchemas), [n.commandSchemas]), f = ge({
|
|
3516
3522
|
executeCommand: async (e, n) => {
|
|
3517
|
-
let i =
|
|
3523
|
+
let i = V(e);
|
|
3518
3524
|
if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
|
|
3519
3525
|
isSuccess: !1,
|
|
3520
3526
|
validationErrors: []
|
|
@@ -3531,13 +3537,13 @@ function hs({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
3531
3537
|
};
|
|
3532
3538
|
},
|
|
3533
3539
|
navigate: (e, t) => {
|
|
3534
|
-
n.screens.some((t) => t.name === e) ?
|
|
3540
|
+
n.screens.some((t) => t.name === e) ? H(e, Ut(t)) : r(`The modeled screen “${e}” is not available.`);
|
|
3535
3541
|
},
|
|
3536
3542
|
navigateBack: () => globalThis.history?.back(),
|
|
3537
3543
|
openDialog: async (e) => {
|
|
3538
3544
|
let t = n.dialogTemplates?.find((t) => t.name === e);
|
|
3539
3545
|
return t ? (s.navigate({
|
|
3540
|
-
kind:
|
|
3546
|
+
kind: p.Dialog,
|
|
3541
3547
|
dialog: t.name
|
|
3542
3548
|
}), { isConfirmed: !0 }) : (r(`The modeled dialog “${e}” is not available in this Stage runtime.`), { isConfirmed: !1 });
|
|
3543
3549
|
},
|
|
@@ -3548,23 +3554,23 @@ function hs({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
3548
3554
|
refreshQuery: async (e) => o.refreshQuery(e),
|
|
3549
3555
|
raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
|
|
3550
3556
|
});
|
|
3551
|
-
return /* @__PURE__ */
|
|
3557
|
+
return /* @__PURE__ */ R(Co, {
|
|
3552
3558
|
state: {
|
|
3553
3559
|
locales: i.locales,
|
|
3554
3560
|
locale: i.locale,
|
|
3555
3561
|
setLocale: i.setLocale,
|
|
3556
3562
|
activity: e
|
|
3557
3563
|
},
|
|
3558
|
-
children: /* @__PURE__ */
|
|
3564
|
+
children: /* @__PURE__ */ R(fe, {
|
|
3559
3565
|
invoker: u,
|
|
3560
|
-
children: /* @__PURE__ */
|
|
3566
|
+
children: /* @__PURE__ */ R(ue, {
|
|
3561
3567
|
fieldsFor: d,
|
|
3562
|
-
children: /* @__PURE__ */
|
|
3563
|
-
dispatcher:
|
|
3568
|
+
children: /* @__PURE__ */ R(ce, {
|
|
3569
|
+
dispatcher: f,
|
|
3564
3570
|
context: {
|
|
3565
3571
|
resolve: o.resolveBinding,
|
|
3566
3572
|
localize: (e) => i.dictionary[e] ?? e,
|
|
3567
|
-
responseContracts:
|
|
3573
|
+
responseContracts: Po(n.responseContracts)
|
|
3568
3574
|
},
|
|
3569
3575
|
attachments: [],
|
|
3570
3576
|
onFindings: (e) => r(e.map((e) => e.detail).join(" ")),
|
|
@@ -3574,12 +3580,12 @@ function hs({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
|
|
|
3574
3580
|
})
|
|
3575
3581
|
});
|
|
3576
3582
|
}
|
|
3577
|
-
function
|
|
3578
|
-
let r = U(), i =
|
|
3579
|
-
return /* @__PURE__ */
|
|
3583
|
+
function xs({ element: e, configuration: t, registry: n }) {
|
|
3584
|
+
let r = U(), i = On();
|
|
3585
|
+
return /* @__PURE__ */ z(Cr, {
|
|
3580
3586
|
element: e,
|
|
3581
3587
|
outputScope: i.scope,
|
|
3582
|
-
children: [/* @__PURE__ */
|
|
3588
|
+
children: [/* @__PURE__ */ R(Fa, { element: e }), /* @__PURE__ */ R(le, {
|
|
3583
3589
|
element: e,
|
|
3584
3590
|
registry: n,
|
|
3585
3591
|
resolveBinding: r.resolveBinding,
|
|
@@ -3589,27 +3595,27 @@ function gs({ element: e, configuration: t, registry: n }) {
|
|
|
3589
3595
|
})]
|
|
3590
3596
|
});
|
|
3591
3597
|
}
|
|
3592
|
-
function
|
|
3593
|
-
let o = U(), s =
|
|
3598
|
+
function Ss({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
3599
|
+
let o = U(), s = On(), c = O(t, r.dictionary);
|
|
3594
3600
|
return a(() => {
|
|
3595
3601
|
let e = (e) => {
|
|
3596
3602
|
e.key === "Escape" && i();
|
|
3597
3603
|
};
|
|
3598
3604
|
return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
|
|
3599
|
-
}, [i]), /* @__PURE__ */
|
|
3605
|
+
}, [i]), /* @__PURE__ */ R("div", {
|
|
3600
3606
|
className: "stage-dialog-backdrop",
|
|
3601
|
-
children: /* @__PURE__ */
|
|
3607
|
+
children: /* @__PURE__ */ z("section", {
|
|
3602
3608
|
role: "dialog",
|
|
3603
3609
|
"aria-modal": "true",
|
|
3604
3610
|
"aria-label": e.displayName ?? e.name,
|
|
3605
3611
|
className: "stage-dialog",
|
|
3606
|
-
children: [/* @__PURE__ */
|
|
3612
|
+
children: [/* @__PURE__ */ R("button", {
|
|
3607
3613
|
type: "button",
|
|
3608
3614
|
onClick: i,
|
|
3609
3615
|
children: "Close"
|
|
3610
|
-
}), /* @__PURE__ */
|
|
3616
|
+
}), /* @__PURE__ */ R(Cr, {
|
|
3611
3617
|
element: c,
|
|
3612
|
-
children: /* @__PURE__ */
|
|
3618
|
+
children: /* @__PURE__ */ R(le, {
|
|
3613
3619
|
element: c,
|
|
3614
3620
|
registry: n,
|
|
3615
3621
|
resolveBinding: o.resolveBinding,
|
|
@@ -3620,4 +3626,4 @@ function _s({ template: e, content: t, registry: n, strings: r, close: i }) {
|
|
|
3620
3626
|
})
|
|
3621
3627
|
});
|
|
3622
3628
|
}
|
|
3623
|
-
export {
|
|
3629
|
+
export { _s as App, _s as StageApplication, Rr as StageCommandForm, fn as StageDataProvider, en as StageGuardedAction, mt as StageSourceProvider, ms as composeStageScreen, rs as createStageSliceInvoker, _n as dataChanged, It as executeRegisteredCommand, xt as hostedBasePath, lo as listsPrimeReact, Ot as performQuery, wt as registerQueryRouteResolver, uo as registerStageLibrary, V as registeredCommand, Tt as registeredQuery, ts as sliceFieldsFrom, cs as stageApplicationRegistry, fs as stageComposition, e as stageDarkSelector, ft as stageEndpoints, us as stageShellOf, dt as staticStageSource, kt as subscribeQuery, Rt as useStageCommandExecutor, U as useStageData, W as useStageQuery, ht as useStageSource };
|