@cratis/event-models 0.180.0 → 0.182.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/CascadeMenu/CascadeEntry.d.ts +44 -0
- package/dist/screen-editor/CascadeMenu/CascadeEntryKind.d.ts +15 -0
- package/dist/screen-editor/CascadeMenu/CascadeFilter.d.ts +9 -0
- package/dist/screen-editor/CascadeMenu/CascadeMenu.d.ts +25 -0
- package/dist/screen-editor/CascadeMenu/CascadePanel.d.ts +26 -0
- package/dist/screen-editor/CascadeMenu/OpenSubmenu.d.ts +8 -0
- package/dist/screen-editor/CascadeMenu/cascadeNavigation.d.ts +27 -0
- package/dist/screen-editor/CascadeMenu/index.d.ts +6 -0
- package/dist/screen-editor/CascadeMenu/keepInputInMenu.d.ts +18 -0
- package/dist/screen-editor/CascadeMenu/placeCascadePanel.d.ts +37 -0
- package/dist/screen-editor/{ColumnListEditor-Cku6GGLp.js → ColumnListEditor-BHLrr4WK.js} +1 -1
- package/dist/screen-editor/{FieldEditor-SquvComm.js → FieldEditor-4a_4uQit.js} +1 -1
- package/dist/screen-editor/{FieldListEditor-CNxskXPf.js → FieldListEditor-RGb59BLM.js} +1 -1
- package/dist/screen-editor/NavigationItemTargetEditor-C3epn45p.js +72 -0
- package/dist/screen-editor/{NavigationTargetEditor-DGnW5pVF.js → NavigationTargetEditor-BZ0uQnIl.js} +1 -1
- package/dist/screen-editor/{ReferenceEditor-BnI2Qd7H.js → ReferenceEditor-BGuaEvY7.js} +1 -1
- package/dist/screen-editor/ReferenceTargetEditors-kxd9SIuG.js +18 -0
- package/dist/screen-editor/{RenderingSlotEditor-Cani_PtT.js → RenderingSlotEditor-D0ppEIOx.js} +4 -4
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeChrome.d.ts +15 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeFrames.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModePopover.d.ts +19 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeStrings.d.ts +73 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/FloatingItemToolbar.d.ts +19 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/EditorLogoContext.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/EditorNavigationScope.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/navigationDocument.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/navigationItemOps.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/Navigation/regionItemSource.d.ts +25 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/cloneWithNewIds.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/collectionItemSource.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeKeys.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeRules.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/designModeTypes.d.ts +89 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/elementItemSource.d.ts +22 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/placeFloatingToolbar.d.ts +18 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/resolveDesignMode.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/useDesignMode.d.ts +31 -0
- package/dist/screen-editor/ScreenEditor/DesignMode/useDesignModeMeasurement.d.ts +10 -0
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +12 -2
- package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +7 -0
- package/dist/screen-editor/ScreenEditor/Inspector/DiagnosticList.d.ts +7 -2
- package/dist/screen-editor/ScreenEditor/Inspector/NavigationSection.d.ts +13 -0
- package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +4 -7
- package/dist/screen-editor/ScreenEditor/Inspector/ToolbarButtonSection.d.ts +9 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorHost.d.ts +2 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorProps.d.ts +3 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorStrings.d.ts +11 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/SearchableSelect.d.ts +4 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/createEditorContext.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/NavigationItemTargetEditor.d.ts +16 -0
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/ReferenceTargetEditors.d.ts +0 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/SliceEditor.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/TemplatePropertyEditor.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +4 -2
- package/dist/screen-editor/ScreenEditor/Surface/designTimePointer.d.ts +2 -0
- package/dist/screen-editor/ScreenEditor/Surface/elementRect.d.ts +1 -0
- package/dist/screen-editor/ScreenEditor/Surface/useDesignTimePointer.d.ts +1 -1
- package/dist/screen-editor/ScreenEditor/Templates/screenTemplateTarget.d.ts +21 -0
- package/dist/screen-editor/ScreenEditor/Toolbar/slicesOfStructure.d.ts +3 -0
- package/dist/screen-editor/ScreenEditor/Toolbar/toolbarDiagnostics.d.ts +8 -0
- package/dist/screen-editor/ScreenEditor/Toolbar/upgradeToolbarButton.d.ts +5 -0
- package/dist/screen-editor/ScreenTemplates/TemplateReference.d.ts +8 -0
- package/dist/screen-editor/ScreenTemplates/TemplateReferenceKind.d.ts +7 -0
- package/dist/screen-editor/ScreenTemplates/toTemplateSources.d.ts +18 -0
- package/dist/screen-editor/SearchableSelect-C4yzIyo_.js +110 -0
- package/dist/screen-editor/{SelectEditor-BuQPlIyf.js → SelectEditor-eeAE7a9p.js} +1 -1
- package/dist/screen-editor/SliceEditor-DLqvdYge.js +51 -0
- package/dist/screen-editor/{StateChangeEditors-9k3Gqtc0.js → StateChangeEditors-OQ-OUDrv.js} +1 -1
- package/dist/screen-editor/TemplatePicker/TemplatePicker.d.ts +28 -0
- package/dist/screen-editor/TemplatePicker/TemplatePickerHandlers.d.ts +14 -0
- package/dist/screen-editor/TemplatePicker/TemplatePickerLabels.d.ts +27 -0
- package/dist/screen-editor/TemplatePicker/TemplatePickerMenu.d.ts +26 -0
- package/dist/screen-editor/TemplatePicker/describeTemplatePicker.d.ts +26 -0
- package/dist/screen-editor/TemplatePicker/index.d.ts +6 -0
- package/dist/screen-editor/TemplatePicker/templateMatchesFilter.d.ts +11 -0
- package/dist/screen-editor/TemplatePropertyEditor-D_OaRTPe.js +38 -0
- package/dist/screen-editor/index.js +4671 -2982
- package/dist/screen-editor/screen-editor.css +1 -1
- package/dist/screen-editor/toTemplateSources-CN-BMZ39.js +492 -0
- package/package.json +12 -12
- package/dist/screen-editor/ReferenceTargetEditors-COKAWO5q.js +0 -19
- package/dist/screen-editor/ScreenEditor/Inspector/TemplateBrowser.d.ts +0 -13
- package/dist/screen-editor/ScreenEditor/Templates/TemplateInapplicability.d.ts +0 -4
- package/dist/screen-editor/ScreenEditor/Templates/templateBrowser.d.ts +0 -21
- package/dist/screen-editor/SearchableSelect-WUNlC3tk.js +0 -109
- package/dist/screen-editor/SliceEditor-Dle8OlsB.js +0 -45
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ComponentDesignModeDescriptor, InspectedProperty, SceneEdit } from '@cratis/scene.model';
|
|
2
|
+
import type { NavigationEdit } from '@cratis/scene.engine';
|
|
3
|
+
export declare const designModeActions: {
|
|
4
|
+
readonly addItem: 'addItem';
|
|
5
|
+
readonly addButton: 'addButton';
|
|
6
|
+
readonly rename: 'rename';
|
|
7
|
+
readonly target: 'target';
|
|
8
|
+
readonly slot: 'slot';
|
|
9
|
+
readonly slice: 'slice';
|
|
10
|
+
readonly emphasis: 'emphasis';
|
|
11
|
+
readonly moveEarlier: 'moveEarlier';
|
|
12
|
+
readonly moveLater: 'moveLater';
|
|
13
|
+
readonly duplicate: 'duplicate';
|
|
14
|
+
readonly delete: 'delete';
|
|
15
|
+
readonly addSubItem: 'addSubItem';
|
|
16
|
+
};
|
|
17
|
+
export declare enum DesignModeItemSourceKind {
|
|
18
|
+
Elements = "elements",
|
|
19
|
+
Collection = "collection",
|
|
20
|
+
Region = "region"
|
|
21
|
+
}
|
|
22
|
+
export interface DesignModeItem {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
index: number;
|
|
26
|
+
count: number;
|
|
27
|
+
parentId?: string;
|
|
28
|
+
readOnly: boolean;
|
|
29
|
+
readOnlyReason?: string;
|
|
30
|
+
origin?: string;
|
|
31
|
+
values: Readonly<Record<string, unknown>>;
|
|
32
|
+
chips?: Readonly<Record<string, string>>;
|
|
33
|
+
problems?: readonly {
|
|
34
|
+
code: string;
|
|
35
|
+
message: string;
|
|
36
|
+
}[];
|
|
37
|
+
unlinked: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface DesignModeChoice {
|
|
40
|
+
property: InspectedProperty;
|
|
41
|
+
plan: (value: unknown) => DesignModePlan | DesignModeRejection;
|
|
42
|
+
}
|
|
43
|
+
export interface DesignModePlan {
|
|
44
|
+
label: string;
|
|
45
|
+
edits: SceneEdit[];
|
|
46
|
+
select?: {
|
|
47
|
+
elementId?: string;
|
|
48
|
+
itemId?: string | null;
|
|
49
|
+
};
|
|
50
|
+
renameNext?: boolean;
|
|
51
|
+
navigationEdits?: NavigationEdit[];
|
|
52
|
+
notice?: string;
|
|
53
|
+
editAtApplication?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface DesignModeRejection {
|
|
56
|
+
rejected: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const isRejection: (outcome: DesignModePlan | DesignModeRejection) => outcome is DesignModeRejection;
|
|
59
|
+
export interface DesignModeReadOnlyAction {
|
|
60
|
+
id: string;
|
|
61
|
+
label: string;
|
|
62
|
+
plan: () => DesignModePlan | DesignModeRejection;
|
|
63
|
+
}
|
|
64
|
+
export interface DesignModeItemSource {
|
|
65
|
+
kind: DesignModeItemSourceKind;
|
|
66
|
+
items: readonly DesignModeItem[];
|
|
67
|
+
add: (actionId: string) => DesignModePlan | DesignModeRejection;
|
|
68
|
+
act: (actionId: string, item: DesignModeItem) => DesignModePlan | DesignModeRejection;
|
|
69
|
+
rename: (item: DesignModeItem, label: string) => DesignModePlan | DesignModeRejection;
|
|
70
|
+
choice: (actionId: string, item: DesignModeItem) => DesignModeChoice | undefined;
|
|
71
|
+
readOnlyActions: (item: DesignModeItem) => readonly DesignModeReadOnlyAction[];
|
|
72
|
+
regionTag?: {
|
|
73
|
+
text: string;
|
|
74
|
+
long: string;
|
|
75
|
+
kind: string;
|
|
76
|
+
};
|
|
77
|
+
region?: {
|
|
78
|
+
region: 'topbar' | 'sidebar';
|
|
79
|
+
module?: string;
|
|
80
|
+
mode?: 'inherit' | 'extend' | 'override';
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface DesignModeSubject {
|
|
84
|
+
componentId: string;
|
|
85
|
+
componentName: string;
|
|
86
|
+
mode: ComponentDesignModeDescriptor;
|
|
87
|
+
source: DesignModeItemSource;
|
|
88
|
+
selected?: DesignModeItem;
|
|
89
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ApplicationStructure, type ExternalComponent, type NodeInspection } from '@cratis/scene.model';
|
|
2
|
+
import { Ownership } from '../Structure/Ownership';
|
|
3
|
+
import { type DesignModeItemSource } from './designModeTypes';
|
|
4
|
+
export interface ElementItemKind {
|
|
5
|
+
slot: string;
|
|
6
|
+
componentName: string;
|
|
7
|
+
labelProperty: string;
|
|
8
|
+
startingLabel: string;
|
|
9
|
+
isUnlinked: (id: string, properties: Record<string, unknown>) => boolean;
|
|
10
|
+
startingProperties: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare const elementItemKinds: Readonly<Record<string, Omit<ElementItemKind, 'startingLabel'>>>;
|
|
13
|
+
export interface ElementItemSourceInputs {
|
|
14
|
+
component: ExternalComponent;
|
|
15
|
+
addActionId: string;
|
|
16
|
+
ownershipOf: (elementId: string) => Ownership;
|
|
17
|
+
inspect: (elementId: string) => NodeInspection | undefined;
|
|
18
|
+
newId: () => string;
|
|
19
|
+
startingLabel: string;
|
|
20
|
+
structure?: ApplicationStructure;
|
|
21
|
+
}
|
|
22
|
+
export declare function createElementItemSource({ component, addActionId, ownershipOf, inspect, newId, startingLabel, structure }: ElementItemSourceInputs): DesignModeItemSource | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Rect } from '../Surface/dropRegionRects';
|
|
2
|
+
export type ToolbarSide = 'above' | 'below';
|
|
3
|
+
export interface ToolbarPlacementInputs {
|
|
4
|
+
anchor: Rect;
|
|
5
|
+
bounds: Rect;
|
|
6
|
+
size: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
prefer: ToolbarSide;
|
|
11
|
+
gap?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ToolbarPlacement {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
side: ToolbarSide;
|
|
17
|
+
}
|
|
18
|
+
export declare function placeFloatingToolbar({ anchor, bounds, size, prefer, gap }: ToolbarPlacementInputs): ToolbarPlacement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ApplicationStructure, DestinationReference, ExternalComponent, NodeInspection, SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import { type DescriptorCatalog } from '@cratis/scene.engine';
|
|
3
|
+
import type { Ownership } from '../Structure/Ownership';
|
|
4
|
+
import type { DesignModeItemSource, DesignModeSubject } from './designModeTypes';
|
|
5
|
+
export interface DesignModeInputs {
|
|
6
|
+
roots: readonly SceneElement[];
|
|
7
|
+
catalog: DescriptorCatalog;
|
|
8
|
+
selectedId: string | undefined;
|
|
9
|
+
selectedItemId: string | undefined;
|
|
10
|
+
inspect: (elementId: string) => NodeInspection | undefined;
|
|
11
|
+
ownershipOf: (elementId: string) => Ownership;
|
|
12
|
+
newId: () => string;
|
|
13
|
+
startingLabels: {
|
|
14
|
+
button: string;
|
|
15
|
+
item: string;
|
|
16
|
+
};
|
|
17
|
+
structure?: ApplicationStructure;
|
|
18
|
+
startingDestination?: DestinationReference;
|
|
19
|
+
otherSource?: (component: ExternalComponent, selectedItemId: string | undefined) => DesignModeItemSource | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveDesignMode(inputs: DesignModeInputs): DesignModeSubject | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NavigationRegionKind, type DestinationReference } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import { type DesignModeItem, type DesignModePlan, type DesignModeRejection, type DesignModeSubject } from './designModeTypes';
|
|
4
|
+
import type { DesignModeStrings } from './DesignModeStrings';
|
|
5
|
+
import { type DesignModeInputs } from './resolveDesignMode';
|
|
6
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
7
|
+
export interface DesignModeOptions {
|
|
8
|
+
controller: ScreenEditorController;
|
|
9
|
+
environment: ScreenEditorEnvironment;
|
|
10
|
+
strings: DesignModeStrings;
|
|
11
|
+
startingLabels: {
|
|
12
|
+
button: string;
|
|
13
|
+
item: string;
|
|
14
|
+
};
|
|
15
|
+
startingDestination?: DestinationReference;
|
|
16
|
+
otherSource?: DesignModeInputs['otherSource'];
|
|
17
|
+
}
|
|
18
|
+
export interface DesignModeState {
|
|
19
|
+
subject: DesignModeSubject | undefined;
|
|
20
|
+
renameToken: number;
|
|
21
|
+
announcement: string;
|
|
22
|
+
notice: string;
|
|
23
|
+
pointItem: (componentId: string | undefined, itemId: string | undefined) => void;
|
|
24
|
+
perform: (outcome: DesignModePlan | DesignModeRejection, announce?: (plan: DesignModePlan) => string) => boolean;
|
|
25
|
+
add: (actionId: string) => boolean;
|
|
26
|
+
act: (actionId: string, item: DesignModeItem) => boolean;
|
|
27
|
+
rename: (item: DesignModeItem, label: string) => boolean;
|
|
28
|
+
deselect: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function useDesignMode({ controller, environment, strings, startingLabels, startingDestination, otherSource }: DesignModeOptions): DesignModeState;
|
|
31
|
+
export declare function regionOf(componentName: string): NavigationRegionKind | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { Rect } from '../Surface/dropRegionRects';
|
|
3
|
+
import type { DesignModeSubject } from './designModeTypes';
|
|
4
|
+
export interface DesignModeMeasurement {
|
|
5
|
+
surface: Rect;
|
|
6
|
+
component: Rect | undefined;
|
|
7
|
+
items: Readonly<Record<string, Rect>>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useSurfaceMeasured<T>(surface: RefObject<HTMLDivElement | null>, compute: (root: HTMLDivElement, origin: DOMRect) => T | undefined, same: (a: T, b: T) => boolean): T | undefined;
|
|
10
|
+
export declare function useDesignModeMeasurement(surface: RefObject<HTMLDivElement | null>, subject: DesignModeSubject | undefined): DesignModeMeasurement | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CanvasPlacement } from '../Document/placeOnCanvas';
|
|
2
|
-
import type { Behavior, DestinationReference, DialogTemplate, Form, NodeInspection, Outlet, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement, ScreenTemplate, TemplateMetadata } from '@cratis/scene.model';
|
|
3
|
-
import type { EditingContext } from '@cratis/scene.engine';
|
|
2
|
+
import type { ApplicationStructure, Behavior, DestinationReference, DialogTemplate, NavigationModel, Form, NodeInspection, Outlet, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement, ScreenTemplate, TemplateMetadata } from '@cratis/scene.model';
|
|
3
|
+
import type { EditingContext, NavigationEdit } from '@cratis/scene.engine';
|
|
4
4
|
import type { Ownership } from '../Structure/Ownership';
|
|
5
5
|
import type { StructureEdit } from '../Structure/StructureEdit';
|
|
6
6
|
import type { StructureEditRejection } from '../Structure/StructureEditRejection';
|
|
@@ -15,6 +15,16 @@ export type ElementMeasurer = (elementId: string) => {
|
|
|
15
15
|
height: number;
|
|
16
16
|
} | undefined;
|
|
17
17
|
export interface ScreenEditorController {
|
|
18
|
+
navigation: NavigationModel;
|
|
19
|
+
structure: ApplicationStructure;
|
|
20
|
+
navigationModule: string | undefined;
|
|
21
|
+
applyNavigationEdits: (edits: NavigationEdit[], label: string) => {
|
|
22
|
+
applied: boolean;
|
|
23
|
+
rejected?: string;
|
|
24
|
+
};
|
|
25
|
+
setNavigationModule: (module: string | undefined) => void;
|
|
26
|
+
selectedItemId: string | undefined;
|
|
27
|
+
selectItem: (componentId: string | undefined, itemId: string | undefined) => void;
|
|
18
28
|
document: SceneDocument;
|
|
19
29
|
composition: EditorComposition;
|
|
20
30
|
context: EditingContext;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ApplicationStructure } from '@cratis/scene.model';
|
|
1
2
|
import type { SceneDocument, TemplateScope } from '@cratis/scene.model';
|
|
2
3
|
import type { QueryCandidate } from '@cratis/scene.model';
|
|
3
4
|
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
@@ -33,6 +34,12 @@ export interface ScreenEditorEnvironment {
|
|
|
33
34
|
references?: (target: string) => readonly EditorReference[];
|
|
34
35
|
};
|
|
35
36
|
templateScope?: TemplateScope;
|
|
37
|
+
navigation?: ScreenEditorNavigation;
|
|
38
|
+
}
|
|
39
|
+
export interface ScreenEditorNavigation {
|
|
40
|
+
structure: ApplicationStructure;
|
|
41
|
+
module?: string;
|
|
42
|
+
slots?: readonly string[];
|
|
36
43
|
}
|
|
37
44
|
export interface ScreenEditorResult {
|
|
38
45
|
document: SceneDocument;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ListedDiagnostic {
|
|
2
|
+
code: string;
|
|
3
|
+
severity: string;
|
|
4
|
+
message: string;
|
|
5
|
+
path?: string | undefined;
|
|
6
|
+
}
|
|
2
7
|
export interface DiagnosticListProps {
|
|
3
|
-
diagnostics: readonly
|
|
8
|
+
diagnostics: readonly ListedDiagnostic[];
|
|
4
9
|
label: string;
|
|
5
10
|
}
|
|
6
11
|
export declare const DiagnosticList: ({ diagnostics, label }: DiagnosticListProps) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
2
|
+
import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
|
|
3
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
|
+
export interface NavigationSectionProps {
|
|
5
|
+
controller: ScreenEditorController;
|
|
6
|
+
environment: ScreenEditorEnvironment;
|
|
7
|
+
strings: ScreenEditorStrings;
|
|
8
|
+
}
|
|
9
|
+
export declare const slotNames: (text: {
|
|
10
|
+
mainArea: string;
|
|
11
|
+
sidePanel: string;
|
|
12
|
+
}) => Record<string, string>;
|
|
13
|
+
export declare const NavigationSection: ({ controller, environment, strings }: NavigationSectionProps) => import("react").JSX.Element | null;
|
|
@@ -7,8 +7,9 @@ import type { Ownership } from '../Structure/Ownership';
|
|
|
7
7
|
import type { SceneDocumentProblem } from '../Document/readSceneDocument';
|
|
8
8
|
import type { StructureEditRejection } from '../Structure/StructureEditRejection';
|
|
9
9
|
import type { SurfaceStrings } from '../Surface/DesignTime/SurfaceStrings';
|
|
10
|
+
import type { DesignModeStrings } from '../DesignMode/DesignModeStrings';
|
|
10
11
|
import type { DestinationProblemKind } from '../Destinations/DestinationProblemKind';
|
|
11
|
-
import type {
|
|
12
|
+
import type { TemplatePickerLabels } from '../../TemplatePicker/TemplatePickerLabels';
|
|
12
13
|
import type { TemplatePreviewSize } from '../Templates/TemplatePreviewSize';
|
|
13
14
|
import type { TemplatePreviewState } from '@cratis/scene.blueprint.default';
|
|
14
15
|
export interface ScreenEditorStrings {
|
|
@@ -40,6 +41,7 @@ export interface ScreenEditorStrings {
|
|
|
40
41
|
close: string;
|
|
41
42
|
};
|
|
42
43
|
surface: SurfaceStrings;
|
|
44
|
+
designMode?: DesignModeStrings;
|
|
43
45
|
undo: string;
|
|
44
46
|
redo: string;
|
|
45
47
|
palette: string;
|
|
@@ -84,12 +86,7 @@ export interface ScreenEditorStrings {
|
|
|
84
86
|
scope: string;
|
|
85
87
|
anyScope: string;
|
|
86
88
|
missing: (template: string) => string;
|
|
87
|
-
|
|
88
|
-
noMatches: string;
|
|
89
|
-
uncategorized: string;
|
|
90
|
-
provenance: (packageName: string) => string;
|
|
91
|
-
inapplicable: Record<TemplateInapplicability, string>;
|
|
92
|
-
previewAction: string;
|
|
89
|
+
picker: TemplatePickerLabels;
|
|
93
90
|
preview: (template: string) => string;
|
|
94
91
|
previewState: string;
|
|
95
92
|
previewStates: Record<TemplatePreviewState, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
import type { ScreenEditorController } from '../Host/ScreenEditorController';
|
|
3
|
+
import type { ScreenEditorStrings } from './ScreenEditorStrings';
|
|
4
|
+
export interface ToolbarButtonSectionProps {
|
|
5
|
+
controller: ScreenEditorController;
|
|
6
|
+
strings: ScreenEditorStrings;
|
|
7
|
+
element: SceneElement;
|
|
8
|
+
}
|
|
9
|
+
export declare const ToolbarButtonSection: ({ controller, strings, element }: ToolbarButtonSectionProps) => import("react").JSX.Element | null;
|
|
@@ -2,6 +2,7 @@ import type { InspectedProperty, SceneDiagnostic } from '@cratis/scene.model';
|
|
|
2
2
|
import type { EditorContext, EditorProblem } from './PropertyEditorProps';
|
|
3
3
|
import type { PropertyEditorRegistry } from './PropertyEditorRegistry';
|
|
4
4
|
export interface PropertyEditorHostProps {
|
|
5
|
+
presentation?: 'field' | 'popover';
|
|
5
6
|
registry: PropertyEditorRegistry;
|
|
6
7
|
property: InspectedProperty;
|
|
7
8
|
context: EditorContext;
|
|
@@ -9,5 +10,5 @@ export interface PropertyEditorHostProps {
|
|
|
9
10
|
onChange: (property: InspectedProperty, value: unknown) => void;
|
|
10
11
|
diagnostics: readonly SceneDiagnostic[];
|
|
11
12
|
}
|
|
12
|
-
export declare const PropertyEditorHost: ({ registry, property, context, componentId, onChange, diagnostics }: PropertyEditorHostProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const PropertyEditorHost: ({ registry, property, context, componentId, onChange, diagnostics, presentation }: PropertyEditorHostProps) => import("react").JSX.Element;
|
|
13
14
|
export declare function problemOf(property: InspectedProperty, diagnostics: readonly SceneDiagnostic[]): EditorProblem | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { ConfigurationDestination } from '@cratis/components/ConfigurationEditor';
|
|
3
|
-
import type { InspectedProperty, PropertyDescriptor, QueryCandidate, QueryResultField, SceneDiagnostic, SceneDocument } from '@cratis/scene.model';
|
|
3
|
+
import type { ApplicationStructure, InspectedProperty, PropertyDescriptor, QueryCandidate, QueryResultField, SceneDiagnostic, SceneDocument } from '@cratis/scene.model';
|
|
4
4
|
import type { EffectiveIconCatalog } from '@cratis/scene.engine';
|
|
5
5
|
import type { IconAdapterRegistry } from '@cratis/scene.react';
|
|
6
6
|
import type { BindingTypeScope } from '@cratis/scene.engine';
|
|
@@ -41,6 +41,7 @@ export interface EditorLookups {
|
|
|
41
41
|
slices: readonly EditorSlice[];
|
|
42
42
|
destinations: readonly ConfigurationDestination[];
|
|
43
43
|
slots: readonly string[];
|
|
44
|
+
structure?: ApplicationStructure;
|
|
44
45
|
queryCandidates: readonly QueryCandidate[];
|
|
45
46
|
availableSources: Readonly<Record<string, string>>;
|
|
46
47
|
fields: readonly QueryResultField[];
|
|
@@ -82,6 +83,7 @@ export interface PropertyEditorProps<T = unknown> {
|
|
|
82
83
|
disabled?: boolean;
|
|
83
84
|
readOnlyReason?: string;
|
|
84
85
|
problem?: EditorProblem;
|
|
86
|
+
inline?: boolean;
|
|
85
87
|
id: string;
|
|
86
88
|
}
|
|
87
89
|
export interface EditorProblem {
|
|
@@ -34,13 +34,24 @@ export interface PropertyEditorStrings {
|
|
|
34
34
|
placeholder: string;
|
|
35
35
|
unresolved: (target: string) => string;
|
|
36
36
|
};
|
|
37
|
+
navigationItemTarget: {
|
|
38
|
+
notLinked: string;
|
|
39
|
+
module: string;
|
|
40
|
+
unresolved: (target: string) => string;
|
|
41
|
+
};
|
|
37
42
|
renderingSlot: {
|
|
38
43
|
none: string;
|
|
39
44
|
diagram: (slot: string) => string;
|
|
45
|
+
names: Readonly<Record<string, string>>;
|
|
40
46
|
};
|
|
41
47
|
slice: {
|
|
42
48
|
placeholder: string;
|
|
43
49
|
notKind: (kind: string) => string;
|
|
50
|
+
kindName: (kind: string) => string;
|
|
51
|
+
sections: {
|
|
52
|
+
accepted: string;
|
|
53
|
+
refused: string;
|
|
54
|
+
};
|
|
44
55
|
};
|
|
45
56
|
inheritanceMode: {
|
|
46
57
|
modes: Record<'inherit' | 'extend' | 'override', {
|
|
@@ -5,6 +5,8 @@ export interface SelectOption {
|
|
|
5
5
|
group?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
reason?: string;
|
|
8
|
+
section?: string;
|
|
9
|
+
trailing?: string;
|
|
8
10
|
}
|
|
9
11
|
export declare function filterOptions(options: readonly SelectOption[], query: string): SelectOption[];
|
|
10
12
|
export interface SearchableSelectProps {
|
|
@@ -18,9 +20,10 @@ export interface SearchableSelectProps {
|
|
|
18
20
|
searchLabel: string;
|
|
19
21
|
emptyLabel: string;
|
|
20
22
|
clearLabel: string;
|
|
23
|
+
inline?: boolean;
|
|
21
24
|
clearable?: boolean;
|
|
22
25
|
renderClosed?: (option: SelectOption | undefined) => ReactNode;
|
|
23
26
|
'aria-labelledby'?: string;
|
|
24
27
|
'aria-describedby'?: string;
|
|
25
28
|
}
|
|
26
|
-
export declare const SearchableSelect: ({ id, options, value, onChange, disabled, invalid, placeholder, searchLabel, emptyLabel, clearLabel, clearable, renderClosed, ...aria }: SearchableSelectProps) => import("react").JSX.Element;
|
|
29
|
+
export declare const SearchableSelect: ({ id, options, value, onChange, disabled, invalid, placeholder, searchLabel, emptyLabel, clearLabel, clearable, renderClosed, inline, ...aria }: SearchableSelectProps) => import("react").JSX.Element;
|
|
@@ -14,6 +14,7 @@ export interface EditorContextInputs {
|
|
|
14
14
|
diagnostics: readonly SceneDiagnostic[];
|
|
15
15
|
inCanvas: boolean;
|
|
16
16
|
bindingScope: BindingTypeScope;
|
|
17
|
+
slotNames?: Readonly<Record<string, string>>;
|
|
17
18
|
}
|
|
18
19
|
export declare function fieldsOfBoundQuery(properties: Readonly<Record<string, unknown>> | undefined, candidates: readonly QueryCandidate[]): readonly QueryResultField[];
|
|
19
20
|
export declare function createEditorContext(inputs: EditorContextInputs): EditorContext;
|
package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/NavigationItemTargetEditor.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ApplicationStructure } from '@cratis/scene.model';
|
|
2
|
+
import type { PropertyEditorProps } from '../Registry/PropertyEditorProps';
|
|
3
|
+
export interface NavigationItemTarget {
|
|
4
|
+
module: string;
|
|
5
|
+
feature?: string;
|
|
6
|
+
}
|
|
7
|
+
interface Row {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
depth: number;
|
|
11
|
+
target: NavigationItemTarget;
|
|
12
|
+
module: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const rowsOf: (structure: ApplicationStructure) => Row[];
|
|
15
|
+
export declare const NavigationItemTargetEditor: ({ value, onChange, context, disabled, id }: PropertyEditorProps<unknown>) => import("react").JSX.Element;
|
|
16
|
+
export {};
|
package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/ReferenceTargetEditors.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { PropertyEditorProps } from '../Registry/PropertyEditorProps';
|
|
2
|
-
export declare const TemplateEditor: (props: PropertyEditorProps<string>) => import("react").JSX.Element;
|
|
3
2
|
export declare const SampleDataEditor: (props: PropertyEditorProps<string>) => import("react").JSX.Element;
|
|
@@ -2,4 +2,4 @@ import type { PropertyEditorProps, EditorLookups } from '../Registry/PropertyEdi
|
|
|
2
2
|
import type { PropertyEditorStrings } from '../Registry/PropertyEditorStrings';
|
|
3
3
|
import type { SelectOption } from '../Registry/SearchableSelect';
|
|
4
4
|
export declare function sliceOptions(lookups: Pick<EditorLookups, 'slices' | 'stateChangeSlices'>, kinds: readonly string[] | undefined, text: PropertyEditorStrings): SelectOption[];
|
|
5
|
-
export declare const SliceEditor: ({ value, onChange, descriptor, context, disabled, problem, id }: PropertyEditorProps<string>) => import("react").JSX.Element;
|
|
5
|
+
export declare const SliceEditor: ({ value, onChange, descriptor, context, disabled, problem, inline, id }: PropertyEditorProps<string>) => import("react").JSX.Element;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import type
|
|
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';
|
|
5
5
|
import type { SurfaceStrings } from './DesignTime/SurfaceStrings';
|
|
6
|
+
import type { ScreenEditorStrings } from '../Inspector/ScreenEditorStrings';
|
|
6
7
|
export interface ScreenSurfaceProps {
|
|
7
8
|
controller: ScreenEditorController;
|
|
8
9
|
environment: ScreenEditorEnvironment;
|
|
9
10
|
resolveBinding: BindingResolver;
|
|
10
11
|
configuration?: EffectiveConfiguration;
|
|
11
12
|
strings: SurfaceStrings;
|
|
13
|
+
editorStrings?: ScreenEditorStrings;
|
|
12
14
|
viewportHeight?: number;
|
|
13
15
|
}
|
|
14
|
-
export declare const ScreenSurface: ({ controller, environment, resolveBinding, configuration, strings, viewportHeight }: ScreenSurfaceProps) => import("react").JSX.Element;
|
|
16
|
+
export declare const ScreenSurface: ({ controller, environment, resolveBinding, configuration: given, strings, editorStrings, viewportHeight }: ScreenSurfaceProps) => import("react").JSX.Element;
|
|
@@ -7,3 +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]";
|
|
11
|
+
export declare function itemIdAt(target: EventTarget | null): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
-
export declare function useDesignTimePointer(surface: RefObject<HTMLElement | null>, select: (id: string | undefined) => void): void;
|
|
2
|
+
export declare function useDesignTimePointer(surface: RefObject<HTMLElement | null>, select: (id: string | undefined, itemId?: string) => void): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TemplateScope, type Layout, type UiProfile } from '@cratis/scene.model';
|
|
2
|
+
import type { TemplateTarget } from '@cratis/scene.engine';
|
|
3
|
+
/** What the screen editor knows about where the screen it edits sits - enough for Scene to say which templates apply. */
|
|
4
|
+
export interface ScreenTemplateTargetInputs {
|
|
5
|
+
/** The packages in play, in ascending override priority. */
|
|
6
|
+
bundles: readonly {
|
|
7
|
+
layouts?: readonly Layout[];
|
|
8
|
+
}[];
|
|
9
|
+
/** The profile the screen is drawn under, which names the shell layout a template goes into. */
|
|
10
|
+
profile: Pick<UiProfile, 'layout'>;
|
|
11
|
+
/** Where in the application the screen sits; a screen of a slice unless the host says otherwise. */
|
|
12
|
+
scope?: TemplateScope;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The target the screen's templates are chosen for: the scope, and the profile's shell layout as the container a
|
|
16
|
+
* template has to fit a slot of. Without the container Scene cannot place a template that names a slot it fits.
|
|
17
|
+
*
|
|
18
|
+
* @param inputs Where the screen sits.
|
|
19
|
+
* @returns The Scene {@link TemplateTarget}.
|
|
20
|
+
*/
|
|
21
|
+
export declare function screenTemplateTarget({ bundles, profile, scope }: ScreenTemplateTargetInputs): TemplateTarget;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ApplicationStructure, SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export interface ToolbarFinding {
|
|
3
|
+
code: string;
|
|
4
|
+
severity: 'error' | 'warning';
|
|
5
|
+
message: string;
|
|
6
|
+
button: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function toolbarDiagnostics(structure: ApplicationStructure, toolbar: SceneElement): ToolbarFinding[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ApplicationStructure, type SceneEdit } from '@cratis/scene.model';
|
|
2
|
+
export declare function upgradeOf(structure: ApplicationStructure, id: string, properties: Record<string, unknown>): {
|
|
3
|
+
slice: string;
|
|
4
|
+
} | undefined;
|
|
5
|
+
export declare function upgradeEdits(id: string, slice: string): SceneEdit[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TemplateReferenceKind } from './TemplateReferenceKind';
|
|
2
|
+
/** A screen template chosen at some level, without the template itself - what is stored. */
|
|
3
|
+
export interface TemplateReference {
|
|
4
|
+
/** Where the template comes from. */
|
|
5
|
+
kind: TemplateReferenceKind;
|
|
6
|
+
/** The blueprint template's name, or the application template's identifier. */
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Where a chosen screen template comes from. */
|
|
2
|
+
export declare enum TemplateReferenceKind {
|
|
3
|
+
/** A screen template a Scene package in the UI Profile contributes, identified by its name. */
|
|
4
|
+
Blueprint = "blueprint",
|
|
5
|
+
/** A screen template built for the application itself, identified by its identifier. */
|
|
6
|
+
Application = "application"
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TemplateSource } from '@cratis/scene.engine';
|
|
2
|
+
/** What a package contributes to the template library: its manifest and the templates and layouts it carries. */
|
|
3
|
+
export interface TemplateSourceBundle {
|
|
4
|
+
manifest: TemplateSource['manifest'];
|
|
5
|
+
layouts?: TemplateSource['layouts'];
|
|
6
|
+
screenTemplates?: TemplateSource['screenTemplates'];
|
|
7
|
+
dialogTemplates?: TemplateSource['dialogTemplates'];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The packages as Scene's template library reads them, in the order given.
|
|
11
|
+
*
|
|
12
|
+
* A later package's template replaces an earlier one of the same name - the rule the whole UI Profile follows - so
|
|
13
|
+
* each source keeps only the templates that win, and the picker never lists the same name twice.
|
|
14
|
+
*
|
|
15
|
+
* @param bundles The packages, in ascending override priority.
|
|
16
|
+
* @returns The template sources.
|
|
17
|
+
*/
|
|
18
|
+
export declare function toTemplateSources(bundles: readonly TemplateSourceBundle[]): TemplateSource[];
|