@cratis/event-models 0.152.4 → 0.153.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 (21) hide show
  1. package/dist/screen-editor/ScreenEditor/Actions/bindingSourceMarkersFor.d.ts +4 -0
  2. package/dist/screen-editor/ScreenEditor/Actions/commandInputSources.d.ts +9 -0
  3. package/dist/screen-editor/ScreenEditor/Inspector/ActionEditor.d.ts +2 -1
  4. package/dist/screen-editor/ScreenEditor/Inspector/DesignTimePropertyEditorsSection.d.ts +14 -0
  5. package/dist/screen-editor/ScreenEditor/Inspector/ScreenEditorStrings.d.ts +19 -0
  6. package/dist/screen-editor/ScreenEditor/Inspector/TemplateBrowser.d.ts +2 -1
  7. package/dist/screen-editor/ScreenEditor/Inspector/TemplatePreviewPane.d.ts +11 -0
  8. package/dist/screen-editor/ScreenEditor/Integration/index.d.ts +0 -3
  9. package/dist/screen-editor/ScreenEditor/Runtime/createDesignTimeHost.d.ts +3 -0
  10. package/dist/screen-editor/ScreenEditor/Runtime/screenEditorRuntime.d.ts +3 -1
  11. package/dist/screen-editor/ScreenEditor/Runtime/studioEditorKinds.d.ts +1 -0
  12. package/dist/screen-editor/ScreenEditor/Surface/BindingSourceMarkers.d.ts +10 -0
  13. package/dist/screen-editor/ScreenEditor/Surface/useSelectedBindingMarkers.d.ts +4 -0
  14. package/dist/screen-editor/ScreenEditor/Templates/TemplatePreviewSize.d.ts +5 -0
  15. package/dist/screen-editor/ScreenEditor/Templates/templatePreview.d.ts +6 -0
  16. package/dist/screen-editor/index.js +2841 -2615
  17. package/dist/screen-editor/screen-editor.css +1 -1
  18. package/package.json +12 -12
  19. package/dist/screen-editor/ScreenEditor/Integration/DesignTimeActionExecutionContext.d.ts +0 -8
  20. package/dist/screen-editor/ScreenEditor/Integration/DesignTimeActionResult.d.ts +0 -7
  21. package/dist/screen-editor/ScreenEditor/Integration/runDesignTimeAction.d.ts +0 -4
@@ -0,0 +1,4 @@
1
+ import type { BindingSourceMarker } from '../Surface/BindingSourceMarkers';
2
+ import type { CommandInputSource } from './commandInputSources';
3
+ import type { ActionModel } from './ActionModel';
4
+ export declare function bindingSourceMarkersFor(action: ActionModel | undefined, sources: readonly CommandInputSource[]): BindingSourceMarker[];
@@ -0,0 +1,9 @@
1
+ import type { ComponentOutputSource } from '../Binding/bindingSources';
2
+ export declare const componentSourcePrefix = "component.";
3
+ export interface CommandInputSource {
4
+ path: string;
5
+ label: string;
6
+ }
7
+ export declare function componentSourcePath(componentId: string, outputPath: string): string;
8
+ export declare function commandInputSources(dataContext: readonly string[], outputs: readonly ComponentOutputSource[], ownComponentId: string): CommandInputSource[];
9
+ export declare function componentOfSource(source: string): string | undefined;
@@ -1,10 +1,11 @@
1
+ import type { CommandInputSource } from '../Actions/commandInputSources';
1
2
  import type { ActionModel } from '../Actions/ActionModel';
2
3
  import type { StateChangeSlice } from '../Actions/StateChangeSlice';
3
4
  import type { ScreenEditorStrings } from './ScreenEditorStrings';
4
5
  export interface ActionEditorProps {
5
6
  action?: ActionModel;
6
7
  slices: readonly StateChangeSlice[];
7
- sources: readonly string[];
8
+ sources: readonly CommandInputSource[];
8
9
  strings: ScreenEditorStrings;
9
10
  disabled: boolean;
10
11
  suggestSource: (inputName: string) => string | undefined;
@@ -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 DesignTimePropertyEditorsSectionProps {
6
+ component: ExternalComponent;
7
+ descriptor: ComponentDescriptor;
8
+ properties: readonly InspectedProperty[];
9
+ controller: ScreenEditorController;
10
+ environment: ScreenEditorEnvironment;
11
+ strings: ScreenEditorStrings;
12
+ disabled: boolean;
13
+ }
14
+ export declare const DesignTimePropertyEditorsSection: ({ component, descriptor, properties, controller, environment, strings, disabled }: DesignTimePropertyEditorsSectionProps) => import("react").JSX.Element | null;
@@ -7,6 +7,8 @@ import type { StructureEditRejection } from '../Structure/StructureEditRejection
7
7
  import type { SurfaceStrings } from '../Surface/DesignTime/SurfaceStrings';
8
8
  import type { DestinationProblemKind } from '../Destinations/DestinationProblemKind';
9
9
  import type { TemplateInapplicability } from '../Templates/TemplateInapplicability';
10
+ import type { TemplatePreviewSize } from '../Templates/TemplatePreviewSize';
11
+ import type { TemplatePreviewState } from '@cratis/scene.blueprint.default';
10
12
  export interface ScreenEditorStrings {
11
13
  inspectorTitle: string;
12
14
  windowLabel: string;
@@ -53,6 +55,7 @@ export interface ScreenEditorStrings {
53
55
  noProperties: string;
54
56
  designTimeActions: string;
55
57
  designTimeDesigners: string;
58
+ designTimePropertyEditors: string;
56
59
  designerFailed: (designer: string) => string;
57
60
  layoutType: string;
58
61
  changeLayout: string;
@@ -81,6 +84,22 @@ export interface ScreenEditorStrings {
81
84
  uncategorized: string;
82
85
  provenance: (packageName: string) => string;
83
86
  inapplicable: Record<TemplateInapplicability, string>;
87
+ previewAction: string;
88
+ preview: (template: string) => string;
89
+ previewState: string;
90
+ previewStates: Record<TemplatePreviewState, string>;
91
+ previewSize: string;
92
+ previewSizes: Record<TemplatePreviewSize, string>;
93
+ previewFailed: string;
94
+ noPreview: string;
95
+ provenanceLabel: string;
96
+ license: string;
97
+ attribution: string;
98
+ compatibility: string;
99
+ compatible: string;
100
+ incompatible: string;
101
+ apply: string;
102
+ discard: string;
84
103
  };
85
104
  outlets: {
86
105
  label: string;
@@ -8,5 +8,6 @@ export interface TemplateBrowserProps {
8
8
  disabled: boolean;
9
9
  strings: ScreenEditorStrings['properties']['templates'];
10
10
  onSelect: (template: string | undefined) => void;
11
+ onPreview?: (template: string) => void;
11
12
  }
12
- export declare const TemplateBrowser: ({ packages, scope, selected, disabled, strings, onSelect }: TemplateBrowserProps) => import("react").JSX.Element;
13
+ export declare const TemplateBrowser: ({ packages, scope, selected, disabled, strings, onSelect, onPreview }: TemplateBrowserProps) => import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
2
+ import type { ScreenEditorStrings } from './ScreenEditorStrings';
3
+ export interface TemplatePreviewPaneProps {
4
+ templateName: string;
5
+ environment: ScreenEditorEnvironment;
6
+ strings: ScreenEditorStrings['properties']['templates'];
7
+ disabled: boolean;
8
+ onApply: () => void;
9
+ onDiscard: () => void;
10
+ }
11
+ export declare const TemplatePreviewPane: ({ templateName, environment, strings, disabled, onApply, onDiscard }: TemplatePreviewPaneProps) => import("react").JSX.Element;
@@ -8,7 +8,4 @@ export * from './CommandFormColumn';
8
8
  export * from './CommandFormConfiguration';
9
9
  export * from './CommandFormInput';
10
10
  export * from './CommandFormMode';
11
- export * from './DesignTimeActionExecutionContext';
12
- export * from './DesignTimeActionResult';
13
11
  export * from './bindingSourceChoices';
14
- export * from './runDesignTimeAction';
@@ -0,0 +1,3 @@
1
+ import type { UiProfile } from '@cratis/scene.model';
2
+ import { type DesignTimeHost, type ScenePackageBundle } from '@cratis/scene.react';
3
+ export declare function createDesignTimeHost(bundles: ScenePackageBundle[], profile: UiProfile): DesignTimeHost;
@@ -1,6 +1,6 @@
1
1
  import { type DescriptorCatalog, type EffectiveIconCatalog, type PackageCatalog } from '@cratis/scene.engine';
2
2
  import type { ComponentDescriptor, UiProfile } from '@cratis/scene.model';
3
- import { type ComponentRegistry, type IconAdapterRegistry, type ScenePackageBundle } from '@cratis/scene.react';
3
+ import { type ComponentRegistry, type DesignTimeHost, type IconAdapterRegistry, type ScenePackageBundle } from '@cratis/scene.react';
4
4
  import type { ScreenEditorAppearance } from './ScreenEditorAppearance';
5
5
  export interface ScreenEditorRuntime {
6
6
  id: number;
@@ -13,6 +13,8 @@ export interface ScreenEditorRuntime {
13
13
  appearance?: ScreenEditorAppearance;
14
14
  icons: EffectiveIconCatalog;
15
15
  iconAdapters: IconAdapterRegistry;
16
+ designTime: DesignTimeHost;
17
+ packageDescriptorOf: (descriptor: ComponentDescriptor) => ComponentDescriptor;
16
18
  isKnownComponent: (bareName: string) => boolean;
17
19
  legacyTypeOf: (componentName: string) => string | undefined;
18
20
  }
@@ -0,0 +1 @@
1
+ export declare const studioEditorKinds: readonly string[];
@@ -0,0 +1,10 @@
1
+ import { type RefObject } from 'react';
2
+ export interface BindingSourceMarker {
3
+ componentId: string;
4
+ label: string;
5
+ }
6
+ export interface BindingSourceMarkersProps {
7
+ surface: RefObject<HTMLDivElement | null>;
8
+ markers: readonly BindingSourceMarker[];
9
+ }
10
+ export declare const BindingSourceMarkers: ({ surface, markers }: BindingSourceMarkersProps) => import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { ScreenEditorController } from '../Host/ScreenEditorController';
2
+ import type { ScreenEditorEnvironment } from '../Host/ScreenEditorHost';
3
+ import type { BindingSourceMarker } from './BindingSourceMarkers';
4
+ export declare function useSelectedBindingMarkers(controller: ScreenEditorController, environment: ScreenEditorEnvironment): BindingSourceMarker[];
@@ -0,0 +1,5 @@
1
+ export declare enum TemplatePreviewSize {
2
+ Desktop = "desktop",
3
+ Tablet = "tablet",
4
+ Phone = "phone"
5
+ }
@@ -0,0 +1,6 @@
1
+ import type { SceneElement, UiProfile } from '@cratis/scene.model';
2
+ import { type TemplateCatalogEntry } from '@cratis/scene.engine';
3
+ import { type TemplatePreviewState } from '@cratis/scene.blueprint.default';
4
+ import type { ScenePackageBundle } from '@cratis/scene.react';
5
+ export declare function templatePreview(templateName: string, state: TemplatePreviewState, bundles: readonly ScenePackageBundle[], profile: UiProfile): SceneElement | undefined;
6
+ export declare function catalogEntryOf(templateName: string, catalog: readonly TemplateCatalogEntry[]): TemplateCatalogEntry | undefined;