@cratis/event-models 0.348.3 → 0.349.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/README.md +2 -0
- package/dist/Board/BoardActions.d.ts +2 -0
- package/dist/Rows/UserExperience/AddPrototypeButton.d.ts +4 -1
- package/dist/Rows/UserExperience/PrototypeVisualAction.d.ts +9 -0
- package/dist/Rows/UserExperience/UiCell.d.ts +2 -1
- package/dist/Rows/UserExperience/addPrototypeMenuItems.d.ts +3 -1
- package/dist/Rows/UserExperience/index.d.ts +1 -0
- package/dist/Slices/sliceFindings.d.ts +3 -0
- package/dist/index.js +1842 -1816
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -235,6 +235,8 @@ import { ScreenEditorPrimeReactProvider } from '@cratis/event-models/screen-edit
|
|
|
235
235
|
|
|
236
236
|
`@cratis/components` 4.25 or later is required by this entry, and is now the minimum for the package. Consumers that only draw the board need to move to it too.
|
|
237
237
|
|
|
238
|
+
A host that keeps more with a screen than a prototype (sketches, mockup pages, images) offers it from the same add button: `actions.prototypeVisuals` is a list of `{ id, label, description?, icon?, onChosen(sliceId, actorId, host) }` listed in the add menu below the prototype choices, after a separator. While an actor has no screen, `UiCell`'s `visual` prop draws the host's latest visual in the place of the thumbnail - without flow connectors, and with the add button still shown so a prototype can be started. A cell that has a prototype ignores it.
|
|
239
|
+
|
|
238
240
|
## Logo, view options and your own tools
|
|
239
241
|
|
|
240
242
|
The board can draw the Cratis logo and a toolbar over itself. Both are off unless you ask for them:
|
|
@@ -2,6 +2,7 @@ import type { Guid } from '@cratis/fundamentals';
|
|
|
2
2
|
import type { CardSurface } from '../Cards/CardSurface';
|
|
3
3
|
import type { CellAction } from '../Rows/CellAction';
|
|
4
4
|
import type { PrototypeTemplate } from '../Rows/UserExperience/PrototypeTemplate';
|
|
5
|
+
import type { PrototypeVisualAction } from '../Rows/UserExperience/PrototypeVisualAction';
|
|
5
6
|
import type { SpecificationAction, SpecificationCollectionAction, SpecificationGenerationAction, SpecificationProblemAction } from '../Specifications/SpecificationAction';
|
|
6
7
|
import type { SliceHeaderAction } from '../Slices/SliceHeaderAction';
|
|
7
8
|
import type { SlicePreviewAction } from '../Slices/SlicePreviewAction';
|
|
@@ -36,6 +37,7 @@ export interface BoardActions {
|
|
|
36
37
|
readModelCardFor?: (readModelId: Guid) => CardSurface | undefined;
|
|
37
38
|
eventsRow?: readonly CellAction[];
|
|
38
39
|
prototypeTemplates?: readonly PrototypeTemplate[];
|
|
40
|
+
prototypeVisuals?: readonly PrototypeVisualAction[];
|
|
39
41
|
interactionRow?: readonly CellAction[];
|
|
40
42
|
specificationRun?: SpecificationAction;
|
|
41
43
|
specificationStop?: SpecificationAction;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { PrototypeTemplate } from './PrototypeTemplate';
|
|
2
|
+
import type { PrototypeVisualAction } from './PrototypeVisualAction';
|
|
2
3
|
export interface AddPrototypeButtonProps {
|
|
3
4
|
templates: readonly PrototypeTemplate[];
|
|
4
5
|
onFromScratch: (host: DOMRect) => void;
|
|
5
6
|
onFromTemplate: (template: PrototypeTemplate, host: DOMRect) => void;
|
|
7
|
+
visuals?: readonly PrototypeVisualAction[];
|
|
8
|
+
onVisual?: (visual: PrototypeVisualAction, host: DOMRect) => void;
|
|
6
9
|
}
|
|
7
|
-
export declare const AddPrototypeButton: ({ templates, onFromScratch, onFromTemplate }: AddPrototypeButtonProps) => import("react").JSX.Element;
|
|
10
|
+
export declare const AddPrototypeButton: ({ templates, onFromScratch, onFromTemplate, visuals, onVisual }: AddPrototypeButtonProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Guid } from '@cratis/fundamentals';
|
|
3
|
+
export interface PrototypeVisualAction {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
onChosen: (sliceId: Guid, actorId: string, host: DOMRect) => void;
|
|
9
|
+
}
|
|
@@ -20,5 +20,6 @@ export interface UiCellProps {
|
|
|
20
20
|
}) => ReactNode;
|
|
21
21
|
adornment?: ReactNode;
|
|
22
22
|
corner?: ReactNode;
|
|
23
|
+
visual?: ReactNode;
|
|
23
24
|
}
|
|
24
|
-
export declare const UiCell: ({ elements, windowSize, layout, collapsed, conn, rowHeight, actorId, hasScreen, renderThumbnail, adornment, corner }: UiCellProps) => React.JSX.Element;
|
|
25
|
+
export declare const UiCell: ({ elements, windowSize, layout, collapsed, conn, rowHeight, actorId, hasScreen, renderThumbnail, adornment, corner, visual }: UiCellProps) => React.JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { EventModelMessages } from '../../Messages';
|
|
2
2
|
import type { MenuDropdownItem } from '../../Menus';
|
|
3
3
|
import type { PrototypeTemplate } from './PrototypeTemplate';
|
|
4
|
+
import type { PrototypeVisualAction } from './PrototypeVisualAction';
|
|
4
5
|
export interface AddPrototypeMenuActions {
|
|
5
6
|
onFromScratch: () => void;
|
|
6
7
|
onFromTemplate: (template: PrototypeTemplate) => void;
|
|
8
|
+
onVisual?: (visual: PrototypeVisualAction) => void;
|
|
7
9
|
}
|
|
8
|
-
export declare const addPrototypeMenuItems: (templates: readonly PrototypeTemplate[], messages: EventModelMessages['prototypes'], actions: AddPrototypeMenuActions) => MenuDropdownItem[];
|
|
10
|
+
export declare const addPrototypeMenuItems: (templates: readonly PrototypeTemplate[], messages: EventModelMessages['prototypes'], actions: AddPrototypeMenuActions, visuals?: readonly PrototypeVisualAction[]) => MenuDropdownItem[];
|