@cratis/event-models 0.329.2 → 0.331.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/Board/BoardSelection.d.ts +5 -1
- package/dist/Board/scopeClick.d.ts +5 -0
- package/dist/Messages/EventModelMessages.d.ts +2 -0
- package/dist/Model/Slice.d.ts +2 -0
- package/dist/Model/SliceStatus.d.ts +3 -1
- package/dist/Slices/SliceHeader.d.ts +1 -1
- package/dist/Slices/SliceHeaderSlice.d.ts +1 -1
- package/dist/Statuses/SliceStatusPicker.d.ts +2 -1
- package/dist/event-model-document.schema.json +10 -1
- package/dist/event-models.css +1 -1
- package/dist/index.js +2894 -2846
- package/dist/index.js.map +1 -1
- package/dist/screen-editor/{CollectionEditor-DAZxBd7y.js → CollectionEditor-BvAtXikL.js} +76 -76
- package/dist/screen-editor/ScreenEditor/Actions/ActionModel.d.ts +3 -2
- package/dist/screen-editor/ScreenEditor/Actions/actionBehavior.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeStrings.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/navigationDocument.d.ts +2 -2
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/navigationItemOps.d.ts +10 -10
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeTypes.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/outletItemSource.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/resolveDesignMode.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Destinations/DestinationProblemKind.d.ts +2 -2
- package/dist/screen-editor/ScreenEditor/Destinations/destinationProblems.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Document/upgradeStoredDocument.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +2 -2
- package/dist/screen-editor/ScreenEditor/Inspector/DestinationReferenceFields.d.ts +2 -2
- package/dist/screen-editor/ScreenEditor/Inspector/OutletButtonSection.d.ts +14 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +21 -8
- package/dist/screen-editor/ScreenEditor/Inspector/SlotListEditor.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ToolbarButtonSection.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Inspector/localizedDisplay.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Runtime/withOutletItemKind.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Surface/designTimePointer.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Toolbar/toolbarDiagnostics.d.ts +4 -1
- package/dist/screen-editor/ScreenTemplates/ApplicationTemplate.d.ts +4 -4
- package/dist/screen-editor/iconDiagnostics-BZq0t8-V.js +50 -0
- package/dist/screen-editor/index.js +3772 -3449
- package/dist/screen-editor/screen-editor.css +1 -1
- package/package.json +41 -41
- package/dist/screen-editor/ScreenEditor/Actions/ActionPresentation.d.ts +0 -5
- package/dist/screen-editor/ScreenEditor/Inspector/OutletListEditor.d.ts +0 -9
- package/dist/screen-editor/ScreenEditor/Runtime/withActionPresentation.d.ts +0 -2
- package/dist/screen-editor/iconDiagnostics-Ds4CnqD0.js +0 -49
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { n as T, t as A } from "./allowedIconChoices-KSkQ6blx.js";
|
|
2
|
-
import { a as u, i as D, r as P, t as $ } from "./iconDiagnostics-
|
|
2
|
+
import { a as u, i as D, r as P, t as $ } from "./iconDiagnostics-BZq0t8-V.js";
|
|
3
3
|
import { StructuredPropertyEditor as U } from "./StructuredPropertyEditor-Bd-8GBgK.js";
|
|
4
4
|
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
5
|
-
import { CollectionOperation as C, DestinationKind as v, PropertyValueType as L, SceneEditKind as
|
|
5
|
+
import { CollectionOperation as C, DestinationKind as v, PropertyValueType as L, SceneEditKind as S } from "@cratis/scene.model";
|
|
6
6
|
import { OrderedItemEditor as F } from "@cratis/components/ConfigurationEditor";
|
|
7
7
|
var K = /* @__PURE__ */ new Set([
|
|
8
8
|
"label",
|
|
9
9
|
"icon",
|
|
10
10
|
"destination"
|
|
11
|
-
]), j = (e) => e.valueType === L.Collection && e.item !== void 0 && e.item.properties.every((
|
|
11
|
+
]), j = (e) => e.valueType === L.Collection && e.item !== void 0 && e.item.properties.every((t) => K.has(t.path)), N = (e) => typeof e == "string" ? e : "";
|
|
12
12
|
function V(e) {
|
|
13
|
-
const
|
|
14
|
-
id:
|
|
15
|
-
label: N(
|
|
16
|
-
...
|
|
17
|
-
...Z(
|
|
18
|
-
destinationReference:
|
|
19
|
-
destination:
|
|
13
|
+
const t = (e.items ?? []).map((i) => ({
|
|
14
|
+
id: i.id,
|
|
15
|
+
label: N(i.values.label),
|
|
16
|
+
...i.values.icon ? { icon: i.values.icon } : {},
|
|
17
|
+
...Z(i.values.destination) ? {
|
|
18
|
+
destinationReference: i.values.destination,
|
|
19
|
+
destination: i.values.destination.screen
|
|
20
20
|
} : {},
|
|
21
|
-
values:
|
|
22
|
-
editable:
|
|
21
|
+
values: i.values,
|
|
22
|
+
editable: i.editable
|
|
23
23
|
}));
|
|
24
24
|
return {
|
|
25
|
-
fixed:
|
|
26
|
-
items:
|
|
25
|
+
fixed: t.filter((i) => !i.editable),
|
|
26
|
+
items: t.filter((i) => i.editable)
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function W(e) {
|
|
30
|
-
const
|
|
30
|
+
const t = new Set(e.operations ?? []), i = t.has(C.EditFields), r = e.descriptor.constraints?.maximumItems;
|
|
31
31
|
return {
|
|
32
|
-
add:
|
|
33
|
-
remove:
|
|
34
|
-
reorder:
|
|
32
|
+
add: t.has(C.Add),
|
|
33
|
+
remove: t.has(C.Remove),
|
|
34
|
+
reorder: t.has(C.Reorder),
|
|
35
35
|
fields: {
|
|
36
|
-
label:
|
|
37
|
-
icon:
|
|
38
|
-
destination:
|
|
36
|
+
label: i ? "editable" : "readonly",
|
|
37
|
+
icon: i ? "editable" : "readonly",
|
|
38
|
+
destination: i ? "editable" : "readonly"
|
|
39
39
|
},
|
|
40
40
|
...r !== void 0 ? { maxItems: r } : {},
|
|
41
41
|
...e.reason ? { reasons: {
|
|
@@ -45,46 +45,46 @@ function W(e) {
|
|
|
45
45
|
} } : {}
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
function _(e,
|
|
48
|
+
function _(e, t, i) {
|
|
49
49
|
const r = {
|
|
50
50
|
component: e,
|
|
51
|
-
path:
|
|
51
|
+
path: t.descriptor.path
|
|
52
52
|
};
|
|
53
|
-
switch (
|
|
53
|
+
switch (i.kind) {
|
|
54
54
|
case "add":
|
|
55
55
|
return [{
|
|
56
|
-
kind:
|
|
56
|
+
kind: S.AddCollectionItem,
|
|
57
57
|
...r,
|
|
58
58
|
item: {
|
|
59
|
-
id:
|
|
60
|
-
values: M(
|
|
59
|
+
id: i.item.id,
|
|
60
|
+
values: M(i.item)
|
|
61
61
|
},
|
|
62
|
-
index:
|
|
62
|
+
index: i.index
|
|
63
63
|
}];
|
|
64
64
|
case "remove":
|
|
65
65
|
return [{
|
|
66
|
-
kind:
|
|
66
|
+
kind: S.RemoveCollectionItem,
|
|
67
67
|
...r,
|
|
68
|
-
itemId:
|
|
68
|
+
itemId: i.item.id
|
|
69
69
|
}];
|
|
70
70
|
case "move":
|
|
71
71
|
return [{
|
|
72
|
-
kind:
|
|
72
|
+
kind: S.ReorderCollectionItem,
|
|
73
73
|
...r,
|
|
74
|
-
itemId:
|
|
75
|
-
index:
|
|
74
|
+
itemId: i.item.id,
|
|
75
|
+
index: i.toIndex
|
|
76
76
|
}];
|
|
77
77
|
case "update":
|
|
78
78
|
return [{
|
|
79
|
-
kind:
|
|
79
|
+
kind: S.EditCollectionItem,
|
|
80
80
|
...r,
|
|
81
|
-
itemId:
|
|
82
|
-
field:
|
|
83
|
-
value: z(
|
|
81
|
+
itemId: i.item.id,
|
|
82
|
+
field: i.field,
|
|
83
|
+
value: z(i.item, i.field)
|
|
84
84
|
}];
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
var z = (e,
|
|
87
|
+
var z = (e, t) => t === "destination" ? x(e) : e[t], M = (e) => ({
|
|
88
88
|
...e.values,
|
|
89
89
|
label: e.label,
|
|
90
90
|
...e.icon ? { icon: e.icon } : {},
|
|
@@ -108,38 +108,38 @@ function Z(e) {
|
|
|
108
108
|
"kind",
|
|
109
109
|
"dialog",
|
|
110
110
|
"routeParameterBindings"
|
|
111
|
-
].some((
|
|
111
|
+
].some((t) => t in e);
|
|
112
112
|
}
|
|
113
113
|
var q = /^:[A-Za-z_][A-Za-z0-9_]*$/;
|
|
114
|
-
function B(e,
|
|
114
|
+
function B(e, t) {
|
|
115
115
|
if (!e) return [];
|
|
116
|
-
const
|
|
117
|
-
return !e.screen && !e.route && !e.dialog && !e.slice &&
|
|
116
|
+
const i = [];
|
|
117
|
+
return !e.screen && !e.route && !e.dialog && !e.slice && i.push(u.NoTarget), e.screen && !t.screens.includes(e.screen) && i.push(u.UnknownScreen), e.route !== void 0 && !G(e.route, e.kind) && i.push(u.InvalidRoute), e.slot && !t.slots.includes(e.slot) && i.push(u.UnknownSlot), e.dialog && !t.dialogTemplates.includes(e.dialog) && i.push(u.UnknownDialog), e.slice && !t.slices.includes(e.slice) && i.push(u.UnknownSlice), e.kind === v.Slot && !e.slot && i.push(u.SlotKindWithoutSlot), e.kind === v.Dialog && !e.dialog && i.push(u.DialogKindWithoutDialog), e.kind === v.External && !e.route && i.push(u.ExternalKindWithoutRoute), i;
|
|
118
118
|
}
|
|
119
|
-
function G(e,
|
|
120
|
-
if (
|
|
119
|
+
function G(e, t) {
|
|
120
|
+
if (t === v.External) return H(e);
|
|
121
121
|
if (!e.startsWith("/") || /\s/.test(e) || e.includes("//")) return !1;
|
|
122
|
-
const
|
|
123
|
-
return
|
|
122
|
+
const i = e.split("/").filter((r) => r.startsWith(":"));
|
|
123
|
+
return i.every((r) => q.test(r)) ? new Set(i).size === i.length : !1;
|
|
124
124
|
}
|
|
125
125
|
function H(e) {
|
|
126
126
|
try {
|
|
127
|
-
const
|
|
128
|
-
return
|
|
127
|
+
const t = new URL(e);
|
|
128
|
+
return t.protocol === "https:" || t.protocol === "http:";
|
|
129
129
|
} catch {
|
|
130
130
|
return !1;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
var J = ({ id: e, label:
|
|
134
|
-
const d =
|
|
133
|
+
var J = ({ id: e, label: t, value: i, destinations: r, slots: s, dialogTemplates: p, problems: m = [], disabled: I, strings: a, onChange: b }) => {
|
|
134
|
+
const d = i ?? {}, h = (o) => b(Y({
|
|
135
135
|
...d,
|
|
136
136
|
...o
|
|
137
|
-
})), y = () => b(void 0), g = `${e}-
|
|
137
|
+
})), y = () => b(void 0), g = `${e}-slots`, k = `${e}-dialogs`;
|
|
138
138
|
return /* @__PURE__ */ c("fieldset", {
|
|
139
139
|
className: "studio-editor-destination",
|
|
140
140
|
disabled: I,
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */ n("legend", { children:
|
|
142
|
+
/* @__PURE__ */ n("legend", { children: t || a.label }),
|
|
143
143
|
/* @__PURE__ */ c("label", { children: [/* @__PURE__ */ n("span", { children: a.screen }), /* @__PURE__ */ c("select", {
|
|
144
144
|
value: d.screen ?? "",
|
|
145
145
|
onChange: (o) => h({ screen: o.target.value || void 0 }),
|
|
@@ -172,8 +172,8 @@ var J = ({ id: e, label: i, value: t, destinations: r, outlets: s, dialogTemplat
|
|
|
172
172
|
children: a.kinds.default
|
|
173
173
|
}),
|
|
174
174
|
/* @__PURE__ */ n("option", {
|
|
175
|
-
value: v.
|
|
176
|
-
children: a.kinds.
|
|
175
|
+
value: v.Slot,
|
|
176
|
+
children: a.kinds.slot
|
|
177
177
|
}),
|
|
178
178
|
/* @__PURE__ */ n("option", {
|
|
179
179
|
value: v.Dialog,
|
|
@@ -186,11 +186,11 @@ var J = ({ id: e, label: i, value: t, destinations: r, outlets: s, dialogTemplat
|
|
|
186
186
|
]
|
|
187
187
|
})] }),
|
|
188
188
|
/* @__PURE__ */ c("label", { children: [
|
|
189
|
-
/* @__PURE__ */ n("span", { children: a.
|
|
189
|
+
/* @__PURE__ */ n("span", { children: a.slot }),
|
|
190
190
|
/* @__PURE__ */ n("input", {
|
|
191
191
|
list: g,
|
|
192
|
-
value: d.
|
|
193
|
-
onChange: (o) => h({
|
|
192
|
+
value: d.slot ?? "",
|
|
193
|
+
onChange: (o) => h({ slot: o.target.value || void 0 })
|
|
194
194
|
}),
|
|
195
195
|
/* @__PURE__ */ n("datalist", {
|
|
196
196
|
id: g,
|
|
@@ -217,7 +217,7 @@ var J = ({ id: e, label: i, value: t, destinations: r, outlets: s, dialogTemplat
|
|
|
217
217
|
m.length > 0 && /* @__PURE__ */ n("ul", {
|
|
218
218
|
className: "studio-editor-diagnostics",
|
|
219
219
|
role: "alert",
|
|
220
|
-
"aria-label":
|
|
220
|
+
"aria-label": t || a.label,
|
|
221
221
|
children: m.map((o) => /* @__PURE__ */ n("li", {
|
|
222
222
|
"data-severity": "error",
|
|
223
223
|
children: a.problems[o]
|
|
@@ -229,31 +229,31 @@ var J = ({ id: e, label: i, value: t, destinations: r, outlets: s, dialogTemplat
|
|
|
229
229
|
function Q(e) {
|
|
230
230
|
return e.group ? `${e.group} / ${e.label}` : e.label;
|
|
231
231
|
}
|
|
232
|
-
function X(e,
|
|
233
|
-
return !!e && !
|
|
232
|
+
function X(e, t) {
|
|
233
|
+
return !!e && !t.some((i) => i.id === e);
|
|
234
234
|
}
|
|
235
235
|
function Y(e) {
|
|
236
|
-
const
|
|
236
|
+
const t = {
|
|
237
237
|
...e,
|
|
238
238
|
...e.screen ? { screen: e.screen } : {},
|
|
239
239
|
...e.route ? { route: e.route } : {},
|
|
240
|
-
...e.
|
|
240
|
+
...e.slot ? { slot: e.slot } : {},
|
|
241
241
|
...e.dialog ? { dialog: e.dialog } : {}
|
|
242
242
|
};
|
|
243
|
-
for (const
|
|
243
|
+
for (const i of [
|
|
244
244
|
"screen",
|
|
245
245
|
"route",
|
|
246
|
-
"
|
|
246
|
+
"slot",
|
|
247
247
|
"dialog",
|
|
248
248
|
"kind"
|
|
249
|
-
]) i
|
|
250
|
-
return Object.keys(
|
|
249
|
+
]) t[i] || delete t[i];
|
|
250
|
+
return Object.keys(t).length > 0 ? t : void 0;
|
|
251
251
|
}
|
|
252
252
|
var ee = ({ context: e }) => {
|
|
253
|
-
const { session:
|
|
254
|
-
if (!
|
|
255
|
-
const { controller:
|
|
256
|
-
|
|
253
|
+
const { session: t } = e;
|
|
254
|
+
if (!t) return null;
|
|
255
|
+
const { controller: i, environment: r, property: s, screenStrings: p } = t, m = e.selection?.id ?? "", I = r.destinations, a = e.lookups.icons, { items: b, fixed: d } = V(s), h = $(a.diagnostics, s.descriptor.path), y = W(s), g = y.fields.destination !== "readonly" || s.editable, k = [...d, ...b].filter((l) => l.destination !== void 0 || l.destinationReference !== void 0 || g), o = P(r, i.document), R = ie(o, s), O = (l, f) => {
|
|
256
|
+
i.setCollectionItemDestination(m, s.descriptor.path, l.id, f, p.properties.destination.label);
|
|
257
257
|
};
|
|
258
258
|
return /* @__PURE__ */ c("section", {
|
|
259
259
|
className: "studio-editor-properties__collection",
|
|
@@ -283,7 +283,7 @@ var ee = ({ context: e }) => {
|
|
|
283
283
|
label: "",
|
|
284
284
|
values: {}
|
|
285
285
|
}),
|
|
286
|
-
onChange: (l) =>
|
|
286
|
+
onChange: (l) => i.applyAll(_(m, s, l), p.properties.itemsLabel)
|
|
287
287
|
}), k.length > 0 && /* @__PURE__ */ c("div", {
|
|
288
288
|
className: "studio-editor-destinations",
|
|
289
289
|
children: [/* @__PURE__ */ n("strong", { children: p.properties.destination.label }), k.map((l) => /* @__PURE__ */ n(J, {
|
|
@@ -291,20 +291,20 @@ var ee = ({ context: e }) => {
|
|
|
291
291
|
label: l.label,
|
|
292
292
|
value: l.destinationReference,
|
|
293
293
|
destinations: I,
|
|
294
|
-
|
|
294
|
+
slots: R.slots,
|
|
295
295
|
dialogTemplates: R.dialogTemplates,
|
|
296
296
|
problems: B(l.destinationReference, o),
|
|
297
297
|
disabled: !g || d.some((f) => f.id === l.id),
|
|
298
298
|
strings: p.properties.destination,
|
|
299
|
-
onChange: (f) =>
|
|
299
|
+
onChange: (f) => O(l, f)
|
|
300
300
|
}, l.id))]
|
|
301
301
|
})]
|
|
302
302
|
});
|
|
303
303
|
};
|
|
304
|
-
function
|
|
305
|
-
const
|
|
304
|
+
function ie(e, t) {
|
|
305
|
+
const i = (t.items ?? []).map((s) => E(s.values.destination) ? s.values.destination.slot : void 0).filter(w), r = (t.items ?? []).map((s) => E(s.values.destination) ? s.values.destination.dialog : void 0).filter(w);
|
|
306
306
|
return {
|
|
307
|
-
|
|
307
|
+
slots: D([...e.slots, ...i]),
|
|
308
308
|
dialogTemplates: D([...e.dialogTemplates, ...r])
|
|
309
309
|
};
|
|
310
310
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Opens } 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
|
+
opensIn?: string;
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type SceneEdit } from '@cratis/scene.model';
|
|
2
2
|
import type { ActionModel } from './ActionModel';
|
|
3
3
|
export declare const actionComponentName = "action";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const opensProperty = "opens";
|
|
5
|
+
export declare const opensInProperty = "opensIn";
|
|
5
6
|
export declare const argumentsProperty = "arguments";
|
|
6
7
|
export declare function readActionModel(properties: Record<string, unknown> | undefined, sliceName?: string): ActionModel | undefined;
|
|
7
8
|
export declare function toActionProperties(model: ActionModel): Record<string, unknown>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type NavigationModel, type OutletNavigationItem, type SceneDocument } from '@cratis/scene.model';
|
|
2
2
|
export type NavigationDocument = SceneDocument & {
|
|
3
3
|
navigation?: NavigationModel;
|
|
4
4
|
};
|
|
5
5
|
export declare const emptyNavigation: () => NavigationModel;
|
|
6
6
|
export declare const navigationOf: (document: SceneDocument) => NavigationModel;
|
|
7
7
|
export declare const withNavigation: (document: SceneDocument, navigation: NavigationModel) => SceneDocument;
|
|
8
|
-
export declare function ownItemsOf(navigation: NavigationModel, module: string | undefined,
|
|
8
|
+
export declare function ownItemsOf(navigation: NavigationModel, module: string | undefined, outlet: string): OutletNavigationItem[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const changeItem: (items: readonly
|
|
3
|
-
export declare const removeItem: (items: readonly
|
|
4
|
-
export declare function findItem(items: readonly
|
|
5
|
-
export declare function siblingsOf(items: readonly
|
|
6
|
-
export declare function moveItem(items: readonly
|
|
7
|
-
export declare const cloneItem: (item:
|
|
8
|
-
export declare function duplicateItem(items: readonly
|
|
9
|
-
items:
|
|
10
|
-
copy?:
|
|
1
|
+
import type { OutletNavigationItem } from '@cratis/scene.model';
|
|
2
|
+
export declare const changeItem: (items: readonly OutletNavigationItem[], id: string, change: Partial<OutletNavigationItem>) => OutletNavigationItem[];
|
|
3
|
+
export declare const removeItem: (items: readonly OutletNavigationItem[], id: string) => OutletNavigationItem[];
|
|
4
|
+
export declare function findItem(items: readonly OutletNavigationItem[], id: string): OutletNavigationItem | undefined;
|
|
5
|
+
export declare function siblingsOf(items: readonly OutletNavigationItem[], id: string): readonly OutletNavigationItem[] | undefined;
|
|
6
|
+
export declare function moveItem(items: readonly OutletNavigationItem[], id: string, to: number): OutletNavigationItem[];
|
|
7
|
+
export declare const cloneItem: (item: OutletNavigationItem, newId: () => string) => OutletNavigationItem;
|
|
8
|
+
export declare function duplicateItem(items: readonly OutletNavigationItem[], id: string, newId: () => string): {
|
|
9
|
+
items: OutletNavigationItem[];
|
|
10
|
+
copy?: OutletNavigationItem;
|
|
11
11
|
};
|
|
@@ -8,6 +8,7 @@ export declare const designModeActions: {
|
|
|
8
8
|
readonly slot: 'slot';
|
|
9
9
|
readonly slice: 'slice';
|
|
10
10
|
readonly emphasis: 'emphasis';
|
|
11
|
+
readonly display: 'display';
|
|
11
12
|
readonly moveEarlier: 'moveEarlier';
|
|
12
13
|
readonly moveLater: 'moveLater';
|
|
13
14
|
readonly duplicate: 'duplicate';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ApplicationStructure, type InspectedProperty } from '@cratis/scene.model';
|
|
2
|
+
import { type DesignModeItemSource } from './designModeTypes';
|
|
3
|
+
export interface OutletItemSourceInputs {
|
|
4
|
+
componentId: string;
|
|
5
|
+
property: InspectedProperty;
|
|
6
|
+
newId: () => string;
|
|
7
|
+
startingLabel: string;
|
|
8
|
+
structure?: ApplicationStructure;
|
|
9
|
+
}
|
|
10
|
+
export declare function createOutletItemSource({ componentId, property, newId, startingLabel, structure }: OutletItemSourceInputs): DesignModeItemSource;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApplicationStructure, DestinationReference, ExternalComponent, NodeInspection, SceneElement } from '@cratis/scene.model';
|
|
2
2
|
import { type DescriptorCatalog } from '@cratis/scene.engine';
|
|
3
3
|
import type { Ownership } from '../Structure/Ownership';
|
|
4
|
-
import type
|
|
4
|
+
import { type DesignModeItemSource, type DesignModeSubject } from './designModeTypes';
|
|
5
5
|
export interface DesignModeInputs {
|
|
6
6
|
roots: readonly SceneElement[];
|
|
7
7
|
catalog: DescriptorCatalog;
|
|
@@ -2,10 +2,10 @@ export declare enum DestinationProblemKind {
|
|
|
2
2
|
NoTarget = "noTarget",
|
|
3
3
|
UnknownScreen = "unknownScreen",
|
|
4
4
|
InvalidRoute = "invalidRoute",
|
|
5
|
-
|
|
5
|
+
UnknownSlot = "unknownSlot",
|
|
6
6
|
UnknownDialog = "unknownDialog",
|
|
7
7
|
UnknownSlice = "unknownSlice",
|
|
8
|
-
|
|
8
|
+
SlotKindWithoutSlot = "slotKindWithoutSlot",
|
|
9
9
|
DialogKindWithoutDialog = "dialogKindWithoutDialog",
|
|
10
10
|
ExternalKindWithoutRoute = "externalKindWithoutRoute"
|
|
11
11
|
}
|
|
@@ -2,7 +2,7 @@ import { DestinationKind, type DestinationReference } from '@cratis/scene.model'
|
|
|
2
2
|
import { DestinationProblemKind } from './DestinationProblemKind';
|
|
3
3
|
export interface DestinationTargets {
|
|
4
4
|
screens: readonly string[];
|
|
5
|
-
|
|
5
|
+
slots: readonly string[];
|
|
6
6
|
dialogTemplates: readonly string[];
|
|
7
7
|
slices: readonly string[];
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CanvasPlacement } from '../Document/placeOnCanvas';
|
|
2
2
|
import type { PreparedSceneScreenDraft, SceneScreenDraftPreparation } from '../Drafting/SceneScreenDraft';
|
|
3
|
-
import type { ApplicationStructure, Behavior, DestinationReference, DialogTemplate, NavigationModel, Form, NodeInspection,
|
|
3
|
+
import type { ApplicationStructure, Behavior, DestinationReference, DialogTemplate, NavigationModel, Form, NodeInspection, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement, ScreenTemplate, Slot, TemplateMetadata } from '@cratis/scene.model';
|
|
4
4
|
import type { EditingContext, NavigationEdit } from '@cratis/scene.engine';
|
|
5
5
|
import type { Ownership } from '../Structure/Ownership';
|
|
6
6
|
import type { StructureEdit } from '../Structure/StructureEdit';
|
|
@@ -61,7 +61,7 @@ export interface ScreenEditorController {
|
|
|
61
61
|
canRemove: (elementId: string) => boolean;
|
|
62
62
|
setProperty: (property: NodeInspection['properties'][number], value: unknown) => void;
|
|
63
63
|
setScreenForms: (forms: Form[], label: string) => void;
|
|
64
|
-
|
|
64
|
+
setScreenTemplateSlots: (templateName: string, slots: Slot[], label: string) => void;
|
|
65
65
|
setScreenTemplateMetadata: (templateName: string, metadata: TemplateMetadata | undefined, label: string) => void;
|
|
66
66
|
setDialogTemplates: (templates: DialogTemplate[], label: string) => void;
|
|
67
67
|
setCollectionItemDestination: (componentId: string, path: string, itemId: string, destination: DestinationReference | undefined, label: string) => void;
|
|
@@ -7,11 +7,11 @@ export interface DestinationReferenceFieldsProps {
|
|
|
7
7
|
label: string;
|
|
8
8
|
value: DestinationReference | undefined;
|
|
9
9
|
destinations: readonly ConfigurationDestination[];
|
|
10
|
-
|
|
10
|
+
slots: readonly string[];
|
|
11
11
|
dialogTemplates: readonly string[];
|
|
12
12
|
problems?: readonly DestinationProblemKind[];
|
|
13
13
|
disabled: boolean;
|
|
14
14
|
strings: ScreenEditorStrings['properties']['destination'];
|
|
15
15
|
onChange: (destination: DestinationReference | undefined) => void;
|
|
16
16
|
}
|
|
17
|
-
export declare const DestinationReferenceFields: ({ id, label, value, destinations,
|
|
17
|
+
export declare const DestinationReferenceFields: ({ id, label, value, destinations, slots, dialogTemplates, problems, disabled, strings, onChange }: DestinationReferenceFieldsProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InspectedProperty } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { EditorContext } from '../PropertyEditors/Registry/PropertyEditorProps';
|
|
4
|
+
import type { PropertyEditorRegistry } from '../PropertyEditors/Registry/PropertyEditorRegistry';
|
|
5
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
6
|
+
export interface OutletButtonSectionProps {
|
|
7
|
+
controller: ScreenEditorController;
|
|
8
|
+
strings: ScreenEditorStrings;
|
|
9
|
+
componentId: string;
|
|
10
|
+
items: InspectedProperty;
|
|
11
|
+
registry: PropertyEditorRegistry;
|
|
12
|
+
context: EditorContext;
|
|
13
|
+
}
|
|
14
|
+
export declare const OutletButtonSection: ({ controller, strings, componentId, items, registry, context }: OutletButtonSectionProps) => import("react").JSX.Element | null;
|
|
@@ -128,16 +128,26 @@ export interface ScreenEditorStrings {
|
|
|
128
128
|
apply: string;
|
|
129
129
|
discard: string;
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
slots: {
|
|
132
132
|
label: string;
|
|
133
133
|
name: string;
|
|
134
|
-
|
|
134
|
+
role: string;
|
|
135
|
+
roles: {
|
|
136
|
+
none: string;
|
|
137
|
+
page: string;
|
|
138
|
+
pane: string;
|
|
139
|
+
panel: string;
|
|
140
|
+
};
|
|
141
|
+
routed: string;
|
|
142
|
+
routedHint: string;
|
|
143
|
+
optional: string;
|
|
144
|
+
optionalHint: string;
|
|
135
145
|
add: string;
|
|
136
146
|
remove: string;
|
|
137
147
|
moveUp: string;
|
|
138
148
|
moveDown: string;
|
|
139
149
|
unnamed: string;
|
|
140
|
-
|
|
150
|
+
newSlotName: string;
|
|
141
151
|
};
|
|
142
152
|
destination: {
|
|
143
153
|
label: string;
|
|
@@ -146,13 +156,13 @@ export interface ScreenEditorStrings {
|
|
|
146
156
|
missingScreen: (screen: string) => string;
|
|
147
157
|
route: string;
|
|
148
158
|
routePlaceholder: string;
|
|
149
|
-
|
|
159
|
+
slot: string;
|
|
150
160
|
dialog: string;
|
|
151
161
|
clear: string;
|
|
152
162
|
kind: string;
|
|
153
163
|
kinds: {
|
|
154
164
|
default: string;
|
|
155
|
-
|
|
165
|
+
slot: string;
|
|
156
166
|
dialog: string;
|
|
157
167
|
external: string;
|
|
158
168
|
};
|
|
@@ -276,12 +286,15 @@ export interface ScreenEditorStrings {
|
|
|
276
286
|
slice: string;
|
|
277
287
|
chooseSlice: string;
|
|
278
288
|
inputs: string;
|
|
279
|
-
|
|
280
|
-
|
|
289
|
+
opens: string;
|
|
290
|
+
openings: {
|
|
291
|
+
automatic: string;
|
|
281
292
|
none: string;
|
|
282
|
-
|
|
293
|
+
dialog: string;
|
|
283
294
|
drawer: string;
|
|
295
|
+
slot: string;
|
|
284
296
|
};
|
|
297
|
+
opensIn: string;
|
|
285
298
|
sourceFor: (input: string) => string;
|
|
286
299
|
problems: {
|
|
287
300
|
missingSlice: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Slot } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
3
|
+
export interface SlotListEditorProps {
|
|
4
|
+
slots: readonly Slot[];
|
|
5
|
+
primarySlot: string;
|
|
6
|
+
hint: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
strings: ScreenEditorStrings['properties']['slots'];
|
|
9
|
+
onChange: (slots: Slot[]) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const SlotListEditor: ({ slots, primarySlot, hint, disabled, strings, onChange }: SlotListEditorProps) => import("react").JSX.Element;
|
|
12
|
+
export declare function cleanSlot(slot: Slot): Slot;
|
|
13
|
+
export declare function nextSlotName(slots: readonly Slot[], baseName: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SceneElement } from '@cratis/scene.model';
|
|
2
2
|
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
3
|
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
4
|
export interface ToolbarButtonSectionProps {
|
|
@@ -7,5 +7,5 @@ export interface DesignTimePointerDecision {
|
|
|
7
7
|
}
|
|
8
8
|
export declare function decideDesignTimePointer(type: string, target: EventTarget | null, button?: number): DesignTimePointerDecision;
|
|
9
9
|
export declare function elementIdAt(target: EventTarget | null): string | undefined;
|
|
10
|
-
export declare const itemHitSelector = "[data-scene-item], [data-scene-nav-item]";
|
|
10
|
+
export declare const itemHitSelector = "[data-scene-item], [data-scene-nav-item], [data-scene-outlet-item]";
|
|
11
11
|
export declare function itemIdAt(target: EventTarget | null): string | undefined;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ApplicationStructure, type SceneElement, type ToolbarButton } from '@cratis/scene.model';
|
|
2
2
|
export interface ToolbarFinding {
|
|
3
3
|
code: string;
|
|
4
4
|
severity: 'error' | 'warning';
|
|
5
5
|
message: string;
|
|
6
6
|
button: string;
|
|
7
7
|
}
|
|
8
|
+
export declare function isToolbarElement(element: SceneElement): boolean;
|
|
9
|
+
export declare function toolbarButtonsOf(toolbar: SceneElement): ToolbarButton[];
|
|
8
10
|
export declare function toolbarDiagnostics(structure: ApplicationStructure, toolbar: SceneElement): ToolbarFinding[];
|
|
11
|
+
export declare function buttonDiagnostics(structure: ApplicationStructure, button: ToolbarButton): ToolbarFinding[];
|
|
@@ -13,10 +13,10 @@ export interface ApplicationTemplate {
|
|
|
13
13
|
sliceKinds?: SliceKind[];
|
|
14
14
|
/** `Root` when the template is made to be the application's shell, which its document says. */
|
|
15
15
|
role?: TemplateRole;
|
|
16
|
-
/** The
|
|
17
|
-
|
|
18
|
-
/** The
|
|
19
|
-
|
|
16
|
+
/** The slot of a shell that holds the screen when a screen does not say which one it fills. */
|
|
17
|
+
primarySlot?: string;
|
|
18
|
+
/** The slots a shell offers. */
|
|
19
|
+
slots?: string[];
|
|
20
20
|
/**
|
|
21
21
|
* The template as its saved Scene document declares it - the content it places and the arrangement it lays out - when the document is known. A shell that is
|
|
22
22
|
* drawn needs it: the metadata above says where a template may be used, only the template itself says what it draws.
|