@cyoda/workflow-react 0.1.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/LICENSE +201 -0
- package/README.md +32 -0
- package/dist/index.cjs +2922 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +271 -0
- package/dist/index.d.ts +271 -0
- package/dist/index.js +2918 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/WorkflowEditor.tsx","../src/i18n/context.ts","../src/i18n/en.ts","../src/state/store.ts","../src/state/derive.ts","../src/components/Canvas.tsx","../src/components/ArrowMarkers.tsx","../src/components/RfStateNode.tsx","../src/components/RfTransitionEdge.tsx","../src/routing/orthogonal.ts","../src/components/resolveConnection.ts","../src/inspector/Inspector.tsx","../src/inspector/resolve.ts","../src/inspector/fields.tsx","../src/inspector/WorkflowForm.tsx","../src/inspector/StateForm.tsx","../src/inspector/TransitionForm.tsx","../src/inspector/ProcessorForm.tsx","../src/toolbar/Toolbar.tsx","../src/toolbar/WorkflowTabs.tsx","../src/modals/DeleteStateModal.tsx","../src/modals/DragConnectModal.tsx","../src/save/useSaveFlow.ts","../src/save/SaveConfirmModal.tsx","../src/save/ConflictBanner.tsx","../src/save/diff.ts"],"sourcesContent":["export { WorkflowEditor } from \"./components/WorkflowEditor.js\";\nexport type { WorkflowEditorProps } from \"./components/WorkflowEditor.js\";\nexport type { LayoutOptions, LayoutPreset, PinnedNode } from \"@cyoda/workflow-layout\";\nexport type { EditorMode, Selection } from \"./state/types.js\";\nexport { defaultMessages } from \"./i18n/en.js\";\nexport { I18nContext, useMessages, mergeMessages } from \"./i18n/context.js\";\nexport type { PartialMessages } from \"./i18n/context.js\";\nexport type { Messages } from \"./i18n/en.js\";\nexport { useSaveFlow } from \"./save/useSaveFlow.js\";\nexport type { SaveFlow, UseSaveFlowArgs } from \"./save/useSaveFlow.js\";\nexport { SaveConfirmModal } from \"./save/SaveConfirmModal.js\";\nexport type { SaveConfirmModalProps } from \"./save/SaveConfirmModal.js\";\nexport { ConflictBanner } from \"./save/ConflictBanner.js\";\nexport type { ConflictBannerProps } from \"./save/ConflictBanner.js\";\nexport { diffSummary } from \"./save/diff.js\";\n","import { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { Connection } from \"reactflow\";\nimport type {\n DomainPatch,\n EditorViewport,\n Workflow,\n WorkflowEditorDocument,\n} from \"@cyoda/workflow-core\";\nimport type { LayoutOptions } from \"@cyoda/workflow-layout\";\nimport { I18nContext, mergeMessages, type PartialMessages } from \"../i18n/context.js\";\nimport { useEditorStore } from \"../state/store.js\";\nimport { deriveFromDocument } from \"../state/derive.js\";\nimport type { EditorMode, Selection } from \"../state/types.js\";\nimport { Canvas } from \"./Canvas.js\";\nimport { resolveConnection, type PendingConnect } from \"./resolveConnection.js\";\nimport { Inspector } from \"../inspector/Inspector.js\";\nimport { Toolbar } from \"../toolbar/Toolbar.js\";\nimport { WorkflowTabs } from \"../toolbar/WorkflowTabs.js\";\nimport { DeleteStateModal } from \"../modals/DeleteStateModal.js\";\nimport { DragConnectModal } from \"../modals/DragConnectModal.js\";\n\nexport interface WorkflowEditorProps {\n document: WorkflowEditorDocument;\n mode?: EditorMode;\n messages?: PartialMessages;\n layoutOptions?: LayoutOptions;\n onChange?: (doc: WorkflowEditorDocument) => void;\n onSave?: (doc: WorkflowEditorDocument) => void;\n}\n\ninterface PendingDelete {\n workflow: string;\n stateCode: string;\n}\n\nfunction defaultNewWorkflow(existing: string[]): Workflow {\n let n = existing.length + 1;\n while (existing.includes(`workflow${n}`)) n++;\n return {\n version: \"1.0\",\n name: `workflow${n}`,\n initialState: \"start\",\n active: true,\n states: { start: { transitions: [] } },\n };\n}\n\n/** Top-level editor shell — spec §14. Provides viewer/playground/editor modes. */\nexport function WorkflowEditor({\n document: initialDocument,\n mode = \"editor\",\n messages,\n layoutOptions,\n onChange,\n onSave,\n}: WorkflowEditorProps) {\n const mergedMessages = useMemo(() => mergeMessages(messages), [messages]);\n const [state, actions] = useEditorStore(initialDocument, mode);\n const [pendingDelete, setPendingDelete] = useState<PendingDelete | null>(null);\n const [pendingConnect, setPendingConnect] = useState<PendingConnect | null>(null);\n\n useEffect(() => {\n onChange?.(state.document);\n }, [state.document, onChange]);\n\n const readOnly = state.mode === \"viewer\";\n const derived = useMemo(\n () => deriveFromDocument(state.document),\n [state.document.session, state.document.meta.ids],\n );\n\n const dispatch = (patch: DomainPatch) => actions.dispatch(patch);\n\n const requestDeleteState = (workflow: string, stateCode: string) => {\n setPendingDelete({ workflow, stateCode });\n };\n\n const confirmDelete = () => {\n if (!pendingDelete) return;\n dispatch({\n op: \"removeState\",\n workflow: pendingDelete.workflow,\n stateCode: pendingDelete.stateCode,\n });\n setPendingDelete(null);\n };\n\n const handleConnect = (connection: Connection) => {\n const resolved = resolveConnection(state.document, connection);\n if (resolved) setPendingConnect(resolved);\n };\n\n const confirmConnect = (name: string) => {\n if (!pendingConnect) return;\n dispatch({\n op: \"addTransition\",\n workflow: pendingConnect.workflow,\n fromState: pendingConnect.fromState,\n transition: {\n name,\n next: pendingConnect.toState,\n manual: false,\n disabled: false,\n },\n });\n setPendingConnect(null);\n };\n\n const workflows = state.document.session.workflows;\n const showTabs = workflows.length > 1 || state.mode !== \"viewer\";\n\n const anyModalOpen = pendingDelete !== null || pendingConnect !== null;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (anyModalOpen) return;\n const mod = e.ctrlKey || e.metaKey;\n if (mod && (e.key === \"z\" || e.key === \"Z\") && !e.shiftKey) {\n if (!readOnly && state.undoStack.length > 0) {\n e.preventDefault();\n actions.undo();\n }\n return;\n }\n if (mod && ((e.key === \"z\" && e.shiftKey) || e.key === \"y\" || e.key === \"Y\")) {\n if (!readOnly && state.redoStack.length > 0) {\n e.preventDefault();\n actions.redo();\n }\n return;\n }\n if (mod && (e.key === \"s\" || e.key === \"S\")) {\n if (onSave && !readOnly && derived.errorCount === 0) {\n e.preventDefault();\n onSave(state.document);\n }\n return;\n }\n },\n [\n anyModalOpen,\n readOnly,\n state.undoStack.length,\n state.redoStack.length,\n state.document,\n actions,\n onSave,\n derived.errorCount,\n ],\n );\n\n const pendingConnectState = useMemo(() => {\n if (!pendingConnect) return null;\n const wf = state.document.session.workflows.find(\n (w) => w.name === pendingConnect.workflow,\n );\n if (!wf) return null;\n return wf.states[pendingConnect.fromState] ?? null;\n }, [pendingConnect, state.document]);\n\n const orientation = layoutOptions?.orientation ?? \"vertical\";\n const savedViewport =\n state.activeWorkflow\n ? state.document.meta.workflowUi[state.activeWorkflow]?.viewports?.[orientation]\n : undefined;\n\n const handleViewportChange = useCallback(\n (viewport: EditorViewport) => {\n const workflow = state.activeWorkflow;\n if (!workflow) return;\n const current = state.document.meta.workflowUi[workflow] ?? {};\n const existing = current.viewports?.[orientation];\n const nextViewport = normalizeViewport(viewport);\n if (existing && sameViewport(existing, nextViewport)) return;\n\n actions.silentReplace(\n {\n session: state.document.session,\n meta: {\n ...state.document.meta,\n workflowUi: {\n ...state.document.meta.workflowUi,\n [workflow]: {\n ...current,\n viewports: {\n ...(current.viewports ?? {}),\n [orientation]: nextViewport,\n },\n },\n },\n },\n },\n { preserveEditorState: true },\n );\n },\n [actions, orientation, state.activeWorkflow, state.document],\n );\n\n return (\n <I18nContext.Provider value={mergedMessages}>\n <div\n style={{\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Inter\", system-ui, sans-serif',\n outline: \"none\",\n }}\n data-testid=\"workflow-editor\"\n onKeyDown={handleKeyDown}\n tabIndex={-1}\n >\n <Toolbar\n derived={derived}\n canUndo={state.undoStack.length > 0}\n canRedo={state.redoStack.length > 0}\n readOnly={readOnly}\n onUndo={actions.undo}\n onRedo={actions.redo}\n onSave={onSave ? () => onSave(state.document) : undefined}\n />\n {showTabs && (\n <WorkflowTabs\n workflows={workflows}\n activeWorkflow={state.activeWorkflow}\n readOnly={readOnly}\n onSelect={actions.setActiveWorkflow}\n onAdd={() =>\n dispatch({\n op: \"addWorkflow\",\n workflow: defaultNewWorkflow(workflows.map((w) => w.name)),\n })\n }\n onClose={(name) => dispatch({ op: \"removeWorkflow\", workflow: name })}\n />\n )}\n <div style={{ flex: 1, display: \"flex\", minHeight: 0 }}>\n <div style={{ flex: 1, minWidth: 0 }}>\n <Canvas\n graph={derived.graph}\n issues={derived.issues}\n activeWorkflow={state.activeWorkflow}\n selection={state.selection}\n layoutOptions={layoutOptions}\n savedViewport={savedViewport}\n onSelectionChange={(sel: Selection) => actions.setSelection(sel)}\n onViewportChange={handleViewportChange}\n onConnect={handleConnect}\n readOnly={readOnly}\n />\n </div>\n <Inspector\n document={state.document}\n selection={state.selection}\n issues={derived.issues}\n readOnly={readOnly}\n onDispatch={dispatch}\n onSelectionChange={actions.setSelection}\n onRequestDeleteState={requestDeleteState}\n />\n </div>\n {pendingDelete && (\n <DeleteStateModal\n document={state.document}\n workflow={pendingDelete.workflow}\n stateCode={pendingDelete.stateCode}\n onConfirm={confirmDelete}\n onCancel={() => setPendingDelete(null)}\n />\n )}\n {pendingConnect && pendingConnectState && (\n <DragConnectModal\n source={pendingConnectState}\n fromState={pendingConnect.fromState}\n toState={pendingConnect.toState}\n onCreate={confirmConnect}\n onCancel={() => setPendingConnect(null)}\n />\n )}\n </div>\n </I18nContext.Provider>\n );\n}\n\nfunction normalizeViewport(viewport: EditorViewport): EditorViewport {\n return {\n x: Math.round(viewport.x * 100) / 100,\n y: Math.round(viewport.y * 100) / 100,\n zoom: Math.round(viewport.zoom * 1000) / 1000,\n };\n}\n\nfunction sameViewport(a: EditorViewport, b: EditorViewport): boolean {\n return a.x === b.x && a.y === b.y && a.zoom === b.zoom;\n}\n","import { createContext, useContext } from \"react\";\nimport { defaultMessages, type Messages } from \"./en.js\";\n\nexport const I18nContext = createContext<Messages>(defaultMessages);\n\nexport function useMessages(): Messages {\n return useContext(I18nContext);\n}\n\nexport type PartialMessages = {\n [K in keyof Messages]?: Partial<Messages[K]>;\n};\n\nexport function mergeMessages(overrides?: PartialMessages): Messages {\n if (!overrides) return defaultMessages;\n const next: Record<string, unknown> = { ...defaultMessages };\n for (const key of Object.keys(overrides)) {\n const base = (defaultMessages as Record<string, unknown>)[key] ?? {};\n const patch = (overrides as Record<string, unknown>)[key] ?? {};\n next[key] = { ...(base as object), ...(patch as object) };\n }\n return next as Messages;\n}\n","export const defaultMessages = {\n toolbar: {\n undo: \"Undo\",\n redo: \"Redo\",\n validate: \"Validate\",\n errors: \"errors\",\n warnings: \"warnings\",\n infos: \"infos\",\n save: \"Save\",\n addWorkflow: \"Add workflow\",\n },\n inspector: {\n empty: \"Select a node or edge to edit its properties.\",\n properties: \"Properties\",\n json: \"JSON\",\n name: \"Name\",\n description: \"Description\",\n version: \"Version\",\n active: \"Active\",\n initialState: \"Initial state\",\n manual: \"Manual\",\n disabled: \"Disabled\",\n processors: \"Processors\",\n criterion: \"Criterion\",\n executionMode: \"Execution mode\",\n addProcessor: \"Add processor\",\n removeProcessor: \"Remove\",\n moveUp: \"Move up\",\n moveDown: \"Move down\",\n issues: \"Issues\",\n sourceAnchor: \"Source anchor\",\n targetAnchor: \"Target anchor\",\n anchorDefault: \"Default\",\n anchorTop: \"Top\",\n anchorRight: \"Right\",\n anchorBottom: \"Bottom\",\n anchorLeft: \"Left\",\n },\n confirmDelete: {\n title: \"Delete state?\",\n message: \"Deleting this state will also remove transitions that reference it.\",\n transitionsAffected: \"Transitions affected\",\n confirm: \"Delete\",\n cancel: \"Cancel\",\n },\n dragConnect: {\n title: \"New transition\",\n transitionName: \"Transition name\",\n create: \"Create\",\n cancel: \"Cancel\",\n invalidName:\n \"Name must start with a letter and contain only letters, digits, underscores, or hyphens.\",\n duplicateName: \"A transition with this name already exists on the source state.\",\n },\n tabs: {\n closeTab: \"Close\",\n untitled: \"(unnamed)\",\n },\n saveConfirm: {\n title: \"Save workflows?\",\n modeLabel: \"Import mode\",\n ackReplace:\n \"I understand this will REPLACE all workflows on the server for this entity.\",\n ackActivate:\n \"I understand this will ACTIVATE these workflows and deactivate the current set.\",\n ackWarnings: \"I acknowledge {count} warning(s) will be saved.\",\n confirm: \"Save\",\n cancel: \"Cancel\",\n },\n conflict: {\n message:\n \"Server state has changed since this editor was opened. Choose Reload to discard local changes or Force overwrite to keep them.\",\n reload: \"Reload\",\n forceOverwrite: \"Force overwrite\",\n },\n};\n\nexport type Messages = typeof defaultMessages;\n","import { useCallback, useMemo, useRef, useState } from \"react\";\nimport {\n applyPatch,\n invertPatch,\n type DomainPatch,\n type WorkflowEditorDocument,\n} from \"@cyoda/workflow-core\";\nimport type {\n EditorActions,\n EditorMode,\n EditorState,\n Selection,\n UndoEntry,\n} from \"./types.js\";\n\nconst MAX_UNDO = 100;\n\nfunction summarize(patch: DomainPatch): string {\n switch (patch.op) {\n case \"addWorkflow\":\n return `Add workflow \"${patch.workflow.name}\"`;\n case \"removeWorkflow\":\n return `Remove workflow \"${patch.workflow}\"`;\n case \"updateWorkflowMeta\":\n return `Update workflow \"${patch.workflow}\"`;\n case \"renameWorkflow\":\n return `Rename workflow \"${patch.from}\" → \"${patch.to}\"`;\n case \"setInitialState\":\n return `Set initial state to \"${patch.stateCode}\"`;\n case \"setWorkflowCriterion\":\n return patch.criterion\n ? `Set workflow criterion`\n : `Clear workflow criterion`;\n case \"addState\":\n return `Add state \"${patch.stateCode}\"`;\n case \"renameState\":\n return `Rename state \"${patch.from}\" → \"${patch.to}\"`;\n case \"removeState\":\n return `Remove state \"${patch.stateCode}\"`;\n case \"addTransition\":\n return `Add transition \"${patch.transition.name}\"`;\n case \"updateTransition\":\n return `Update transition`;\n case \"removeTransition\":\n return `Remove transition`;\n case \"reorderTransition\":\n return `Reorder transition`;\n case \"addProcessor\":\n return `Add processor \"${patch.processor.name}\"`;\n case \"updateProcessor\":\n return `Update processor`;\n case \"removeProcessor\":\n return `Remove processor`;\n case \"reorderProcessor\":\n return `Reorder processor`;\n case \"setCriterion\":\n return patch.criterion ? `Set criterion` : `Clear criterion`;\n case \"setImportMode\":\n return `Set import mode to \"${patch.mode}\"`;\n case \"setEntity\":\n return patch.entity ? `Set entity` : `Clear entity`;\n case \"replaceSession\":\n return `Replace session`;\n case \"setEdgeAnchors\":\n return patch.anchors ? `Update edge anchors` : `Clear edge anchors`;\n }\n}\n\nfunction pickDefaultActiveWorkflow(doc: WorkflowEditorDocument): string | null {\n return doc.session.workflows[0]?.name ?? null;\n}\n\nexport function useEditorStore(\n initialDocument: WorkflowEditorDocument,\n initialMode: EditorMode = \"editor\",\n): [EditorState, EditorActions] {\n const [state, setState] = useState<EditorState>(() => ({\n document: initialDocument,\n selection: null,\n activeWorkflow: pickDefaultActiveWorkflow(initialDocument),\n mode: initialMode,\n undoStack: [],\n redoStack: [],\n }));\n\n const stateRef = useRef(state);\n stateRef.current = state;\n\n const dispatch = useCallback((patch: DomainPatch, summary?: string) => {\n const current = stateRef.current;\n if (current.mode === \"viewer\") return;\n const nextDoc = applyPatch(current.document, patch);\n const inverse = invertPatch(current.document, patch);\n const entry: UndoEntry = {\n forward: patch,\n inverse,\n summary: summary ?? summarize(patch),\n };\n const undoStack = [...current.undoStack, entry].slice(-MAX_UNDO);\n setState({\n ...current,\n document: nextDoc,\n undoStack,\n redoStack: [],\n activeWorkflow: reconcileActiveWorkflow(current.activeWorkflow, nextDoc),\n selection: reconcileSelection(current.selection, nextDoc),\n });\n }, []);\n\n const silentReplace = useCallback((\n document: WorkflowEditorDocument,\n options?: { preserveEditorState?: boolean },\n ) => {\n const current = stateRef.current;\n if (options?.preserveEditorState) {\n setState({\n ...current,\n document,\n activeWorkflow: reconcileActiveWorkflow(current.activeWorkflow, document),\n selection: reconcileSelection(current.selection, document),\n });\n return;\n }\n setState({\n ...current,\n document,\n undoStack: [],\n redoStack: [],\n activeWorkflow: pickDefaultActiveWorkflow(document),\n selection: null,\n });\n }, []);\n\n const undo = useCallback(() => {\n const current = stateRef.current;\n const top = current.undoStack[current.undoStack.length - 1];\n if (!top) return;\n const reverted = applyPatch(current.document, top.inverse);\n setState({\n ...current,\n document: reverted,\n undoStack: current.undoStack.slice(0, -1),\n redoStack: [...current.redoStack, top],\n activeWorkflow: reconcileActiveWorkflow(current.activeWorkflow, reverted),\n selection: reconcileSelection(current.selection, reverted),\n });\n }, []);\n\n const redo = useCallback(() => {\n const current = stateRef.current;\n const top = current.redoStack[current.redoStack.length - 1];\n if (!top) return;\n const next = applyPatch(current.document, top.forward);\n setState({\n ...current,\n document: next,\n undoStack: [...current.undoStack, top],\n redoStack: current.redoStack.slice(0, -1),\n activeWorkflow: reconcileActiveWorkflow(current.activeWorkflow, next),\n selection: reconcileSelection(current.selection, next),\n });\n }, []);\n\n const setSelection = useCallback((sel: Selection) => {\n setState((s) => ({ ...s, selection: sel }));\n }, []);\n\n const setActiveWorkflow = useCallback((name: string | null) => {\n setState((s) => ({ ...s, activeWorkflow: name, selection: null }));\n }, []);\n\n const setMode = useCallback((mode: EditorMode) => {\n setState((s) => ({ ...s, mode }));\n }, []);\n\n const actions = useMemo<EditorActions>(\n () => ({ dispatch, silentReplace, undo, redo, setSelection, setActiveWorkflow, setMode }),\n [dispatch, silentReplace, undo, redo, setSelection, setActiveWorkflow, setMode],\n );\n\n return [state, actions];\n}\n\n/**\n * After a patch the active workflow may have been renamed or removed; pick a\n * sensible fallback rather than leaving a dangling reference.\n */\nfunction reconcileActiveWorkflow(\n current: string | null,\n doc: WorkflowEditorDocument,\n): string | null {\n if (!current) return doc.session.workflows[0]?.name ?? null;\n const hit = doc.session.workflows.find((w) => w.name === current);\n if (hit) return current;\n return doc.session.workflows[0]?.name ?? null;\n}\n\n/**\n * After a patch the selected node/edge may no longer exist. Clear selections\n * that became dangling.\n */\nfunction reconcileSelection(\n selection: Selection,\n doc: WorkflowEditorDocument,\n): Selection {\n if (!selection) return null;\n const { ids } = doc.meta;\n switch (selection.kind) {\n case \"workflow\": {\n const hit = doc.session.workflows.find((w) => w.name === selection.workflow);\n return hit ? selection : null;\n }\n case \"state\": {\n const wf = doc.session.workflows.find((w) => w.name === selection.workflow);\n if (!wf || !wf.states[selection.stateCode]) return null;\n return selection;\n }\n case \"transition\":\n return ids.transitions[selection.transitionUuid] ? selection : null;\n case \"processor\":\n return ids.processors[selection.processorUuid] ? selection : null;\n case \"criterion\":\n return ids.criteria[selection.hostId] ||\n ids.workflows[selection.hostId] ||\n ids.transitions[selection.hostId]\n ? selection\n : null;\n }\n}\n","import {\n validateSession,\n type ValidationIssue,\n type WorkflowEditorDocument,\n} from \"@cyoda/workflow-core\";\nimport type { GraphDocument } from \"@cyoda/workflow-graph\";\nimport { projectToGraph } from \"@cyoda/workflow-graph\";\n\nexport interface DerivedState {\n graph: GraphDocument;\n issues: ValidationIssue[];\n errorCount: number;\n warningCount: number;\n infoCount: number;\n}\n\n/**\n * Re-run validation + projection from the canonical session. Memoised by the\n * caller — the editor shell typically memoises on `document.meta.revision`.\n */\nexport function deriveFromDocument(doc: WorkflowEditorDocument): DerivedState {\n const issues = validateSession(doc.session);\n const graph = projectToGraph(doc, { issues });\n let errorCount = 0;\n let warningCount = 0;\n let infoCount = 0;\n for (const issue of issues) {\n if (issue.severity === \"error\") errorCount++;\n else if (issue.severity === \"warning\") warningCount++;\n else infoCount++;\n }\n return { graph, issues, errorCount, warningCount, infoCount };\n}\n","import { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Background,\n ConnectionMode,\n Controls,\n MiniMap,\n ReactFlow,\n ReactFlowProvider,\n useReactFlow,\n type Viewport,\n type Connection,\n type Edge,\n type Node,\n type NodeMouseHandler,\n type EdgeMouseHandler,\n} from \"reactflow\";\nimport \"reactflow/dist/style.css\";\nimport type { ValidationIssue } from \"@cyoda/workflow-core\";\nimport type {\n GraphDocument,\n StateNode as GraphStateNode,\n TransitionEdge,\n} from \"@cyoda/workflow-graph\";\nimport { layoutGraph, estimateNodeSize, type LayoutOptions, type LayoutResult } from \"@cyoda/workflow-layout\";\nimport { ArrowMarkers } from \"./ArrowMarkers.js\";\nimport { RfStateNode, type RfStateNodeData } from \"./RfStateNode.js\";\nimport { RfTransitionEdge, type RfEdgeData } from \"./RfTransitionEdge.js\";\nimport type { Selection } from \"../state/types.js\";\n\nconst nodeTypes = { stateNode: RfStateNode };\nconst edgeTypes = { transition: RfTransitionEdge };\n\nexport interface CanvasProps {\n graph: GraphDocument;\n issues: ValidationIssue[];\n activeWorkflow: string | null;\n selection: Selection;\n layoutOptions?: LayoutOptions;\n savedViewport?: Viewport;\n onSelectionChange: (sel: Selection) => void;\n onViewportChange?: (viewport: Viewport) => void;\n onConnect?: (connection: Connection) => void;\n readOnly?: boolean;\n}\n\nfunction toRfNodes(\n graph: GraphDocument,\n layout: LayoutResult,\n activeWorkflow: string | null,\n issuesByNode: Map<string, ValidationIssue[]>,\n selection: Selection,\n): Node<RfStateNodeData>[] {\n return graph.nodes\n .filter((n): n is GraphStateNode => n.kind === \"state\")\n .filter((n) => !activeWorkflow || n.workflow === activeWorkflow)\n .map((n) => {\n const pos = layout.positions.get(n.id);\n const nodeIssues = issuesByNode.get(n.id) ?? [];\n const hasError = nodeIssues.some((i) => i.severity === \"error\");\n const hasWarning = nodeIssues.some((i) => i.severity === \"warning\");\n const selected =\n selection?.kind === \"state\" && selection.nodeId === n.id;\n const size = pos\n ? { width: pos.width, height: pos.height }\n : estimateNodeSize(n.stateCode);\n return {\n id: n.id,\n type: \"stateNode\",\n data: { node: n, hasError, hasWarning, size },\n position: pos ? { x: pos.x, y: pos.y } : { x: 0, y: 0 },\n selected,\n // width/height on the node object tells ReactFlow the dimensions\n // before ResizeObserver fires. fitView's nodesInitialized guard\n // (nodes.every(n => n.width && n.height)) requires these to be set\n // or it returns false and leaves the viewport at {x:0, y:0, zoom:1}.\n width: size.width,\n height: size.height,\n style: { width: size.width, height: size.height },\n };\n });\n}\n\nfunction toRfEdges(\n graph: GraphDocument,\n layout: LayoutResult,\n activeWorkflow: string | null,\n selection: Selection,\n orientation: \"vertical\" | \"horizontal\",\n): Edge<RfEdgeData>[] {\n const stateById = new Map(\n graph.nodes\n .filter((n): n is GraphStateNode => n.kind === \"state\")\n .map((n) => [n.id, n]),\n );\n // Precompute obstacle bounding boxes once per render.\n const allObstacles = Array.from(layout.positions.values()).map((p) => ({\n id: p.id,\n x: p.x,\n y: p.y,\n width: p.width,\n height: p.height,\n }));\n return graph.edges\n .filter((e): e is TransitionEdge => e.kind === \"transition\")\n .filter((e) => !activeWorkflow || e.workflow === activeWorkflow)\n .map((e) => {\n const target = stateById.get(e.targetId);\n const targetIsTerminal =\n target?.role === \"terminal\" || target?.role === \"initial-terminal\";\n const selected =\n selection?.kind === \"transition\" && selection.transitionUuid === e.id;\n const route = layout.edges.get(e.id);\n const routePoints = route?.points;\n const obstacles = allObstacles.filter(\n (o) => o.id !== e.sourceId && o.id !== e.targetId,\n );\n\n // Detect horizontal back-edges (source is to the right of target).\n // The layout synthesises these as U-arcs exiting/entering from the\n // bottom of each node, so the handle must match.\n const isHorizontalBackEdge =\n !e.isSelf &&\n orientation === \"horizontal\" &&\n (layout.positions.get(e.sourceId)?.x ?? 0) >\n (layout.positions.get(e.targetId)?.x ?? 0);\n\n return {\n id: e.id,\n source: e.sourceId,\n target: e.targetId,\n sourceHandle: anchorHandleId(e.sourceAnchor, \"source\", orientation, isHorizontalBackEdge),\n targetHandle: anchorHandleId(e.targetAnchor, \"target\", orientation, isHorizontalBackEdge),\n type: \"transition\",\n data: {\n edge: e,\n targetIsTerminal: !!targetIsTerminal,\n routePoints,\n labelX: route?.labelX,\n labelY: route?.labelY,\n labelWidth: route?.labelWidth,\n labelHeight: route?.labelHeight,\n obstacles,\n },\n selected,\n };\n });\n}\n\n/**\n * Resolve the React Flow handle ID for an edge endpoint.\n *\n * Explicit per-edge anchor overrides always win. When no override is stored,\n * defaults depend on orientation and whether the edge is a back-edge:\n *\n * | orientation | edge type | source | target |\n * |-------------|-----------|---------|--------|\n * | vertical | any | bottom | top |\n * | horizontal | forward | right | left |\n * | horizontal | back | bottom | bottom |\n *\n * Back-edges in horizontal mode use bottom/bottom because the layout engine\n * synthesises their routes as U-arcs that exit and enter from the node bottom.\n */\nfunction anchorHandleId(\n anchor: TransitionEdge[\"sourceAnchor\"],\n role: \"source\" | \"target\",\n orientation: \"vertical\" | \"horizontal\",\n isBackEdge = false,\n): string | undefined {\n if (anchor) return anchor;\n if (orientation === \"horizontal\") {\n if (isBackEdge) return \"bottom\";\n return role === \"source\" ? \"right\" : \"left\";\n }\n return role === \"source\" ? \"bottom\" : \"top\";\n}\n\nfunction groupIssuesByNode(\n graph: GraphDocument,\n issues: ValidationIssue[],\n): Map<string, ValidationIssue[]> {\n const byNode = new Map<string, ValidationIssue[]>();\n for (const ann of graph.annotations) {\n const list = byNode.get(ann.targetId) ?? [];\n const issue = issues.find((i) => i.code === ann.code);\n if (issue) list.push(issue);\n byNode.set(ann.targetId, list);\n }\n return byNode;\n}\n\nfunction CanvasInner({\n graph,\n issues,\n activeWorkflow,\n selection,\n layoutOptions,\n savedViewport,\n onSelectionChange,\n onViewportChange,\n onConnect,\n readOnly,\n}: CanvasProps) {\n const [layout, setLayout] = useState<LayoutResult | null>(null);\n const rf = useReactFlow();\n\n // Extract primitive fields so the effect dep array is stable even when the\n // consumer passes a new object literal on every parent render.\n const preset = layoutOptions?.preset ?? \"configuratorReadable\";\n const orientation = layoutOptions?.orientation ?? \"vertical\";\n const elkOverrides = layoutOptions?.elk;\n const nodeSize = layoutOptions?.nodeSize;\n const pinned = layoutOptions?.pinned;\n\n const effectiveOpts = useMemo<LayoutOptions>(\n () => ({ preset, orientation, elk: elkOverrides, nodeSize, pinned }),\n // elkOverrides / nodeSize / pinned are objects; they are rarely supplied\n // in practice, so a reference change there is an intentional re-layout.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [preset, orientation, elkOverrides, nodeSize, pinned],\n );\n\n // Track which orientation was in effect when each layout was triggered, so\n // that the fitView guard can tell whether layout changed due to an\n // orientation switch (which requires a refit) vs. a graph edit (no refit).\n const orientationAtLayoutRef = useRef(orientation);\n\n useEffect(() => {\n let cancelled = false;\n orientationAtLayoutRef.current = orientation;\n layoutGraph(graph, effectiveOpts).then((result) => {\n if (!cancelled) setLayout(result);\n });\n return () => {\n cancelled = true;\n };\n }, [graph, effectiveOpts, orientation]);\n\n // ── Viewport fit ────────────────────────────────────────────────────────────\n //\n // Rules:\n // 1. Never fit while layout is still pending — nodes would be at (0,0).\n // 2. Fit once on the first completed layout (initial load / reload).\n // 3. Refit when the graph orientation changes (new layout = different bounds).\n // 4. Do NOT refit on subsequent graph edits — preserve the user's zoom/pan.\n // 5. Cap maxZoom at 1.2 so small graphs do not blow up absurdly.\n //\n // A requestAnimationFrame defers the call until React Flow has committed the\n // new node positions to the DOM, which is required for correct bounds.\n\n const lastHandledViewportKeyRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (!layout) return;\n const viewportKey = `${activeWorkflow ?? \"__all__\"}:${orientationAtLayoutRef.current}`;\n if (lastHandledViewportKeyRef.current === viewportKey) return;\n\n const rafId = requestAnimationFrame(() => {\n if (savedViewport) {\n void rf.setViewport(savedViewport, { duration: 0 });\n lastHandledViewportKeyRef.current = viewportKey;\n } else {\n const stateCount = graph.nodes.filter(\n (node): node is GraphStateNode =>\n node.kind === \"state\" &&\n (!activeWorkflow || node.workflow === activeWorkflow),\n ).length;\n const fitOptions =\n stateCount <= 6\n ? { padding: 0.12, maxZoom: 1 }\n : { padding: 0.12 };\n // fitView returns false if nodes are not yet initialized in the\n // ReactFlow store (nodesInitialized guard). Only mark the key as\n // handled when the fit actually ran, so a retry happens if needed.\n const fitted = rf.fitView(fitOptions);\n if (fitted) lastHandledViewportKeyRef.current = viewportKey;\n }\n });\n return () => cancelAnimationFrame(rafId);\n }, [activeWorkflow, graph.nodes, layout, rf, savedViewport]);\n\n // ── Derived RF data ─────────────────────────────────────────────────────────\n //\n // Critically: nodes and edges are EMPTY until the layout result is available.\n //\n // Before layout resolves, every node position is (0,0). React Flow would\n // then compute edge handles at the origin, causing all edge-label overlays to\n // pile up in the top-left corner — and fitView would zoom into empty space.\n // Deferring until layout is ready avoids both problems with no user-visible\n // cost (ELK typically resolves in < 150 ms for typical workflow sizes).\n\n const issuesByNode = useMemo(() => groupIssuesByNode(graph, issues), [graph, issues]);\n\n const nodes = useMemo(\n () =>\n layout\n ? toRfNodes(graph, layout, activeWorkflow, issuesByNode, selection)\n : [],\n [graph, layout, activeWorkflow, issuesByNode, selection],\n );\n\n const edges = useMemo(\n () =>\n layout\n ? toRfEdges(graph, layout, activeWorkflow, selection, orientation)\n : [],\n [graph, layout, activeWorkflow, selection, orientation],\n );\n\n const onNodeClick: NodeMouseHandler = (_, node) => {\n const data = node.data as RfStateNodeData;\n onSelectionChange({\n kind: \"state\",\n workflow: data.node.workflow,\n stateCode: data.node.stateCode,\n nodeId: data.node.id,\n });\n };\n\n const onEdgeClick: EdgeMouseHandler = (_, edge) => {\n onSelectionChange({ kind: \"transition\", transitionUuid: edge.id });\n };\n\n return (\n <div style={{ width: \"100%\", height: \"100%\" }} data-testid=\"workflow-canvas\">\n <ArrowMarkers />\n <ReactFlow\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n edgeTypes={edgeTypes}\n onNodeClick={onNodeClick}\n onEdgeClick={onEdgeClick}\n onPaneClick={() => onSelectionChange(null)}\n onConnect={readOnly ? undefined : onConnect}\n connectionMode={ConnectionMode.Loose}\n nodesDraggable={!readOnly}\n nodesConnectable={!readOnly}\n elementsSelectable\n // fitView is intentionally absent — handled imperatively after layout.\n // See the fitView useEffect above for the reasoning.\n snapToGrid\n snapGrid={[16, 16]}\n minZoom={0.1}\n maxZoom={4}\n onMoveEnd={(_, viewport) => {\n if (layout) onViewportChange?.(viewport);\n }}\n >\n <Background />\n <Controls showInteractive={false} />\n <MiniMap zoomable pannable />\n </ReactFlow>\n </div>\n );\n}\n\nexport function Canvas(props: CanvasProps) {\n return (\n <ReactFlowProvider>\n <CanvasInner {...props} />\n </ReactFlowProvider>\n );\n}\n","import { geometry, workflowPalette } from \"@cyoda/workflow-viewer/theme\";\n\n/**\n * React-Flow renders edges inside its own root SVG, so we can't reuse the\n * viewer's `<Defs />` directly. This component injects an out-of-flow `<svg>`\n * sitting on top of the canvas that only declares arrow markers — same IDs\n * and geometry as the viewer so RfTransitionEdge can `url(#wf-arrow-XXX)`.\n */\nexport function ArrowMarkers() {\n const size = geometry.edge.arrowheadSize;\n const colors = Array.from(new Set(Object.values(workflowPalette.edge)));\n return (\n <svg\n width={0}\n height={0}\n style={{ position: \"absolute\", pointerEvents: \"none\" }}\n aria-hidden\n >\n <defs>\n {colors.map((color) => (\n <marker\n key={color}\n id={arrowMarkerId(color)}\n viewBox={`0 0 ${size * 2} ${size * 2}`}\n refX={size * 1.85}\n refY={size}\n markerWidth={size}\n markerHeight={size}\n orient=\"auto-start-reverse\"\n >\n <path\n d={`M 0 ${size / 2} L ${size * 2} ${size} L 0 ${size * 1.5} z`}\n fill={color}\n />\n </marker>\n ))}\n </defs>\n </svg>\n );\n}\n\nexport function arrowMarkerId(color: string): string {\n return `wf-arrow-${color.replace(\"#\", \"\").toLowerCase()}`;\n}\n","import { memo, type CSSProperties } from \"react\";\nimport { Handle, Position, type NodeProps } from \"reactflow\";\nimport type { StateNode } from \"@cyoda/workflow-graph\";\nimport {\n geometry,\n paletteFor,\n roleCategoryLabel,\n typography,\n workflowPalette,\n} from \"@cyoda/workflow-viewer/theme\";\n\nexport interface RfStateNodeData {\n node: StateNode;\n hasError: boolean;\n hasWarning: boolean;\n /** Computed by the layout engine. When absent the token defaults are used. */\n size?: { width: number; height: number };\n}\n\n/**\n * React Flow custom node that visually matches the slim viewer's state\n * chrome. Only interaction affordances (handles, selection ring) differ.\n */\nfunction RfStateNodeImpl({ data, selected }: NodeProps<RfStateNodeData>) {\n const { node, hasError, hasWarning, size } = data;\n const palette = paletteFor(node);\n const { radius, strokeWidth } = geometry.node;\n const width = size?.width ?? geometry.node.width;\n const height = size?.height ?? geometry.node.height;\n const category = roleCategoryLabel(node);\n const isTerminal = node.role === \"terminal\" || node.role === \"initial-terminal\";\n\n const borderColor = hasError\n ? \"#DC2626\"\n : hasWarning\n ? \"#D97706\"\n : selected\n ? workflowPalette.neutrals.slate900\n : palette.border;\n const borderWidth = selected ? strokeWidth + 1 : strokeWidth;\n\n return (\n <div\n style={{\n width,\n height,\n background: palette.fill,\n border: `${borderWidth}px solid ${borderColor}`,\n borderRadius: radius,\n boxShadow: selected\n ? \"0 2px 4px rgba(15,23,42,0.14)\"\n : \"0 1px 2px rgba(15,23,42,0.08)\",\n position: \"relative\",\n boxSizing: \"border-box\",\n fontFamily: typography.fontFamily,\n userSelect: \"none\",\n }}\n data-testid={`rf-state-${node.stateCode}`}\n >\n {ANCHOR_SIDES.map(({ side, position }) => (\n <AnchorHandle\n key={side}\n side={side}\n position={position}\n color={palette.border}\n />\n ))}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: \"100%\",\n gap: 2,\n padding: \"0 8px\",\n }}\n >\n <div\n style={{\n color: palette.meta,\n fontSize: typography.stateCategory.size,\n fontWeight: typography.stateCategory.weight,\n letterSpacing: typography.stateCategory.tracking,\n }}\n >\n {category}\n </div>\n <div\n style={{\n color: palette.title,\n fontFamily: typography.monoFamily,\n fontSize: typography.stateTitle.size,\n fontWeight: typography.stateTitle.weight,\n letterSpacing: typography.stateTitle.tracking,\n textAlign: \"center\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"100%\",\n }}\n >\n {node.stateCode}\n </div>\n </div>\n {isTerminal && (\n <div\n style={{\n position: \"absolute\",\n inset: 3,\n borderRadius: 8,\n border: `1px solid ${\"innerRing\" in palette ? palette.innerRing : workflowPalette.neutrals.white75}`,\n pointerEvents: \"none\",\n }}\n />\n )}\n </div>\n );\n}\n\nconst ANCHOR_SIDES: ReadonlyArray<{\n side: \"top\" | \"right\" | \"bottom\" | \"left\";\n position: Position;\n}> = [\n { side: \"top\", position: Position.Top },\n { side: \"right\", position: Position.Right },\n { side: \"bottom\", position: Position.Bottom },\n { side: \"left\", position: Position.Left },\n];\n\nfunction AnchorHandle({\n side,\n position,\n color,\n}: {\n side: \"top\" | \"right\" | \"bottom\" | \"left\";\n position: Position;\n color: string;\n}) {\n const isVertical = position === Position.Top || position === Position.Bottom;\n\n // Small visible dot centered on the edge, non-interactive.\n const dotStyle: CSSProperties = {\n position: \"absolute\",\n width: 8,\n height: 8,\n background: color,\n borderRadius: \"50%\",\n pointerEvents: \"none\",\n ...(side === \"top\"\n ? { top: -4, left: \"calc(50% - 4px)\" }\n : side === \"bottom\"\n ? { bottom: -4, left: \"calc(50% - 4px)\" }\n : side === \"left\"\n ? { left: -4, top: \"calc(50% - 4px)\" }\n : { right: -4, top: \"calc(50% - 4px)\" }),\n };\n\n return (\n <>\n {/* Large transparent hit area spanning most of the edge for forgiving drops. */}\n <Handle\n id={side}\n type=\"source\"\n position={position}\n style={{\n background: \"transparent\",\n border: \"none\",\n borderRadius: 0,\n width: isVertical ? \"80%\" : 16,\n height: isVertical ? 16 : \"80%\",\n }}\n />\n <div style={dotStyle} />\n </>\n );\n}\n\nexport const RfStateNode = memo(RfStateNodeImpl);\n","import { memo } from \"react\";\nimport {\n BaseEdge,\n EdgeLabelRenderer,\n type EdgeProps,\n} from \"reactflow\";\nimport type { TransitionEdge } from \"@cyoda/workflow-graph\";\nimport {\n badgesFor,\n geometry,\n laneColor,\n laneDashArray,\n typography,\n workflowPalette,\n} from \"@cyoda/workflow-viewer/theme\";\nimport { orthogonalEdgePath, type Rect } from \"../routing/orthogonal.js\";\nimport { arrowMarkerId } from \"./ArrowMarkers.js\";\n\nexport interface RfEdgeData {\n edge: TransitionEdge;\n targetIsTerminal: boolean;\n /** ELK-computed polyline for this edge, if available. */\n routePoints?: { x: number; y: number }[];\n /** Layout-computed label centre and size. */\n labelX?: number;\n labelY?: number;\n labelWidth?: number;\n labelHeight?: number;\n /** Other nodes' bounding boxes, for obstacle-aware nudging. */\n obstacles?: Rect[];\n}\n\nfunction RfTransitionEdgeImpl(props: EdgeProps<RfEdgeData>) {\n const {\n id,\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n data,\n selected,\n } = props;\n if (!data) return null;\n const { edge, targetIsTerminal, routePoints, obstacles } = data;\n\n const { path, labelX: fallbackLabelX, labelY: fallbackLabelY } = orthogonalEdgePath({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n routePoints,\n obstacles,\n });\n const labelX = data.labelX ?? fallbackLabelX;\n const labelY = data.labelY ?? fallbackLabelY;\n\n const color = laneColor(edge, { targetIsTerminal });\n const dash = laneDashArray(edge);\n const strokeWidth = selected\n ? geometry.edge.strokeWidth + 1\n : edge.isLoopback\n ? geometry.edge.loopStrokeWidth\n : geometry.edge.strokeWidth;\n const isManualSolid = edge.manual && !edge.disabled && !edge.isLoopback;\n\n const badges = badgesFor(edge.summary, {\n manual: edge.manual,\n disabled: edge.disabled,\n });\n\n return (\n <>\n <BaseEdge\n id={id}\n path={path}\n style={{\n stroke: color,\n strokeWidth,\n strokeDasharray: dash,\n }}\n markerEnd={`url(#${arrowMarkerId(color)})`}\n />\n {isManualSolid && (\n <path\n d={path}\n fill=\"none\"\n stroke={workflowPalette.neutrals.white}\n strokeWidth={0.6}\n pointerEvents=\"none\"\n />\n )}\n <EdgeLabelRenderer>\n <div\n style={{\n position: \"absolute\",\n transform: `translate(-50%, -50%) translate(${labelX}px, ${labelY}px)`,\n fontFamily: typography.fontFamily,\n pointerEvents: \"all\",\n background: workflowPalette.edgeLabel.fill,\n border: `1px solid ${workflowPalette.edgeLabel.border}`,\n borderRadius: geometry.labelPill.radius,\n padding: `${geometry.labelPill.paddingY}px ${geometry.labelPill.paddingX}px`,\n boxShadow: \"0 1px 2px rgba(15,23,42,0.08)\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 3,\n minWidth: 40,\n width: data.labelWidth,\n }}\n className=\"nodrag nopan\"\n data-testid={`rf-edge-label-${edge.id}`}\n >\n <div\n style={{\n color: workflowPalette.edgeLabel.text,\n fontSize: typography.edgeLabel.size,\n fontWeight: typography.edgeLabel.weight,\n letterSpacing: typography.edgeLabel.tracking,\n textTransform: \"uppercase\",\n }}\n >\n {edge.summary.display}\n </div>\n {badges.length > 0 && (\n <div style={{ display: \"flex\", gap: 3, flexWrap: \"wrap\", justifyContent: \"center\" }}>\n {badges.map((b, i) => {\n const slot =\n b.key === \"manual\"\n ? workflowPalette.badge.manual\n : b.key === \"processor\" || b.key === \"execution\"\n ? workflowPalette.badge.processor\n : b.key === \"criterion\"\n ? workflowPalette.badge.criterion\n : workflowPalette.badge.disabled;\n return (\n <span\n key={`${b.key}-${i}`}\n style={{\n background: slot.fill,\n border: `1px solid ${slot.border}`,\n color: workflowPalette.badge.text,\n fontSize: typography.badge.size,\n fontWeight: typography.badge.weight,\n letterSpacing: typography.badge.tracking,\n padding: \"1px 4px\",\n borderRadius: 8,\n }}\n >\n {b.label}\n </span>\n );\n })}\n </div>\n )}\n </div>\n </EdgeLabelRenderer>\n </>\n );\n}\n\nexport const RfTransitionEdge = memo(RfTransitionEdgeImpl);\n","import { Position } from \"reactflow\";\n\nexport type Anchor = \"top\" | \"right\" | \"bottom\" | \"left\";\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface OrthogonalEdgeInput {\n /** Absolute coordinate of the source attach point (already anchor-resolved by RF). */\n sourceX: number;\n sourceY: number;\n targetX: number;\n targetY: number;\n sourcePosition: Position;\n targetPosition: Position;\n /** Pre-computed polyline from the layout engine — if present, used verbatim. */\n routePoints?: { x: number; y: number }[];\n /** Other nodes' bounding boxes; the router may nudge past these. */\n obstacles?: Rect[];\n /** IDs of the source/target nodes (so obstacles can exclude self). Not used directly here — caller filters. */\n /** Snap distance for straight-segment detection. */\n alignmentTolerance?: number;\n /** Stub length extending the edge along its anchor normal before turning. */\n stubLength?: number;\n}\n\nexport interface OrthogonalEdge {\n /** SVG path `d` string. */\n path: string;\n /** Label placement midpoint. */\n labelX: number;\n labelY: number;\n /** Raw polyline points (for debugging / further processing). */\n points: { x: number; y: number }[];\n}\n\nconst DEFAULT_TOLERANCE = 6;\nconst DEFAULT_STUB = 16;\n\n/**\n * Compute an orthogonal (polyline) edge path between two anchor points.\n *\n * Preference order:\n * 1. If `routePoints` is provided (ELK output), use it verbatim.\n * 2. If anchors are facing each other and nearly aligned, emit a straight\n * segment (snap away tiny doglegs).\n * 3. Otherwise emit a 3-segment \"Z\"/\"L\" path that exits along the source\n * anchor's normal and enters along the target anchor's normal.\n * 4. Single mid-segment nudge if the middle of the primary leg passes\n * through a non-endpoint node.\n */\nexport function orthogonalEdgePath(input: OrthogonalEdgeInput): OrthogonalEdge {\n const {\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourcePosition,\n targetPosition,\n routePoints,\n obstacles = [],\n alignmentTolerance = DEFAULT_TOLERANCE,\n stubLength = DEFAULT_STUB,\n } = input;\n\n if (routePoints && routePoints.length >= 2) {\n const mid = midpoint(routePoints);\n return {\n path: polylineToPath(routePoints),\n labelX: mid.x,\n labelY: mid.y,\n points: routePoints,\n };\n }\n\n const sx = sourceX;\n const sy = sourceY;\n const tx = targetX;\n const ty = targetY;\n\n const sourceNormal = normalOf(sourcePosition);\n const targetNormal = normalOf(targetPosition);\n\n // Straight-line shortcut: if the two anchors face each other AND are\n // nearly colinear on the non-normal axis, emit one straight segment.\n const straight = tryStraight(\n { x: sx, y: sy },\n sourceNormal,\n { x: tx, y: ty },\n targetNormal,\n alignmentTolerance,\n );\n if (straight) {\n return {\n path: polylineToPath(straight),\n labelX: (sx + tx) / 2,\n labelY: (sy + ty) / 2,\n points: straight,\n };\n }\n\n // Emit stubs, then route orthogonally between them.\n const sStub = { x: sx + sourceNormal.x * stubLength, y: sy + sourceNormal.y * stubLength };\n const tStub = { x: tx + targetNormal.x * stubLength, y: ty + targetNormal.y * stubLength };\n\n // Z-shape: decide which axis the middle segment runs on.\n // Rule: if the source normal is vertical (top/bottom), the mid is\n // horizontal at the midpoint Y of the two stubs; otherwise vice versa.\n const sourceAxis = sourceNormal.x !== 0 ? \"horizontal\" : \"vertical\";\n let path: { x: number; y: number }[];\n\n if (sourceAxis === \"vertical\") {\n // mid segment is horizontal\n let midY = (sStub.y + tStub.y) / 2;\n // Obstacle nudge: if the midline passes through an obstacle, shift it.\n midY = nudgeHorizontalLine(\n sStub.x,\n tStub.x,\n midY,\n obstacles,\n );\n path = [\n { x: sx, y: sy },\n { x: sStub.x, y: midY },\n { x: tStub.x, y: midY },\n { x: tx, y: ty },\n ];\n } else {\n // mid segment is vertical\n let midX = (sStub.x + tStub.x) / 2;\n midX = nudgeVerticalLine(\n sStub.y,\n tStub.y,\n midX,\n obstacles,\n );\n path = [\n { x: sx, y: sy },\n { x: midX, y: sStub.y },\n { x: midX, y: tStub.y },\n { x: tx, y: ty },\n ];\n }\n\n path = simplify(path);\n\n const mid = midpoint(path);\n return {\n path: polylineToPath(path),\n labelX: mid.x,\n labelY: mid.y,\n points: path,\n };\n}\n\nexport function polylineToPath(points: { x: number; y: number }[]): string {\n if (points.length === 0) return \"\";\n const [first, ...rest] = points;\n let d = `M ${first!.x} ${first!.y}`;\n for (const p of rest) d += ` L ${p.x} ${p.y}`;\n return d;\n}\n\nfunction normalOf(pos: Position): { x: number; y: number } {\n switch (pos) {\n case Position.Top:\n return { x: 0, y: -1 };\n case Position.Right:\n return { x: 1, y: 0 };\n case Position.Bottom:\n return { x: 0, y: 1 };\n case Position.Left:\n return { x: -1, y: 0 };\n }\n}\n\nfunction tryStraight(\n s: { x: number; y: number },\n sn: { x: number; y: number },\n t: { x: number; y: number },\n tn: { x: number; y: number },\n tolerance: number,\n): { x: number; y: number }[] | null {\n // Only valid when normals are opposite (e.g. source Bottom -> target Top).\n if (sn.x + tn.x !== 0 || sn.y + tn.y !== 0) return null;\n\n if (sn.x !== 0) {\n // Horizontal: both points must share nearly the same Y, and X must go\n // in the source-normal direction.\n if (Math.abs(s.y - t.y) > tolerance) return null;\n if (sn.x > 0 && t.x < s.x) return null;\n if (sn.x < 0 && t.x > s.x) return null;\n // Snap Y to source for a perfectly level line.\n return [\n { x: s.x, y: s.y },\n { x: t.x, y: s.y },\n ];\n }\n // Vertical\n if (Math.abs(s.x - t.x) > tolerance) return null;\n if (sn.y > 0 && t.y < s.y) return null;\n if (sn.y < 0 && t.y > s.y) return null;\n return [\n { x: s.x, y: s.y },\n { x: s.x, y: t.y },\n ];\n}\n\nfunction nudgeHorizontalLine(\n x1: number,\n x2: number,\n y: number,\n obstacles: Rect[],\n): number {\n const pad = 8;\n const loX = Math.min(x1, x2);\n const hiX = Math.max(x1, x2);\n for (const o of obstacles) {\n const ox1 = o.x - pad;\n const oy1 = o.y - pad;\n const ox2 = o.x + o.width + pad;\n const oy2 = o.y + o.height + pad;\n // Does the horizontal segment at Y cross this obstacle's X-range and Y-range?\n if (hiX < ox1 || loX > ox2) continue;\n if (y < oy1 || y > oy2) continue;\n // Nudge: shift Y outside the obstacle's Y-range on whichever side is closer.\n const above = oy1 - 1;\n const below = oy2 + 1;\n y = Math.abs(y - above) < Math.abs(y - below) ? above : below;\n }\n return y;\n}\n\nfunction nudgeVerticalLine(\n y1: number,\n y2: number,\n x: number,\n obstacles: Rect[],\n): number {\n const pad = 8;\n const loY = Math.min(y1, y2);\n const hiY = Math.max(y1, y2);\n for (const o of obstacles) {\n const ox1 = o.x - pad;\n const oy1 = o.y - pad;\n const ox2 = o.x + o.width + pad;\n const oy2 = o.y + o.height + pad;\n if (hiY < oy1 || loY > oy2) continue;\n if (x < ox1 || x > ox2) continue;\n const left = ox1 - 1;\n const right = ox2 + 1;\n x = Math.abs(x - left) < Math.abs(x - right) ? left : right;\n }\n return x;\n}\n\n/** Drop consecutive duplicate points and collapse co-linear runs. */\nfunction simplify(points: { x: number; y: number }[]): { x: number; y: number }[] {\n const out: { x: number; y: number }[] = [];\n for (const p of points) {\n const last = out[out.length - 1];\n if (last && last.x === p.x && last.y === p.y) continue;\n out.push(p);\n }\n // collapse co-linear triples\n let i = 1;\n while (i < out.length - 1) {\n const a = out[i - 1]!;\n const b = out[i]!;\n const c = out[i + 1]!;\n const colinearX = a.x === b.x && b.x === c.x;\n const colinearY = a.y === b.y && b.y === c.y;\n if (colinearX || colinearY) {\n out.splice(i, 1);\n } else {\n i++;\n }\n }\n return out;\n}\n\nfunction midpoint(points: { x: number; y: number }[]): { x: number; y: number } {\n if (points.length === 0) return { x: 0, y: 0 };\n if (points.length === 1) return points[0]!;\n // Find the longest segment and return its centre — best label anchor.\n let bestLen = -1;\n let best = points[0]!;\n for (let i = 0; i < points.length - 1; i++) {\n const a = points[i]!;\n const b = points[i + 1]!;\n const len = Math.hypot(b.x - a.x, b.y - a.y);\n if (len > bestLen) {\n bestLen = len;\n best = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };\n }\n }\n return best;\n}\n","import type { Connection } from \"reactflow\";\nimport type { WorkflowEditorDocument } from \"@cyoda/workflow-core\";\n\nexport interface PendingConnect {\n workflow: string;\n fromState: string;\n toState: string;\n}\n\n/**\n * Resolves a React Flow Connection into pending connect data.\n * Returns null if source/target are missing, not found in the document,\n * or belong to different workflows.\n */\nexport function resolveConnection(\n doc: WorkflowEditorDocument,\n connection: Connection,\n): PendingConnect | null {\n const { source, target } = connection;\n if (!source || !target) return null;\n\n const sourcePtr = doc.meta.ids.states[source];\n const targetPtr = doc.meta.ids.states[target];\n\n if (!sourcePtr || !targetPtr) return null;\n if (sourcePtr.workflow !== targetPtr.workflow) return null;\n\n return {\n workflow: sourcePtr.workflow,\n fromState: sourcePtr.state,\n toState: targetPtr.state,\n };\n}\n","import { useMemo, useState } from \"react\";\nimport type {\n DomainPatch,\n ValidationIssue,\n WorkflowEditorDocument,\n} from \"@cyoda/workflow-core\";\nimport { serializeEditorDocument } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport type { Selection } from \"../state/types.js\";\nimport { processorUuidsInOrder, resolveSelection } from \"./resolve.js\";\nimport { WorkflowForm } from \"./WorkflowForm.js\";\nimport { StateForm } from \"./StateForm.js\";\nimport { TransitionForm } from \"./TransitionForm.js\";\nimport { ProcessorForm } from \"./ProcessorForm.js\";\n\nexport interface InspectorProps {\n document: WorkflowEditorDocument;\n selection: Selection;\n issues: ValidationIssue[];\n readOnly: boolean;\n onDispatch: (patch: DomainPatch) => void;\n onSelectionChange: (sel: Selection) => void;\n onRequestDeleteState: (workflow: string, stateCode: string) => void;\n}\n\nfunction issueKeyForSelection(selection: Selection): string | null {\n if (!selection) return null;\n switch (selection.kind) {\n case \"workflow\":\n return selection.workflow;\n case \"state\":\n return selection.nodeId;\n case \"transition\":\n return selection.transitionUuid;\n case \"processor\":\n return selection.processorUuid;\n case \"criterion\":\n return selection.hostId;\n }\n}\n\nexport function Inspector({\n document: doc,\n selection,\n issues,\n readOnly,\n onDispatch,\n onSelectionChange,\n onRequestDeleteState,\n}: InspectorProps) {\n const messages = useMessages();\n const [tab, setTab] = useState<\"properties\" | \"json\">(\"properties\");\n const resolved = useMemo(() => resolveSelection(doc, selection), [doc, selection]);\n\n const selectionIssueKey = issueKeyForSelection(selection);\n const selectionIssues = useMemo(() => {\n if (!selectionIssueKey) return [];\n return issues.filter((i) => i.targetId === selectionIssueKey);\n }, [issues, selectionIssueKey]);\n\n const breadcrumb = renderBreadcrumb(resolved);\n\n return (\n <aside\n style={{\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n background: \"#F8FAFC\",\n borderLeft: \"1px solid #E2E8F0\",\n minWidth: 280,\n }}\n data-testid=\"inspector\"\n >\n <header\n style={{\n padding: \"10px 12px\",\n borderBottom: \"1px solid #E2E8F0\",\n fontSize: 12,\n color: \"#475569\",\n }}\n >\n {breadcrumb}\n </header>\n <div style={{ display: \"flex\", borderBottom: \"1px solid #E2E8F0\" }}>\n <TabButton active={tab === \"properties\"} onClick={() => setTab(\"properties\")}>\n {messages.inspector.properties}\n </TabButton>\n <TabButton active={tab === \"json\"} onClick={() => setTab(\"json\")}>\n {messages.inspector.json}\n </TabButton>\n </div>\n <div style={{ padding: 12, overflowY: \"auto\", flex: 1, display: \"flex\", flexDirection: \"column\", gap: 16 }}>\n {tab === \"properties\" && (\n <>\n {!resolved && <EmptyState message={messages.inspector.empty} />}\n {resolved?.kind === \"workflow\" && (\n <WorkflowForm workflow={resolved.workflow} disabled={readOnly} onDispatch={onDispatch} />\n )}\n {resolved?.kind === \"state\" && (\n <StateForm\n workflow={resolved.workflow}\n stateCode={resolved.stateCode}\n state={resolved.state}\n disabled={readOnly}\n onDispatch={onDispatch}\n onRequestDelete={() =>\n onRequestDeleteState(resolved.workflow.name, resolved.stateCode)\n }\n />\n )}\n {resolved?.kind === \"transition\" && (\n <TransitionForm\n workflow={resolved.workflow}\n stateCode={resolved.stateCode}\n transition={resolved.transition}\n transitionUuid={resolved.transitionUuid}\n transitionIndex={resolved.transitionIndex}\n anchors={\n doc.meta.workflowUi[resolved.workflow.name]?.edgeAnchors?.[\n resolved.transitionUuid\n ]\n }\n disabled={readOnly}\n onDispatch={onDispatch}\n onSelectProcessor={(ordinalKey) => {\n const [, transitionUuid, indexStr] = ordinalKey.split(\":\");\n if (!transitionUuid || !indexStr) return;\n const procUuids = processorUuidsInOrder(doc, transitionUuid);\n const uuid = procUuids[Number.parseInt(indexStr, 10)];\n if (uuid) onSelectionChange({ kind: \"processor\", processorUuid: uuid });\n }}\n />\n )}\n {resolved?.kind === \"processor\" && (\n <ProcessorForm\n processor={resolved.processor}\n processorUuid={resolved.processorUuid}\n processorIndex={resolved.processorIndex}\n transitionUuid={resolved.transitionUuid}\n disabled={readOnly}\n onDispatch={onDispatch}\n />\n )}\n </>\n )}\n {tab === \"json\" && <JsonPreview document={doc} resolved={resolved} />}\n\n {selectionIssues.length > 0 && (\n <IssuesList issues={selectionIssues} title={messages.inspector.issues} />\n )}\n </div>\n </aside>\n );\n}\n\nfunction renderBreadcrumb(resolved: ReturnType<typeof resolveSelection>): string {\n if (!resolved) return \"\";\n if (resolved.kind === \"workflow\") return resolved.workflow.name;\n if (resolved.kind === \"state\")\n return `${resolved.workflow.name} › ${resolved.stateCode}`;\n if (resolved.kind === \"transition\")\n return `${resolved.workflow.name} › ${resolved.stateCode} › ${resolved.transition.name}`;\n if (resolved.kind === \"processor\")\n return `${resolved.workflow.name} › ${resolved.stateCode} › ${resolved.transition.name} › ${resolved.processor.name}`;\n return \"\";\n}\n\nfunction TabButton({\n active,\n onClick,\n children,\n}: {\n active: boolean;\n onClick: () => void;\n children: React.ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n style={{\n flex: 1,\n padding: \"8px 12px\",\n background: active ? \"white\" : \"transparent\",\n border: \"none\",\n borderBottom: active ? \"2px solid #0F172A\" : \"2px solid transparent\",\n fontSize: 13,\n fontWeight: active ? 600 : 400,\n cursor: \"pointer\",\n }}\n >\n {children}\n </button>\n );\n}\n\nfunction EmptyState({ message }: { message: string }) {\n return <p style={{ color: \"#64748B\", fontSize: 13 }}>{message}</p>;\n}\n\nfunction IssuesList({\n issues,\n title,\n}: {\n issues: ValidationIssue[];\n title: string;\n}) {\n return (\n <section style={{ display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n <header style={{ fontSize: 11, fontWeight: 600, letterSpacing: \"0.08em\", textTransform: \"uppercase\", color: \"#475569\" }}>\n {title}\n </header>\n {issues.map((issue, i) => (\n <div\n key={`${issue.code}-${i}`}\n style={{\n padding: 8,\n border: `1px solid ${severityBorder(issue.severity)}`,\n background: severityBackground(issue.severity),\n borderRadius: 4,\n fontSize: 12,\n }}\n >\n <strong>{issue.code}</strong>\n <div>{issue.message}</div>\n </div>\n ))}\n </section>\n );\n}\n\nfunction severityBorder(severity: ValidationIssue[\"severity\"]): string {\n if (severity === \"error\") return \"#FCA5A5\";\n if (severity === \"warning\") return \"#FCD34D\";\n return \"#93C5FD\";\n}\nfunction severityBackground(severity: ValidationIssue[\"severity\"]): string {\n if (severity === \"error\") return \"#FEF2F2\";\n if (severity === \"warning\") return \"#FFFBEB\";\n return \"#EFF6FF\";\n}\n\nfunction JsonPreview({\n document: doc,\n resolved,\n}: {\n document: WorkflowEditorDocument;\n resolved: ReturnType<typeof resolveSelection>;\n}) {\n const json = useMemo(() => {\n if (!resolved) return serializeEditorDocument(doc);\n if (resolved.kind === \"workflow\") return JSON.stringify(resolved.workflow, null, 2);\n if (resolved.kind === \"state\") return JSON.stringify(resolved.state, null, 2);\n if (resolved.kind === \"transition\") return JSON.stringify(resolved.transition, null, 2);\n if (resolved.kind === \"processor\") return JSON.stringify(resolved.processor, null, 2);\n return \"\";\n }, [doc, resolved]);\n return (\n <pre\n style={{\n fontFamily: \"ui-monospace, 'SF Mono', Menlo, monospace\",\n fontSize: 12,\n margin: 0,\n padding: 8,\n background: \"white\",\n border: \"1px solid #E2E8F0\",\n borderRadius: 4,\n maxHeight: 480,\n overflow: \"auto\",\n }}\n data-testid=\"inspector-json\"\n >\n {json}\n </pre>\n );\n}\n","import type {\n Processor,\n State,\n Transition,\n Workflow,\n WorkflowEditorDocument,\n} from \"@cyoda/workflow-core\";\nimport type { Selection } from \"../state/types.js\";\n\nexport interface ResolvedWorkflow {\n kind: \"workflow\";\n workflow: Workflow;\n}\nexport interface ResolvedState {\n kind: \"state\";\n workflow: Workflow;\n stateCode: string;\n state: State;\n}\nexport interface ResolvedTransition {\n kind: \"transition\";\n workflow: Workflow;\n stateCode: string;\n transition: Transition;\n transitionUuid: string;\n transitionIndex: number;\n}\nexport interface ResolvedProcessor {\n kind: \"processor\";\n workflow: Workflow;\n stateCode: string;\n transition: Transition;\n transitionUuid: string;\n processor: Processor;\n processorUuid: string;\n processorIndex: number;\n}\n\nexport type Resolved =\n | ResolvedWorkflow\n | ResolvedState\n | ResolvedTransition\n | ResolvedProcessor\n | null;\n\nfunction transitionUuidsInOrder(\n doc: WorkflowEditorDocument,\n workflow: string,\n state: string,\n): string[] {\n const uuids: string[] = [];\n for (const [uuid, ptr] of Object.entries(doc.meta.ids.transitions)) {\n if (ptr.workflow === workflow && ptr.state === state) uuids.push(uuid);\n }\n return uuids;\n}\n\nfunction processorUuidsInOrder(\n doc: WorkflowEditorDocument,\n transitionUuid: string,\n): string[] {\n const uuids: string[] = [];\n for (const [uuid, ptr] of Object.entries(doc.meta.ids.processors)) {\n if (ptr.transitionUuid === transitionUuid) uuids.push(uuid);\n }\n return uuids;\n}\n\nexport function resolveSelection(\n doc: WorkflowEditorDocument,\n selection: Selection,\n): Resolved {\n if (!selection) return null;\n\n switch (selection.kind) {\n case \"workflow\": {\n const workflow = doc.session.workflows.find((w) => w.name === selection.workflow);\n return workflow ? { kind: \"workflow\", workflow } : null;\n }\n case \"state\": {\n const workflow = doc.session.workflows.find((w) => w.name === selection.workflow);\n if (!workflow) return null;\n const state = workflow.states[selection.stateCode];\n if (!state) return null;\n return { kind: \"state\", workflow, stateCode: selection.stateCode, state };\n }\n case \"transition\": {\n const ptr = doc.meta.ids.transitions[selection.transitionUuid];\n if (!ptr) return null;\n const workflow = doc.session.workflows.find((w) => w.name === ptr.workflow);\n if (!workflow) return null;\n const state = workflow.states[ptr.state];\n if (!state) return null;\n const orderedUuids = transitionUuidsInOrder(doc, ptr.workflow, ptr.state);\n const index = orderedUuids.indexOf(selection.transitionUuid);\n if (index < 0) return null;\n const transition = state.transitions[index];\n if (!transition) return null;\n return {\n kind: \"transition\",\n workflow,\n stateCode: ptr.state,\n transition,\n transitionUuid: selection.transitionUuid,\n transitionIndex: index,\n };\n }\n case \"processor\": {\n const ptr = doc.meta.ids.processors[selection.processorUuid];\n if (!ptr) return null;\n const workflow = doc.session.workflows.find((w) => w.name === ptr.workflow);\n if (!workflow) return null;\n const state = workflow.states[ptr.state];\n if (!state) return null;\n const txUuids = transitionUuidsInOrder(doc, ptr.workflow, ptr.state);\n const txIndex = txUuids.indexOf(ptr.transitionUuid);\n if (txIndex < 0) return null;\n const transition = state.transitions[txIndex];\n if (!transition) return null;\n const procUuids = processorUuidsInOrder(doc, ptr.transitionUuid);\n const procIndex = procUuids.indexOf(selection.processorUuid);\n if (procIndex < 0) return null;\n const processor = transition.processors?.[procIndex];\n if (!processor) return null;\n return {\n kind: \"processor\",\n workflow,\n stateCode: ptr.state,\n transition,\n transitionUuid: ptr.transitionUuid,\n processor,\n processorUuid: selection.processorUuid,\n processorIndex: procIndex,\n };\n }\n case \"criterion\":\n return null;\n }\n}\n\n/** Public helper — exported for toolbar/validation code that needs to walk IDs. */\nexport { transitionUuidsInOrder, processorUuidsInOrder };\n","import type { ChangeEvent, ReactNode } from \"react\";\n\n/** Minimal uncontrolled field wrappers used by the per-selection forms. */\nexport function TextField({\n label,\n value,\n onCommit,\n disabled,\n placeholder,\n testId,\n}: {\n label: string;\n value: string;\n onCommit: (next: string) => void;\n disabled?: boolean;\n placeholder?: string;\n testId?: string;\n}) {\n return (\n <label style={rowStyle}>\n <span style={labelStyle}>{label}</span>\n <input\n type=\"text\"\n defaultValue={value}\n disabled={disabled}\n placeholder={placeholder}\n data-testid={testId}\n onBlur={(e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.value !== value) onCommit(e.target.value);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") (e.target as HTMLInputElement).blur();\n }}\n style={inputStyle}\n />\n </label>\n );\n}\n\nexport function CheckboxField({\n label,\n checked,\n onChange,\n disabled,\n testId,\n}: {\n label: string;\n checked: boolean;\n onChange: (next: boolean) => void;\n disabled?: boolean;\n testId?: string;\n}) {\n return (\n <label style={{ ...rowStyle, flexDirection: \"row\", alignItems: \"center\", gap: 8 }}>\n <input\n type=\"checkbox\"\n checked={checked}\n disabled={disabled}\n onChange={(e) => onChange(e.target.checked)}\n data-testid={testId}\n />\n <span style={{ ...labelStyle, marginBottom: 0 }}>{label}</span>\n </label>\n );\n}\n\nexport function SelectField<T extends string>({\n label,\n value,\n options,\n onChange,\n disabled,\n testId,\n}: {\n label: string;\n value: T;\n options: ReadonlyArray<{ value: T; label: string }>;\n onChange: (next: T) => void;\n disabled?: boolean;\n testId?: string;\n}) {\n return (\n <label style={rowStyle}>\n <span style={labelStyle}>{label}</span>\n <select\n value={value}\n disabled={disabled}\n onChange={(e) => onChange(e.target.value as T)}\n data-testid={testId}\n style={inputStyle}\n >\n {options.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n </label>\n );\n}\n\nexport function FieldGroup({ title, children }: { title: string; children: ReactNode }) {\n return (\n <section style={{ display: \"flex\", flexDirection: \"column\", gap: 8 }}>\n <header style={{ fontSize: 11, fontWeight: 600, letterSpacing: \"0.08em\", textTransform: \"uppercase\", color: \"#475569\" }}>\n {title}\n </header>\n {children}\n </section>\n );\n}\n\nconst rowStyle = {\n display: \"flex\",\n flexDirection: \"column\" as const,\n gap: 4,\n};\n\nconst labelStyle = {\n fontSize: 12,\n color: \"#475569\",\n marginBottom: 2,\n};\n\nconst inputStyle = {\n padding: \"6px 8px\",\n fontSize: 13,\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n background: \"white\",\n};\n","import type { DomainPatch, Workflow } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport { CheckboxField, FieldGroup, TextField } from \"./fields.js\";\n\nexport function WorkflowForm({\n workflow,\n disabled,\n onDispatch,\n}: {\n workflow: Workflow;\n disabled: boolean;\n onDispatch: (patch: DomainPatch) => void;\n}) {\n const messages = useMessages();\n return (\n <FieldGroup title={messages.inspector.properties}>\n <TextField\n label={messages.inspector.name}\n value={workflow.name}\n disabled={disabled}\n onCommit={(next) =>\n next !== workflow.name && onDispatch({ op: \"renameWorkflow\", from: workflow.name, to: next })\n }\n testId=\"inspector-workflow-name\"\n />\n <TextField\n label={messages.inspector.version}\n value={workflow.version}\n disabled={disabled}\n onCommit={(next) =>\n onDispatch({\n op: \"updateWorkflowMeta\",\n workflow: workflow.name,\n updates: { version: next },\n })\n }\n testId=\"inspector-workflow-version\"\n />\n <TextField\n label={messages.inspector.description}\n value={workflow.desc ?? \"\"}\n disabled={disabled}\n onCommit={(next) =>\n onDispatch({\n op: \"updateWorkflowMeta\",\n workflow: workflow.name,\n updates: { desc: next === \"\" ? undefined : next },\n })\n }\n testId=\"inspector-workflow-desc\"\n />\n <CheckboxField\n label={messages.inspector.active}\n checked={workflow.active}\n disabled={disabled}\n onChange={(next) =>\n onDispatch({\n op: \"updateWorkflowMeta\",\n workflow: workflow.name,\n updates: { active: next },\n })\n }\n testId=\"inspector-workflow-active\"\n />\n <TextField\n label={messages.inspector.initialState}\n value={workflow.initialState}\n disabled={disabled}\n onCommit={(next) =>\n onDispatch({\n op: \"setInitialState\",\n workflow: workflow.name,\n stateCode: next,\n })\n }\n testId=\"inspector-workflow-initial\"\n />\n </FieldGroup>\n );\n}\n","import type { DomainPatch, State, Workflow } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport { FieldGroup, TextField } from \"./fields.js\";\n\nexport function StateForm({\n workflow,\n stateCode,\n state,\n disabled,\n onDispatch,\n onRequestDelete,\n}: {\n workflow: Workflow;\n stateCode: string;\n state: State;\n disabled: boolean;\n onDispatch: (patch: DomainPatch) => void;\n onRequestDelete: () => void;\n}) {\n const messages = useMessages();\n const transitionCount = state.transitions.length;\n return (\n <FieldGroup title={messages.inspector.properties}>\n <TextField\n label={messages.inspector.name}\n value={stateCode}\n disabled={disabled}\n onCommit={(next) =>\n next !== stateCode &&\n onDispatch({\n op: \"renameState\",\n workflow: workflow.name,\n from: stateCode,\n to: next,\n })\n }\n testId=\"inspector-state-name\"\n />\n <div style={{ fontSize: 12, color: \"#475569\" }}>\n {transitionCount} outgoing transition{transitionCount === 1 ? \"\" : \"s\"}.\n </div>\n <button\n type=\"button\"\n onClick={onRequestDelete}\n disabled={disabled}\n data-testid=\"inspector-state-delete\"\n style={dangerBtn}\n >\n Delete state…\n </button>\n </FieldGroup>\n );\n}\n\nconst dangerBtn = {\n alignSelf: \"flex-start\" as const,\n padding: \"6px 10px\",\n background: \"#FEF2F2\",\n border: \"1px solid #FCA5A5\",\n color: \"#B91C1C\",\n borderRadius: 4,\n fontSize: 13,\n cursor: \"pointer\",\n};\n","import type {\n DomainPatch,\n EdgeAnchor,\n EdgeAnchorPair,\n Transition,\n Workflow,\n} from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport { CheckboxField, FieldGroup, TextField } from \"./fields.js\";\n\nexport function TransitionForm({\n workflow,\n stateCode,\n transition,\n transitionUuid,\n transitionIndex,\n anchors,\n disabled,\n onDispatch,\n onSelectProcessor,\n}: {\n workflow: Workflow;\n stateCode: string;\n transition: Transition;\n transitionUuid: string;\n transitionIndex: number;\n anchors: EdgeAnchorPair | undefined;\n disabled: boolean;\n onDispatch: (patch: DomainPatch) => void;\n onSelectProcessor: (processorUuid: string) => void;\n}) {\n const messages = useMessages();\n const update = (updates: Partial<Transition>) =>\n onDispatch({ op: \"updateTransition\", transitionUuid, updates });\n\n const removeTransition = () =>\n onDispatch({ op: \"removeTransition\", transitionUuid });\n\n const setAnchor = (role: \"source\" | \"target\", next: EdgeAnchor | \"\") => {\n const current: EdgeAnchorPair = anchors ?? {};\n const updated: EdgeAnchorPair = { ...current };\n if (next === \"\") delete updated[role];\n else updated[role] = next;\n const isEmpty = updated.source === undefined && updated.target === undefined;\n onDispatch({\n op: \"setEdgeAnchors\",\n transitionUuid,\n anchors: isEmpty ? null : updated,\n });\n };\n\n const reorder = (direction: -1 | 1) => {\n const toIndex = transitionIndex + direction;\n if (toIndex < 0) return;\n onDispatch({\n op: \"reorderTransition\",\n workflow: workflow.name,\n fromState: stateCode,\n transitionUuid,\n toIndex,\n });\n };\n\n return (\n <FieldGroup title={messages.inspector.properties}>\n <TextField\n label={messages.inspector.name}\n value={transition.name}\n disabled={disabled}\n onCommit={(next) => update({ name: next })}\n testId=\"inspector-transition-name\"\n />\n <TextField\n label=\"Target state\"\n value={transition.next}\n disabled={disabled}\n onCommit={(next) => update({ next })}\n testId=\"inspector-transition-next\"\n />\n <CheckboxField\n label={messages.inspector.manual}\n checked={transition.manual}\n disabled={disabled}\n onChange={(next) => update({ manual: next })}\n testId=\"inspector-transition-manual\"\n />\n <CheckboxField\n label={messages.inspector.disabled}\n checked={transition.disabled}\n disabled={disabled}\n onChange={(next) => update({ disabled: next })}\n testId=\"inspector-transition-disabled\"\n />\n\n <AnchorSelect\n label={messages.inspector.sourceAnchor}\n value={anchors?.source}\n disabled={disabled}\n messages={messages}\n onChange={(next) => setAnchor(\"source\", next)}\n testId=\"inspector-transition-source-anchor\"\n />\n <AnchorSelect\n label={messages.inspector.targetAnchor}\n value={anchors?.target}\n disabled={disabled}\n messages={messages}\n onChange={(next) => setAnchor(\"target\", next)}\n testId=\"inspector-transition-target-anchor\"\n />\n\n <div style={{ display: \"flex\", gap: 6 }}>\n <button type=\"button\" disabled={disabled} onClick={() => reorder(-1)} style={ghostBtn}>\n {messages.inspector.moveUp}\n </button>\n <button type=\"button\" disabled={disabled} onClick={() => reorder(1)} style={ghostBtn}>\n {messages.inspector.moveDown}\n </button>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={removeTransition}\n style={dangerBtn}\n data-testid=\"inspector-transition-delete\"\n >\n Delete\n </button>\n </div>\n\n <section style={{ marginTop: 12, display: \"flex\", flexDirection: \"column\", gap: 6 }}>\n <header style={{ fontSize: 11, fontWeight: 600, letterSpacing: \"0.08em\", textTransform: \"uppercase\", color: \"#475569\" }}>\n {messages.inspector.processors}\n </header>\n {(transition.processors ?? []).map((p, i) => (\n <button\n type=\"button\"\n key={`${p.name}-${i}`}\n onClick={() => {\n // Processor UUIDs are looked up by ordinal in the resolver; this\n // shell relies on the caller to translate index → UUID, which\n // it does via inspector/resolve.ts helpers wired by WorkflowEditor.\n onSelectProcessor(`__ordinal:${transitionUuid}:${i}`);\n }}\n style={processorBtn}\n data-testid={`inspector-processor-${i}`}\n >\n {p.name}\n </button>\n ))}\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() =>\n onDispatch({\n op: \"addProcessor\",\n transitionUuid,\n processor: {\n type: \"externalized\",\n name: \"newProcessor\",\n executionMode: \"ASYNC_NEW_TX\",\n config: {\n attachEntity: false,\n responseTimeoutMs: 5000,\n },\n },\n })\n }\n style={ghostBtn}\n data-testid=\"inspector-add-processor\"\n >\n {messages.inspector.addProcessor}\n </button>\n </section>\n </FieldGroup>\n );\n}\n\nconst ghostBtn = {\n padding: \"4px 8px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 12,\n cursor: \"pointer\",\n};\n\nconst dangerBtn = {\n ...ghostBtn,\n background: \"#FEF2F2\",\n borderColor: \"#FCA5A5\",\n color: \"#B91C1C\",\n};\n\nconst processorBtn = {\n ...ghostBtn,\n textAlign: \"left\" as const,\n background: \"#F8FAFC\",\n};\n\nfunction AnchorSelect({\n label,\n value,\n disabled,\n messages,\n onChange,\n testId,\n}: {\n label: string;\n value: EdgeAnchor | undefined;\n disabled: boolean;\n messages: ReturnType<typeof useMessages>;\n onChange: (next: EdgeAnchor | \"\") => void;\n testId: string;\n}) {\n return (\n <label\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n fontSize: 12,\n color: \"#334155\",\n }}\n >\n <span style={{ fontWeight: 500 }}>{label}</span>\n <select\n value={value ?? \"\"}\n disabled={disabled}\n onChange={(event) =>\n onChange(event.target.value === \"\" ? \"\" : (event.target.value as EdgeAnchor))\n }\n data-testid={testId}\n style={{\n padding: \"4px 6px\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n background: \"white\",\n fontSize: 12,\n }}\n >\n <option value=\"\">{messages.inspector.anchorDefault}</option>\n <option value=\"top\">{messages.inspector.anchorTop}</option>\n <option value=\"right\">{messages.inspector.anchorRight}</option>\n <option value=\"bottom\">{messages.inspector.anchorBottom}</option>\n <option value=\"left\">{messages.inspector.anchorLeft}</option>\n </select>\n </label>\n );\n}\n","import type { DomainPatch, Processor } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport { CheckboxField, FieldGroup, SelectField, TextField } from \"./fields.js\";\n\nconst EXECUTION_MODES = [\n { value: \"ASYNC_NEW_TX\", label: \"ASYNC_NEW_TX\" },\n { value: \"ASYNC_SAME_TX\", label: \"ASYNC_SAME_TX\" },\n { value: \"SYNC\", label: \"SYNC\" },\n] as const;\n\nexport function ProcessorForm({\n processor,\n processorUuid,\n processorIndex,\n transitionUuid,\n disabled,\n onDispatch,\n}: {\n processor: Processor;\n processorUuid: string;\n processorIndex: number;\n transitionUuid: string;\n disabled: boolean;\n onDispatch: (patch: DomainPatch) => void;\n}) {\n const messages = useMessages();\n const update = (updates: Partial<Processor>) =>\n onDispatch({ op: \"updateProcessor\", processorUuid, updates });\n\n const isExternalized = processor.type === \"externalized\";\n\n return (\n <FieldGroup title={messages.inspector.properties}>\n <TextField\n label={messages.inspector.name}\n value={processor.name}\n disabled={disabled}\n onCommit={(next) => update({ name: next } as Partial<Processor>)}\n testId=\"inspector-processor-name\"\n />\n {isExternalized && (\n <>\n <SelectField\n label={messages.inspector.executionMode}\n value={processor.executionMode ?? \"ASYNC_NEW_TX\"}\n options={EXECUTION_MODES}\n disabled={disabled}\n onChange={(next) => update({ executionMode: next } as Partial<Processor>)}\n testId=\"inspector-processor-execmode\"\n />\n <CheckboxField\n label=\"Attach entity\"\n checked={processor.config?.attachEntity ?? false}\n disabled={disabled}\n onChange={(next) =>\n update({\n config: { ...(processor.config ?? {}), attachEntity: next },\n } as Partial<Processor>)\n }\n testId=\"inspector-processor-attachentity\"\n />\n <TextField\n label=\"Response timeout (ms)\"\n value={String(processor.config?.responseTimeoutMs ?? 5000)}\n disabled={disabled}\n onCommit={(next) => {\n const parsed = Number.parseInt(next, 10);\n if (!Number.isFinite(parsed)) return;\n update({\n config: { ...(processor.config ?? {}), responseTimeoutMs: parsed },\n } as Partial<Processor>);\n }}\n testId=\"inspector-processor-timeout\"\n />\n </>\n )}\n\n <div style={{ display: \"flex\", gap: 6 }}>\n <button\n type=\"button\"\n disabled={disabled || processorIndex === 0}\n onClick={() =>\n onDispatch({\n op: \"reorderProcessor\",\n transitionUuid,\n processorUuid,\n toIndex: processorIndex - 1,\n })\n }\n style={ghostBtn}\n >\n {messages.inspector.moveUp}\n </button>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() =>\n onDispatch({\n op: \"reorderProcessor\",\n transitionUuid,\n processorUuid,\n toIndex: processorIndex + 1,\n })\n }\n style={ghostBtn}\n >\n {messages.inspector.moveDown}\n </button>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => onDispatch({ op: \"removeProcessor\", processorUuid })}\n style={dangerBtn}\n data-testid=\"inspector-processor-delete\"\n >\n {messages.inspector.removeProcessor}\n </button>\n </div>\n </FieldGroup>\n );\n}\n\nconst ghostBtn = {\n padding: \"4px 8px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 12,\n cursor: \"pointer\",\n};\n\nconst dangerBtn = {\n ...ghostBtn,\n background: \"#FEF2F2\",\n borderColor: \"#FCA5A5\",\n color: \"#B91C1C\",\n};\n","import { useMessages } from \"../i18n/context.js\";\nimport type { DerivedState } from \"../state/derive.js\";\n\nexport interface ToolbarProps {\n derived: DerivedState;\n canUndo: boolean;\n canRedo: boolean;\n readOnly: boolean;\n onUndo: () => void;\n onRedo: () => void;\n onSave?: () => void;\n}\n\nexport function Toolbar({\n derived,\n canUndo,\n canRedo,\n readOnly,\n onUndo,\n onRedo,\n onSave,\n}: ToolbarProps) {\n const messages = useMessages();\n return (\n <header\n style={{\n padding: \"8px 12px\",\n borderBottom: \"1px solid #E2E8F0\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n background: \"white\",\n }}\n data-testid=\"toolbar\"\n >\n <button\n type=\"button\"\n onClick={onUndo}\n disabled={!canUndo || readOnly}\n style={btnStyle}\n data-testid=\"toolbar-undo\"\n >\n {messages.toolbar.undo}\n </button>\n <button\n type=\"button\"\n onClick={onRedo}\n disabled={!canRedo || readOnly}\n style={btnStyle}\n data-testid=\"toolbar-redo\"\n >\n {messages.toolbar.redo}\n </button>\n <div style={{ flex: 1 }} />\n <ValidationPill\n count={derived.errorCount}\n label={messages.toolbar.errors}\n background=\"#FEF2F2\"\n borderColor=\"#FCA5A5\"\n color=\"#B91C1C\"\n testId=\"toolbar-errors\"\n />\n <ValidationPill\n count={derived.warningCount}\n label={messages.toolbar.warnings}\n background=\"#FFFBEB\"\n borderColor=\"#FCD34D\"\n color=\"#B45309\"\n testId=\"toolbar-warnings\"\n />\n <ValidationPill\n count={derived.infoCount}\n label={messages.toolbar.infos}\n background=\"#EFF6FF\"\n borderColor=\"#93C5FD\"\n color=\"#1D4ED8\"\n testId=\"toolbar-infos\"\n />\n {onSave && (\n <button\n type=\"button\"\n onClick={onSave}\n disabled={readOnly || derived.errorCount > 0}\n style={{ ...btnStyle, background: \"#0F172A\", color: \"white\", borderColor: \"#0F172A\" }}\n data-testid=\"toolbar-save\"\n >\n {messages.toolbar.save}\n </button>\n )}\n </header>\n );\n}\n\nfunction ValidationPill({\n count,\n label,\n background,\n borderColor,\n color,\n testId,\n}: {\n count: number;\n label: string;\n background: string;\n borderColor: string;\n color: string;\n testId: string;\n}) {\n return (\n <span\n role=\"status\"\n aria-live=\"polite\"\n aria-label={`${count} ${label}`}\n style={{\n padding: \"3px 8px\",\n background,\n border: `1px solid ${borderColor}`,\n color,\n borderRadius: 999,\n fontSize: 12,\n fontWeight: 600,\n }}\n data-testid={testId}\n >\n {count} {label}\n </span>\n );\n}\n\nconst btnStyle = {\n padding: \"4px 10px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 13,\n cursor: \"pointer\",\n};\n","import type { Workflow } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\n\nexport interface WorkflowTabsProps {\n workflows: Workflow[];\n activeWorkflow: string | null;\n onSelect: (name: string) => void;\n onAdd?: () => void;\n onClose?: (name: string) => void;\n readOnly: boolean;\n}\n\n/**\n * Multi-workflow strip per spec §16. Hidden by `WorkflowEditor` when the\n * session has only a single workflow.\n */\nexport function WorkflowTabs({\n workflows,\n activeWorkflow,\n onSelect,\n onAdd,\n onClose,\n readOnly,\n}: WorkflowTabsProps) {\n const messages = useMessages();\n return (\n <nav\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n padding: \"6px 12px\",\n borderBottom: \"1px solid #E2E8F0\",\n background: \"#F8FAFC\",\n overflowX: \"auto\",\n }}\n data-testid=\"workflow-tabs\"\n >\n {workflows.map((w) => {\n const active = w.name === activeWorkflow;\n return (\n <div\n key={w.name}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n borderRadius: 4,\n border: `1px solid ${active ? \"#0F172A\" : \"#CBD5E1\"}`,\n background: active ? \"white\" : \"transparent\",\n }}\n >\n <button\n type=\"button\"\n onClick={() => onSelect(w.name)}\n style={{\n padding: \"4px 10px\",\n background: \"transparent\",\n border: \"none\",\n fontSize: 13,\n fontWeight: active ? 600 : 400,\n cursor: \"pointer\",\n }}\n data-testid={`tab-${w.name}`}\n >\n {w.name || messages.tabs.untitled}\n </button>\n {onClose && !readOnly && workflows.length > 1 && (\n <button\n type=\"button\"\n onClick={() => onClose(w.name)}\n style={{\n padding: \"0 8px\",\n background: \"transparent\",\n border: \"none\",\n color: \"#64748B\",\n cursor: \"pointer\",\n fontSize: 14,\n }}\n aria-label={messages.tabs.closeTab}\n data-testid={`tab-close-${w.name}`}\n >\n ×\n </button>\n )}\n </div>\n );\n })}\n {onAdd && !readOnly && (\n <button\n type=\"button\"\n onClick={onAdd}\n style={{\n padding: \"4px 8px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 12,\n cursor: \"pointer\",\n }}\n data-testid=\"tab-add\"\n >\n + {messages.toolbar.addWorkflow}\n </button>\n )}\n </nav>\n );\n}\n","import { useEffect, useMemo, useRef } from \"react\";\nimport type { WorkflowEditorDocument } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\n\nexport interface DeleteStateModalProps {\n document: WorkflowEditorDocument;\n workflow: string;\n stateCode: string;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nfunction countAffected(\n doc: WorkflowEditorDocument,\n workflow: string,\n stateCode: string,\n): { outgoing: number; incoming: number } {\n let outgoing = 0;\n let incoming = 0;\n const wf = doc.session.workflows.find((w) => w.name === workflow);\n if (!wf) return { outgoing, incoming };\n for (const [code, state] of Object.entries(wf.states)) {\n for (const t of state.transitions) {\n if (code === stateCode) outgoing++;\n if (t.next === stateCode && code !== stateCode) incoming++;\n }\n }\n return { outgoing, incoming };\n}\n\n/** Cascading-delete confirmation per spec §11.7. */\nexport function DeleteStateModal({\n document: doc,\n workflow,\n stateCode,\n onConfirm,\n onCancel,\n}: DeleteStateModalProps) {\n const messages = useMessages();\n const counts = useMemo(\n () => countAffected(doc, workflow, stateCode),\n [doc, workflow, stateCode],\n );\n return (\n <ModalFrame onCancel={onCancel}>\n <h2 style={{ margin: 0, fontSize: 16 }}>{messages.confirmDelete.title}</h2>\n <p style={{ margin: \"12px 0\", fontSize: 13, color: \"#475569\" }}>\n {messages.confirmDelete.message}\n </p>\n <div style={{ padding: 8, background: \"#F8FAFC\", border: \"1px solid #E2E8F0\", borderRadius: 4, fontSize: 13 }}>\n <strong>{stateCode}</strong>\n <div style={{ color: \"#475569\" }}>\n {messages.confirmDelete.transitionsAffected}: {counts.outgoing + counts.incoming}\n </div>\n </div>\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", gap: 8, marginTop: 16 }}>\n <button type=\"button\" onClick={onCancel} style={ghostBtn} data-testid=\"modal-delete-cancel\">\n {messages.confirmDelete.cancel}\n </button>\n <button type=\"button\" onClick={onConfirm} style={dangerBtn} data-testid=\"modal-delete-confirm\">\n {messages.confirmDelete.confirm}\n </button>\n </div>\n </ModalFrame>\n );\n}\n\nexport function ModalFrame({\n children,\n onCancel,\n labelledBy,\n}: {\n children: React.ReactNode;\n onCancel: () => void;\n labelledBy?: string;\n}) {\n const frameRef = useRef<HTMLDivElement>(null);\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n previousFocusRef.current = (document.activeElement as HTMLElement) ?? null;\n const node = frameRef.current;\n if (node) {\n const focusable = node.querySelector<HTMLElement>(\n 'input, select, textarea, button, [tabindex]:not([tabindex=\"-1\"])',\n );\n (focusable ?? node).focus();\n }\n return () => {\n previousFocusRef.current?.focus?.();\n };\n }, []);\n\n return (\n <div\n onClick={onCancel}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n e.stopPropagation();\n onCancel();\n }\n }}\n style={{\n position: \"fixed\",\n inset: 0,\n background: \"rgba(15,23,42,0.4)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 1000,\n }}\n data-testid=\"modal-backdrop\"\n >\n <div\n ref={frameRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={labelledBy}\n tabIndex={-1}\n onClick={(e) => e.stopPropagation()}\n style={{\n background: \"white\",\n borderRadius: 6,\n padding: 20,\n minWidth: 340,\n boxShadow: \"0 10px 30px rgba(15,23,42,0.25)\",\n outline: \"none\",\n }}\n data-testid=\"modal-frame\"\n >\n {children}\n </div>\n </div>\n );\n}\n\nconst ghostBtn = {\n padding: \"6px 12px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 13,\n cursor: \"pointer\",\n};\nconst dangerBtn = {\n ...ghostBtn,\n background: \"#DC2626\",\n color: \"white\",\n borderColor: \"#DC2626\",\n};\n","import { useState } from \"react\";\nimport { NAME_REGEX, type State } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport { ModalFrame } from \"./DeleteStateModal.js\";\n\nexport interface DragConnectModalProps {\n source: State;\n fromState: string;\n toState: string;\n onCreate: (name: string) => void;\n onCancel: () => void;\n}\n\n/** Drag-connect modal per spec §11.5. Requires a named transition — cancel\n * must not create an anonymous transition. */\nexport function DragConnectModal({\n source,\n fromState,\n toState,\n onCreate,\n onCancel,\n}: DragConnectModalProps) {\n const messages = useMessages();\n const [name, setName] = useState(\"\");\n const existing = new Set(source.transitions.map((t) => t.name));\n const invalidFormat = !!name && !NAME_REGEX.test(name);\n const duplicate = existing.has(name);\n const blocked = name.length === 0 || invalidFormat || duplicate;\n\n return (\n <ModalFrame onCancel={onCancel}>\n <h2 style={{ margin: 0, fontSize: 16 }}>{messages.dragConnect.title}</h2>\n <p style={{ margin: \"6px 0 14px\", fontSize: 12, color: \"#475569\" }}>\n {fromState} → {toState}\n </p>\n <label style={{ display: \"flex\", flexDirection: \"column\", gap: 4 }}>\n <span style={{ fontSize: 12, color: \"#475569\" }}>{messages.dragConnect.transitionName}</span>\n <input\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n style={{\n padding: \"6px 8px\",\n fontSize: 13,\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n }}\n data-testid=\"dragconnect-name\"\n autoFocus\n />\n </label>\n {invalidFormat && (\n <div style={errorMsg} data-testid=\"dragconnect-error-format\">\n {messages.dragConnect.invalidName}\n </div>\n )}\n {duplicate && (\n <div style={errorMsg} data-testid=\"dragconnect-error-duplicate\">\n {messages.dragConnect.duplicateName}\n </div>\n )}\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", gap: 8, marginTop: 16 }}>\n <button type=\"button\" onClick={onCancel} style={ghostBtn} data-testid=\"dragconnect-cancel\">\n {messages.dragConnect.cancel}\n </button>\n <button\n type=\"button\"\n onClick={() => !blocked && onCreate(name)}\n disabled={blocked}\n style={primaryBtn}\n data-testid=\"dragconnect-create\"\n >\n {messages.dragConnect.create}\n </button>\n </div>\n </ModalFrame>\n );\n}\n\nconst errorMsg = {\n marginTop: 6,\n fontSize: 12,\n color: \"#B91C1C\",\n};\nconst ghostBtn = {\n padding: \"6px 12px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 13,\n cursor: \"pointer\",\n};\nconst primaryBtn = {\n ...ghostBtn,\n background: \"#0F172A\",\n color: \"white\",\n borderColor: \"#0F172A\",\n};\n","import { useCallback, useRef, useState } from \"react\";\nimport {\n WorkflowApiConflictError,\n type ConcurrencyToken,\n type ImportMode,\n type ImportPayload,\n type SaveStatus,\n type WorkflowApi,\n type WorkflowEditorDocument,\n} from \"@cyoda/workflow-core\";\n\nexport interface UseSaveFlowArgs {\n api: WorkflowApi;\n document: WorkflowEditorDocument;\n /**\n * Concurrency token from the last successful `exportWorkflows` / `importWorkflows`.\n * `null` means we have no server context (first-save scenario).\n */\n concurrencyToken: ConcurrencyToken | null;\n /** Called after a successful save to refresh the session and token. */\n onSaved: (nextToken: ConcurrencyToken | null) => void;\n /** Called when the user chooses \"Reload\" from the conflict banner. */\n onReload?: () => void;\n}\n\nexport interface SaveFlow {\n status: SaveStatus;\n /** Show the confirmation modal — REPLACE / ACTIVATE require explicit confirm (§17.3). */\n requestSave: () => void;\n /** Called from the modal after the user confirms. */\n confirmSave: () => Promise<void>;\n /** Dismiss the confirmation modal without dispatching. */\n cancel: () => void;\n /** Force-overwrite branch of the 409 banner (§17.4). */\n forceOverwrite: () => Promise<void>;\n /** Reload branch of the 409 banner — delegates to `onReload`. */\n reload: () => void;\n /** Reset status back to idle after viewing a success/error toast. */\n clear: () => void;\n}\n\n/**\n * Save-flow hook per spec §17.3. Owns the modal/banner state machine so\n * the shell only needs to render the current `status` and call `requestSave`\n * from the toolbar's Save button.\n */\nexport function useSaveFlow(args: UseSaveFlowArgs): SaveFlow {\n const { api, document: doc, concurrencyToken, onSaved, onReload } = args;\n const [status, setStatus] = useState<SaveStatus>({ kind: \"idle\" });\n const tokenRef = useRef<ConcurrencyToken | null>(concurrencyToken);\n tokenRef.current = concurrencyToken;\n\n const entityRef = useRef(doc.session.entity);\n entityRef.current = doc.session.entity;\n\n const payloadRef = useRef<ImportPayload>({\n importMode: doc.session.importMode,\n workflows: doc.session.workflows,\n });\n payloadRef.current = {\n importMode: doc.session.importMode,\n workflows: doc.session.workflows,\n };\n\n const performImport = useCallback(\n async (token: ConcurrencyToken | null) => {\n const entity = entityRef.current;\n if (!entity) {\n setStatus({\n kind: \"error\",\n message: \"Cannot save: session has no entity identity.\",\n });\n return;\n }\n setStatus({ kind: \"saving\" });\n try {\n const result = await api.importWorkflows(entity, payloadRef.current, {\n concurrencyToken: token,\n });\n onSaved(result.concurrencyToken);\n setStatus({ kind: \"success\", at: Date.now() });\n } catch (err) {\n if (err instanceof WorkflowApiConflictError) {\n setStatus({\n kind: \"conflict\",\n serverConcurrencyToken: err.serverConcurrencyToken,\n });\n return;\n }\n setStatus({\n kind: \"error\",\n message: err instanceof Error ? err.message : \"Unknown save error.\",\n });\n }\n },\n [api, onSaved],\n );\n\n const requestSave = useCallback(() => {\n const mode: ImportMode = payloadRef.current.importMode;\n const requiresExplicitConfirm = mode === \"REPLACE\" || mode === \"ACTIVATE\";\n setStatus({ kind: \"confirming\", mode, requiresExplicitConfirm });\n }, []);\n\n const confirmSave = useCallback(\n () => performImport(tokenRef.current),\n [performImport],\n );\n\n const cancel = useCallback(() => setStatus({ kind: \"idle\" }), []);\n\n const forceOverwrite = useCallback(() => performImport(null), [performImport]);\n\n const reload = useCallback(() => {\n onReload?.();\n setStatus({ kind: \"idle\" });\n }, [onReload]);\n\n const clear = useCallback(() => setStatus({ kind: \"idle\" }), []);\n\n return { status, requestSave, confirmSave, cancel, forceOverwrite, reload, clear };\n}\n","import { useState } from \"react\";\nimport type { ImportMode, WorkflowEditorDocument } from \"@cyoda/workflow-core\";\nimport { useMessages } from \"../i18n/context.js\";\nimport { ModalFrame } from \"../modals/DeleteStateModal.js\";\n\nexport interface SaveConfirmModalProps {\n mode: ImportMode;\n requiresExplicitConfirm: boolean;\n warningCount: number;\n document: WorkflowEditorDocument;\n /** Summary of changes vs. server state — rendered verbatim above the\n * confirm button. Callers who have not fetched server state pass null. */\n diffSummary?: string | null;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\n/**\n * Save confirmation modal per spec §17.3 + §18.5.\n *\n * - REPLACE / ACTIVATE require a tick on \"I understand this replaces /\n * activates server state\" before the confirm button enables.\n * - When warnings are present, a separate tick is required acknowledging\n * the warning count.\n * - The diff summary (if provided) is shown above the tick-boxes.\n */\nexport function SaveConfirmModal({\n mode,\n requiresExplicitConfirm,\n warningCount,\n diffSummary,\n onConfirm,\n onCancel,\n}: SaveConfirmModalProps) {\n const messages = useMessages();\n const [ackMode, setAckMode] = useState(!requiresExplicitConfirm);\n const [ackWarnings, setAckWarnings] = useState(warningCount === 0);\n const blocked = !ackMode || !ackWarnings;\n\n return (\n <ModalFrame onCancel={onCancel}>\n <h2 style={{ margin: 0, fontSize: 16 }}>{messages.saveConfirm.title}</h2>\n <p style={{ margin: \"12px 0\", fontSize: 13, color: \"#475569\" }}>\n {messages.saveConfirm.modeLabel}: <strong>{mode}</strong>\n </p>\n {diffSummary && (\n <pre\n style={{\n fontFamily: \"ui-monospace, SFMono-Regular, Consolas, monospace\",\n background: \"#F8FAFC\",\n border: \"1px solid #E2E8F0\",\n padding: 8,\n borderRadius: 4,\n fontSize: 12,\n margin: \"8px 0\",\n maxHeight: 160,\n overflow: \"auto\",\n whiteSpace: \"pre-wrap\",\n }}\n data-testid=\"save-diff-summary\"\n >\n {diffSummary}\n </pre>\n )}\n {requiresExplicitConfirm && (\n <label style={checkRow} data-testid=\"save-ack-mode\">\n <input\n type=\"checkbox\"\n checked={ackMode}\n onChange={(e) => setAckMode(e.target.checked)}\n />\n <span>\n {mode === \"REPLACE\"\n ? messages.saveConfirm.ackReplace\n : messages.saveConfirm.ackActivate}\n </span>\n </label>\n )}\n {warningCount > 0 && (\n <label style={checkRow} data-testid=\"save-ack-warnings\">\n <input\n type=\"checkbox\"\n checked={ackWarnings}\n onChange={(e) => setAckWarnings(e.target.checked)}\n />\n <span>\n {messages.saveConfirm.ackWarnings.replace(\"{count}\", String(warningCount))}\n </span>\n </label>\n )}\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", gap: 8, marginTop: 16 }}>\n <button type=\"button\" onClick={onCancel} style={ghostBtn} data-testid=\"save-cancel\">\n {messages.saveConfirm.cancel}\n </button>\n <button\n type=\"button\"\n disabled={blocked}\n onClick={onConfirm}\n style={primaryBtn}\n data-testid=\"save-confirm\"\n >\n {messages.saveConfirm.confirm}\n </button>\n </div>\n </ModalFrame>\n );\n}\n\nconst checkRow = {\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 13,\n color: \"#1E293B\",\n margin: \"8px 0\",\n};\nconst ghostBtn = {\n padding: \"6px 12px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 13,\n cursor: \"pointer\",\n};\nconst primaryBtn = {\n ...ghostBtn,\n background: \"#0F172A\",\n color: \"white\",\n borderColor: \"#0F172A\",\n};\n","import { useMessages } from \"../i18n/context.js\";\n\nexport interface ConflictBannerProps {\n onReload: () => void;\n onForceOverwrite: () => void;\n}\n\n/**\n * 409-conflict banner per spec §17.4. Non-dismissable; the user must pick\n * Reload (discard local) or Force overwrite (resend without the token).\n */\nexport function ConflictBanner({ onReload, onForceOverwrite }: ConflictBannerProps) {\n const messages = useMessages();\n return (\n <div\n style={{\n padding: \"10px 14px\",\n background: \"#FEF3C7\",\n borderBottom: \"1px solid #F59E0B\",\n color: \"#78350F\",\n fontSize: 13,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n }}\n role=\"alert\"\n data-testid=\"conflict-banner\"\n >\n <span style={{ flex: 1 }}>{messages.conflict.message}</span>\n <button\n type=\"button\"\n onClick={onReload}\n style={btn}\n data-testid=\"conflict-reload\"\n >\n {messages.conflict.reload}\n </button>\n <button\n type=\"button\"\n onClick={onForceOverwrite}\n style={{ ...btn, background: \"#DC2626\", color: \"white\", borderColor: \"#DC2626\" }}\n data-testid=\"conflict-force\"\n >\n {messages.conflict.forceOverwrite}\n </button>\n </div>\n );\n}\n\nconst btn = {\n padding: \"4px 10px\",\n background: \"white\",\n border: \"1px solid #CBD5E1\",\n borderRadius: 4,\n fontSize: 12,\n cursor: \"pointer\",\n};\n","import type { WorkflowEditorDocument } from \"@cyoda/workflow-core\";\n\n/**\n * Produce a short human-readable diff summary between the last-known server\n * document and the current editor document (spec §17.3). Counts workflows /\n * states / transitions added, removed, or changed; returns null when no\n * server document is available (first-save scenario).\n *\n * The summary is intentionally coarse — detailed diffs belong in a dedicated\n * compare view, not a modal.\n */\nexport function diffSummary(\n server: WorkflowEditorDocument | null,\n local: WorkflowEditorDocument,\n): string | null {\n if (!server) return null;\n const sw = new Map(server.session.workflows.map((w) => [w.name, w]));\n const lw = new Map(local.session.workflows.map((w) => [w.name, w]));\n\n const added: string[] = [];\n const removed: string[] = [];\n const changed: string[] = [];\n\n for (const [name, localWf] of lw) {\n const serverWf = sw.get(name);\n if (!serverWf) {\n added.push(name);\n continue;\n }\n if (JSON.stringify(serverWf) !== JSON.stringify(localWf)) {\n changed.push(name);\n }\n }\n for (const [name] of sw) {\n if (!lw.has(name)) removed.push(name);\n }\n\n const lines: string[] = [];\n if (added.length) lines.push(`+ added: ${added.join(\", \")}`);\n if (removed.length) lines.push(`- removed: ${removed.join(\", \")}`);\n if (changed.length) lines.push(`~ changed: ${changed.join(\", \")}`);\n if (lines.length === 0) lines.push(\"(no workflow-level differences)\");\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA0D;;;ACA1D,mBAA0C;;;ACAnC,IAAM,kBAAkB;AAAA,EAC7B,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,IACN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U,QAAQ,MAAM,KAAK,UAAU,OAAO,GAAG;AACxD,cAAQ,KAAK,IAAI;AAAA,IACnB;AAAA,EACF;AACA,aAAW,CAAC,IAAI,KAAK,IAAI;AACvB,QAAI,CAAC,GAAG,IAAI,IAAI,EAAG,SAAQ,KAAK,IAAI;AAAA,EACtC;AAEA,QAAM,QAAkB,CAAC;AACzB,MAAI,MAAM,OAAQ,OAAM,KAAK,YAAY,MAAM,KAAK,IAAI,CAAC,EAAE;AAC3D,MAAI,QAAQ,OAAQ,OAAM,KAAK,cAAc,QAAQ,KAAK,IAAI,CAAC,EAAE;AACjE,MAAI,QAAQ,OAAQ,OAAM,KAAK,cAAc,QAAQ,KAAK,IAAI,CAAC,EAAE;AACjE,MAAI,MAAM,WAAW,EAAG,OAAM,KAAK,iCAAiC;AACpE,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["import_react","import_react","document","import_workflow_core","import_react","import_reactflow","import_react","import_theme","import_jsx_runtime","import_react","import_reactflow","import_theme","import_reactflow","mid","import_jsx_runtime","import_jsx_runtime","import_react","import_workflow_core","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","dangerBtn","import_jsx_runtime","ghostBtn","dangerBtn","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","ghostBtn","dangerBtn","import_react","import_workflow_core","import_jsx_runtime","ghostBtn","import_jsx_runtime","import_react","import_workflow_core","import_react","import_jsx_runtime","diffSummary","ghostBtn","primaryBtn","import_jsx_runtime"]}
|