Add shared automation and WebUI editing primitives

This commit is contained in:
2026-07-31 02:48:56 +02:00
parent f0898fcdee
commit 5b55f59a92
42 changed files with 3788 additions and 554 deletions
+21
View File
@@ -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