@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
1
|
+
import { R as N, c as E, d as B, f as F, h as I, l as L, m as j, t as M, u as Q, z as R } from "./DataBindingSections-BeQxUfQM.js";
|
|
2
|
+
import { useState as k } from "react";
|
|
3
3
|
import { Fragment as S, jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
4
4
|
import { validateBinding as D } from "@cratis/scene.engine";
|
|
5
5
|
var c = /* @__PURE__ */ (function(r) {
|
|
@@ -15,8 +15,8 @@ function b(r, i, u, l) {
|
|
|
15
15
|
isStorable: s.every((m) => m.severity !== "error")
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
var V = (r) => r.origin.map((i) => i.name).join(" / "),
|
|
19
|
-
const t = l.properties.query, [g, y] =
|
|
18
|
+
var V = (r) => r.origin.map((i) => i.name).join(" / "), z = ({ 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
20
|
if (!e) {
|
|
21
21
|
y(void 0), m(void 0);
|
|
22
22
|
return;
|
|
@@ -37,7 +37,7 @@ var V = (r) => r.origin.map((i) => i.name).join(" / "), T = ({ property: r, cand
|
|
|
37
37
|
value: n?.queryId ?? "",
|
|
38
38
|
onChange: (e) => {
|
|
39
39
|
const a = i.find((f) => f.id === e.target.value);
|
|
40
|
-
v(a ?
|
|
40
|
+
v(a ? E(a) : void 0);
|
|
41
41
|
},
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ o("option", {
|
|
@@ -66,8 +66,8 @@ var V = (r) => r.origin.map((i) => i.name).join(" / "), T = ({ property: r, cand
|
|
|
66
66
|
n && p && /* @__PURE__ */ d(S, { children: [p.parameters.length > 0 && /* @__PURE__ */ d("div", {
|
|
67
67
|
className: "studio-editor-query__group",
|
|
68
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:
|
|
70
|
-
onChange: (a) => v(
|
|
69
|
+
value: j(n, e),
|
|
70
|
+
onChange: (a) => v(F(n, e.name, a.target.value)),
|
|
71
71
|
children: [/* @__PURE__ */ o("option", {
|
|
72
72
|
value: "",
|
|
73
73
|
children: t.noSource
|
|
@@ -82,8 +82,8 @@ var V = (r) => r.origin.map((i) => i.name).join(" / "), T = ({ property: r, cand
|
|
|
82
82
|
className: "studio-editor-query__column",
|
|
83
83
|
children: [/* @__PURE__ */ o("input", {
|
|
84
84
|
type: "checkbox",
|
|
85
|
-
checked:
|
|
86
|
-
onChange: (a) => v(a.target.checked ?
|
|
85
|
+
checked: L(n, e),
|
|
86
|
+
onChange: (a) => v(a.target.checked ? B(n, e.name) : I(n, e.name))
|
|
87
87
|
}), /* @__PURE__ */ o("span", { children: t.showColumn(e.name) })]
|
|
88
88
|
}, e.name))]
|
|
89
89
|
})] }),
|
|
@@ -91,16 +91,16 @@ var V = (r) => r.origin.map((i) => i.name).join(" / "), T = ({ property: r, cand
|
|
|
91
91
|
className: "studio-editor-query__preview",
|
|
92
92
|
role: "status",
|
|
93
93
|
"data-state": q,
|
|
94
|
-
children:
|
|
94
|
+
children: T(q, t.preview)
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */ o(
|
|
96
|
+
/* @__PURE__ */ o(N, {
|
|
97
97
|
diagnostics: _,
|
|
98
98
|
label: l.properties.diagnostics
|
|
99
99
|
})
|
|
100
100
|
]
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
function T(r, i) {
|
|
104
104
|
switch (r) {
|
|
105
105
|
case c.NoQuery:
|
|
106
106
|
return i.noQuery;
|
|
@@ -120,14 +120,14 @@ var J = ({ value: r, onChange: i, context: u, disabled: l }) => {
|
|
|
120
120
|
const { session: s } = u;
|
|
121
121
|
if (!s) return null;
|
|
122
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(
|
|
123
|
+
return /* @__PURE__ */ d(S, { children: [/* @__PURE__ */ o(z, {
|
|
124
124
|
property: s.property,
|
|
125
125
|
candidates: u.lookups.queryCandidates,
|
|
126
126
|
scope: s.bindingScope,
|
|
127
127
|
strings: s.screenStrings,
|
|
128
128
|
disabled: l === !0,
|
|
129
129
|
onChange: i
|
|
130
|
-
}), m && t && /* @__PURE__ */ o(
|
|
130
|
+
}), m && t && /* @__PURE__ */ o(M, {
|
|
131
131
|
controller: s.controller,
|
|
132
132
|
environment: s.environment,
|
|
133
133
|
strings: s.screenStrings,
|
|
@@ -135,7 +135,7 @@ var J = ({ value: r, onChange: i, context: u, disabled: l }) => {
|
|
|
135
135
|
candidate: t,
|
|
136
136
|
disabled: l === !0,
|
|
137
137
|
onChange: (g, y, h) => {
|
|
138
|
-
const n = h === "" ? s.bindingScope :
|
|
138
|
+
const n = h === "" ? s.bindingScope : R({
|
|
139
139
|
...s.bindingScope.types,
|
|
140
140
|
[h]: y.type
|
|
141
141
|
});
|
|
@@ -76,6 +76,7 @@ export interface DesignModeStrings {
|
|
|
76
76
|
duplicated: (label: string) => string;
|
|
77
77
|
removed: (label: string) => string;
|
|
78
78
|
refused: (reason: string) => string;
|
|
79
|
+
nothingToAdd: string;
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
export declare const defaultDesignModeStrings: DesignModeStrings;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DesignModeItem } from './designModeTypes';
|
|
2
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
3
|
+
export declare const actionAnnouncement: (strings: DesignModeStrings, actionId: string, item: DesignModeItem) => string;
|
|
4
|
+
export declare const refusalReasonOf: (result: {
|
|
5
|
+
rejected?: string;
|
|
6
|
+
diagnostics?: readonly {
|
|
7
|
+
message: string;
|
|
8
|
+
}[];
|
|
9
|
+
}, label: string) => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface DesignModeFeedback {
|
|
2
|
+
announcement: string;
|
|
3
|
+
notice: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const refusedFeedback: (message: string) => DesignModeFeedback;
|
|
6
|
+
export interface AddOffer {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const addOfferOf: (label: string, readOnlyReason: string | undefined) => AddOffer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DesignModePlan } from './designModeTypes';
|
|
2
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
3
|
+
import type { RegionSourceInputs } from './Navigation/regionItemSource';
|
|
4
|
+
export interface SelectionTarget {
|
|
5
|
+
select: (elementId: string | undefined) => void;
|
|
6
|
+
selectItem: (componentId: string | undefined, itemId: string | undefined) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function applyPlanSelection(target: SelectionTarget, select: DesignModePlan['select'], componentId: string | undefined): void;
|
|
9
|
+
export declare function regionStringsOf(strings: DesignModeStrings): RegionSourceInputs['strings'];
|
|
@@ -21,6 +21,8 @@ export type ElementMeasurer = (elementId: string) => {
|
|
|
21
21
|
height: number;
|
|
22
22
|
} | undefined;
|
|
23
23
|
export interface ScreenEditorController {
|
|
24
|
+
opensOverPage: boolean;
|
|
25
|
+
readOnlyReason?: string;
|
|
24
26
|
navigation: NavigationModel;
|
|
25
27
|
structure: ApplicationStructure;
|
|
26
28
|
navigationModule: string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Behavior, DestinationReference, DialogTemplate, Form, SceneDocument, ScreenTemplate, Slot, TemplateMetadata } from '@cratis/scene.model';
|
|
2
|
+
import { type ScreenEditSession } from '../Session/EditSession';
|
|
3
|
+
import type { ScreenEditorEnvironment } from './ScreenEditorHost';
|
|
4
|
+
export declare const useDocumentSetters: (commit: (change: (current: ScreenEditSession) => ScreenEditSession) => unknown, environment: ScreenEditorEnvironment) => {
|
|
5
|
+
setScreenForms: (forms: Form[], label: string) => void;
|
|
6
|
+
changeDocument: (change: (document: SceneDocument) => SceneDocument, label: string) => {
|
|
7
|
+
applied: boolean;
|
|
8
|
+
};
|
|
9
|
+
setScreenTemplateSlots: (templateName: string, slots: Slot[], label: string) => void;
|
|
10
|
+
setScreenTemplateMetadata: (templateName: string, metadata: TemplateMetadata | undefined, label: string) => void;
|
|
11
|
+
setDialogTemplates: (dialogTemplates: DialogTemplate[], label: string) => void;
|
|
12
|
+
setCollectionItemDestination: (componentId: string, path: string, itemId: string, destination: DestinationReference | undefined, label: string) => void;
|
|
13
|
+
setScreenTemplate: (template: ScreenTemplate | undefined, label: string) => void;
|
|
14
|
+
setElementBehaviors: (elementId: string, behaviors: Behavior[] | undefined, label: string) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SceneEdit } from '@cratis/scene.model';
|
|
2
|
+
import type { EditingContext } from '@cratis/scene.engine';
|
|
3
|
+
import { type ScreenEditSession } from '../Session/EditSession';
|
|
4
|
+
import type { SessionCell } from '../Session/SessionCell';
|
|
5
|
+
export declare const useEditApplication: (cell: SessionCell, commit: (change: (current: ScreenEditSession) => ScreenEditSession) => ScreenEditSession, context: EditingContext) => {
|
|
6
|
+
tryApply: (edit: SceneEdit, label: string) => {
|
|
7
|
+
applied: boolean;
|
|
8
|
+
diagnostics: import("@cratis/scene.model").SceneDiagnostic[];
|
|
9
|
+
};
|
|
10
|
+
apply: (edit: SceneEdit, label: string) => void;
|
|
11
|
+
applyAll: (edits: SceneEdit[], label: string) => {
|
|
12
|
+
applied: boolean;
|
|
13
|
+
diagnostics: import("@cratis/scene.model").SceneDiagnostic[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import type { EditingContext } from '@cratis/scene.engine';
|
|
3
|
+
import type { ScreenEditSession } from '../Session/EditSession';
|
|
4
|
+
import type { ScreenEditorEnvironment } from './ScreenEditorHost';
|
|
5
|
+
export declare const useEditingScene: (document: ScreenEditSession['document'], authoringTemplate: string | undefined, environment: ScreenEditorEnvironment, opensOverPage?: boolean) => {
|
|
6
|
+
context: EditingContext;
|
|
7
|
+
composition: import("../Templates/composeEditorScreen").EditorComposition;
|
|
8
|
+
ownershipOf: import("../Structure/OwnershipResolver").OwnershipResolver;
|
|
9
|
+
adapter: import("../Structure/StructureTreeAdapter").StructureTreeAdapter<SceneElement>;
|
|
10
|
+
authored: import("@cratis/scene.model").Panel | undefined;
|
|
11
|
+
dropRegions: import("../DropRegions/DropRegion").DropRegion[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type NavigationEdit } from '@cratis/scene.engine';
|
|
2
|
+
import { type ScreenEditSession } from '../Session/EditSession';
|
|
3
|
+
import type { SessionCell } from '../Session/SessionCell';
|
|
4
|
+
import type { ScreenEditorEnvironment } from './ScreenEditorHost';
|
|
5
|
+
export declare const useNavigationEditing: (document: ScreenEditSession['document'], cell: SessionCell, commit: (change: (current: ScreenEditSession) => ScreenEditSession) => ScreenEditSession, environment: ScreenEditorEnvironment) => {
|
|
6
|
+
navigation: import("@cratis/scene.model").NavigationModel;
|
|
7
|
+
structure: import("@cratis/scene.model").ApplicationStructure;
|
|
8
|
+
navigationModule: string | undefined;
|
|
9
|
+
setNavigationModule: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
10
|
+
applyNavigationEdits: (edits: NavigationEdit[], label: string) => {
|
|
11
|
+
applied: boolean;
|
|
12
|
+
rejected: string | undefined;
|
|
13
|
+
} | {
|
|
14
|
+
rejected?: undefined;
|
|
15
|
+
applied: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SceneEdit, SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import { type CanvasPlacement } from '../Document/placeOnCanvas';
|
|
3
|
+
import { type BoxMeasure } from '../Document/canvasMoveEdits';
|
|
4
|
+
import type { StructureTreeAdapter } from '../Structure/StructureTreeAdapter';
|
|
5
|
+
import { StructureEditRejection } from '../Structure/StructureEditRejection';
|
|
6
|
+
import type { SessionCell } from '../Session/SessionCell';
|
|
7
|
+
import type { ScreenEditorController } from './ScreenEditorController';
|
|
8
|
+
import type { ComponentInsertedListener } from './useScreenEditor';
|
|
9
|
+
type Applied = {
|
|
10
|
+
applied: boolean;
|
|
11
|
+
};
|
|
12
|
+
type MoveEdit = Parameters<ScreenEditorController['move']>[0];
|
|
13
|
+
export interface StructureOperationsInput {
|
|
14
|
+
cell: SessionCell;
|
|
15
|
+
composition: {
|
|
16
|
+
roots: SceneElement[];
|
|
17
|
+
entry?: string;
|
|
18
|
+
};
|
|
19
|
+
authored: {
|
|
20
|
+
id?: string;
|
|
21
|
+
} | undefined;
|
|
22
|
+
adapter: StructureTreeAdapter<SceneElement>;
|
|
23
|
+
authoringTemplate: string | undefined;
|
|
24
|
+
measureBox: BoxMeasure;
|
|
25
|
+
tryApply: (edit: SceneEdit, label: string) => Applied;
|
|
26
|
+
applyAll: (edits: SceneEdit[], label: string) => Applied;
|
|
27
|
+
setSelectedId: (change: string | undefined | ((current: string | undefined) => string | undefined)) => void;
|
|
28
|
+
onInserted?: ComponentInsertedListener;
|
|
29
|
+
}
|
|
30
|
+
export declare const useStructureOperations: (input: StructureOperationsInput) => {
|
|
31
|
+
move: (edit: MoveEdit, at?: CanvasPlacement) => StructureEditRejection | undefined;
|
|
32
|
+
insertElement: (element: SceneElement, parentId: string | undefined, index: number | undefined, label: string, at?: CanvasPlacement) => void;
|
|
33
|
+
remove: (elementId: string) => void;
|
|
34
|
+
canRemove: (elementId: string) => boolean;
|
|
35
|
+
validateMove: (edit: Parameters<ScreenEditorController['validateMove']>[0]) => StructureEditRejection | undefined;
|
|
36
|
+
insertComponent: (componentName: string, parentId: string | undefined, index: number | undefined, at?: CanvasPlacement) => void;
|
|
37
|
+
insertLayout: (item: Parameters<ScreenEditorController['insertLayout']>[0], parentId: string | undefined, index: number | undefined, at?: CanvasPlacement) => void;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
2
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
3
|
+
import type { PlacementEnvironment } from '../Placement/hookPlacement';
|
|
4
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
5
|
+
export interface ActionPropertiesProps {
|
|
6
|
+
controller: ScreenEditorController;
|
|
7
|
+
environment: ScreenEditorEnvironment;
|
|
8
|
+
strings: ScreenEditorStrings;
|
|
9
|
+
elementId: string;
|
|
10
|
+
properties: Record<string, unknown> | undefined;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
placement?: PlacementEnvironment;
|
|
13
|
+
}
|
|
14
|
+
export declare const ActionProperties: ({ controller, environment, strings, elementId, properties, disabled, placement }: ActionPropertiesProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
2
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
3
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
|
+
export interface CommandFormPropertiesProps {
|
|
5
|
+
elementId: string;
|
|
6
|
+
properties: Record<string, unknown> | undefined;
|
|
7
|
+
controller: ScreenEditorController;
|
|
8
|
+
environment: ScreenEditorEnvironment;
|
|
9
|
+
strings: ScreenEditorStrings;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const CommandFormProperties: ({ elementId, properties, controller, environment, strings, disabled }: CommandFormPropertiesProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ScreenOutlets } from '../DesignMode/Outlets/screenOutlets';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
4
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
5
|
+
import type { Ownership } from '../Structure/Ownership';
|
|
6
|
+
export interface ComponentPropertiesProps {
|
|
7
|
+
controller: ScreenEditorController;
|
|
8
|
+
environment: ScreenEditorEnvironment;
|
|
9
|
+
strings: ScreenEditorStrings;
|
|
10
|
+
ownership: Ownership | undefined;
|
|
11
|
+
authoringTemplate?: string;
|
|
12
|
+
selectedId: string;
|
|
13
|
+
selection: NonNullable<ScreenEditorController['selection']>;
|
|
14
|
+
inspection: NonNullable<ScreenEditorController['inspection']>;
|
|
15
|
+
screenOutlets: ScreenOutlets;
|
|
16
|
+
}
|
|
17
|
+
export declare const ComponentProperties: ({ controller, environment, strings, ownership, authoringTemplate, selectedId, selection, inspection, screenOutlets }: ComponentPropertiesProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentDescriptor, ExternalComponent, InspectedProperty } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
4
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
5
|
+
export interface ExternalComponentSectionsProps {
|
|
6
|
+
component: ExternalComponent;
|
|
7
|
+
descriptor: ComponentDescriptor;
|
|
8
|
+
properties: InspectedProperty[];
|
|
9
|
+
controller: ScreenEditorController;
|
|
10
|
+
environment: ScreenEditorEnvironment;
|
|
11
|
+
strings: ScreenEditorStrings;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const ExternalComponentSections: ({ component, descriptor, properties, controller, environment, strings, disabled }: ExternalComponentSectionsProps) => import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ChangeLayoutTypeEdit, NodeInspection } from '@cratis/scene.model';
|
|
2
2
|
import type { SceneOrderedItem } from '../Collections/orderedItems';
|
|
3
3
|
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
4
4
|
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { InspectedProperty, SceneDiagnostic } from '@cratis/scene.model';
|
|
2
|
+
import { PropertyEditorHost } from '../PropertyEditors/Registry/PropertyEditorHost';
|
|
3
|
+
import { withSession, type EditorContextInputs } from '../PropertyEditors/Registry/createEditorContext';
|
|
4
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
5
|
+
type EditorContext = Parameters<typeof withSession>[0];
|
|
6
|
+
type Registry = Parameters<typeof PropertyEditorHost>[0]['registry'];
|
|
7
|
+
export interface PropertyGroupsProps {
|
|
8
|
+
groups: {
|
|
9
|
+
name: string;
|
|
10
|
+
properties: InspectedProperty[];
|
|
11
|
+
}[];
|
|
12
|
+
selectedId: string;
|
|
13
|
+
registry: Registry;
|
|
14
|
+
baseContext: EditorContext;
|
|
15
|
+
editorInputs: EditorContextInputs;
|
|
16
|
+
diagnostics: SceneDiagnostic[];
|
|
17
|
+
onChange: ScreenEditorController['setProperty'];
|
|
18
|
+
}
|
|
19
|
+
export declare const PropertyGroups: ({ groups, selectedId, registry, baseContext, editorInputs, diagnostics, onChange }: PropertyGroupsProps) => import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -24,6 +24,8 @@ export interface ScreenEditorStrings {
|
|
|
24
24
|
showApplicationShell: string;
|
|
25
25
|
hideApplicationShell: string;
|
|
26
26
|
showTemplate: string;
|
|
27
|
+
opensAsDialog: string;
|
|
28
|
+
opensAsDrawer: string;
|
|
27
29
|
hideTemplate: string;
|
|
28
30
|
shellPeeking: (name: string) => string;
|
|
29
31
|
shellPeekBack: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
2
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
3
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
|
+
export interface ScreenPropertiesProps {
|
|
5
|
+
controller: ScreenEditorController;
|
|
6
|
+
environment: ScreenEditorEnvironment;
|
|
7
|
+
strings: ScreenEditorStrings;
|
|
8
|
+
authoringTemplate?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ScreenProperties: ({ controller, environment, strings, authoringTemplate }: ScreenPropertiesProps) => import("react").JSX.Element;
|
|
@@ -8,10 +8,11 @@ export interface ViewportControlsProps {
|
|
|
8
8
|
shown: boolean;
|
|
9
9
|
toggle: () => void;
|
|
10
10
|
};
|
|
11
|
+
opensAs?: string;
|
|
11
12
|
template?: {
|
|
12
13
|
shown: boolean;
|
|
13
14
|
toggle: () => void;
|
|
14
15
|
};
|
|
15
16
|
onResize: (size: ViewportSize) => void;
|
|
16
17
|
}
|
|
17
|
-
export declare const ViewportControls: ({ windowSize, available, strings, shell, template, onResize }: ViewportControlsProps) => import("react").JSX.Element;
|
|
18
|
+
export declare const ViewportControls: ({ windowSize, available, strings, shell, opensAs, template, onResize }: ViewportControlsProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BindingMode, BindingSourceKind, PropertyValueType, type BindingExpression } from '@cratis/scene.model';
|
|
2
|
+
import type { BindingSourceInventory } from '../Binding/bindingSources';
|
|
3
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
|
+
export type BindingStrings = ScreenEditorStrings['properties']['binding'];
|
|
5
|
+
export declare enum LiteralEditorKind {
|
|
6
|
+
String = "string",
|
|
7
|
+
Number = "number",
|
|
8
|
+
Boolean = "boolean",
|
|
9
|
+
Null = "null",
|
|
10
|
+
Json = "json"
|
|
11
|
+
}
|
|
12
|
+
export interface SourceChoice {
|
|
13
|
+
kind: BindingSourceKind;
|
|
14
|
+
label: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function kindOf(binding: BindingExpression): BindingSourceKind;
|
|
19
|
+
export declare function bindingShapedValue(value: unknown): unknown | undefined;
|
|
20
|
+
export declare function modesFor(binding: BindingExpression): BindingMode[];
|
|
21
|
+
export declare function normalize(binding: BindingExpression): BindingExpression;
|
|
22
|
+
export declare function forKind(kind: BindingSourceKind, binding: BindingExpression): Partial<BindingExpression>;
|
|
23
|
+
export declare function literalKindFor(value: unknown, targetType: PropertyValueType): LiteralEditorKind;
|
|
24
|
+
export declare function literalSignature(value: unknown, targetType: PropertyValueType): string;
|
|
25
|
+
export declare function defaultLiteralValue(kind: LiteralEditorKind): unknown;
|
|
26
|
+
export declare function sourceKindChoices(binding: BindingExpression, accepted: readonly BindingSourceKind[], sources: BindingSourceInventory, text: BindingStrings): SourceChoice[];
|
|
@@ -7,5 +7,6 @@ export interface PlayScreenViewProps {
|
|
|
7
7
|
runtime: ScreenEditorRuntime;
|
|
8
8
|
resolveBinding: BindingResolver;
|
|
9
9
|
registry?: ComponentRegistry;
|
|
10
|
+
opensOverPage?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare const PlayScreenView: ({ document, runtime, resolveBinding, registry }: PlayScreenViewProps) => import("react").JSX.Element;
|
|
12
|
+
export declare const PlayScreenView: ({ document, runtime, resolveBinding, registry, opensOverPage }: PlayScreenViewProps) => import("react").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { EffectiveConfiguration, SceneDocument, SceneElement } from '@cratis/scene.model';
|
|
1
|
+
import type { DialogTemplate, EffectiveConfiguration, SceneDocument, SceneElement } from '@cratis/scene.model';
|
|
2
2
|
import { type DescriptorCatalog } from '@cratis/scene.engine';
|
|
3
|
+
import { type DialogFrameDescription } from '../Templates/dialogPresentation';
|
|
3
4
|
export interface PlayScreen {
|
|
4
5
|
element: SceneElement;
|
|
5
6
|
configuration?: EffectiveConfiguration;
|
|
7
|
+
dialog?: DialogFrameDescription;
|
|
6
8
|
}
|
|
7
|
-
export declare function composePlayScreen(document: SceneDocument, catalog: DescriptorCatalog): PlayScreen;
|
|
9
|
+
export declare function composePlayScreen(document: SceneDocument, catalog: DescriptorCatalog, knownDialogTemplates?: readonly DialogTemplate[], pageTemplateNames?: readonly string[], opensOverPage?: boolean): PlayScreen;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { SceneDocument } from '@cratis/scene.model';
|
|
1
|
+
import type { DialogTemplate, SceneDocument } from '@cratis/scene.model';
|
|
2
2
|
export declare enum ShellSubject {
|
|
3
3
|
Screen = "screen",
|
|
4
|
+
DialogScreen = "dialogScreen",
|
|
4
5
|
ScreenTemplate = "screenTemplate",
|
|
5
6
|
DialogTemplate = "dialogTemplate",
|
|
6
7
|
TheShell = "theShell"
|
|
7
8
|
}
|
|
8
|
-
export declare function shellSubjectOf(document: SceneDocument, authoringTemplate: string | undefined, shellName: string): ShellSubject;
|
|
9
|
+
export declare function shellSubjectOf(document: SceneDocument, authoringTemplate: string | undefined, shellName: string, knownDialogTemplates?: readonly DialogTemplate[], pageTemplateNames?: readonly string[], opensOverPage?: boolean): ShellSubject;
|
|
9
10
|
export declare const shellShownByDefault: (subject: ShellSubject) => boolean;
|
|
10
11
|
export declare const templateShownByDefault: (_subject: ShellSubject) => boolean;
|
|
11
12
|
export declare const templateCanFrame: (subject: ShellSubject) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DestinationReference, SceneDocument } from '@cratis/scene.model';
|
|
2
|
+
import { type DialogFrameDescription } from '../Templates/dialogPresentation';
|
|
2
3
|
import type { ScreenEditorRuntime } from '../Runtime/screenEditorRuntime';
|
|
3
4
|
import { type ShellFrame } from './frameInShell';
|
|
4
5
|
import { type ShellPreference } from './shellVisibility';
|
|
@@ -11,10 +12,11 @@ export interface ShellState {
|
|
|
11
12
|
shown: boolean;
|
|
12
13
|
toggle(): void;
|
|
13
14
|
};
|
|
15
|
+
dialog?: DialogFrameDescription;
|
|
14
16
|
frame?: ShellFrame;
|
|
15
17
|
peeking?: DestinationReference;
|
|
16
18
|
peekingName: string;
|
|
17
19
|
navigate(destination: DestinationReference): void;
|
|
18
20
|
back(): void;
|
|
19
21
|
}
|
|
20
|
-
export declare function useShellFrame(document: SceneDocument, runtime: ScreenEditorRuntime, authoringTemplate: string | undefined, preference?: ShellPreference, hasTemplate?: boolean): ShellState;
|
|
22
|
+
export declare function useShellFrame(document: SceneDocument, runtime: ScreenEditorRuntime, authoringTemplate: string | undefined, preference?: ShellPreference, hasTemplate?: boolean, opensOverPage?: boolean): ShellState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BindingResolver } from '@cratis/scene.engine';
|
|
2
2
|
import { type EffectiveConfiguration } from '@cratis/scene.model';
|
|
3
3
|
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
4
4
|
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SelectionGripProps {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
elementId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
title: string;
|
|
7
|
+
onStart: (elementId: string) => void;
|
|
8
|
+
onEnd: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const SelectionGrip: ({ left, top, elementId, name, title, onStart, onEnd }: SelectionGripProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { DialogFrameDescription } from '../Templates/dialogPresentation';
|
|
3
|
+
export declare function dialogFrameAttributes(frame: DialogFrameDescription | undefined): {
|
|
4
|
+
'data-studio-dialog'?: string;
|
|
5
|
+
style: CSSProperties;
|
|
6
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SurfaceStrings } from './DesignTime/SurfaceStrings';
|
|
2
|
+
import type { DragFeedback } from './useSurfaceDrop';
|
|
3
|
+
export declare const selectedNameOf: (selection: object | undefined) => string;
|
|
4
|
+
export declare const dropAnnouncement: (feedback: DragFeedback | undefined, strings: Pick<SurfaceStrings, 'dropDenied' | 'dropTarget'>) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EffectiveConfiguration } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
4
|
+
import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
|
|
5
|
+
import type { ShellState } from '../ShellFrame/useShellFrame';
|
|
6
|
+
export declare const useEffectiveConfiguration: (given: EffectiveConfiguration | undefined, controller: ScreenEditorController) => EffectiveConfiguration | undefined;
|
|
7
|
+
export declare const useDrawnScreen: (controller: ScreenEditorController, environment: ScreenEditorEnvironment, shell: ShellState | undefined, editorStrings: ScreenEditorStrings | undefined) => import("@cratis/scene.model").SceneElement;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { KeyboardEvent, RefObject } from 'react';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ShellState } from '../ShellFrame/useShellFrame';
|
|
4
|
+
import type { useDesignMode } from '../DesignMode/useDesignMode';
|
|
5
|
+
export declare const useSurfaceKeys: (surface: RefObject<HTMLDivElement | null>, controller: ScreenEditorController, designMode: ReturnType<typeof useDesignMode>, shell: ShellState | undefined) => (event: KeyboardEvent) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type DialogTemplate, type Layout, type Outlet, type SceneDocument, type SceneElement, type ScreenTemplate } from '@cratis/scene.model';
|
|
2
2
|
export declare const dialogActionsChromeId = "dialog-actions-chrome";
|
|
3
3
|
export declare const defaultDialogTemplateName = "FormDialog";
|
|
4
|
-
export declare function screenFitsDialog(document: SceneDocument): boolean;
|
|
5
|
-
export declare function dialogTemplateOf(document: SceneDocument): DialogTemplate;
|
|
4
|
+
export declare function screenFitsDialog(document: SceneDocument, pageTemplateNames?: readonly string[], opensOverPage?: boolean, known?: readonly DialogTemplate[]): boolean;
|
|
5
|
+
export declare function dialogTemplateOf(document: SceneDocument, known?: readonly DialogTemplate[]): DialogTemplate;
|
|
6
6
|
export declare function dialogActionsOutletOf(template: DialogTemplate): Outlet | undefined;
|
|
7
|
-
export declare function showsDialogActions(document: SceneDocument, templates?: readonly ScreenTemplate[], layouts?: readonly Layout[]): boolean;
|
|
7
|
+
export declare function showsDialogActions(document: SceneDocument, templates?: readonly ScreenTemplate[], layouts?: readonly Layout[], opensOverPage?: boolean, known?: readonly DialogTemplate[]): boolean;
|
|
8
8
|
export declare function documentWithChrome(document: SceneDocument, chrome: readonly SceneElement[]): SceneDocument;
|
|
9
9
|
export declare function dialogActionsChrome(): SceneElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DialogTemplate, type SceneDocument, type Screen } from '@cratis/scene.model';
|
|
2
|
+
export declare enum DialogPresentation {
|
|
3
|
+
Dialog = "dialog",
|
|
4
|
+
Drawer = "drawer"
|
|
5
|
+
}
|
|
6
|
+
export interface DialogFrameDescription {
|
|
7
|
+
presentation: DialogPresentation;
|
|
8
|
+
template?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function dialogTemplatesIn(document: Pick<SceneDocument, 'dialogTemplates'>, known?: readonly DialogTemplate[]): DialogTemplate[];
|
|
12
|
+
export declare function screenPresentationOf(screen: Pick<Screen, 'fits' | 'screenTemplate'>, pageTemplateNames?: readonly string[], opensOverPage?: boolean, dialogTemplateNames?: readonly string[]): DialogPresentation | undefined;
|
|
13
|
+
export declare function dialogFrameOf(document: SceneDocument, known?: readonly DialogTemplate[], pageTemplateNames?: readonly string[], opensOverPage?: boolean): DialogFrameDescription | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScreenFit, type DialogTemplate, type SceneDocument, type Screen } from '@cratis/scene.model';
|
|
2
|
+
import type { ScenePackageBundle } from '@cratis/scene.react';
|
|
3
|
+
export declare function displayedFitsOf(screen: Pick<Screen, 'fits' | 'screenTemplate'> | undefined, pageTemplateNames?: readonly string[], opensOverPage?: boolean, dialogTemplateNames?: readonly string[]): readonly ScreenFit[];
|
|
4
|
+
export declare function dialogTemplateNamesOf(document: Pick<SceneDocument, 'dialogTemplates' | 'screenTemplates'> | undefined, known?: readonly Pick<DialogTemplate, 'name'>[]): string[];
|
|
5
|
+
export declare function pageTemplateNamesOf(document: Pick<SceneDocument, 'screenTemplates'> | undefined, bundles?: readonly Pick<ScenePackageBundle, 'screenTemplates'>[]): string[];
|
|
6
|
+
export declare function blueprintDialogTemplatesOf(bundles?: readonly Pick<ScenePackageBundle, 'dialogTemplates'>[]): DialogTemplate[];
|
|
@@ -11,5 +11,6 @@ export interface ScreenThumbnailProps {
|
|
|
11
11
|
openTitle?: string;
|
|
12
12
|
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
13
13
|
placeholder?: ReactNode;
|
|
14
|
+
opensOverPage?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare const ScreenThumbnail: ({ document, runtime, windowSize, width, title, openTitle, onClick, placeholder }: ScreenThumbnailProps) => import("react").JSX.Element;
|
|
16
|
+
export declare const ScreenThumbnail: ({ document, runtime, windowSize, width, title, openTitle, onClick, placeholder, opensOverPage }: ScreenThumbnailProps) => import("react").JSX.Element;
|