@cratis/event-models 0.137.2 → 0.138.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/screen-editor/ScreenEditor/Actions/ToolbarButtonClickKind.d.ts +6 -0
- package/dist/screen-editor/ScreenEditor/Actions/toolbarButtonClick.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/Destinations/DestinationProblemKind.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/Destinations/destinationProblems.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Destinations/destinationTargetsOf.d.ts +5 -0
- package/dist/screen-editor/ScreenEditor/Document/updateElementInDocument.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +5 -1
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWindow.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/Host/createScreenEditorEnvironment.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Inspector/DestinationReferenceFields.d.ts +4 -2
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +31 -0
- package/dist/screen-editor/ScreenEditor/Inspector/TemplateBrowser.d.ts +12 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ToolbarButtonClickEditor.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/Templates/TemplateInapplicability.d.ts +4 -0
- package/dist/screen-editor/ScreenEditor/Templates/chooseScreenTemplate.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Templates/templateBrowser.d.ts +21 -0
- package/dist/screen-editor/index.js +3231 -2772
- package/dist/screen-editor/screen-editor.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Behavior } from '@cratis/scene.model';
|
|
2
|
+
import { ToolbarButtonClickKind } from './ToolbarButtonClickKind';
|
|
3
|
+
export interface ToolbarButtonClick {
|
|
4
|
+
kind: ToolbarButtonClickKind;
|
|
5
|
+
target: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const toolbarButtonClickBehavior = "studio.toolbarButton.click";
|
|
8
|
+
export declare function readToolbarButtonClick(behaviors: readonly Behavior[] | undefined): ToolbarButtonClick;
|
|
9
|
+
export declare function withToolbarButtonClick(behaviors: readonly Behavior[] | undefined, click: ToolbarButtonClick): Behavior[] | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum DestinationProblemKind {
|
|
2
|
+
NoTarget = "noTarget",
|
|
3
|
+
UnknownScreen = "unknownScreen",
|
|
4
|
+
InvalidRoute = "invalidRoute",
|
|
5
|
+
UnknownOutlet = "unknownOutlet",
|
|
6
|
+
UnknownDialog = "unknownDialog",
|
|
7
|
+
UnknownSlice = "unknownSlice",
|
|
8
|
+
OutletKindWithoutOutlet = "outletKindWithoutOutlet",
|
|
9
|
+
DialogKindWithoutDialog = "dialogKindWithoutDialog",
|
|
10
|
+
ExternalKindWithoutRoute = "externalKindWithoutRoute"
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DestinationKind, type DestinationReference } from '@cratis/scene.model';
|
|
2
|
+
import { DestinationProblemKind } from './DestinationProblemKind';
|
|
3
|
+
export interface DestinationTargets {
|
|
4
|
+
screens: readonly string[];
|
|
5
|
+
outlets: readonly string[];
|
|
6
|
+
dialogTemplates: readonly string[];
|
|
7
|
+
slices: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function destinationProblems(destination: DestinationReference | undefined, targets: DestinationTargets): DestinationProblemKind[];
|
|
10
|
+
export declare function isValidRoute(route: string, kind?: DestinationKind): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SceneDocument } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
3
|
+
import type { DestinationTargets } from './destinationProblems';
|
|
4
|
+
export declare function destinationTargetsOf(environment: ScreenEditorEnvironment, document: SceneDocument): DestinationTargets;
|
|
5
|
+
export declare function unique(values: readonly string[]): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CanvasPlacement } from '../Document/placeOnCanvas';
|
|
2
|
-
import type { DestinationReference, DialogTemplate, Form, NodeInspection, Outlet, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import type { Behavior, DestinationReference, DialogTemplate, Form, NodeInspection, Outlet, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement, ScreenTemplate, TemplateMetadata } from '@cratis/scene.model';
|
|
3
3
|
import type { EditingContext } from '@cratis/scene.engine';
|
|
4
4
|
import type { Ownership } from '../Structure/Ownership';
|
|
5
5
|
import type { StructureEdit } from '../Structure/StructureEdit';
|
|
@@ -45,8 +45,12 @@ export interface ScreenEditorController {
|
|
|
45
45
|
setProperty: (property: NodeInspection['properties'][number], value: unknown) => void;
|
|
46
46
|
setScreenForms: (forms: Form[], label: string) => void;
|
|
47
47
|
setScreenTemplateOutlets: (templateName: string, outlets: Outlet[], label: string) => void;
|
|
48
|
+
setScreenTemplateMetadata: (templateName: string, metadata: TemplateMetadata | undefined, label: string) => void;
|
|
48
49
|
setDialogTemplates: (templates: DialogTemplate[], label: string) => void;
|
|
49
50
|
setCollectionItemDestination: (componentId: string, path: string, itemId: string, destination: DestinationReference | undefined, label: string) => void;
|
|
51
|
+
setElementBehaviors: (elementId: string, behaviors: Behavior[] | undefined, label: string) => void;
|
|
52
|
+
setScreenTemplate: (template: ScreenTemplate | undefined, label: string) => void;
|
|
53
|
+
markSaved: () => void;
|
|
50
54
|
undo: () => void;
|
|
51
55
|
redo: () => void;
|
|
52
56
|
canUndo: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SceneDocument } from '@cratis/scene.model';
|
|
1
|
+
import type { SceneDocument, TemplateScope } from '@cratis/scene.model';
|
|
2
2
|
import type { QueryCandidate } from '@cratis/scene.model';
|
|
3
3
|
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
4
4
|
import type { ScreenEditorRuntime } from '../Runtime/screenEditorRuntime';
|
|
@@ -23,6 +23,7 @@ export interface ScreenEditorEnvironment {
|
|
|
23
23
|
availableSources: Record<string, string>;
|
|
24
24
|
richText?: QuillLoader;
|
|
25
25
|
fileUpload?: ScreenEditorFileUpload;
|
|
26
|
+
templateScope?: TemplateScope;
|
|
26
27
|
}
|
|
27
28
|
export interface ScreenEditorResult {
|
|
28
29
|
document: SceneDocument;
|
|
@@ -24,5 +24,7 @@ export interface ScreenEditorWindowProps {
|
|
|
24
24
|
window: ScreenEditorWindowState;
|
|
25
25
|
deviceFrame?: boolean;
|
|
26
26
|
saveFailure?: string;
|
|
27
|
+
onSave?: () => void;
|
|
28
|
+
isSaving?: boolean;
|
|
27
29
|
}
|
|
28
|
-
export declare const ScreenEditorWindow: ({ controller, environment, strings, window: state, deviceFrame, saveFailure }: ScreenEditorWindowProps) => import("react").JSX.Element;
|
|
30
|
+
export declare const ScreenEditorWindow: ({ controller, environment, strings, window: state, deviceFrame, saveFailure, onSave, isSaving }: ScreenEditorWindowProps) => import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
2
|
+
import type { TemplateScope } from '@cratis/scene.model';
|
|
2
3
|
import type { ScreenEditorRuntime } from '../Runtime/screenEditorRuntime';
|
|
3
4
|
import type { QuillLoader } from '@cratis/scene.primereact';
|
|
4
5
|
import type { StateChangeSlice } from '../Actions/StateChangeSlice';
|
|
@@ -12,5 +13,6 @@ export interface ScreenEditorEnvironmentSource {
|
|
|
12
13
|
destinations?: readonly ConfigurationDestination[];
|
|
13
14
|
richText?: QuillLoader | false;
|
|
14
15
|
fileUpload?: ScreenEditorFileUpload;
|
|
16
|
+
templateScope?: TemplateScope;
|
|
15
17
|
}
|
|
16
18
|
export declare function createScreenEditorEnvironment(source: ScreenEditorEnvironmentSource): ScreenEditorEnvironment;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DestinationReference } from '@cratis/scene.model';
|
|
2
|
+
import type { DestinationProblemKind } from '../Destinations/DestinationProblemKind';
|
|
2
3
|
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
3
4
|
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
5
|
export interface DestinationReferenceFieldsProps {
|
|
@@ -8,8 +9,9 @@ export interface DestinationReferenceFieldsProps {
|
|
|
8
9
|
destinations: readonly ConfigurationDestination[];
|
|
9
10
|
outlets: readonly string[];
|
|
10
11
|
dialogTemplates: readonly string[];
|
|
12
|
+
problems?: readonly DestinationProblemKind[];
|
|
11
13
|
disabled: boolean;
|
|
12
14
|
strings: ScreenEditorStrings['properties']['destination'];
|
|
13
15
|
onChange: (destination: DestinationReference | undefined) => void;
|
|
14
16
|
}
|
|
15
|
-
export declare const DestinationReferenceFields: ({ id, label, value, destinations, outlets, dialogTemplates, disabled, strings, onChange }: DestinationReferenceFieldsProps) => import("react").JSX.Element;
|
|
17
|
+
export declare const DestinationReferenceFields: ({ id, label, value, destinations, outlets, dialogTemplates, problems, disabled, strings, onChange }: DestinationReferenceFieldsProps) => import("react").JSX.Element;
|
|
@@ -5,6 +5,8 @@ import type { Ownership } from '../Structure/Ownership';
|
|
|
5
5
|
import type { SceneDocumentProblem } from '../Document/readSceneDocument';
|
|
6
6
|
import type { StructureEditRejection } from '../Structure/StructureEditRejection';
|
|
7
7
|
import type { SurfaceStrings } from '../Surface/DesignTime/SurfaceStrings';
|
|
8
|
+
import type { DestinationProblemKind } from '../Destinations/DestinationProblemKind';
|
|
9
|
+
import type { TemplateInapplicability } from '../Templates/TemplateInapplicability';
|
|
8
10
|
export interface ScreenEditorStrings {
|
|
9
11
|
inspectorTitle: string;
|
|
10
12
|
windowLabel: string;
|
|
@@ -42,6 +44,9 @@ export interface ScreenEditorStrings {
|
|
|
42
44
|
closeDrawer: string;
|
|
43
45
|
deleteElement: string;
|
|
44
46
|
saveRefused: string;
|
|
47
|
+
save: string;
|
|
48
|
+
unsavedChanges: string;
|
|
49
|
+
allChangesSaved: string;
|
|
45
50
|
properties: {
|
|
46
51
|
diagnostics: string;
|
|
47
52
|
noProperties: string;
|
|
@@ -69,6 +74,11 @@ export interface ScreenEditorStrings {
|
|
|
69
74
|
scope: string;
|
|
70
75
|
anyScope: string;
|
|
71
76
|
missing: (template: string) => string;
|
|
77
|
+
search: string;
|
|
78
|
+
noMatches: string;
|
|
79
|
+
uncategorized: string;
|
|
80
|
+
provenance: (packageName: string) => string;
|
|
81
|
+
inapplicable: Record<TemplateInapplicability, string>;
|
|
72
82
|
};
|
|
73
83
|
outlets: {
|
|
74
84
|
label: string;
|
|
@@ -91,6 +101,27 @@ export interface ScreenEditorStrings {
|
|
|
91
101
|
outlet: string;
|
|
92
102
|
dialog: string;
|
|
93
103
|
clear: string;
|
|
104
|
+
kind: string;
|
|
105
|
+
kinds: {
|
|
106
|
+
default: string;
|
|
107
|
+
outlet: string;
|
|
108
|
+
dialog: string;
|
|
109
|
+
external: string;
|
|
110
|
+
};
|
|
111
|
+
problems: Record<DestinationProblemKind, string>;
|
|
112
|
+
};
|
|
113
|
+
toolbarButton: {
|
|
114
|
+
label: string;
|
|
115
|
+
onClick: string;
|
|
116
|
+
kinds: {
|
|
117
|
+
none: string;
|
|
118
|
+
navigate: string;
|
|
119
|
+
openDialog: string;
|
|
120
|
+
executeCommand: string;
|
|
121
|
+
};
|
|
122
|
+
target: string;
|
|
123
|
+
chooseTarget: string;
|
|
124
|
+
missingTarget: (target: string) => string;
|
|
94
125
|
};
|
|
95
126
|
dialogTemplates: {
|
|
96
127
|
label: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TemplateScope } from '@cratis/scene.model';
|
|
2
|
+
import { type TemplateBrowserPackage } from '../Templates/templateBrowser';
|
|
3
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
|
+
export interface TemplateBrowserProps {
|
|
5
|
+
packages: readonly TemplateBrowserPackage[];
|
|
6
|
+
scope: TemplateScope | undefined;
|
|
7
|
+
selected: string | undefined;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
strings: ScreenEditorStrings['properties']['templates'];
|
|
10
|
+
onSelect: (template: string | undefined) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const TemplateBrowser: ({ packages, scope, selected, disabled, strings, onSelect }: TemplateBrowserProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Behavior } from '@cratis/scene.model';
|
|
2
|
+
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
3
|
+
import type { StateChangeSlice } from '../Actions/StateChangeSlice';
|
|
4
|
+
import type { DestinationTargets } from '../Destinations/destinationProblems';
|
|
5
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
6
|
+
export interface ToolbarButtonClickEditorProps {
|
|
7
|
+
behaviors: Behavior[] | undefined;
|
|
8
|
+
targets: DestinationTargets;
|
|
9
|
+
destinations: readonly ConfigurationDestination[];
|
|
10
|
+
slices: readonly StateChangeSlice[];
|
|
11
|
+
strings: ScreenEditorStrings['properties']['toolbarButton'];
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
onChange: (behaviors: Behavior[] | undefined) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const ToolbarButtonClickEditor: ({ behaviors, targets, destinations, slices, strings, disabled, onChange }: ToolbarButtonClickEditorProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TemplateScope, type ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
import { TemplateInapplicability } from './TemplateInapplicability';
|
|
3
|
+
export declare const applicationShellType = "ApplicationShell";
|
|
4
|
+
export interface TemplateBrowserPackage {
|
|
5
|
+
manifest: {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
screenTemplates?: readonly ScreenTemplate[];
|
|
9
|
+
}
|
|
10
|
+
export interface TemplateBrowserEntry {
|
|
11
|
+
template: ScreenTemplate;
|
|
12
|
+
packageName: string;
|
|
13
|
+
label: string;
|
|
14
|
+
inapplicable?: TemplateInapplicability;
|
|
15
|
+
}
|
|
16
|
+
export interface TemplateBrowserCategory {
|
|
17
|
+
name: string;
|
|
18
|
+
entries: TemplateBrowserEntry[];
|
|
19
|
+
}
|
|
20
|
+
export declare function browseTemplates(packages: readonly TemplateBrowserPackage[], scope: TemplateScope | undefined, search: string): TemplateBrowserCategory[];
|
|
21
|
+
export declare function inapplicabilityOf(template: ScreenTemplate, scope: TemplateScope | undefined): TemplateInapplicability | undefined;
|