Add shared automation and WebUI editing primitives
This commit is contained in:
@@ -6,6 +6,13 @@ import type {
|
||||
} from "../types";
|
||||
|
||||
export const PLATFORM_VIEW_CHANGED_EVENT = "govoplan:view-changed";
|
||||
export const PLATFORM_WORKFLOW_VIEW_CHANGED_EVENT =
|
||||
"govoplan:workflow-view-changed";
|
||||
|
||||
export type WorkflowViewChangedEventDetail = {
|
||||
projection: EffectiveViewProjection | null;
|
||||
contextId?: string | null;
|
||||
};
|
||||
|
||||
export function moduleViewSurfaceId(moduleId: string): string {
|
||||
return `${moduleId}.module`;
|
||||
@@ -115,6 +122,20 @@ export function dispatchPlatformViewChanged(): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function dispatchWorkflowViewChanged(
|
||||
projection: EffectiveViewProjection | null,
|
||||
contextId?: string | null
|
||||
): void {
|
||||
if (typeof window !== "undefined") {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent<WorkflowViewChangedEventDetail>(
|
||||
PLATFORM_WORKFLOW_VIEW_CHANGED_EVENT,
|
||||
{ detail: { projection, contextId } }
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function addSurface(
|
||||
target: Map<string, PlatformViewSurface>,
|
||||
surface: PlatformViewSurface
|
||||
|
||||
Reference in New Issue
Block a user