@cratis/event-models 0.338.0 → 0.339.1
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/screen-editor/{BindingExpressionPropertyEditor-CcIqajvT.js → BindingExpressionPropertyEditor-D63oFTJg.js} +1 -1
- package/dist/screen-editor/DataBindingSections-DGWtMxlD.js +1859 -0
- package/dist/screen-editor/HookEditors-vV4ycK6R.js +37 -0
- package/dist/screen-editor/HookOpensField-Ja5uMCr8.js +231 -0
- package/dist/screen-editor/QueryBindingPropertyEditor-QpvyESab.js +148 -0
- package/dist/screen-editor/ScreenEditor/Actions/ActionModel.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/Actions/StateChangeSlice.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Actions/actionBehavior.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/Binding/detailShows.d.ts +18 -0
- package/dist/screen-editor/ScreenEditor/Binding/parameterFeeds.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/Binding/queryBindingModel.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Data/DataField.d.ts +39 -0
- package/dist/screen-editor/ScreenEditor/Data/insertDataField.d.ts +29 -0
- package/dist/screen-editor/ScreenEditor/Data/queryTables.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeFrames.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/OutletStrings.d.ts +74 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/createOutletDesign.d.ts +34 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletBindings.d.ts +23 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletDesignModes.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletDocument.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletItemOps.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/screenOutletChain.d.ts +18 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/screenOutlets.d.ts +44 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeTypes.d.ts +19 -2
- package/dist/screen-editor/ScreenEditor/DesignMode/resolveDesignMode.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/useDesignMode.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Forms/fieldChoices.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Forms/fieldMarkers.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWindow.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/Host/openSubject.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/Inspector/ActionEditor.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/Inspector/CommandFormEditor.d.ts +3 -2
- package/dist/screen-editor/ScreenEditor/Inspector/DataBindingSections.d.ts +23 -0
- package/dist/screen-editor/ScreenEditor/Inspector/FormEditor.d.ts +3 -2
- package/dist/screen-editor/ScreenEditor/Inspector/OutletListEditor.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Inspector/OutletSection.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +31 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenOutletsSection.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Palette/PaletteEntry.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Placement/HookEnabledField.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Placement/HookOpensField.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Placement/PlacementStrings.d.ts +32 -0
- package/dist/screen-editor/ScreenEditor/Placement/hookBinding.d.ts +28 -0
- package/dist/screen-editor/ScreenEditor/Placement/hookPlacement.d.ts +27 -0
- package/dist/screen-editor/ScreenEditor/Placement/opensOptions.d.ts +16 -0
- package/dist/screen-editor/ScreenEditor/Placement/placementEnvironment.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorProps.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/HookEditors.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/QueryBindingPropertyEditor.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Surface/columnAt.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Surface/useSurfaceDrop.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Templates/composeEditorScreen.d.ts +5 -1
- package/dist/screen-editor/ScreenEditor/Templates/dialogActionsChrome.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Templates/slotSections.d.ts +1 -0
- package/dist/screen-editor/defaultStructuredEditorStrings-Bwbw58wD.js +116 -0
- package/dist/screen-editor/hookBinding-DOpu2dMp.js +171 -0
- package/dist/screen-editor/index.js +5478 -4935
- package/dist/screen-editor/sceneTree-CNx3I3MJ.js +32 -0
- package/dist/screen-editor/screen-editor.css +1 -1
- package/package.json +3 -3
- package/dist/screen-editor/QueryBindingEditor-MTd0R7iQ.js +0 -40
- package/dist/screen-editor/QueryBindingPropertyEditor-Cu4PTcOz.js +0 -169
- package/dist/screen-editor/defaultStructuredEditorStrings-BPl2XP8A.js +0 -144
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { n as p, t as k } from "./HookOpensField-Ja5uMCr8.js";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { Opens as s } from "@cratis/scene.model";
|
|
4
|
+
var b = ({ value: o, onChange: t, context: e, disabled: n }) => /* @__PURE__ */ i(k, {
|
|
5
|
+
hook: {
|
|
6
|
+
...o?.hook,
|
|
7
|
+
...l(o?.value)
|
|
8
|
+
},
|
|
9
|
+
environment: e.lookups.placement,
|
|
10
|
+
strings: e.strings.editors.placement,
|
|
11
|
+
disabled: n,
|
|
12
|
+
onChange: (r) => t({
|
|
13
|
+
value: r,
|
|
14
|
+
hook: o?.hook ?? {}
|
|
15
|
+
})
|
|
16
|
+
}), l = (o) => o === void 0 || o === s.Automatic ? {} : o.startsWith(s.Slot) ? {
|
|
17
|
+
opens: s.Slot,
|
|
18
|
+
...o.length > 5 ? { opensIn: o.slice(5) } : {}
|
|
19
|
+
} : { opens: o }, h = ({ value: o, onChange: t, context: e, disabled: n }) => /* @__PURE__ */ i(p, {
|
|
20
|
+
hook: o?.hook ?? {},
|
|
21
|
+
environment: e.lookups.placement,
|
|
22
|
+
strings: e.strings.editors.placement,
|
|
23
|
+
disabled: n,
|
|
24
|
+
...o?.outletSubject ? { outletSubject: o.outletSubject } : {},
|
|
25
|
+
value: {
|
|
26
|
+
...o?.subject ? { subject: o.subject } : {},
|
|
27
|
+
...o?.enabledWhen ? { enabledWhen: o.enabledWhen } : {}
|
|
28
|
+
},
|
|
29
|
+
onChange: (r) => t({
|
|
30
|
+
...r,
|
|
31
|
+
hook: o?.hook ?? {}
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
h as HookEnabledEditor,
|
|
36
|
+
b as HookOpensEditor
|
|
37
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { a as C, s as j } from "./hookBinding-DOpu2dMp.js";
|
|
2
|
+
import { useEffect as y, useState as F } from "react";
|
|
3
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
4
|
+
import { Opens as t, OutletSubject as S } from "@cratis/scene.model";
|
|
5
|
+
import { EnablementOutcome as O, parseGuardCondition as w } from "@cratis/scene.engine";
|
|
6
|
+
var P = ({ hook: i, environment: l, strings: a, disabled: c, outletSubject: r, value: d, onChange: u }) => {
|
|
7
|
+
const v = d.subject ?? "", h = d.enabledWhen ?? "", [s, _] = F(h), f = s.trim() === "" || w(s) !== void 0;
|
|
8
|
+
y(() => _(h), [h]);
|
|
9
|
+
const e = () => {
|
|
10
|
+
f && s.trim() !== h.trim() && u({
|
|
11
|
+
...d,
|
|
12
|
+
enabledWhen: s
|
|
13
|
+
});
|
|
14
|
+
}, m = {
|
|
15
|
+
...i,
|
|
16
|
+
subject: d.subject ?? r ?? S.Screen,
|
|
17
|
+
...f && s.trim() !== "" ? { enabledWhen: s } : {}
|
|
18
|
+
}, b = j(m, l ?? {
|
|
19
|
+
slices: [],
|
|
20
|
+
slots: [],
|
|
21
|
+
itemFields: /* @__PURE__ */ new Set(),
|
|
22
|
+
routeParameters: []
|
|
23
|
+
}).enablement.steps;
|
|
24
|
+
return /* @__PURE__ */ p("div", {
|
|
25
|
+
className: "studio-placement",
|
|
26
|
+
"data-field": "enabled",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ p("label", {
|
|
29
|
+
className: "studio-placement__field",
|
|
30
|
+
children: [/* @__PURE__ */ o("span", { children: a.actsOn }), /* @__PURE__ */ o("select", {
|
|
31
|
+
value: v,
|
|
32
|
+
disabled: c,
|
|
33
|
+
onChange: (n) => u({
|
|
34
|
+
...d,
|
|
35
|
+
...n.target.value === "" ? { subject: void 0 } : { subject: n.target.value }
|
|
36
|
+
}),
|
|
37
|
+
children: [
|
|
38
|
+
"",
|
|
39
|
+
S.Item,
|
|
40
|
+
S.Screen
|
|
41
|
+
].map((n) => /* @__PURE__ */ o("option", {
|
|
42
|
+
value: n,
|
|
43
|
+
children: a.actsOnChoices[n]
|
|
44
|
+
}, n))
|
|
45
|
+
})]
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ p("label", {
|
|
48
|
+
className: "studio-placement__field",
|
|
49
|
+
children: [/* @__PURE__ */ o("span", { children: a.condition }), /* @__PURE__ */ o("input", {
|
|
50
|
+
value: s,
|
|
51
|
+
disabled: c,
|
|
52
|
+
placeholder: a.conditionPlaceholder,
|
|
53
|
+
"aria-invalid": !f || void 0,
|
|
54
|
+
onChange: (n) => _(n.target.value),
|
|
55
|
+
onBlur: e,
|
|
56
|
+
onKeyDown: (n) => {
|
|
57
|
+
n.key === "Enter" && (n.preventDefault(), e());
|
|
58
|
+
}
|
|
59
|
+
})]
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ o("p", {
|
|
62
|
+
className: "studio-placement__note",
|
|
63
|
+
children: f ? a.conditionHint : a.conditionUnreadable
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ o("p", {
|
|
66
|
+
className: "studio-placement__heading",
|
|
67
|
+
children: a.derivedFrom
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ p("ul", {
|
|
70
|
+
className: "studio-placement__steps",
|
|
71
|
+
"aria-label": a.derivedFrom,
|
|
72
|
+
children: [b.length === 0 && /* @__PURE__ */ o("li", {
|
|
73
|
+
"data-outcome": "passed",
|
|
74
|
+
children: a.alwaysEnabled
|
|
75
|
+
}), b.map((n) => /* @__PURE__ */ p("li", {
|
|
76
|
+
"data-outcome": n.outcome,
|
|
77
|
+
"data-blocked": n.outcome === O.Blocked || void 0,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ o("strong", { children: a.steps[n.check] }),
|
|
80
|
+
" ",
|
|
81
|
+
n.reason
|
|
82
|
+
]
|
|
83
|
+
}, n.check))]
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
}, k = [
|
|
88
|
+
t.Automatic,
|
|
89
|
+
t.None,
|
|
90
|
+
t.Dialog,
|
|
91
|
+
t.Drawer,
|
|
92
|
+
t.Slot
|
|
93
|
+
], x = (i) => [
|
|
94
|
+
"…",
|
|
95
|
+
...i.parameters.map((l) => l.value ?? `:${l.name}`),
|
|
96
|
+
i.segment
|
|
97
|
+
].join("/"), A = (i) => {
|
|
98
|
+
const { opensIn: l, ...a } = i;
|
|
99
|
+
return a;
|
|
100
|
+
}, D = (i, l, a) => j({
|
|
101
|
+
...a === t.Slot ? i : A(i),
|
|
102
|
+
opens: a
|
|
103
|
+
}, l).placement;
|
|
104
|
+
function E(i, l) {
|
|
105
|
+
const a = j(i, l), c = a.placement;
|
|
106
|
+
return c ? {
|
|
107
|
+
inspection: a,
|
|
108
|
+
decision: c,
|
|
109
|
+
options: k.map((r) => {
|
|
110
|
+
if (r === t.Automatic) return {
|
|
111
|
+
value: r,
|
|
112
|
+
available: !0,
|
|
113
|
+
reason: D(i, l, t.Automatic).reason
|
|
114
|
+
};
|
|
115
|
+
if (r === t.None) return {
|
|
116
|
+
value: r,
|
|
117
|
+
available: c.runDirectly.available,
|
|
118
|
+
reason: c.runDirectly.reason
|
|
119
|
+
};
|
|
120
|
+
if (r === t.Slot) {
|
|
121
|
+
const u = c.slots.filter((v) => v.offered);
|
|
122
|
+
return {
|
|
123
|
+
value: r,
|
|
124
|
+
available: u.length > 0,
|
|
125
|
+
reason: u.length > 0 ? "" : c.slots[0]?.reason ?? ""
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const d = D(i, l, r);
|
|
129
|
+
return {
|
|
130
|
+
value: r,
|
|
131
|
+
available: d.resolved !== void 0,
|
|
132
|
+
reason: d.reason
|
|
133
|
+
};
|
|
134
|
+
}),
|
|
135
|
+
slots: c.slots
|
|
136
|
+
} : {
|
|
137
|
+
inspection: a,
|
|
138
|
+
options: [],
|
|
139
|
+
slots: []
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
var H = [
|
|
143
|
+
t.Automatic,
|
|
144
|
+
t.None,
|
|
145
|
+
t.Dialog,
|
|
146
|
+
t.Drawer,
|
|
147
|
+
t.Slot
|
|
148
|
+
], G = ({ hook: i, environment: l, strings: a, disabled: c, onChange: r }) => {
|
|
149
|
+
if (!l) return null;
|
|
150
|
+
if (!i.slice) return /* @__PURE__ */ o("p", {
|
|
151
|
+
className: "studio-placement__note",
|
|
152
|
+
children: a.chooseSlice
|
|
153
|
+
});
|
|
154
|
+
const { inspection: d, decision: u, options: v, slots: h } = E(i, l);
|
|
155
|
+
if (!u) return /* @__PURE__ */ o("p", {
|
|
156
|
+
className: "studio-placement__note",
|
|
157
|
+
children: a.chooseSlice
|
|
158
|
+
});
|
|
159
|
+
const s = C(i.opens, i.opensIn), _ = (e) => e === t.Slot ? s.startsWith("slot") : s === e, f = (e, m) => {
|
|
160
|
+
!c && m && r(e);
|
|
161
|
+
};
|
|
162
|
+
return /* @__PURE__ */ p("div", {
|
|
163
|
+
className: "studio-placement",
|
|
164
|
+
"data-field": "opens",
|
|
165
|
+
children: [
|
|
166
|
+
d.screenless && /* @__PURE__ */ o("p", {
|
|
167
|
+
className: "studio-placement__note",
|
|
168
|
+
"data-screenless": "",
|
|
169
|
+
children: a.screenless
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ o("div", {
|
|
172
|
+
role: "radiogroup",
|
|
173
|
+
"aria-label": a.opens,
|
|
174
|
+
className: "studio-placement__choices",
|
|
175
|
+
children: H.map((e) => {
|
|
176
|
+
const m = v.find((N) => N.value === e);
|
|
177
|
+
if (!m) return null;
|
|
178
|
+
const b = a.choices[e], n = !m.available;
|
|
179
|
+
return /* @__PURE__ */ o("div", {
|
|
180
|
+
className: "studio-placement__choice",
|
|
181
|
+
"data-chosen": _(e) || void 0,
|
|
182
|
+
"data-unavailable": n || void 0,
|
|
183
|
+
children: /* @__PURE__ */ p("button", {
|
|
184
|
+
type: "button",
|
|
185
|
+
role: "radio",
|
|
186
|
+
"aria-checked": _(e),
|
|
187
|
+
"aria-disabled": n || c || void 0,
|
|
188
|
+
"data-opens": e,
|
|
189
|
+
title: n ? m.reason : b.hint,
|
|
190
|
+
onClick: () => f(e === t.Slot ? C(t.Slot, h.find((N) => N.offered)?.name) : e, m.available),
|
|
191
|
+
children: [/* @__PURE__ */ o("strong", { children: b.label }), /* @__PURE__ */ o("span", { children: e === t.Slot && !n ? b.hint : m.reason || b.hint })]
|
|
192
|
+
})
|
|
193
|
+
}, e);
|
|
194
|
+
})
|
|
195
|
+
}),
|
|
196
|
+
_(t.Automatic) && /* @__PURE__ */ o("p", {
|
|
197
|
+
className: "studio-placement__resolved",
|
|
198
|
+
"data-resolved": "",
|
|
199
|
+
children: u.reason
|
|
200
|
+
}),
|
|
201
|
+
!d.screenless && /* @__PURE__ */ p("ul", {
|
|
202
|
+
className: "studio-placement__slots",
|
|
203
|
+
"aria-label": a.slotsHeading,
|
|
204
|
+
children: [h.length === 0 && /* @__PURE__ */ o("li", {
|
|
205
|
+
className: "studio-placement__note",
|
|
206
|
+
children: a.noSlots
|
|
207
|
+
}), h.map((e) => /* @__PURE__ */ o("li", {
|
|
208
|
+
"data-unavailable": !e.offered || void 0,
|
|
209
|
+
"data-chosen": s === `slot:${e.name}` || void 0,
|
|
210
|
+
children: /* @__PURE__ */ p("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
"aria-pressed": s === `slot:${e.name}`,
|
|
213
|
+
"aria-disabled": !e.offered || c || void 0,
|
|
214
|
+
"data-slot": e.name,
|
|
215
|
+
title: e.reason,
|
|
216
|
+
onClick: () => f(`slot:${e.name}`, e.offered),
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ o("strong", { children: e.name }),
|
|
219
|
+
/* @__PURE__ */ o("span", { children: a.slotKind(e.role, e.routed) }),
|
|
220
|
+
/* @__PURE__ */ o("em", { children: e.offered && e.route ? a.slotRoute(x(e.route)) : e.reason })
|
|
221
|
+
]
|
|
222
|
+
})
|
|
223
|
+
}, e.name))]
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
export {
|
|
229
|
+
P as n,
|
|
230
|
+
G as t
|
|
231
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { L as N, R as E, c as B, d as L, f as F, h as I, l as j, m as M, t as R, u as Q } from "./DataBindingSections-DGWtMxlD.js";
|
|
2
|
+
import { useState as k } from "react";
|
|
3
|
+
import { Fragment as S, jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
4
|
+
import { validateBinding as D } from "@cratis/scene.engine";
|
|
5
|
+
var c = /* @__PURE__ */ (function(r) {
|
|
6
|
+
return r.NoQuery = "noQuery", r.MissingQuery = "missingQuery", r.Loading = "loading", r.Empty = "empty", r.Error = "error", r.Ready = "ready", r;
|
|
7
|
+
})({});
|
|
8
|
+
function O({ binding: r, candidate: i, isLoading: u, error: l, rowCount: s }) {
|
|
9
|
+
return r ? i ? l != null ? c.Error : u ? c.Loading : s === 0 ? c.Empty : c.Ready : c.MissingQuery : c.NoQuery;
|
|
10
|
+
}
|
|
11
|
+
function b(r, i, u, l) {
|
|
12
|
+
const s = D(r, i, u, l);
|
|
13
|
+
return {
|
|
14
|
+
diagnostics: s,
|
|
15
|
+
isStorable: s.every((m) => m.severity !== "error")
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var V = (r) => r.origin.map((i) => i.name).join(" / "), T = ({ property: r, candidates: i, scope: u, strings: l, disabled: s, onChange: m }) => {
|
|
19
|
+
const t = l.properties.query, [g, y] = k(), h = Q(r.effectiveValue) ? r.effectiveValue : void 0, n = g ?? h, p = n ? i.find((e) => e.id === n.queryId) : void 0, _ = n ? b(r.descriptor, p, n, u).diagnostics : [], v = (e) => {
|
|
20
|
+
if (!e) {
|
|
21
|
+
y(void 0), m(void 0);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const a = b(r.descriptor, i.find((f) => f.id === e.queryId), e, u);
|
|
25
|
+
y(a.isStorable ? void 0 : e), a.isStorable && m(e);
|
|
26
|
+
}, q = O({
|
|
27
|
+
binding: n,
|
|
28
|
+
candidate: p,
|
|
29
|
+
isLoading: !1
|
|
30
|
+
}), C = Object.keys(u.types);
|
|
31
|
+
return /* @__PURE__ */ d("fieldset", {
|
|
32
|
+
className: "studio-editor-query",
|
|
33
|
+
disabled: s,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ o("legend", { children: r.descriptor.label }),
|
|
36
|
+
/* @__PURE__ */ d("label", { children: [/* @__PURE__ */ o("span", { children: t.label }), /* @__PURE__ */ d("select", {
|
|
37
|
+
value: n?.queryId ?? "",
|
|
38
|
+
onChange: (e) => {
|
|
39
|
+
const a = i.find((f) => f.id === e.target.value);
|
|
40
|
+
v(a ? B(a) : void 0);
|
|
41
|
+
},
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ o("option", {
|
|
44
|
+
value: "",
|
|
45
|
+
children: t.none
|
|
46
|
+
}),
|
|
47
|
+
n && !p && /* @__PURE__ */ o("option", {
|
|
48
|
+
value: n.queryId,
|
|
49
|
+
children: n.query
|
|
50
|
+
}),
|
|
51
|
+
i.map((e) => /* @__PURE__ */ d("option", {
|
|
52
|
+
value: e.id,
|
|
53
|
+
children: [
|
|
54
|
+
e.name,
|
|
55
|
+
" - ",
|
|
56
|
+
V(e)
|
|
57
|
+
]
|
|
58
|
+
}, e.id))
|
|
59
|
+
]
|
|
60
|
+
})] }),
|
|
61
|
+
n && !p && /* @__PURE__ */ o("p", {
|
|
62
|
+
className: "studio-editor-query__missing",
|
|
63
|
+
role: "alert",
|
|
64
|
+
children: t.missing
|
|
65
|
+
}),
|
|
66
|
+
n && p && /* @__PURE__ */ d(S, { children: [p.parameters.length > 0 && /* @__PURE__ */ d("div", {
|
|
67
|
+
className: "studio-editor-query__group",
|
|
68
|
+
children: [/* @__PURE__ */ o("strong", { children: t.parameters }), p.parameters.map((e) => /* @__PURE__ */ d("label", { children: [/* @__PURE__ */ d("span", { children: [t.sourceFor(e.name), e.required ? " *" : ""] }), /* @__PURE__ */ d("select", {
|
|
69
|
+
value: M(n, e),
|
|
70
|
+
onChange: (a) => v(F(n, e.name, a.target.value)),
|
|
71
|
+
children: [/* @__PURE__ */ o("option", {
|
|
72
|
+
value: "",
|
|
73
|
+
children: t.noSource
|
|
74
|
+
}), C.map((a) => /* @__PURE__ */ o("option", {
|
|
75
|
+
value: a,
|
|
76
|
+
children: a
|
|
77
|
+
}, a))]
|
|
78
|
+
})] }, e.name))]
|
|
79
|
+
}), /* @__PURE__ */ d("div", {
|
|
80
|
+
className: "studio-editor-query__group",
|
|
81
|
+
children: [/* @__PURE__ */ o("strong", { children: t.columns }), p.resultFields.map((e) => /* @__PURE__ */ d("label", {
|
|
82
|
+
className: "studio-editor-query__column",
|
|
83
|
+
children: [/* @__PURE__ */ o("input", {
|
|
84
|
+
type: "checkbox",
|
|
85
|
+
checked: j(n, e),
|
|
86
|
+
onChange: (a) => v(a.target.checked ? L(n, e.name) : I(n, e.name))
|
|
87
|
+
}), /* @__PURE__ */ o("span", { children: t.showColumn(e.name) })]
|
|
88
|
+
}, e.name))]
|
|
89
|
+
})] }),
|
|
90
|
+
/* @__PURE__ */ o("p", {
|
|
91
|
+
className: "studio-editor-query__preview",
|
|
92
|
+
role: "status",
|
|
93
|
+
"data-state": q,
|
|
94
|
+
children: $(q, t.preview)
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ o(N, {
|
|
97
|
+
diagnostics: _,
|
|
98
|
+
label: l.properties.diagnostics
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
function $(r, i) {
|
|
104
|
+
switch (r) {
|
|
105
|
+
case c.NoQuery:
|
|
106
|
+
return i.noQuery;
|
|
107
|
+
case c.MissingQuery:
|
|
108
|
+
return i.missingQuery;
|
|
109
|
+
case c.Loading:
|
|
110
|
+
return i.loading;
|
|
111
|
+
case c.Empty:
|
|
112
|
+
return i.empty;
|
|
113
|
+
case c.Error:
|
|
114
|
+
return i.error;
|
|
115
|
+
case c.Ready:
|
|
116
|
+
return i.ready;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var J = ({ value: r, onChange: i, context: u, disabled: l }) => {
|
|
120
|
+
const { session: s } = u;
|
|
121
|
+
if (!s) return null;
|
|
122
|
+
const m = Q(r) ? r : void 0, t = m ? u.lookups.queryCandidates.find((g) => g.id === m.queryId) : void 0;
|
|
123
|
+
return /* @__PURE__ */ d(S, { children: [/* @__PURE__ */ o(T, {
|
|
124
|
+
property: s.property,
|
|
125
|
+
candidates: u.lookups.queryCandidates,
|
|
126
|
+
scope: s.bindingScope,
|
|
127
|
+
strings: s.screenStrings,
|
|
128
|
+
disabled: l === !0,
|
|
129
|
+
onChange: i
|
|
130
|
+
}), m && t && /* @__PURE__ */ o(R, {
|
|
131
|
+
controller: s.controller,
|
|
132
|
+
environment: s.environment,
|
|
133
|
+
strings: s.screenStrings,
|
|
134
|
+
binding: m,
|
|
135
|
+
candidate: t,
|
|
136
|
+
disabled: l === !0,
|
|
137
|
+
onChange: (g, y, h) => {
|
|
138
|
+
const n = h === "" ? s.bindingScope : E({
|
|
139
|
+
...s.bindingScope.types,
|
|
140
|
+
[h]: y.type
|
|
141
|
+
});
|
|
142
|
+
b(s.property.descriptor, t, g, n).isStorable && i(g);
|
|
143
|
+
}
|
|
144
|
+
})] });
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
J as QueryBindingPropertyEditor
|
|
148
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { Opens } from '@cratis/scene.model';
|
|
1
|
+
import type { Opens, OutletSubject } from '@cratis/scene.model';
|
|
2
2
|
export interface ActionModel {
|
|
3
3
|
sliceId: string;
|
|
4
4
|
sliceName: string;
|
|
5
5
|
inputs: Record<string, string>;
|
|
6
6
|
opens: Opens;
|
|
7
7
|
opensIn?: string;
|
|
8
|
+
subject?: OutletSubject;
|
|
9
|
+
enabledWhen?: string;
|
|
8
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ScreenFit } from '@cratis/scene.model';
|
|
1
2
|
export interface StateChangeSlice {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -8,6 +9,9 @@ export interface StateChangeSlice {
|
|
|
8
9
|
type: string;
|
|
9
10
|
required: boolean;
|
|
10
11
|
}[];
|
|
12
|
+
screenless?: boolean;
|
|
13
|
+
fits?: ScreenFit[];
|
|
14
|
+
authorize?: string;
|
|
11
15
|
}
|
|
12
16
|
export declare const commandNameOf: (slice: StateChangeSlice) => string;
|
|
13
17
|
export declare function sliceNamedBy(slices: readonly StateChangeSlice[], command: unknown): StateChangeSlice | undefined;
|
|
@@ -3,7 +3,9 @@ import type { ActionModel } from './ActionModel';
|
|
|
3
3
|
export declare const actionComponentName = "action";
|
|
4
4
|
export declare const opensProperty = "opens";
|
|
5
5
|
export declare const opensInProperty = "opensIn";
|
|
6
|
+
export declare const subjectProperty = "subject";
|
|
7
|
+
export declare const enabledWhenProperty = "enabledWhen";
|
|
6
8
|
export declare const argumentsProperty = "arguments";
|
|
7
9
|
export declare function readActionModel(properties: Record<string, unknown> | undefined, sliceName?: string): ActionModel | undefined;
|
|
8
10
|
export declare function toActionProperties(model: ActionModel): Record<string, unknown>;
|
|
9
|
-
export declare function actionEdits(componentId: string, model: ActionModel): SceneEdit[];
|
|
11
|
+
export declare function actionEdits(componentId: string, model: ActionModel, current?: Record<string, unknown>): SceneEdit[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Layout, SceneDocument } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenTemplate } from '@cratis/scene.model';
|
|
3
|
+
export interface DetailShow {
|
|
4
|
+
slot: string;
|
|
5
|
+
screen: string;
|
|
6
|
+
by: string;
|
|
7
|
+
element: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const showText: (show: Omit<DetailShow, 'slot'>) => string;
|
|
10
|
+
export declare function screenplayNameOf(elementId: string): string;
|
|
11
|
+
export declare function detailShowsOf(document: SceneDocument): DetailShow[];
|
|
12
|
+
export declare function withDetailShow(document: SceneDocument, slot: string, show: Omit<DetailShow, 'slot'> | undefined): SceneDocument;
|
|
13
|
+
export interface RoutedSlot {
|
|
14
|
+
name: string;
|
|
15
|
+
routedBy: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export declare const hasRoutedSlot: (document: SceneDocument, templates: readonly ScreenTemplate[], layouts: readonly Layout[]) => boolean;
|
|
18
|
+
export declare function routedSlotsOf(document: SceneDocument, templates: readonly ScreenTemplate[], layouts: readonly Layout[]): RoutedSlot[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type OutletFilter, type QueryBinding, type Slot } from '@cratis/scene.model';
|
|
2
|
+
export interface FilterFeed {
|
|
3
|
+
outlet: string;
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ListedItem {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
values: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare function filtersSetting(outlet: string, items: readonly ListedItem[], query: string, parameter: string): FilterFeed[];
|
|
13
|
+
export declare const filtersSettingQuery: (items: readonly ListedItem[], query: string) => ListedItem[];
|
|
14
|
+
export declare function filterFor(query: string, parameter: string, id: string): OutletFilter;
|
|
15
|
+
export interface RoutedValue {
|
|
16
|
+
slot: string;
|
|
17
|
+
parameter: string;
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function routedValuesOf(slots: readonly Slot[]): RoutedValue[];
|
|
21
|
+
export declare const mappedRouteOf: (binding: QueryBinding, parameter: string, values: readonly RoutedValue[]) => RoutedValue | undefined;
|
|
22
|
+
export declare const withRouteSource: (binding: QueryBinding, parameter: string, value: RoutedValue | undefined) => QueryBinding;
|
|
@@ -3,6 +3,7 @@ export declare function bindToCandidate(candidate: QueryCandidate): QueryBinding
|
|
|
3
3
|
export declare function isQueryBinding(value: unknown): value is QueryBinding;
|
|
4
4
|
export declare function mapParameter(binding: QueryBinding, parameter: string, sourcePath: string): QueryBinding;
|
|
5
5
|
export declare function mapColumn(binding: QueryBinding, field: string, target?: string): QueryBinding;
|
|
6
|
+
export declare function placeColumn(binding: QueryBinding, field: string, index: number | undefined, target?: string): QueryBinding;
|
|
6
7
|
export declare function unmapColumn(binding: QueryBinding, field: string): QueryBinding;
|
|
7
8
|
export declare const sourceOf: (binding: QueryBinding, parameter: QueryParameter) => string;
|
|
8
9
|
export declare const isColumnShown: (binding: QueryBinding, field: QueryResultField) => boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type QueryCandidate } from '@cratis/scene.model';
|
|
2
|
+
import { type StateChangeSlice } from '../Actions/StateChangeSlice';
|
|
3
|
+
export interface CommandDataField {
|
|
4
|
+
source: 'command';
|
|
5
|
+
sliceId: string;
|
|
6
|
+
command: string;
|
|
7
|
+
property: string;
|
|
8
|
+
type: string;
|
|
9
|
+
}
|
|
10
|
+
export interface QueryDataField {
|
|
11
|
+
source: 'query';
|
|
12
|
+
queryId: string;
|
|
13
|
+
query: string;
|
|
14
|
+
field: string;
|
|
15
|
+
type: string;
|
|
16
|
+
}
|
|
17
|
+
export interface QueryResultDataField {
|
|
18
|
+
source: 'queryResult';
|
|
19
|
+
queryId: string;
|
|
20
|
+
query: string;
|
|
21
|
+
shape: 'collection' | 'single' | 'optional-single';
|
|
22
|
+
}
|
|
23
|
+
export type DataField = CommandDataField | QueryDataField | QueryResultDataField;
|
|
24
|
+
export interface ScreenData {
|
|
25
|
+
command?: {
|
|
26
|
+
name: string;
|
|
27
|
+
fields: readonly CommandDataField[];
|
|
28
|
+
};
|
|
29
|
+
queries: readonly {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
shape: QueryResultDataField['shape'];
|
|
33
|
+
fields: readonly QueryDataField[];
|
|
34
|
+
}[];
|
|
35
|
+
}
|
|
36
|
+
export declare const dataFieldKey: (field: DataField) => string;
|
|
37
|
+
export declare const dataFieldLabel: (field: DataField) => string;
|
|
38
|
+
export declare function screenDataOf(sliceId: string | undefined, slices: readonly StateChangeSlice[], candidates: readonly QueryCandidate[]): ScreenData;
|
|
39
|
+
export declare const isDataField: (value: unknown) => value is DataField;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type QueryCandidate } from '@cratis/scene.model';
|
|
2
|
+
import type { PackageCatalog } from '@cratis/scene.engine';
|
|
3
|
+
import { type StateChangeSlice } from '../Actions/StateChangeSlice';
|
|
4
|
+
import type { CanvasPlacement } from '../Document/placeOnCanvas';
|
|
5
|
+
import type { TableDrop } from '../Surface/columnAt';
|
|
6
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
7
|
+
import type { DataField, QueryDataField } from './DataField';
|
|
8
|
+
export declare const singleResultComponentName = "singleResult";
|
|
9
|
+
export declare const initialTableColumns = 4;
|
|
10
|
+
export declare const initialSummaryFields = 6;
|
|
11
|
+
export interface DataFieldTarget {
|
|
12
|
+
parentId: string | undefined;
|
|
13
|
+
index: number | undefined;
|
|
14
|
+
at?: CanvasPlacement;
|
|
15
|
+
over?: TableDrop;
|
|
16
|
+
}
|
|
17
|
+
export interface DataFieldInsertion {
|
|
18
|
+
controller: Pick<ScreenEditorController, 'document' | 'composition' | 'insertElement' | 'setScreenForms' | 'select' | 'apply'>;
|
|
19
|
+
packages: PackageCatalog;
|
|
20
|
+
stateChangeSlices: readonly StateChangeSlice[];
|
|
21
|
+
queryCandidates: readonly QueryCandidate[];
|
|
22
|
+
bindsQuery: (componentName: string) => boolean;
|
|
23
|
+
newId: () => string;
|
|
24
|
+
}
|
|
25
|
+
export type DataFieldRefusal = 'unknownCommand' | 'unknownQuery' | 'noCommandForm' | 'noSingleResult' | 'noTable';
|
|
26
|
+
export declare function componentNamed(packages: PackageCatalog, component: string): string | undefined;
|
|
27
|
+
export declare function insertDataField(field: DataField, target: DataFieldTarget, insertion: DataFieldInsertion): DataFieldRefusal | undefined;
|
|
28
|
+
export declare function generateForm(sliceId: string, target: DataFieldTarget, insertion: DataFieldInsertion): DataFieldRefusal | undefined;
|
|
29
|
+
export declare function removeQueryColumn(field: QueryDataField, { controller }: Pick<DataFieldInsertion, 'controller'>): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type QueryBinding, type SceneEdit, type SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export declare const tableComponentNames: string[];
|
|
3
|
+
export declare const queryProperty = "query";
|
|
4
|
+
export interface QueryTable {
|
|
5
|
+
elementId: string;
|
|
6
|
+
binding: QueryBinding;
|
|
7
|
+
}
|
|
8
|
+
export declare function queryTableOf(element: SceneElement): QueryTable | undefined;
|
|
9
|
+
export declare function queryTablesOf(roots: readonly SceneElement[]): QueryTable[];
|
|
10
|
+
export declare const bindingEdit: (elementId: string, binding: QueryBinding) => SceneEdit;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ScreenOutlets } from './Outlets/screenOutlets';
|
|
3
4
|
import type { DesignModeStrings } from './DesignModeStrings';
|
|
4
5
|
export interface DesignModeFramesProps {
|
|
5
6
|
surface: RefObject<HTMLDivElement | null>;
|
|
6
7
|
controller: ScreenEditorController;
|
|
7
8
|
strings: DesignModeStrings;
|
|
9
|
+
outlets?: ScreenOutlets;
|
|
8
10
|
}
|
|
9
|
-
export declare const DesignModeFrames: ({ surface, controller, strings }: DesignModeFramesProps) => import("react").JSX.Element;
|
|
11
|
+
export declare const DesignModeFrames: ({ surface, controller, strings, outlets }: DesignModeFramesProps) => import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type OutletStrings } from './Outlets/OutletStrings';
|
|
1
2
|
export interface DesignModeStrings {
|
|
2
3
|
toolbarLabel: (itemLabel: string) => string;
|
|
3
4
|
slotName: (slot: string) => string;
|
|
@@ -68,6 +69,7 @@ export interface DesignModeStrings {
|
|
|
68
69
|
};
|
|
69
70
|
problems: Record<string, string>;
|
|
70
71
|
};
|
|
72
|
+
outlets: OutletStrings;
|
|
71
73
|
announce: {
|
|
72
74
|
added: (label: string) => string;
|
|
73
75
|
moved: (label: string, position: number, of: number) => string;
|