@cratis/event-models 0.346.0 → 0.348.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/References/EventNavigateButton.d.ts +1 -0
- package/dist/Rows/UserExperience/UiCell.d.ts +2 -1
- package/dist/event-models.css +1 -1
- package/dist/index.js +805 -791
- package/dist/index.js.map +1 -1
- package/dist/screen-editor/BindingExpressionPropertyEditor-BDzuLWUA.js +471 -0
- package/dist/screen-editor/DataBindingSections-BeQxUfQM.js +1919 -0
- package/dist/screen-editor/{QueryBindingPropertyEditor-BofsQo32.js → QueryBindingPropertyEditor-XQDHU9xb.js} +15 -15
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeStrings.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeAnnouncements.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeFeedback.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeSelection.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/useDesignMode.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Host/openSubject.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Host/useDocumentSetters.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/Host/useEditApplication.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/Host/useEditingScene.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Host/useNavigationEditing.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Host/useStructureOperations.d.ts +39 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ActionProperties.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Inspector/CommandFormProperties.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ComponentProperties.d.ts +17 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ExternalComponentSections.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Inspector/PropertiesPanel.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Inspector/PropertyGroups.d.ts +20 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenProperties.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ViewportControls.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/Inspector/bindingExpressionEdits.d.ts +26 -0
- package/dist/screen-editor/ScreenEditor/Play/PlayScreen.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/Play/composePlayScreen.d.ts +4 -2
- package/dist/screen-editor/ScreenEditor/ShellFrame/shellVisibility.d.ts +3 -2
- package/dist/screen-editor/ScreenEditor/ShellFrame/useShellFrame.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Surface/SelectionGrip.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Surface/dialogFrameAttributes.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Surface/surfaceText.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Surface/useDrawnScreen.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Surface/useSurfaceKeys.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Surface/useSurfaceMeasurer.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Surface/useSurfaceViewportHeight.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Templates/dialogActionsChrome.d.ts +3 -3
- package/dist/screen-editor/ScreenEditor/Templates/dialogPresentation.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Templates/displayedFits.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Thumbnail/ScreenThumbnail.d.ts +2 -1
- package/dist/screen-editor/index.js +6451 -6246
- package/dist/screen-editor/screen-editor.css +1 -1
- package/package.json +3 -3
- package/dist/screen-editor/BindingExpressionPropertyEditor-D63oFTJg.js +0 -455
- package/dist/screen-editor/DataBindingSections-wybsadzf.js +0 -1862
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { a as V, c as O, i as J, n as K, o as T, r as w, s as F, t as j, u as D } from "./defaultStructuredEditorStrings-Bwbw58wD.js";
|
|
2
|
+
import { t as Q } from "./StructuredValueEditor-DUSATTWd.js";
|
|
3
|
+
import { c as E } from "./structuredValue-vqCZttsk.js";
|
|
4
|
+
import { useEffect as L, useRef as $, useState as A } from "react";
|
|
5
|
+
import { Fragment as q, jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
import { BindingMode as B, BindingSourceKind as l, PropertyValueType as g } from "@cratis/scene.model";
|
|
7
|
+
var i = /* @__PURE__ */ (function(e) {
|
|
8
|
+
return e.String = "string", e.Number = "number", e.Boolean = "boolean", e.Null = "null", e.Json = "json", e;
|
|
9
|
+
})({});
|
|
10
|
+
function v(e) {
|
|
11
|
+
return e.kind ?? l.DataContext;
|
|
12
|
+
}
|
|
13
|
+
var M = [
|
|
14
|
+
"kind",
|
|
15
|
+
"path",
|
|
16
|
+
"query",
|
|
17
|
+
"componentId",
|
|
18
|
+
"componentPropertyPath",
|
|
19
|
+
"value"
|
|
20
|
+
], W = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
21
|
+
function U(e) {
|
|
22
|
+
if (W(e))
|
|
23
|
+
return M.some((o) => o in e) ? e : void 0;
|
|
24
|
+
}
|
|
25
|
+
function z(e) {
|
|
26
|
+
return v(e) === l.CommandResponse && e.mode !== B.TwoWay ? [B.OneWay] : w;
|
|
27
|
+
}
|
|
28
|
+
function G(e) {
|
|
29
|
+
switch (v(e)) {
|
|
30
|
+
case l.Literal:
|
|
31
|
+
return {
|
|
32
|
+
...e,
|
|
33
|
+
path: "",
|
|
34
|
+
query: void 0,
|
|
35
|
+
componentId: void 0,
|
|
36
|
+
componentPropertyPath: void 0
|
|
37
|
+
};
|
|
38
|
+
case l.QueryResult:
|
|
39
|
+
return {
|
|
40
|
+
...e,
|
|
41
|
+
componentId: void 0,
|
|
42
|
+
componentPropertyPath: void 0,
|
|
43
|
+
value: void 0
|
|
44
|
+
};
|
|
45
|
+
case l.ComponentProperty:
|
|
46
|
+
return {
|
|
47
|
+
...e,
|
|
48
|
+
query: void 0,
|
|
49
|
+
value: void 0,
|
|
50
|
+
path: e.componentPropertyPath ?? e.path
|
|
51
|
+
};
|
|
52
|
+
case l.DataContext:
|
|
53
|
+
case l.CommandResponse:
|
|
54
|
+
return {
|
|
55
|
+
...e,
|
|
56
|
+
query: void 0,
|
|
57
|
+
componentId: void 0,
|
|
58
|
+
componentPropertyPath: void 0,
|
|
59
|
+
value: void 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function Y(e, o) {
|
|
64
|
+
switch (e) {
|
|
65
|
+
case l.Literal:
|
|
66
|
+
return {
|
|
67
|
+
kind: e,
|
|
68
|
+
path: "",
|
|
69
|
+
value: o.value ?? ""
|
|
70
|
+
};
|
|
71
|
+
case l.QueryResult:
|
|
72
|
+
return {
|
|
73
|
+
kind: e,
|
|
74
|
+
query: o.query,
|
|
75
|
+
path: o.path
|
|
76
|
+
};
|
|
77
|
+
case l.ComponentProperty:
|
|
78
|
+
return {
|
|
79
|
+
kind: e,
|
|
80
|
+
componentId: o.componentId,
|
|
81
|
+
componentPropertyPath: o.componentPropertyPath ?? o.path,
|
|
82
|
+
path: o.componentPropertyPath ?? o.path
|
|
83
|
+
};
|
|
84
|
+
case l.CommandResponse:
|
|
85
|
+
return {
|
|
86
|
+
kind: e,
|
|
87
|
+
path: o.path,
|
|
88
|
+
mode: o.mode === B.TwoWay ? void 0 : o.mode
|
|
89
|
+
};
|
|
90
|
+
case l.DataContext:
|
|
91
|
+
return {
|
|
92
|
+
kind: e,
|
|
93
|
+
path: o.path
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function H(e) {
|
|
98
|
+
if (e === null) return i.Null;
|
|
99
|
+
if (typeof e == "number") return i.Number;
|
|
100
|
+
if (typeof e == "boolean") return i.Boolean;
|
|
101
|
+
if (typeof e == "object") return i.Json;
|
|
102
|
+
}
|
|
103
|
+
var X = {
|
|
104
|
+
[g.Number]: i.Number,
|
|
105
|
+
[g.Boolean]: i.Boolean,
|
|
106
|
+
[g.Object]: i.Json,
|
|
107
|
+
[g.Collection]: i.Json,
|
|
108
|
+
[g.Json]: i.Json
|
|
109
|
+
};
|
|
110
|
+
function I(e, o) {
|
|
111
|
+
return H(e) ?? X[o] ?? i.String;
|
|
112
|
+
}
|
|
113
|
+
function N(e, o) {
|
|
114
|
+
return JSON.stringify({
|
|
115
|
+
kind: I(e, o),
|
|
116
|
+
value: e
|
|
117
|
+
}) ?? "undefined";
|
|
118
|
+
}
|
|
119
|
+
function _(e) {
|
|
120
|
+
switch (e) {
|
|
121
|
+
case i.String:
|
|
122
|
+
return "";
|
|
123
|
+
case i.Number:
|
|
124
|
+
return 0;
|
|
125
|
+
case i.Boolean:
|
|
126
|
+
return !1;
|
|
127
|
+
case i.Null:
|
|
128
|
+
return null;
|
|
129
|
+
case i.Json:
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function Z(e, o) {
|
|
134
|
+
switch (e) {
|
|
135
|
+
case l.DataContext:
|
|
136
|
+
return o.dataContext;
|
|
137
|
+
case l.QueryResult:
|
|
138
|
+
return o.queryResult;
|
|
139
|
+
case l.ComponentProperty:
|
|
140
|
+
return o.componentProperty;
|
|
141
|
+
case l.Literal:
|
|
142
|
+
return o.literal;
|
|
143
|
+
case l.CommandResponse:
|
|
144
|
+
return o.commandResponse;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function k(e, o) {
|
|
148
|
+
return e === l.QueryResult && o.queryResults.length === 0 || e === l.ComponentProperty && o.componentOutputs.length === 0 || e === l.CommandResponse && !o.commandResponse;
|
|
149
|
+
}
|
|
150
|
+
function ee(e, o, d, s, c) {
|
|
151
|
+
const n = d.includes(e), h = k(e, s), y = e === l.CommandResponse ? c.commandResponseOutOfScope : c.unavailableSource;
|
|
152
|
+
return {
|
|
153
|
+
kind: e,
|
|
154
|
+
label: Z(e, c.sources),
|
|
155
|
+
disabled: e !== o && (!n || h),
|
|
156
|
+
reason: n ? h ? y : void 0 : c.incompatibleSource
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function ne(e, o, d, s) {
|
|
160
|
+
const c = v(e);
|
|
161
|
+
return K.filter((n) => n !== l.CommandResponse || o.includes(n) || c === n).map((n) => ee(n, c, o, d, s));
|
|
162
|
+
}
|
|
163
|
+
var te = ({ property: e, sources: o, strings: d, disabled: s, onChange: c }) => {
|
|
164
|
+
const n = d.properties.binding, h = O(e.effectiveValue) ? e.effectiveValue : void 0, y = h ? void 0 : U(e.effectiveValue), b = T(e), a = h ?? b, C = e.descriptor.acceptedBindingKinds?.length ? e.descriptor.acceptedBindingKinds : V, P = ne(a, C, o, n), f = a.query ? o.queryResults.find((r) => r.id === a.query || r.name === a.query) : void 0, p = a.componentId ? o.componentOutputs.find((r) => r.componentId === a.componentId) : void 0, m = (r) => c(G({
|
|
165
|
+
...a,
|
|
166
|
+
...r
|
|
167
|
+
})), x = () => c(void 0);
|
|
168
|
+
return y !== void 0 ? /* @__PURE__ */ u("fieldset", {
|
|
169
|
+
className: "studio-editor-binding",
|
|
170
|
+
disabled: s,
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ t("legend", { children: e.descriptor.label }),
|
|
173
|
+
/* @__PURE__ */ u("div", {
|
|
174
|
+
className: "studio-editor-binding__missing",
|
|
175
|
+
role: "alert",
|
|
176
|
+
children: [/* @__PURE__ */ t("p", { children: n.unsupportedValue }), /* @__PURE__ */ t("pre", { children: JSON.stringify(y, void 0, 2) ?? "" })]
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ u("div", {
|
|
179
|
+
className: "studio-editor-binding__row",
|
|
180
|
+
children: [/* @__PURE__ */ t("button", {
|
|
181
|
+
type: "button",
|
|
182
|
+
onClick: () => c(b),
|
|
183
|
+
children: n.replaceUnsupported
|
|
184
|
+
}), /* @__PURE__ */ t("button", {
|
|
185
|
+
type: "button",
|
|
186
|
+
onClick: x,
|
|
187
|
+
children: n.clear
|
|
188
|
+
})]
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
}) : /* @__PURE__ */ u("fieldset", {
|
|
192
|
+
className: "studio-editor-binding",
|
|
193
|
+
disabled: s,
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ t("legend", { children: e.descriptor.label }),
|
|
196
|
+
/* @__PURE__ */ u("div", {
|
|
197
|
+
className: "studio-editor-binding__row",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: n.source }), /* @__PURE__ */ t("select", {
|
|
200
|
+
value: a.kind ?? l.DataContext,
|
|
201
|
+
onChange: (r) => m(Y(r.target.value, a)),
|
|
202
|
+
children: P.map((r) => /* @__PURE__ */ t("option", {
|
|
203
|
+
value: r.kind,
|
|
204
|
+
disabled: r.disabled,
|
|
205
|
+
children: r.label
|
|
206
|
+
}, r.kind))
|
|
207
|
+
})] }),
|
|
208
|
+
/* @__PURE__ */ t(R, {
|
|
209
|
+
label: n.mode,
|
|
210
|
+
emptyLabel: n.inheritedMode,
|
|
211
|
+
value: a.mode,
|
|
212
|
+
options: z(a),
|
|
213
|
+
onChange: (r) => m({ mode: r })
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ t(R, {
|
|
216
|
+
label: n.nullBehavior,
|
|
217
|
+
emptyLabel: n.defaultNullBehavior,
|
|
218
|
+
value: a.nullBehavior,
|
|
219
|
+
options: J,
|
|
220
|
+
onChange: (r) => m({ nullBehavior: r })
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ t(R, {
|
|
223
|
+
label: n.expectedType,
|
|
224
|
+
emptyLabel: n.inferType,
|
|
225
|
+
value: a.expectedValueType,
|
|
226
|
+
options: F,
|
|
227
|
+
onChange: (r) => m({ expectedValueType: r })
|
|
228
|
+
})
|
|
229
|
+
]
|
|
230
|
+
}),
|
|
231
|
+
P.filter((r) => r.disabled && r.reason).map((r) => /* @__PURE__ */ u("p", {
|
|
232
|
+
className: "studio-editor-binding__missing",
|
|
233
|
+
children: [
|
|
234
|
+
r.label,
|
|
235
|
+
": ",
|
|
236
|
+
r.reason
|
|
237
|
+
]
|
|
238
|
+
}, `${r.kind}:reason`)),
|
|
239
|
+
v(a) === l.DataContext && /* @__PURE__ */ t(S, {
|
|
240
|
+
id: `${e.descriptor.path}-data-context-paths`,
|
|
241
|
+
label: n.path,
|
|
242
|
+
value: a.path,
|
|
243
|
+
options: o.dataContextPaths,
|
|
244
|
+
onChange: (r) => m({ path: r })
|
|
245
|
+
}),
|
|
246
|
+
v(a) === l.CommandResponse && /* @__PURE__ */ t(oe, {
|
|
247
|
+
id: `${e.descriptor.path}-command-response-paths`,
|
|
248
|
+
path: a.path,
|
|
249
|
+
source: o.commandResponse,
|
|
250
|
+
text: n,
|
|
251
|
+
onChange: (r) => m({ path: r })
|
|
252
|
+
}),
|
|
253
|
+
v(a) === l.QueryResult && /* @__PURE__ */ u(q, { children: [
|
|
254
|
+
/* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: n.query }), /* @__PURE__ */ u("select", {
|
|
255
|
+
value: a.query ?? "",
|
|
256
|
+
onChange: (r) => m({
|
|
257
|
+
query: r.target.value,
|
|
258
|
+
path: ""
|
|
259
|
+
}),
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ t("option", {
|
|
262
|
+
value: "",
|
|
263
|
+
children: n.noSource
|
|
264
|
+
}),
|
|
265
|
+
a.query && !f && /* @__PURE__ */ t("option", {
|
|
266
|
+
value: a.query,
|
|
267
|
+
children: n.missingQuery(a.query)
|
|
268
|
+
}),
|
|
269
|
+
o.queryResults.map((r) => /* @__PURE__ */ t("option", {
|
|
270
|
+
value: r.id,
|
|
271
|
+
children: r.name
|
|
272
|
+
}, r.id))
|
|
273
|
+
]
|
|
274
|
+
})] }),
|
|
275
|
+
/* @__PURE__ */ t(S, {
|
|
276
|
+
id: `${e.descriptor.path}-query-paths`,
|
|
277
|
+
label: n.path,
|
|
278
|
+
value: a.path,
|
|
279
|
+
options: f?.fields ?? [],
|
|
280
|
+
onChange: (r) => m({ path: r })
|
|
281
|
+
}),
|
|
282
|
+
a.query && !f && /* @__PURE__ */ t("p", {
|
|
283
|
+
className: "studio-editor-binding__missing",
|
|
284
|
+
role: "alert",
|
|
285
|
+
children: n.missingQuery(a.query)
|
|
286
|
+
})
|
|
287
|
+
] }),
|
|
288
|
+
v(a) === l.ComponentProperty && /* @__PURE__ */ u(q, { children: [
|
|
289
|
+
/* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: n.component }), /* @__PURE__ */ u("select", {
|
|
290
|
+
value: a.componentId ?? "",
|
|
291
|
+
onChange: (r) => m({
|
|
292
|
+
componentId: r.target.value,
|
|
293
|
+
componentPropertyPath: "",
|
|
294
|
+
path: ""
|
|
295
|
+
}),
|
|
296
|
+
children: [
|
|
297
|
+
/* @__PURE__ */ t("option", {
|
|
298
|
+
value: "",
|
|
299
|
+
children: n.noSource
|
|
300
|
+
}),
|
|
301
|
+
a.componentId && !p && /* @__PURE__ */ t("option", {
|
|
302
|
+
value: a.componentId,
|
|
303
|
+
children: n.missingComponent(a.componentId)
|
|
304
|
+
}),
|
|
305
|
+
o.componentOutputs.map((r) => /* @__PURE__ */ u("option", {
|
|
306
|
+
value: r.componentId,
|
|
307
|
+
children: [
|
|
308
|
+
r.label,
|
|
309
|
+
" (",
|
|
310
|
+
r.componentId,
|
|
311
|
+
")"
|
|
312
|
+
]
|
|
313
|
+
}, r.componentId))
|
|
314
|
+
]
|
|
315
|
+
})] }),
|
|
316
|
+
/* @__PURE__ */ t(S, {
|
|
317
|
+
id: `${e.descriptor.path}-component-paths`,
|
|
318
|
+
label: n.componentProperty,
|
|
319
|
+
value: a.componentPropertyPath ?? a.path,
|
|
320
|
+
options: p?.outputs.map((r) => r.path) ?? [],
|
|
321
|
+
onChange: (r) => m({
|
|
322
|
+
componentPropertyPath: r,
|
|
323
|
+
path: r
|
|
324
|
+
})
|
|
325
|
+
}),
|
|
326
|
+
a.componentId && !p && /* @__PURE__ */ t("p", {
|
|
327
|
+
className: "studio-editor-binding__missing",
|
|
328
|
+
role: "alert",
|
|
329
|
+
children: n.missingComponent(a.componentId)
|
|
330
|
+
})
|
|
331
|
+
] }),
|
|
332
|
+
v(a) === l.Literal && /* @__PURE__ */ t(re, {
|
|
333
|
+
value: a.value,
|
|
334
|
+
descriptor: e.descriptor,
|
|
335
|
+
targetType: a.expectedValueType ?? e.descriptor.valueType,
|
|
336
|
+
strings: n,
|
|
337
|
+
structured: d.properties.structured ?? j,
|
|
338
|
+
onChange: (r) => m({
|
|
339
|
+
value: r,
|
|
340
|
+
path: ""
|
|
341
|
+
})
|
|
342
|
+
}, N(a.value, a.expectedValueType ?? e.descriptor.valueType)),
|
|
343
|
+
h && /* @__PURE__ */ t("button", {
|
|
344
|
+
type: "button",
|
|
345
|
+
onClick: x,
|
|
346
|
+
children: n.clear
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
}, R = ({ label: e, emptyLabel: o, value: d, options: s, onChange: c }) => /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: e }), /* @__PURE__ */ u("select", {
|
|
351
|
+
value: d ?? "",
|
|
352
|
+
onChange: (n) => c(n.target.value === "" ? void 0 : n.target.value),
|
|
353
|
+
children: [/* @__PURE__ */ t("option", {
|
|
354
|
+
value: "",
|
|
355
|
+
children: o
|
|
356
|
+
}), s.map((n) => /* @__PURE__ */ t("option", {
|
|
357
|
+
value: n,
|
|
358
|
+
children: n
|
|
359
|
+
}, n))]
|
|
360
|
+
})] }), oe = ({ id: e, path: o, source: d, text: s, onChange: c }) => /* @__PURE__ */ u(q, { children: [/* @__PURE__ */ t(S, {
|
|
361
|
+
id: e,
|
|
362
|
+
label: s.path,
|
|
363
|
+
value: o,
|
|
364
|
+
options: d?.paths ?? [],
|
|
365
|
+
onChange: c
|
|
366
|
+
}), !d && /* @__PURE__ */ t("p", {
|
|
367
|
+
className: "studio-editor-binding__missing",
|
|
368
|
+
role: "alert",
|
|
369
|
+
children: s.commandResponseOutOfScope
|
|
370
|
+
})] }), S = ({ id: e, label: o, value: d, options: s, onChange: c }) => /* @__PURE__ */ u("label", { children: [
|
|
371
|
+
/* @__PURE__ */ t("span", { children: o }),
|
|
372
|
+
/* @__PURE__ */ t("input", {
|
|
373
|
+
list: e,
|
|
374
|
+
value: d,
|
|
375
|
+
onChange: (n) => c(n.target.value)
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ t("datalist", {
|
|
378
|
+
id: e,
|
|
379
|
+
children: s.map((n) => /* @__PURE__ */ t("option", { value: n }, n))
|
|
380
|
+
})
|
|
381
|
+
] }), re = ({ value: e, descriptor: o, targetType: d, strings: s, structured: c, onChange: n }) => {
|
|
382
|
+
const h = I(e, d), y = N(e, d), b = $(y), [a, C] = A(h);
|
|
383
|
+
L(() => {
|
|
384
|
+
const p = N(e, d);
|
|
385
|
+
p !== b.current && (b.current = p, C(I(e, d)));
|
|
386
|
+
}, [e, d]);
|
|
387
|
+
const P = (p) => {
|
|
388
|
+
C(p);
|
|
389
|
+
const m = _(p);
|
|
390
|
+
b.current = N(m, d), n(m);
|
|
391
|
+
}, f = E(o);
|
|
392
|
+
return /* @__PURE__ */ u("div", {
|
|
393
|
+
className: "studio-editor-binding__literal",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: s.literalType }), /* @__PURE__ */ u("select", {
|
|
396
|
+
value: a,
|
|
397
|
+
onChange: (p) => P(p.target.value),
|
|
398
|
+
children: [
|
|
399
|
+
/* @__PURE__ */ t("option", {
|
|
400
|
+
value: i.String,
|
|
401
|
+
children: "String"
|
|
402
|
+
}),
|
|
403
|
+
/* @__PURE__ */ t("option", {
|
|
404
|
+
value: i.Number,
|
|
405
|
+
children: "Number"
|
|
406
|
+
}),
|
|
407
|
+
/* @__PURE__ */ t("option", {
|
|
408
|
+
value: i.Boolean,
|
|
409
|
+
children: "Boolean"
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ t("option", {
|
|
412
|
+
value: i.Null,
|
|
413
|
+
children: "Null"
|
|
414
|
+
}),
|
|
415
|
+
(f || a === i.Json) && /* @__PURE__ */ t("option", {
|
|
416
|
+
value: i.Json,
|
|
417
|
+
children: s.literalStructured
|
|
418
|
+
})
|
|
419
|
+
]
|
|
420
|
+
})] }),
|
|
421
|
+
a === i.String && /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: s.literalValue }), /* @__PURE__ */ t("input", {
|
|
422
|
+
value: typeof e == "string" ? e : "",
|
|
423
|
+
onChange: (p) => n(p.target.value)
|
|
424
|
+
})] }),
|
|
425
|
+
a === i.Number && /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: s.literalValue }), /* @__PURE__ */ t("input", {
|
|
426
|
+
type: "number",
|
|
427
|
+
value: typeof e == "number" ? String(e) : "",
|
|
428
|
+
onChange: (p) => n(p.target.value === "" ? void 0 : Number(p.target.value))
|
|
429
|
+
})] }),
|
|
430
|
+
a === i.Boolean && /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ t("span", { children: s.literalValue }), /* @__PURE__ */ u("select", {
|
|
431
|
+
value: e === !0 ? "true" : "false",
|
|
432
|
+
onChange: (p) => n(p.target.value === "true"),
|
|
433
|
+
children: [/* @__PURE__ */ t("option", {
|
|
434
|
+
value: "true",
|
|
435
|
+
children: "true"
|
|
436
|
+
}), /* @__PURE__ */ t("option", {
|
|
437
|
+
value: "false",
|
|
438
|
+
children: "false"
|
|
439
|
+
})]
|
|
440
|
+
})] }),
|
|
441
|
+
a === i.Null && /* @__PURE__ */ t("p", { children: s.literalNull }),
|
|
442
|
+
a === i.Json && f && /* @__PURE__ */ t(Q, {
|
|
443
|
+
descriptor: o,
|
|
444
|
+
value: e,
|
|
445
|
+
idPrefix: "literal",
|
|
446
|
+
strings: c,
|
|
447
|
+
disabled: !1,
|
|
448
|
+
onChange: (p) => n(p ?? _(i.Json))
|
|
449
|
+
}),
|
|
450
|
+
a === i.Json && !f && /* @__PURE__ */ t("p", {
|
|
451
|
+
className: "studio-editor-binding__missing",
|
|
452
|
+
role: "alert",
|
|
453
|
+
children: s.literalNoEditor
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
});
|
|
457
|
+
}, de = ({ onChange: e, context: o, disabled: d }) => {
|
|
458
|
+
const { session: s } = o;
|
|
459
|
+
if (!s) return null;
|
|
460
|
+
const { controller: c, environment: n } = s, h = D(c.document, c.composition.roots, c.context, n.availableSources, n.queryCandidates);
|
|
461
|
+
return /* @__PURE__ */ t(te, {
|
|
462
|
+
property: s.property,
|
|
463
|
+
sources: h,
|
|
464
|
+
strings: s.screenStrings,
|
|
465
|
+
disabled: d === !0,
|
|
466
|
+
onChange: e
|
|
467
|
+
});
|
|
468
|
+
};
|
|
469
|
+
export {
|
|
470
|
+
de as BindingExpressionPropertyEditor
|
|
471
|
+
};
|