@cratis/event-models 0.338.0 → 0.339.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.
Files changed (68) hide show
  1. package/dist/screen-editor/{BindingExpressionPropertyEditor-CcIqajvT.js → BindingExpressionPropertyEditor-D63oFTJg.js} +1 -1
  2. package/dist/screen-editor/DataBindingSections-DGWtMxlD.js +1859 -0
  3. package/dist/screen-editor/HookEditors-vV4ycK6R.js +37 -0
  4. package/dist/screen-editor/HookOpensField-Ja5uMCr8.js +231 -0
  5. package/dist/screen-editor/QueryBindingPropertyEditor-QpvyESab.js +148 -0
  6. package/dist/screen-editor/ScreenEditor/Actions/ActionModel.d.ts +3 -1
  7. package/dist/screen-editor/ScreenEditor/Actions/StateChangeSlice.d.ts +4 -0
  8. package/dist/screen-editor/ScreenEditor/Actions/actionBehavior.d.ts +3 -1
  9. package/dist/screen-editor/ScreenEditor/Binding/detailShows.d.ts +18 -0
  10. package/dist/screen-editor/ScreenEditor/Binding/parameterFeeds.d.ts +22 -0
  11. package/dist/screen-editor/ScreenEditor/Binding/queryBindingModel.d.ts +1 -0
  12. package/dist/screen-editor/ScreenEditor/Data/DataField.d.ts +39 -0
  13. package/dist/screen-editor/ScreenEditor/Data/insertDataField.d.ts +29 -0
  14. package/dist/screen-editor/ScreenEditor/Data/queryTables.d.ts +10 -0
  15. package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeFrames.d.ts +3 -1
  16. package/dist/screen-editor/ScreenEditor/DesignMode/DesignModeStrings.d.ts +2 -0
  17. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/OutletStrings.d.ts +74 -0
  18. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/createOutletDesign.d.ts +34 -0
  19. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletBindings.d.ts +23 -0
  20. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletDesignModes.d.ts +6 -0
  21. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletDocument.d.ts +15 -0
  22. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/outletItemOps.d.ts +11 -0
  23. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/screenOutletChain.d.ts +18 -0
  24. package/dist/screen-editor/ScreenEditor/DesignMode/Outlets/screenOutlets.d.ts +44 -0
  25. package/dist/screen-editor/ScreenEditor/DesignMode/designModeTypes.d.ts +19 -2
  26. package/dist/screen-editor/ScreenEditor/DesignMode/resolveDesignMode.d.ts +2 -0
  27. package/dist/screen-editor/ScreenEditor/DesignMode/useDesignMode.d.ts +2 -0
  28. package/dist/screen-editor/ScreenEditor/Forms/fieldChoices.d.ts +14 -0
  29. package/dist/screen-editor/ScreenEditor/Forms/fieldMarkers.d.ts +8 -0
  30. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorController.d.ts +22 -0
  31. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorHost.d.ts +11 -0
  32. package/dist/screen-editor/ScreenEditor/Host/ScreenEditorWindow.d.ts +2 -1
  33. package/dist/screen-editor/ScreenEditor/Host/openSubject.d.ts +2 -1
  34. package/dist/screen-editor/ScreenEditor/Inspector/ActionEditor.d.ts +3 -1
  35. package/dist/screen-editor/ScreenEditor/Inspector/CommandFormEditor.d.ts +3 -2
  36. package/dist/screen-editor/ScreenEditor/Inspector/DataBindingSections.d.ts +23 -0
  37. package/dist/screen-editor/ScreenEditor/Inspector/FormEditor.d.ts +3 -2
  38. package/dist/screen-editor/ScreenEditor/Inspector/OutletListEditor.d.ts +11 -0
  39. package/dist/screen-editor/ScreenEditor/Inspector/OutletSection.d.ts +12 -0
  40. package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +31 -0
  41. package/dist/screen-editor/ScreenEditor/Inspector/ScreenOutletsSection.d.ts +9 -0
  42. package/dist/screen-editor/ScreenEditor/Palette/PaletteEntry.d.ts +4 -0
  43. package/dist/screen-editor/ScreenEditor/Placement/HookEnabledField.d.ts +14 -0
  44. package/dist/screen-editor/ScreenEditor/Placement/HookOpensField.d.ts +10 -0
  45. package/dist/screen-editor/ScreenEditor/Placement/PlacementStrings.d.ts +32 -0
  46. package/dist/screen-editor/ScreenEditor/Placement/hookBinding.d.ts +28 -0
  47. package/dist/screen-editor/ScreenEditor/Placement/hookPlacement.d.ts +27 -0
  48. package/dist/screen-editor/ScreenEditor/Placement/opensOptions.d.ts +16 -0
  49. package/dist/screen-editor/ScreenEditor/Placement/placementEnvironment.d.ts +12 -0
  50. package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorProps.d.ts +2 -0
  51. package/dist/screen-editor/ScreenEditor/PropertyEditors/Registry/PropertyEditorStrings.d.ts +2 -0
  52. package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/HookEditors.d.ts +4 -0
  53. package/dist/screen-editor/ScreenEditor/PropertyEditors/Specific/QueryBindingPropertyEditor.d.ts +1 -1
  54. package/dist/screen-editor/ScreenEditor/Surface/ScreenSurface.d.ts +1 -1
  55. package/dist/screen-editor/ScreenEditor/Surface/columnAt.d.ts +6 -0
  56. package/dist/screen-editor/ScreenEditor/Surface/useSurfaceDrop.d.ts +1 -1
  57. package/dist/screen-editor/ScreenEditor/Templates/composeEditorScreen.d.ts +5 -1
  58. package/dist/screen-editor/ScreenEditor/Templates/dialogActionsChrome.d.ts +9 -0
  59. package/dist/screen-editor/ScreenEditor/Templates/slotSections.d.ts +1 -0
  60. package/dist/screen-editor/defaultStructuredEditorStrings-Bwbw58wD.js +116 -0
  61. package/dist/screen-editor/hookBinding-DOpu2dMp.js +171 -0
  62. package/dist/screen-editor/index.js +5478 -4935
  63. package/dist/screen-editor/sceneTree-CNx3I3MJ.js +32 -0
  64. package/dist/screen-editor/screen-editor.css +1 -1
  65. package/package.json +3 -3
  66. package/dist/screen-editor/QueryBindingEditor-MTd0R7iQ.js +0 -40
  67. package/dist/screen-editor/QueryBindingPropertyEditor-Cu4PTcOz.js +0 -169
  68. package/dist/screen-editor/defaultStructuredEditorStrings-BPl2XP8A.js +0 -144
@@ -0,0 +1,74 @@
1
+ export interface OutletStrings {
2
+ kinds: Record<string, string>;
3
+ newItem: Record<string, string>;
4
+ frameName: (name: string, kind: string) => string;
5
+ tagLong: (name: string, summary: string) => string;
6
+ title: (name: string, kind: string) => string;
7
+ declaredBy: (owner: string) => string;
8
+ editingAs: string;
9
+ levels: Record<string, string>;
10
+ levelName: (kind: string, name: string) => string;
11
+ everyScreenBelow: (level: string) => string;
12
+ modeTitle: string;
13
+ modes: Record<'inherit' | 'extend' | 'override', {
14
+ title: string;
15
+ description: (owner: string) => string;
16
+ }>;
17
+ copyPrompt: string;
18
+ copyYes: string;
19
+ copyNo: string;
20
+ extendsNotice: string;
21
+ items: string;
22
+ add: (item: string) => string;
23
+ own: string;
24
+ fromLevel: (owner: string) => string;
25
+ contributedBy: (owner: string) => string;
26
+ hiddenHere: string;
27
+ overriddenHere: string;
28
+ hide: string;
29
+ bringBack: string;
30
+ contributionNote: string;
31
+ nothingYet: string;
32
+ bindings: {
33
+ title: string;
34
+ sets: string;
35
+ control: string;
36
+ controls: Record<string, string>;
37
+ shows: string;
38
+ valueFrom: string;
39
+ trend: string;
40
+ target: string;
41
+ slot: string;
42
+ icon: string;
43
+ opens: string;
44
+ opensChoices: Record<string, string>;
45
+ chooseParameter: string;
46
+ chooseScreen: string;
47
+ chooseField: string;
48
+ automatic: string;
49
+ noQuery: string;
50
+ };
51
+ otherOutlets: string;
52
+ modeOf: Record<'inherit' | 'extend' | 'override' | 'declares', string>;
53
+ added: (count: number) => string;
54
+ template: {
55
+ slots: string;
56
+ outlets: string;
57
+ name: string;
58
+ kind: string;
59
+ subject: string;
60
+ subjects: Record<string, string>;
61
+ slot: string;
62
+ noSlot: string;
63
+ defaults: string;
64
+ defaultsCount: (count: number) => string;
65
+ addOutlet: string;
66
+ removeOutlet: string;
67
+ removeDefault: string;
68
+ newOutletName: string;
69
+ routed: string;
70
+ primary: string;
71
+ optional: string;
72
+ };
73
+ }
74
+ export declare const defaultOutletStrings: OutletStrings;
@@ -0,0 +1,34 @@
1
+ import { OutletKind, type ComponentDesignModeDescriptor, type OutletItem, type OutletSubject, type SceneDocument } from '@cratis/scene.model';
2
+ import { type EffectiveOutlet, type OutletChain } from '@cratis/scene.engine';
3
+ import { type DesignModeItem, type DesignModeItemSource, type DesignModePlan, type DesignModeRejection } from '../designModeTypes';
4
+ import { type OutletBindingContext } from './outletBindings';
5
+ import { type OutletEditingLevel } from './outletDocument';
6
+ import type { OutletStrings } from './OutletStrings';
7
+ export type OutletLevelMode = 'inherit' | 'extend' | 'override';
8
+ export interface OutletDesignInputs {
9
+ document: SceneDocument;
10
+ outlets: OutletChain;
11
+ outlet: string;
12
+ level: OutletEditingLevel;
13
+ newId: () => string;
14
+ binding: OutletBindingContext;
15
+ strings: OutletStrings;
16
+ }
17
+ export interface OutletDesign extends DesignModeItemSource {
18
+ name: string;
19
+ outletKind: OutletKind;
20
+ subject?: OutletSubject;
21
+ slot?: string;
22
+ declaredBy?: string;
23
+ level: OutletEditingLevel;
24
+ mode: OutletLevelMode;
25
+ effective: EffectiveOutlet;
26
+ removed: readonly DesignModeItem[];
27
+ designMode: ComponentDesignModeDescriptor;
28
+ setMode: (mode: OutletLevelMode, copy?: boolean) => DesignModePlan | DesignModeRejection;
29
+ addItem: (item: OutletItem) => DesignModePlan;
30
+ hide: (item: DesignModeItem) => DesignModePlan | DesignModeRejection;
31
+ bringBack: (item: DesignModeItem) => DesignModePlan | DesignModeRejection;
32
+ }
33
+ export declare function declaresOutlet(outlets: OutletChain, outlet: string): boolean;
34
+ export declare function createOutletDesign(inputs: OutletDesignInputs): OutletDesign | undefined;
@@ -0,0 +1,23 @@
1
+ import { OutletItemKind, OutletSubject, type ApplicationStructure, type InspectedProperty, type OutletItem, type PropertyDescriptor, type QueryCandidate } from '@cratis/scene.model';
2
+ import type { OutletStrings } from './OutletStrings';
3
+ import type { HookPlacementInput, PlacementEnvironment } from '../../Placement/hookPlacement';
4
+ import type { PlacementStrings } from '../../Placement/PlacementStrings';
5
+ export interface OutletBindingContext {
6
+ queries: readonly QueryCandidate[];
7
+ screens: readonly {
8
+ id: string;
9
+ label: string;
10
+ }[];
11
+ actionProperties: readonly PropertyDescriptor[];
12
+ structure?: ApplicationStructure;
13
+ strings: OutletStrings['bindings'];
14
+ placement?: PlacementEnvironment;
15
+ placementStrings?: PlacementStrings;
16
+ outletSubject?: OutletSubject;
17
+ }
18
+ export declare function hookOf(item: OutletItem, context: Pick<OutletBindingContext, 'outletSubject'>): HookPlacementInput;
19
+ export declare const bindingActionsOf: (kind: OutletItemKind | string) => readonly string[];
20
+ export declare function bindingProperty(actionId: string, item: OutletItem, context: OutletBindingContext): InspectedProperty | undefined;
21
+ export declare function bindingChange(actionId: string, value: unknown): Record<string, unknown> | undefined;
22
+ export declare function bindingChips(item: OutletItem, context: OutletBindingContext): Record<string, string>;
23
+ export declare function isUnbound(item: OutletItem): boolean;
@@ -0,0 +1,6 @@
1
+ import { OutletItemKind, OutletKind, type ComponentDesignModeDescriptor } from '@cratis/scene.model';
2
+ export declare const addActionOf: Record<OutletKind, {
3
+ id: string;
4
+ item: OutletItemKind;
5
+ }>;
6
+ export declare function outletDesignModeOf(kind: OutletKind): ComponentDesignModeDescriptor;
@@ -0,0 +1,15 @@
1
+ import type { Outlet, OutletRefinement, SceneDocument } from '@cratis/scene.model';
2
+ import { OutletLevelKind, type OutletLevel } from '@cratis/scene.engine';
3
+ export type OutletDocument = SceneDocument & {
4
+ outletLevels?: OutletLevel[];
5
+ };
6
+ export interface OutletEditingLevel {
7
+ kind: OutletLevelKind;
8
+ name: string;
9
+ }
10
+ export declare const sameLevel: (one: OutletEditingLevel | undefined, other: OutletEditingLevel | undefined) => boolean;
11
+ export declare const outletLevelsOf: (document: SceneDocument) => OutletLevel[];
12
+ export declare function withOutletLevels(document: SceneDocument, levels: readonly OutletLevel[]): SceneDocument;
13
+ export declare function refinementAt(document: SceneDocument, level: OutletEditingLevel, outlet: string): OutletRefinement | undefined;
14
+ export declare function withRefinement(document: SceneDocument, level: OutletEditingLevel, outlet: string, refinement: OutletRefinement | undefined): SceneDocument;
15
+ export declare function withTemplateOutlets(document: SceneDocument, template: string, outlets: readonly Outlet[]): SceneDocument;
@@ -0,0 +1,11 @@
1
+ import type { OutletItem } from '@cratis/scene.model';
2
+ export declare function findOutletItem(items: readonly OutletItem[], id: string): OutletItem | undefined;
3
+ export declare function siblingsOfOutletItem(items: readonly OutletItem[], id: string): readonly OutletItem[] | undefined;
4
+ export declare const changeOutletItem: (items: readonly OutletItem[], id: string, change: Record<string, unknown>) => OutletItem[];
5
+ export declare const removeOutletItem: (items: readonly OutletItem[], id: string) => OutletItem[];
6
+ export declare function moveOutletItem(items: readonly OutletItem[], id: string, to: number): OutletItem[];
7
+ export declare function duplicateOutletItem(items: readonly OutletItem[], id: string, newId: () => string): {
8
+ items: OutletItem[];
9
+ copy?: OutletItem;
10
+ };
11
+ export declare const addOutletSubItem: (items: readonly OutletItem[], parentId: string, child: OutletItem) => OutletItem[];
@@ -0,0 +1,18 @@
1
+ import type { DialogTemplate, Layout, SceneDocument, ScreenTemplate } from '@cratis/scene.model';
2
+ import { type OutletChain, type OutletLevel } from '@cratis/scene.engine';
3
+ import { type OutletEditingLevel } from './outletDocument';
4
+ export interface ScreenOutletChainInputs {
5
+ document: SceneDocument;
6
+ screen: string;
7
+ path?: readonly string[];
8
+ templates?: readonly ScreenTemplate[];
9
+ layouts?: readonly Layout[];
10
+ dialogTemplate?: DialogTemplate;
11
+ }
12
+ export declare function screenOutletChain({ document, screen, path, templates, layouts, dialogTemplate }: ScreenOutletChainInputs): OutletChain;
13
+ export declare const editingLevelsOf: (chain: readonly OutletLevel[]) => OutletEditingLevel[];
14
+ export declare function chainAt(outlets: OutletChain, level: OutletEditingLevel | undefined): OutletChain;
15
+ export declare const declaredOutletsOf: (chain: readonly OutletLevel[]) => {
16
+ outlet: import("@cratis/scene.model").Outlet;
17
+ level: OutletLevel;
18
+ }[];
@@ -0,0 +1,44 @@
1
+ import { type DialogTemplate, type Layout, type OutletKind, PropertyDescriptor, QueryCandidate, SceneDocument, ScreenTemplate } from '@cratis/scene.model';
2
+ import { type DescriptorCatalog, type OutletChain } from '@cratis/scene.engine';
3
+ import type { ScreenEditorController } from '../../Host/ScreenEditorController';
4
+ import type { ScreenEditorEnvironment } from '../../Host/ScreenEditorHost';
5
+ import type { StateChangeSlice } from '../../Actions/StateChangeSlice';
6
+ import { type OutletDesign } from './createOutletDesign';
7
+ import type { OutletBindingContext } from './outletBindings';
8
+ import { type OutletEditingLevel } from './outletDocument';
9
+ import type { OutletStrings } from './OutletStrings';
10
+ export interface ScreenOutlets {
11
+ outlets: OutletChain;
12
+ levels: readonly OutletEditingLevel[];
13
+ level: OutletEditingLevel | undefined;
14
+ declared: readonly {
15
+ name: string;
16
+ kind: OutletKind;
17
+ owner: string;
18
+ shell: boolean;
19
+ }[];
20
+ binding: OutletBindingContext;
21
+ design: (outlet: string) => OutletDesign | undefined;
22
+ }
23
+ export interface ScreenOutletsInputs {
24
+ document: SceneDocument;
25
+ catalog: DescriptorCatalog;
26
+ path?: readonly string[];
27
+ templates?: readonly ScreenTemplate[];
28
+ layouts?: readonly Layout[];
29
+ dialogTemplate?: DialogTemplate;
30
+ requestedLevel?: OutletEditingLevel;
31
+ queries: readonly QueryCandidate[];
32
+ slices?: readonly StateChangeSlice[];
33
+ screens: readonly {
34
+ id: string;
35
+ label: string;
36
+ }[];
37
+ structure?: OutletBindingContext['structure'];
38
+ strings: OutletStrings;
39
+ newId?: () => string;
40
+ }
41
+ export declare function queriesOfScreen(document: SceneDocument, candidates: readonly QueryCandidate[]): QueryCandidate[];
42
+ export declare function actionPropertiesOf(catalog: DescriptorCatalog): PropertyDescriptor[];
43
+ export declare function screenOutletsOf(inputs: ScreenOutletsInputs): ScreenOutlets;
44
+ export declare function useScreenOutlets(controller: ScreenEditorController, environment: ScreenEditorEnvironment, strings: OutletStrings): ScreenOutlets;
@@ -1,4 +1,4 @@
1
- import type { ComponentDesignModeDescriptor, InspectedProperty, SceneEdit } from '@cratis/scene.model';
1
+ import type { ComponentDesignModeDescriptor, InspectedProperty, SceneDocument, SceneEdit } from '@cratis/scene.model';
2
2
  import type { NavigationEdit } from '@cratis/scene.engine';
3
3
  export declare const designModeActions: {
4
4
  readonly addItem: 'addItem';
@@ -9,6 +9,15 @@ export declare const designModeActions: {
9
9
  readonly slice: 'slice';
10
10
  readonly emphasis: 'emphasis';
11
11
  readonly display: 'display';
12
+ readonly addFilter: 'addFilter';
13
+ readonly addTab: 'addTab';
14
+ readonly addStat: 'addStat';
15
+ readonly sets: 'sets';
16
+ readonly control: 'control';
17
+ readonly shows: 'shows';
18
+ readonly valueFrom: 'valueFrom';
19
+ readonly opens: 'opens';
20
+ readonly enabled: 'enabled';
12
21
  readonly moveEarlier: 'moveEarlier';
13
22
  readonly moveLater: 'moveLater';
14
23
  readonly duplicate: 'duplicate';
@@ -18,7 +27,8 @@ export declare const designModeActions: {
18
27
  export declare enum DesignModeItemSourceKind {
19
28
  Elements = "elements",
20
29
  Collection = "collection",
21
- Region = "region"
30
+ Region = "region",
31
+ Outlet = "outlet"
22
32
  }
23
33
  export interface DesignModeItem {
24
34
  id: string;
@@ -36,6 +46,12 @@ export interface DesignModeItem {
36
46
  message: string;
37
47
  }[];
38
48
  unlinked: boolean;
49
+ provenance?: {
50
+ owner: string;
51
+ level: string;
52
+ source: string;
53
+ };
54
+ removal?: 'hidden' | 'overridden';
39
55
  }
40
56
  export interface DesignModeChoice {
41
57
  property: InspectedProperty;
@@ -50,6 +66,7 @@ export interface DesignModePlan {
50
66
  };
51
67
  renameNext?: boolean;
52
68
  navigationEdits?: NavigationEdit[];
69
+ documentChange?: (document: SceneDocument) => SceneDocument;
53
70
  notice?: string;
54
71
  editAtApplication?: boolean;
55
72
  }
@@ -2,6 +2,7 @@ import type { ApplicationStructure, DestinationReference, ExternalComponent, Nod
2
2
  import { type DescriptorCatalog } from '@cratis/scene.engine';
3
3
  import type { Ownership } from '../Structure/Ownership';
4
4
  import { type DesignModeItemSource, type DesignModeSubject } from './designModeTypes';
5
+ import type { OutletDesign } from './Outlets/createOutletDesign';
5
6
  export interface DesignModeInputs {
6
7
  roots: readonly SceneElement[];
7
8
  catalog: DescriptorCatalog;
@@ -17,5 +18,6 @@ export interface DesignModeInputs {
17
18
  structure?: ApplicationStructure;
18
19
  startingDestination?: DestinationReference;
19
20
  otherSource?: (component: ExternalComponent, selectedItemId: string | undefined) => DesignModeItemSource | undefined;
21
+ outletDesign?: (component: ExternalComponent) => OutletDesign | undefined;
20
22
  }
21
23
  export declare function resolveDesignMode(inputs: DesignModeInputs): DesignModeSubject | undefined;
@@ -4,6 +4,7 @@ import { type DesignModeItem, type DesignModePlan, type DesignModeRejection, typ
4
4
  import type { DesignModeStrings } from './DesignModeStrings';
5
5
  import { type DesignModeInputs } from './resolveDesignMode';
6
6
  import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
7
+ import { type ScreenOutlets } from './Outlets/screenOutlets';
7
8
  export interface DesignModeOptions {
8
9
  controller: ScreenEditorController;
9
10
  environment: ScreenEditorEnvironment;
@@ -26,6 +27,7 @@ export interface DesignModeState {
26
27
  act: (actionId: string, item: DesignModeItem) => boolean;
27
28
  rename: (item: DesignModeItem, label: string) => boolean;
28
29
  deselect: () => void;
30
+ outlets?: ScreenOutlets;
29
31
  }
30
32
  export declare function useDesignMode({ controller, environment, strings, startingLabels, startingDestination, otherSource }: DesignModeOptions): DesignModeState;
31
33
  export declare function regionOf(componentName: string): NavigationRegionKind | undefined;
@@ -0,0 +1,14 @@
1
+ import { type FormField, type QueryCandidate, type QueryResultField } from '@cratis/scene.model';
2
+ export interface FieldChoices {
3
+ query: string;
4
+ show: string;
5
+ }
6
+ export type ChoiceField = FormField & {
7
+ choices?: FieldChoices;
8
+ };
9
+ export declare const choicesOf: (field: FormField) => FieldChoices | undefined;
10
+ export declare function withChoices(field: FormField, choices: FieldChoices | undefined): FormField;
11
+ export declare const listQueriesOf: (candidates: readonly QueryCandidate[]) => QueryCandidate[];
12
+ export declare function defaultDisplayField(candidate: QueryCandidate): QueryResultField | undefined;
13
+ export declare function inferChoices(type: string, candidates: readonly QueryCandidate[]): FieldChoices | undefined;
14
+ export declare const choicesFor: (field: FormField, type: string | undefined, candidates: readonly QueryCandidate[]) => FieldChoices | undefined;
@@ -0,0 +1,8 @@
1
+ import type { FormField } from '@cratis/scene.model';
2
+ import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
+ export declare enum FieldMarkerKind {
4
+ BoundToCommand = "boundToCommand",
5
+ InheritedFromRules = "inheritedFromRules",
6
+ Local = "local"
7
+ }
8
+ export declare function fieldMarkersOf(field: FormField, slice: StateChangeSlice | undefined): FieldMarkerKind[];
@@ -1,4 +1,7 @@
1
1
  import type { CanvasPlacement } from '../Document/placeOnCanvas';
2
+ import type { DataField } from '../Data/DataField';
3
+ import type { DataFieldRefusal } from '../Data/insertDataField';
4
+ import type { TableDrop } from '../Surface/columnAt';
2
5
  import type { PreparedSceneScreenDraft, SceneScreenDraftPreparation } from '../Drafting/SceneScreenDraft';
3
6
  import type { ApplicationStructure, Behavior, DestinationReference, DialogTemplate, NavigationModel, Form, NodeInspection, SceneDiagnostic, SceneDocument, SceneEdit, SceneElement, ScreenTemplate, Slot, TemplateMetadata } from '@cratis/scene.model';
4
7
  import type { EditingContext, NavigationEdit } from '@cratis/scene.engine';
@@ -9,6 +12,8 @@ import type { StructureTreeAdapter } from '../Structure/StructureTreeAdapter';
9
12
  import type { EditorComposition } from '../Templates/composeEditorScreen';
10
13
  import type { DropRegion } from '../DropRegions/DropRegion';
11
14
  import type { LayoutItem } from '../Layouts/LayoutItem';
15
+ import type { OutletEditingLevel } from '../DesignMode/Outlets/outletDocument';
16
+ import type { ScreenEditorButtonToAdd } from './ScreenEditorHost';
12
17
  export type ElementMeasurer = (elementId: string) => {
13
18
  left: number;
14
19
  top: number;
@@ -24,8 +29,19 @@ export interface ScreenEditorController {
24
29
  rejected?: string;
25
30
  };
26
31
  setNavigationModule: (module: string | undefined) => void;
32
+ outletLevel: OutletEditingLevel | undefined;
33
+ setOutletLevel: (level: OutletEditingLevel | undefined) => void;
34
+ changeDocument: (change: (document: SceneDocument) => SceneDocument, label: string) => {
35
+ applied: boolean;
36
+ rejected?: string;
37
+ };
27
38
  selectedItemId: string | undefined;
28
39
  selectItem: (componentId: string | undefined, itemId: string | undefined) => void;
40
+ buttonToAdd: {
41
+ componentId: string;
42
+ button: ScreenEditorButtonToAdd;
43
+ } | undefined;
44
+ settleButtonToAdd: () => void;
29
45
  document: SceneDocument;
30
46
  prepareSceneScreenDraft?: (answer: string, parameterlessQueryIds: readonly string[]) => SceneScreenDraftPreparation;
31
47
  applySceneScreenDraft?: (draft: PreparedSceneScreenDraft) => {
@@ -57,6 +73,12 @@ export interface ScreenEditorController {
57
73
  validateMove: (edit: StructureEdit) => StructureEditRejection | undefined;
58
74
  insertComponent: (componentName: string, parentId: string | undefined, index: number | undefined, at?: CanvasPlacement) => void;
59
75
  insertLayout: (item: LayoutItem, parentId: string | undefined, index: number | undefined, at?: CanvasPlacement) => void;
76
+ insertElement: (element: SceneElement, parentId: string | undefined, index: number | undefined, label: string, at?: CanvasPlacement) => void;
77
+ insertDataField: (field: DataField, parentId: string | undefined, index: number | undefined, at?: CanvasPlacement, over?: TableDrop) => DataFieldRefusal | undefined;
78
+ generateForm: (sliceId: string, parentId: string | undefined, index: number | undefined) => DataFieldRefusal | undefined;
79
+ removeDataField: (field: Extract<DataField, {
80
+ source: 'query';
81
+ }>) => void;
60
82
  remove: (elementId: string) => void;
61
83
  canRemove: (elementId: string) => boolean;
62
84
  setProperty: (property: NodeInspection['properties'][number], value: unknown) => void;
@@ -18,6 +18,17 @@ export interface ScreenEditorSubject {
18
18
  authoringTemplate?: string;
19
19
  screenTemplate?: string;
20
20
  screen?: string;
21
+ select?: ScreenEditorSelection;
22
+ }
23
+ export interface ScreenEditorSelection {
24
+ componentId: string;
25
+ itemId?: string;
26
+ add?: ScreenEditorButtonToAdd;
27
+ }
28
+ export interface ScreenEditorButtonToAdd {
29
+ outlet: string;
30
+ slice: string;
31
+ title: string;
21
32
  }
22
33
  export interface ScreenEditorEnvironment {
23
34
  runtime: ScreenEditorRuntime;
@@ -33,5 +33,6 @@ export interface ScreenEditorWindowProps {
33
33
  onPreview?: (document: SceneDocument) => void;
34
34
  readOnly?: boolean;
35
35
  toolbarActions?: ReactNode;
36
+ renderControls?: (controls: ReactNode) => ReactNode;
36
37
  }
37
- export declare const ScreenEditorWindow: ({ controller, environment, strings, window: state, authoringTemplate, title, deviceFrame, saveFailure, onKeepEditing, onDiscard, onPreview, readOnly, toolbarActions }: ScreenEditorWindowProps) => import("react").JSX.Element;
38
+ export declare const ScreenEditorWindow: ({ controller, environment, strings, window: state, authoringTemplate, title, deviceFrame, saveFailure, onKeepEditing, onDiscard, onPreview, readOnly, toolbarActions, renderControls }: ScreenEditorWindowProps) => import("react").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import type { SceneDocument, ScreenTemplate } from '@cratis/scene.model';
2
2
  import { type SceneDocumentProblem } from '../Document/readSceneDocument';
3
3
  import type { ScreenEditorRuntime } from '../Runtime/screenEditorRuntime';
4
- import type { ScreenEditorSubject } from './ScreenEditorHost';
4
+ import type { ScreenEditorSelection, ScreenEditorSubject } from './ScreenEditorHost';
5
5
  export interface OpenedSubject {
6
6
  document: SceneDocument;
7
+ select?: ScreenEditorSelection;
7
8
  }
8
9
  export type OpenResult = {
9
10
  opened: true;
@@ -1,6 +1,7 @@
1
1
  import type { CommandInputSource } from '../Actions/commandInputSources';
2
2
  import type { ActionModel } from '../Actions/ActionModel';
3
3
  import { type StateChangeSlice } from '../Actions/StateChangeSlice';
4
+ import type { PlacementEnvironment } from '../Placement/hookPlacement';
4
5
  import type { ScreenEditorStrings } from './ScreenEditorStrings';
5
6
  export interface ActionEditorProps {
6
7
  action?: ActionModel;
@@ -8,7 +9,8 @@ export interface ActionEditorProps {
8
9
  sources: readonly CommandInputSource[];
9
10
  strings: ScreenEditorStrings;
10
11
  disabled: boolean;
12
+ placement?: PlacementEnvironment;
11
13
  suggestSource: (inputName: string) => string | undefined;
12
14
  onChange: (action: ActionModel | undefined) => void;
13
15
  }
14
- export declare const ActionEditor: ({ action, slices, sources, strings, disabled, suggestSource, onChange }: ActionEditorProps) => import("react").JSX.Element;
16
+ export declare const ActionEditor: ({ action, slices, sources, strings, disabled, placement, suggestSource, onChange }: ActionEditorProps) => import("react").JSX.Element;
@@ -1,10 +1,11 @@
1
- import type { Form } from '@cratis/scene.model';
1
+ import type { Form, QueryCandidate } from '@cratis/scene.model';
2
2
  import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
3
  import type { ScreenEditorStrings } from './ScreenEditorStrings';
4
4
  export interface CommandFormEditorProps {
5
5
  elementId: string;
6
6
  command: string | undefined;
7
7
  slices: readonly StateChangeSlice[];
8
+ queries?: readonly QueryCandidate[];
8
9
  forms: readonly Form[];
9
10
  strings: ScreenEditorStrings;
10
11
  disabled: boolean;
@@ -12,4 +13,4 @@ export interface CommandFormEditorProps {
12
13
  onFormChange: (form: Form) => void;
13
14
  onFormCreate: (slice: StateChangeSlice) => void;
14
15
  }
15
- export declare const CommandFormEditor: ({ elementId, command, slices, forms, strings, disabled, onCommandChange, onFormChange, onFormCreate }: CommandFormEditorProps) => import("react").JSX.Element;
16
+ export declare const CommandFormEditor: ({ elementId, command, slices, queries, forms, strings, disabled, onCommandChange, onFormChange, onFormCreate }: CommandFormEditorProps) => import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { type QueryBinding, type QueryCandidate, type QueryParameter } 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
+ interface FeedsProps {
6
+ controller: ScreenEditorController;
7
+ environment: ScreenEditorEnvironment;
8
+ strings: ScreenEditorStrings;
9
+ binding: QueryBinding;
10
+ candidate: QueryCandidate;
11
+ disabled?: boolean;
12
+ onChange?: (binding: QueryBinding, parameter: QueryParameter, path: string) => void;
13
+ }
14
+ export declare const ParameterFeedsSection: ({ controller, environment, strings, binding, candidate, disabled, onChange }: FeedsProps) => import("react").JSX.Element | null;
15
+ interface SelectionProps {
16
+ controller: ScreenEditorController;
17
+ environment: ScreenEditorEnvironment;
18
+ strings: ScreenEditorStrings;
19
+ elementId: string;
20
+ disabled: boolean;
21
+ }
22
+ export declare const SelectionDetailSection: ({ controller, environment, strings, elementId, disabled }: SelectionProps) => import("react").JSX.Element | null;
23
+ export {};
@@ -1,12 +1,13 @@
1
- import { type Form } from '@cratis/scene.model';
1
+ import { type Form, type QueryCandidate } from '@cratis/scene.model';
2
2
  import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
3
  import type { ScreenEditorStrings } from './ScreenEditorStrings';
4
4
  export interface FormEditorProps {
5
5
  form: Form;
6
6
  slice: StateChangeSlice | undefined;
7
7
  idPrefix: string;
8
+ queries?: readonly QueryCandidate[];
8
9
  strings: ScreenEditorStrings['properties']['forms'];
9
10
  disabled: boolean;
10
11
  onChange: (form: Form) => void;
11
12
  }
12
- export declare const FormEditor: ({ form, slice, idPrefix, strings: text, disabled, onChange }: FormEditorProps) => import("react").JSX.Element;
13
+ export declare const FormEditor: ({ form, slice, idPrefix, queries, strings: text, disabled, onChange }: FormEditorProps) => import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type Outlet, type Slot } from '@cratis/scene.model';
2
+ import type { OutletStrings } from '../DesignMode/Outlets/OutletStrings';
3
+ export interface OutletListEditorProps {
4
+ outlets: readonly Outlet[];
5
+ slots: readonly Slot[];
6
+ disabled: boolean;
7
+ strings: OutletStrings;
8
+ newId: () => string;
9
+ onChange: (outlets: Outlet[]) => void;
10
+ }
11
+ export declare const OutletListEditor: ({ outlets, slots, disabled, strings, newId, onChange }: OutletListEditorProps) => 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 OutletSectionProps {
5
+ controller: ScreenEditorController;
6
+ environment: ScreenEditorEnvironment;
7
+ strings: ScreenEditorStrings;
8
+ outlet: string;
9
+ componentId?: string;
10
+ onChooseOutlet?: (outlet: string) => void;
11
+ }
12
+ export declare const OutletSection: ({ controller, environment, strings, outlet, componentId, onChooseOutlet }: OutletSectionProps) => import("react").JSX.Element | null;
@@ -212,6 +212,14 @@ export interface ScreenEditorStrings {
212
212
  manual: string;
213
213
  fieldLabel: string;
214
214
  sourceProperty: string;
215
+ mapping: Record<'autoMapped' | 'renamed' | 'composed' | 'broken', string>;
216
+ markers: Record<'boundToCommand' | 'inheritedFromRules' | 'local', string>;
217
+ control: string;
218
+ controlText: string;
219
+ controlPicker: string;
220
+ choicesQuery: string;
221
+ choicesShow: string;
222
+ choicesInferred: string;
215
223
  fieldComposition: string;
216
224
  columns: string;
217
225
  column: (index: number) => string;
@@ -262,6 +270,28 @@ export interface ScreenEditorStrings {
262
270
  missingQuery: (query: string) => string;
263
271
  missingComponent: (componentId: string) => string;
264
272
  };
273
+ dataBinding: {
274
+ feedsTitle: string;
275
+ fedByFilter: (title: string) => string;
276
+ fedByRoute: (parameter: string, slot: string) => string;
277
+ fedByMapping: (source: string) => string;
278
+ fedByNothing: string;
279
+ routeSource: (parameter: string) => string;
280
+ routeSourceNone: string;
281
+ routeSourceOption: (parameter: string, slot: string) => string;
282
+ addFilter: string;
283
+ filtersInAddress: string;
284
+ selectionTitle: string;
285
+ selectionHint: string;
286
+ selectionNone: string;
287
+ selectionSlot: string;
288
+ selectionScreen: string;
289
+ selectionBy: string;
290
+ selectionNoSlot: string;
291
+ selectionSummary: (screen: string, slot: string, by: string) => string;
292
+ statFollowsFilters: (filters: string) => string;
293
+ statFollowsNothing: string;
294
+ };
265
295
  query: {
266
296
  label: string;
267
297
  choose: string;
@@ -278,6 +308,7 @@ export interface ScreenEditorStrings {
278
308
  loading: string;
279
309
  empty: string;
280
310
  error: string;
311
+ ready: string;
281
312
  };
282
313
  };
283
314
  action: {
@@ -0,0 +1,9 @@
1
+ import type { ScreenEditorController } from '../Host/ScreenEditorController';
2
+ import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
3
+ import type { ScreenEditorStrings } from './ScreenEditorStrings';
4
+ export interface ScreenOutletsSectionProps {
5
+ controller: ScreenEditorController;
6
+ environment: ScreenEditorEnvironment;
7
+ strings: ScreenEditorStrings;
8
+ }
9
+ export declare const ScreenOutletsSection: ({ controller, environment, strings }: ScreenOutletsSectionProps) => import("react").JSX.Element | null;
@@ -1,4 +1,5 @@
1
1
  import type { LayoutItem } from '../Layouts/LayoutItem';
2
+ import { type DataField } from '../Data/DataField';
2
3
  export type PalettePayload = {
3
4
  kind: 'layout';
4
5
  item: LayoutItem;
@@ -6,5 +7,8 @@ export type PalettePayload = {
6
7
  kind: 'component';
7
8
  componentName: string;
8
9
  package: string;
10
+ } | {
11
+ kind: 'field';
12
+ field: DataField;
9
13
  };
10
14
  export declare const isPalettePayload: (value: unknown) => value is PalettePayload;
@@ -0,0 +1,14 @@
1
+ import { OutletSubject } from '@cratis/scene.model';
2
+ import { type HookPlacementInput, type PlacementEnvironment } from './hookPlacement';
3
+ import type { EnabledValue } from './hookBinding';
4
+ import type { PlacementStrings } from './PlacementStrings';
5
+ export interface HookEnabledFieldProps {
6
+ hook: HookPlacementInput;
7
+ environment: PlacementEnvironment | undefined;
8
+ strings: PlacementStrings;
9
+ disabled?: boolean;
10
+ outletSubject?: OutletSubject;
11
+ value: EnabledValue;
12
+ onChange: (value: EnabledValue) => void;
13
+ }
14
+ export declare const HookEnabledField: ({ hook, environment, strings, disabled, outletSubject, value, onChange }: HookEnabledFieldProps) => import("react").JSX.Element;