@aranzatech/diagrams-bpmn 0.2.12 → 0.2.13
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/dist/{catalog-DUfPajtM.d.cts → catalog-BiLXVn-2.d.cts} +1 -1
- package/dist/{catalog-BKdtbOQT.d.ts → catalog-Di2nzGs9.d.ts} +1 -1
- package/dist/chunk-FBTGIYZS.js +218 -0
- package/dist/chunk-FBTGIYZS.js.map +1 -0
- package/dist/{chunk-MZVDC6FU.js → chunk-YUE5EM3W.js} +76 -10
- package/dist/chunk-YUE5EM3W.js.map +1 -0
- package/dist/elements/index.cjs +217 -0
- package/dist/elements/index.cjs.map +1 -1
- package/dist/elements/index.d.cts +15 -16
- package/dist/elements/index.d.ts +15 -16
- package/dist/elements/index.js +1 -1
- package/dist/guards-DPHXfpY8.d.cts +16 -0
- package/dist/guards-qgSeZEU4.d.ts +16 -0
- package/dist/index.cjs +74 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/layout/index.cjs +10 -10
- package/dist/layout/index.cjs.map +1 -1
- package/dist/layout/index.d.cts +3 -3
- package/dist/layout/index.d.ts +3 -3
- package/dist/layout/index.js +10 -10
- package/dist/layout/index.js.map +1 -1
- package/dist/modeling/index.d.cts +3 -3
- package/dist/modeling/index.d.ts +3 -3
- package/dist/{types-hgmLfRA9.d.cts → types-Dfrt0wVs.d.cts} +29 -1
- package/dist/{types-hgmLfRA9.d.ts → types-Dfrt0wVs.d.ts} +29 -1
- package/dist/{types-kI1SiQB4.d.ts → types-rEfHsPr5.d.ts} +1 -1
- package/dist/{types-44yNtMtO.d.cts → types-s2_VvPGf.d.cts} +1 -1
- package/dist/validation/index.d.cts +2 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/xml/index.cjs +74 -8
- package/dist/xml/index.cjs.map +1 -1
- package/dist/xml/index.d.cts +3 -3
- package/dist/xml/index.d.ts +3 -3
- package/dist/xml/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-MZVDC6FU.js.map +0 -1
- package/dist/chunk-OZKTOILD.js +0 -3
- package/dist/chunk-OZKTOILD.js.map +0 -1
package/dist/layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/elk.ts","../../src/layout/index.ts"],"names":[],"mappings":";;;;;;AAOA,IAAM,oBAAA,uBAA2B,GAAA,CAAqB;AAAA,EACpD,MAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,kBAAA,GAAiF;AAAA,EACrF,IAAA,EAAM,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EACvB,IAAA,EAAM,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EACvB,UAAA,EAAY,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EAC7B,WAAA,EAAa,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EAC9B,eAAA,EAAiB,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EAClC,eAAA,EAAiB,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA;AAChC,CAAA;AAGA,IAAM,iBAAA,GAA8D;AAAA,EAClE,IAAA,EAAM,qCAAA;AAAA,EACN,IAAA,EAAM,qCAAA;AAAA,EACN,UAAA,EAAY,qCAAA;AAAA,EACZ,WAAA,EAAa,qCAAA;AAAA,EACb,eAAA,EAAiB,qCAAA;AAAA,EACjB,eAAA,EAAiB;AACnB,CAAA;AAeA,eAAsB,aAAA,CACpB,OACA,KAAA,EACuD;AAGvD,EAAA,MAAM,cAAA,uBAAqB,GAAA,EAAY;AACvC,EAAA,KAAA,MAAW,QAAQ,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C,MAAM,OAAO,IAAA;AAClB,IAAA,MAAM,QAAA,GAAW,EAAE,GAAG,IAAA,CAAK,IAAA,EAAK;AAChC,IAAA,IAAI,IAAA,CAAK,MAAA,IAAU,IAAA,CAAK,MAAA,CAAO,SAAS,CAAA,EAAG;AACzC,MAAA,QAAA,CAAS,gBAAgB,IAAA,CAAK,MAAA;AAAA,IAChC,CAAA,MAAO;AACL,MAAA,OAAO,QAAA,CAAS,aAAA;AAAA,IAClB;AACA,IAAA,OAAO,EAAE,GAAG,IAAA,EAAM,IAAA,EAAM,QAAA,EAAS;AAAA,EACnC,CAAC,CAAA;AAED,EAAA,OAAO,EAAE,KAAA,EAAO,YAAA,EAAc,KAAA,EAAO,YAAA,EAA6B;AACpE;;;AC3GA,eAAsB,eAAA,CACpB,KAAA,EACA,KAAA,EACA,OAAA,GAAyB,EAAC,EACH;AACvB,EAAA,OAAO,WAAA,CAAY,OAAwB,KAAA,EAAwB;AAAA,IACjE,GAAG,OAAA;AAAA,IACH,WAAA,EAAa,CAAC,IAAA,KAAS,eAAA,CAAgB,IAAkB;AAAA,GAC1D,CAAA;AACH;AAMO,SAAS,qBAAA,CACd,OACA,MAAA,EACkB;AAClB,EAAA,OAAO,0BAAA,CAA2B,OAAO,MAAM,CAAA;AACjD","file":"index.js","sourcesContent":["import { elkLayout } from \"@aranzatech/diagrams-core/layout\";\nimport type { DiagramNode, DiagramEdge } from \"@aranzatech/diagrams-core/types\";\nimport type { BpmnRFNode, BpmnRFEdge } from \"../xml/types\";\nimport type { BpmnElementType } from \"../elements/types\";\nimport { getBpmnNodeSize } from \"../modeling\";\n\n// Container types that ELK auto-sizes based on their children.\nconst BPMN_CONTAINER_TYPES = new Set<BpmnElementType>([\n \"Pool\",\n \"Lane\",\n \"SubProcess\",\n \"Transaction\",\n \"EventSubProcess\",\n \"AdHocSubProcess\",\n]);\n\nconst CONTAINER_MIN_SIZE: Partial<Record<BpmnElementType, { w: number; h: number }>> = {\n Pool: { w: 560, h: 160 },\n Lane: { w: 480, h: 100 },\n SubProcess: { w: 200, h: 120 },\n Transaction: { w: 200, h: 120 },\n EventSubProcess: { w: 200, h: 120 },\n AdHocSubProcess: { w: 200, h: 120 },\n};\n\n// Left padding includes the pool label strip (≈30 px).\nconst CONTAINER_PADDING: Partial<Record<BpmnElementType, string>> = {\n Pool: \"[top=20,left=30,bottom=20,right=20]\",\n Lane: \"[top=20,left=50,bottom=20,right=50]\",\n SubProcess: \"[top=20,left=30,bottom=20,right=30]\",\n Transaction: \"[top=20,left=30,bottom=20,right=30]\",\n EventSubProcess: \"[top=20,left=30,bottom=20,right=30]\",\n AdHocSubProcess: \"[top=20,left=30,bottom=20,right=30]\",\n};\n\n/**\n * ELK-based auto-layout for BPMN diagrams.\n *\n * Direction policy — always LEFT-TO-RIGHT to match screen anatomy:\n * - Root: RIGHT — free nodes and pools flow LR on the canvas.\n * - Pool that contains Lanes: DOWN internally so lanes stack top-to-bottom\n * (standard horizontal-pool anatomy); the pool itself is still placed LR.\n * - Pool without lanes, Lane, SubProcess, Transaction, AdHoc: RIGHT — content\n * flows left-to-right inside the container.\n * - All edges get ORTHOGONAL routing in a single INCLUDE_CHILDREN pass so\n * cross-pool and cross-lane edges are routed correctly.\n * - Containers auto-resize to fit their children.\n */\nexport async function bpmnElkLayout(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n): Promise<{ nodes: BpmnRFNode[]; edges: BpmnRFEdge[] }> {\n // Pools that contain at least one Lane child need DOWN internal direction so\n // the lanes stack vertically (standard horizontal BPMN pool).\n const poolsWithLanes = new Set<string>();\n for (const node of nodes) {\n if (node.data.elementType === \"Lane\" && node.parentId) {\n poolsWithLanes.add(node.parentId);\n }\n }\n\n const result = await elkLayout(\n nodes as unknown as DiagramNode[],\n edges as unknown as DiagramEdge[],\n {\n direction: \"LR\",\n getNodeSize: (node) => {\n const bNode = node as unknown as BpmnRFNode;\n if (BPMN_CONTAINER_TYPES.has(bNode.data.elementType)) return undefined;\n return getBpmnNodeSize(bNode);\n },\n isContainerNode: (node) =>\n BPMN_CONTAINER_TYPES.has((node as unknown as BpmnRFNode).data.elementType),\n getNodeLayoutOptions: (node) => {\n const type = (node as unknown as BpmnRFNode).data.elementType;\n if (!BPMN_CONTAINER_TYPES.has(type)) return undefined;\n const min = CONTAINER_MIN_SIZE[type];\n // Pool with Lanes: DOWN so lanes stack top-to-bottom inside the pool.\n // Everything else (Lane content, SubProcess, free tasks): RIGHT (LR).\n const dir = type === \"Pool\" && poolsWithLanes.has(node.id) ? \"DOWN\" : \"RIGHT\";\n return {\n \"elk.direction\": dir,\n \"elk.nodeSize.constraints\": \"MINIMUM_SIZE\",\n ...(min ? { \"elk.nodeSize.minimum\": `[w=${min.w},h=${min.h}]` } : {}),\n ...(CONTAINER_PADDING[type] ? { \"elk.padding\": CONTAINER_PADDING[type] } : {}),\n };\n },\n elk: {\n \"elk.algorithm\": \"layered\",\n \"elk.direction\": \"RIGHT\",\n \"elk.hierarchyHandling\": \"INCLUDE_CHILDREN\",\n \"elk.edgeRouting\": \"ORTHOGONAL\",\n \"elk.layered.spacing.nodeNodeBetweenLayers\": \"80\",\n \"elk.layered.spacing.edgeNodeBetweenLayers\": \"20\",\n \"elk.spacing.nodeNode\": \"40\",\n \"elk.spacing.componentComponent\": \"60\",\n },\n },\n );\n\n const nodeMap = new Map(result.nodes.map((n) => [n.id, n]));\n const edgeMap = new Map(result.edges.map((e) => [e.id, e]));\n\n const updatedNodes = nodes.map((node) => {\n const laid = nodeMap.get(node.id);\n if (!laid) return node;\n return { ...node, position: laid.position, width: laid.width, height: laid.height };\n });\n\n const updatedEdges = edges.map((edge) => {\n const laid = edgeMap.get(edge.id);\n if (!laid) return edge;\n const nextData = { ...edge.data };\n if (laid.points && laid.points.length > 0) {\n nextData.routingPoints = laid.points;\n } else {\n delete nextData.routingPoints;\n }\n return { ...edge, data: nextData };\n });\n\n return { nodes: updatedNodes, edges: updatedEdges as BpmnRFEdge[] };\n}\n","import type { DiagramEdge, LayoutOptions, LayoutResult } from \"@aranzatech/diagrams-core/types\";\nimport { dagreLayout, applyLayoutResultToDiagram } from \"@aranzatech/diagrams-core/layout\";\nimport type { DiagramNode } from \"@aranzatech/diagrams-core/types\";\nimport type { BpmnRFNode, BpmnRFEdge } from \"../xml/types\";\nimport { getBpmnNodeSize } from \"../modeling\";\nimport type { BpmnDiagramState } from \"../modeling\";\n\nexport { applyLayoutResultToDiagram };\nexport { bpmnElkLayout } from \"./elk\";\n\n/**\n * Dagre layout pre-configured for BPMN diagrams.\n * Uses BPMN-specific node sizes (events 52×52, gateways 64×64, tasks 192×64, etc.)\n * instead of the generic fallback, which prevents overlaps and poor spacing.\n */\nexport async function bpmnDagreLayout(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n options: LayoutOptions = {},\n): Promise<LayoutResult> {\n return dagreLayout(nodes as DiagramNode[], edges as DiagramEdge[], {\n ...options,\n getNodeSize: (node) => getBpmnNodeSize(node as BpmnRFNode),\n });\n}\n\n/**\n * Applies a bpmn dagre layout result back to the diagram state.\n * Convenience wrapper so callers only need one import.\n */\nexport function applyBpmnLayoutResult(\n state: BpmnDiagramState,\n result: LayoutResult,\n): BpmnDiagramState {\n return applyLayoutResultToDiagram(state, result) as BpmnDiagramState;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/elk.ts","../../src/layout/index.ts"],"names":[],"mappings":";;;;;;AAOA,IAAM,oBAAA,uBAA2B,GAAA,CAAqB;AAAA,EACpD,MAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,kBAAA,GAAiF;AAAA,EACrF,IAAA,EAAM,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EACvB,IAAA,EAAM,EAAE,CAAA,EAAG,GAAA,EAAK,GAAG,GAAA,EAAI;AAAA,EACvB,UAAA,EAAY,EAAE,CAAA,EAAG,G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AAA,KAAS,eAAA,CAAgB,IAAkB;AAAA,GAC1D,CAAA;AACH;AAMO,SAAS,qBAAA,CACd,OACA,MAAA,EACkB;AAClB,EAAA,OAAO,0BAAA,CAA2B,OAAO,MAAM,CAAA;AACjD","file":"index.js","sourcesContent":["import { elkLayout } from \"@aranzatech/diagrams-core/layout\";\nimport type { DiagramNode, DiagramEdge } from \"@aranzatech/diagrams-core/types\";\nimport type { BpmnRFNode, BpmnRFEdge } from \"../xml/types\";\nimport type { BpmnElementType } from \"../elements/types\";\nimport { getBpmnNodeSize } from \"../modeling\";\n\n// Container types that ELK auto-sizes based on their children.\nconst BPMN_CONTAINER_TYPES = new Set<BpmnElementType>([\n \"Pool\",\n \"Lane\",\n \"SubProcess\",\n \"Transaction\",\n \"EventSubProcess\",\n \"AdHocSubProcess\",\n]);\n\nconst CONTAINER_MIN_SIZE: Partial<Record<BpmnElementType, { w: number; h: number }>> = {\n Pool: { w: 560, h: 160 },\n Lane: { w: 480, h: 100 },\n SubProcess: { w: 200, h: 120 },\n Transaction: { w: 200, h: 120 },\n EventSubProcess: { w: 200, h: 120 },\n AdHocSubProcess: { w: 200, h: 120 },\n};\n\n// Left padding: label strip (≈30 px) + breathing room before first node.\nconst CONTAINER_PADDING: Partial<Record<BpmnElementType, string>> = {\n Pool: \"[top=30,left=55,bottom=30,right=40]\",\n Lane: \"[top=25,left=60,bottom=25,right=40]\",\n SubProcess: \"[top=25,left=35,bottom=25,right=35]\",\n Transaction: \"[top=25,left=35,bottom=25,right=35]\",\n EventSubProcess: \"[top=25,left=35,bottom=25,right=35]\",\n AdHocSubProcess: \"[top=25,left=35,bottom=25,right=35]\",\n};\n\n/**\n * ELK-based auto-layout for BPMN diagrams.\n *\n * Direction policy — always LEFT-TO-RIGHT to match screen anatomy:\n * - Root: RIGHT — free nodes and pools flow LR on the canvas.\n * - Pool that contains Lanes: DOWN internally so lanes stack top-to-bottom\n * (standard horizontal-pool anatomy); the pool itself is still placed LR.\n * - Pool without lanes, Lane, SubProcess, Transaction, AdHoc: RIGHT — content\n * flows left-to-right inside the container.\n * - All edges get ORTHOGONAL routing in a single INCLUDE_CHILDREN pass so\n * cross-pool and cross-lane edges are routed correctly.\n * - Containers auto-resize to fit their children.\n */\nexport async function bpmnElkLayout(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n): Promise<{ nodes: BpmnRFNode[]; edges: BpmnRFEdge[] }> {\n // Pools that contain at least one Lane child need DOWN internal direction so\n // the lanes stack vertically (standard horizontal BPMN pool).\n const poolsWithLanes = new Set<string>();\n for (const node of nodes) {\n if (node.data.elementType === \"Lane\" && node.parentId) {\n poolsWithLanes.add(node.parentId);\n }\n }\n\n const result = await elkLayout(\n nodes as unknown as DiagramNode[],\n edges as unknown as DiagramEdge[],\n {\n direction: \"LR\",\n getNodeSize: (node) => {\n const bNode = node as unknown as BpmnRFNode;\n if (BPMN_CONTAINER_TYPES.has(bNode.data.elementType)) return undefined;\n return getBpmnNodeSize(bNode);\n },\n isContainerNode: (node) =>\n BPMN_CONTAINER_TYPES.has((node as unknown as BpmnRFNode).data.elementType),\n getNodeLayoutOptions: (node) => {\n const type = (node as unknown as BpmnRFNode).data.elementType;\n if (!BPMN_CONTAINER_TYPES.has(type)) return undefined;\n const min = CONTAINER_MIN_SIZE[type];\n // Pool with Lanes: DOWN so lanes stack top-to-bottom inside the pool.\n // Everything else (Lane content, SubProcess, free tasks): RIGHT (LR).\n const dir = type === \"Pool\" && poolsWithLanes.has(node.id) ? \"DOWN\" : \"RIGHT\";\n return {\n \"elk.direction\": dir,\n \"elk.nodeSize.constraints\": \"MINIMUM_SIZE\",\n ...(min ? { \"elk.nodeSize.minimum\": `[w=${min.w},h=${min.h}]` } : {}),\n ...(CONTAINER_PADDING[type] ? { \"elk.padding\": CONTAINER_PADDING[type] } : {}),\n };\n },\n elk: {\n \"elk.algorithm\": \"layered\",\n \"elk.direction\": \"RIGHT\",\n \"elk.hierarchyHandling\": \"INCLUDE_CHILDREN\",\n \"elk.edgeRouting\": \"ORTHOGONAL\",\n \"elk.layered.spacing.nodeNodeBetweenLayers\": \"100\",\n \"elk.layered.spacing.edgeNodeBetweenLayers\": \"40\",\n \"elk.spacing.nodeNode\": \"60\",\n \"elk.spacing.componentComponent\": \"80\",\n },\n },\n );\n\n const nodeMap = new Map(result.nodes.map((n) => [n.id, n]));\n const edgeMap = new Map(result.edges.map((e) => [e.id, e]));\n\n const updatedNodes = nodes.map((node) => {\n const laid = nodeMap.get(node.id);\n if (!laid) return node;\n return { ...node, position: laid.position, width: laid.width, height: laid.height };\n });\n\n const updatedEdges = edges.map((edge) => {\n const laid = edgeMap.get(edge.id);\n if (!laid) return edge;\n const nextData = { ...edge.data };\n if (laid.points && laid.points.length > 0) {\n nextData.routingPoints = laid.points;\n } else {\n delete nextData.routingPoints;\n }\n return { ...edge, data: nextData };\n });\n\n return { nodes: updatedNodes, edges: updatedEdges as BpmnRFEdge[] };\n}\n","import type { DiagramEdge, LayoutOptions, LayoutResult } from \"@aranzatech/diagrams-core/types\";\nimport { dagreLayout, applyLayoutResultToDiagram } from \"@aranzatech/diagrams-core/layout\";\nimport type { DiagramNode } from \"@aranzatech/diagrams-core/types\";\nimport type { BpmnRFNode, BpmnRFEdge } from \"../xml/types\";\nimport { getBpmnNodeSize } from \"../modeling\";\nimport type { BpmnDiagramState } from \"../modeling\";\n\nexport { applyLayoutResultToDiagram };\nexport { bpmnElkLayout } from \"./elk\";\n\n/**\n * Dagre layout pre-configured for BPMN diagrams.\n * Uses BPMN-specific node sizes (events 52×52, gateways 64×64, tasks 192×64, etc.)\n * instead of the generic fallback, which prevents overlaps and poor spacing.\n */\nexport async function bpmnDagreLayout(\n nodes: BpmnRFNode[],\n edges: BpmnRFEdge[],\n options: LayoutOptions = {},\n): Promise<LayoutResult> {\n return dagreLayout(nodes as DiagramNode[], edges as DiagramEdge[], {\n ...options,\n getNodeSize: (node) => getBpmnNodeSize(node as BpmnRFNode),\n });\n}\n\n/**\n * Applies a bpmn dagre layout result back to the diagram state.\n * Convenience wrapper so callers only need one import.\n */\nexport function applyBpmnLayoutResult(\n state: BpmnDiagramState,\n result: LayoutResult,\n): BpmnDiagramState {\n return applyLayoutResultToDiagram(state, result) as BpmnDiagramState;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModelingRules, ClipboardState, DiagramSnapshot, DiagramState, DiagramEventBus, ResizeHandlePosition, DiagramCommand, ConnectionValidator, SmartGuideResult, SelectionState, LayoutCacheOptions, LayoutCache, EdgeLabelOffsetOptions, EdgeLabelLayout, CommandStackState, Viewport, LayoutFn } from '@aranzatech/diagrams-core';
|
|
2
2
|
import { DiagramDocument, CreateDiagramDocumentOptions } from '@aranzatech/diagrams-core/serialization';
|
|
3
|
-
import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types-
|
|
4
|
-
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-
|
|
5
|
-
export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-
|
|
3
|
+
import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types-Dfrt0wVs.cjs';
|
|
4
|
+
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-s2_VvPGf.cjs';
|
|
5
|
+
export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-BiLXVn-2.cjs';
|
|
6
6
|
import '@xyflow/react';
|
|
7
7
|
|
|
8
8
|
type BpmnDiagramState = DiagramState<BpmnRFNode, BpmnRFEdge>;
|
package/dist/modeling/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModelingRules, ClipboardState, DiagramSnapshot, DiagramState, DiagramEventBus, ResizeHandlePosition, DiagramCommand, ConnectionValidator, SmartGuideResult, SelectionState, LayoutCacheOptions, LayoutCache, EdgeLabelOffsetOptions, EdgeLabelLayout, CommandStackState, Viewport, LayoutFn } from '@aranzatech/diagrams-core';
|
|
2
2
|
import { DiagramDocument, CreateDiagramDocumentOptions } from '@aranzatech/diagrams-core/serialization';
|
|
3
|
-
import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types-
|
|
4
|
-
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-
|
|
5
|
-
export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-
|
|
3
|
+
import { c as BpmnEdgeType, b as BpmnEdgeData, f as BpmnElementType, m as BpmnNodeData } from '../types-Dfrt0wVs.js';
|
|
4
|
+
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-rEfHsPr5.js';
|
|
5
|
+
export { g as getBpmnElementSize, i as isBpmnElementResizable } from '../catalog-Di2nzGs9.js';
|
|
6
6
|
import '@xyflow/react';
|
|
7
7
|
|
|
8
8
|
type BpmnDiagramState = DiagramState<BpmnRFNode, BpmnRFEdge>;
|
|
@@ -166,6 +166,8 @@ interface BpmnNodeData extends Record<string, unknown> {
|
|
|
166
166
|
script?: string;
|
|
167
167
|
/** BusinessRuleTask: id of the referenced DMN decision table. */
|
|
168
168
|
decisionRef?: string;
|
|
169
|
+
/** BusinessRuleTask: simplified inline decision table (alternative to external decisionRef). */
|
|
170
|
+
inlineDecisionTable?: InlineDecisionTable;
|
|
169
171
|
/** UserTask: form key resolved to a FormDefinition by name at runtime. */
|
|
170
172
|
formKey?: string;
|
|
171
173
|
/** UserTask: comma-separated Flowable user ids that can claim this task. */
|
|
@@ -191,6 +193,28 @@ interface BpmnNodeData extends Record<string, unknown> {
|
|
|
191
193
|
/** MultiInstanceLoopCharacteristics: FEEL condition to stop before all instances finish. */
|
|
192
194
|
loopCompletionCondition?: string;
|
|
193
195
|
}
|
|
196
|
+
interface InlineDecisionInput {
|
|
197
|
+
id: string;
|
|
198
|
+
expression: string;
|
|
199
|
+
label: string;
|
|
200
|
+
}
|
|
201
|
+
interface InlineDecisionOutput {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
label: string;
|
|
205
|
+
}
|
|
206
|
+
interface InlineDecisionRule {
|
|
207
|
+
id: string;
|
|
208
|
+
inputs: Record<string, string>;
|
|
209
|
+
outputs: Record<string, string>;
|
|
210
|
+
annotation?: string;
|
|
211
|
+
}
|
|
212
|
+
interface InlineDecisionTable {
|
|
213
|
+
hitPolicy: "FIRST" | "UNIQUE" | "COLLECT";
|
|
214
|
+
inputs: InlineDecisionInput[];
|
|
215
|
+
outputs: InlineDecisionOutput[];
|
|
216
|
+
rules: InlineDecisionRule[];
|
|
217
|
+
}
|
|
194
218
|
interface BpmnEdgeData extends Record<string, unknown> {
|
|
195
219
|
label?: string;
|
|
196
220
|
edgeType: BpmnEdgeType;
|
|
@@ -206,6 +230,10 @@ interface BpmnEdgeData extends Record<string, unknown> {
|
|
|
206
230
|
x: number;
|
|
207
231
|
y: number;
|
|
208
232
|
}>;
|
|
233
|
+
/** MessageFlow: free-text description or JSON schema of the message payload. */
|
|
234
|
+
payloadSchema?: string;
|
|
235
|
+
/** MessageFlow: FEEL/JSONPath correlation key expression, e.g. $.orderId. */
|
|
236
|
+
correlationKey?: string;
|
|
209
237
|
}
|
|
210
238
|
|
|
211
|
-
export type { BpmnCategory as B, EventTrigger as E, SubProcessVariant as S, TaskMarker as T, BpmnDefinitionsSet as a, BpmnEdgeData as b, BpmnEdgeType as c, BpmnElementMeta as d, BpmnElementSize as e, BpmnElementType as f, BpmnErrorDefinition as g, BpmnEscalationDefinition as h, BpmnEventDefinition as i, BpmnEventSemantics as j, BpmnHandlePolicy as k, BpmnMessageDefinition as l, BpmnNodeData as m, BpmnOrientation as n, BpmnProcessVariable as o, BpmnSignalDefinition as p, BpmnTimerDefinition as q, BpmnTimerKind as r };
|
|
239
|
+
export type { BpmnCategory as B, EventTrigger as E, InlineDecisionInput as I, SubProcessVariant as S, TaskMarker as T, BpmnDefinitionsSet as a, BpmnEdgeData as b, BpmnEdgeType as c, BpmnElementMeta as d, BpmnElementSize as e, BpmnElementType as f, BpmnErrorDefinition as g, BpmnEscalationDefinition as h, BpmnEventDefinition as i, BpmnEventSemantics as j, BpmnHandlePolicy as k, BpmnMessageDefinition as l, BpmnNodeData as m, BpmnOrientation as n, BpmnProcessVariable as o, BpmnSignalDefinition as p, BpmnTimerDefinition as q, BpmnTimerKind as r, InlineDecisionOutput as s, InlineDecisionRule as t, InlineDecisionTable as u };
|
|
@@ -166,6 +166,8 @@ interface BpmnNodeData extends Record<string, unknown> {
|
|
|
166
166
|
script?: string;
|
|
167
167
|
/** BusinessRuleTask: id of the referenced DMN decision table. */
|
|
168
168
|
decisionRef?: string;
|
|
169
|
+
/** BusinessRuleTask: simplified inline decision table (alternative to external decisionRef). */
|
|
170
|
+
inlineDecisionTable?: InlineDecisionTable;
|
|
169
171
|
/** UserTask: form key resolved to a FormDefinition by name at runtime. */
|
|
170
172
|
formKey?: string;
|
|
171
173
|
/** UserTask: comma-separated Flowable user ids that can claim this task. */
|
|
@@ -191,6 +193,28 @@ interface BpmnNodeData extends Record<string, unknown> {
|
|
|
191
193
|
/** MultiInstanceLoopCharacteristics: FEEL condition to stop before all instances finish. */
|
|
192
194
|
loopCompletionCondition?: string;
|
|
193
195
|
}
|
|
196
|
+
interface InlineDecisionInput {
|
|
197
|
+
id: string;
|
|
198
|
+
expression: string;
|
|
199
|
+
label: string;
|
|
200
|
+
}
|
|
201
|
+
interface InlineDecisionOutput {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
label: string;
|
|
205
|
+
}
|
|
206
|
+
interface InlineDecisionRule {
|
|
207
|
+
id: string;
|
|
208
|
+
inputs: Record<string, string>;
|
|
209
|
+
outputs: Record<string, string>;
|
|
210
|
+
annotation?: string;
|
|
211
|
+
}
|
|
212
|
+
interface InlineDecisionTable {
|
|
213
|
+
hitPolicy: "FIRST" | "UNIQUE" | "COLLECT";
|
|
214
|
+
inputs: InlineDecisionInput[];
|
|
215
|
+
outputs: InlineDecisionOutput[];
|
|
216
|
+
rules: InlineDecisionRule[];
|
|
217
|
+
}
|
|
194
218
|
interface BpmnEdgeData extends Record<string, unknown> {
|
|
195
219
|
label?: string;
|
|
196
220
|
edgeType: BpmnEdgeType;
|
|
@@ -206,6 +230,10 @@ interface BpmnEdgeData extends Record<string, unknown> {
|
|
|
206
230
|
x: number;
|
|
207
231
|
y: number;
|
|
208
232
|
}>;
|
|
233
|
+
/** MessageFlow: free-text description or JSON schema of the message payload. */
|
|
234
|
+
payloadSchema?: string;
|
|
235
|
+
/** MessageFlow: FEEL/JSONPath correlation key expression, e.g. $.orderId. */
|
|
236
|
+
correlationKey?: string;
|
|
209
237
|
}
|
|
210
238
|
|
|
211
|
-
export type { BpmnCategory as B, EventTrigger as E, SubProcessVariant as S, TaskMarker as T, BpmnDefinitionsSet as a, BpmnEdgeData as b, BpmnEdgeType as c, BpmnElementMeta as d, BpmnElementSize as e, BpmnElementType as f, BpmnErrorDefinition as g, BpmnEscalationDefinition as h, BpmnEventDefinition as i, BpmnEventSemantics as j, BpmnHandlePolicy as k, BpmnMessageDefinition as l, BpmnNodeData as m, BpmnOrientation as n, BpmnProcessVariable as o, BpmnSignalDefinition as p, BpmnTimerDefinition as q, BpmnTimerKind as r };
|
|
239
|
+
export type { BpmnCategory as B, EventTrigger as E, InlineDecisionInput as I, SubProcessVariant as S, TaskMarker as T, BpmnDefinitionsSet as a, BpmnEdgeData as b, BpmnEdgeType as c, BpmnElementMeta as d, BpmnElementSize as e, BpmnElementType as f, BpmnErrorDefinition as g, BpmnEscalationDefinition as h, BpmnEventDefinition as i, BpmnEventSemantics as j, BpmnHandlePolicy as k, BpmnMessageDefinition as l, BpmnNodeData as m, BpmnOrientation as n, BpmnProcessVariable as o, BpmnSignalDefinition as p, BpmnTimerDefinition as q, BpmnTimerKind as r, InlineDecisionOutput as s, InlineDecisionRule as t, InlineDecisionTable as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, Edge } from '@xyflow/react';
|
|
2
|
-
import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types-
|
|
2
|
+
import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types-Dfrt0wVs.js';
|
|
3
3
|
|
|
4
4
|
type BpmnRFNode = Node<BpmnNodeData>;
|
|
5
5
|
type BpmnRFEdge = Edge<BpmnEdgeData>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, Edge } from '@xyflow/react';
|
|
2
|
-
import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types-
|
|
2
|
+
import { m as BpmnNodeData, b as BpmnEdgeData, a as BpmnDefinitionsSet } from './types-Dfrt0wVs.cjs';
|
|
3
3
|
|
|
4
4
|
type BpmnRFNode = Node<BpmnNodeData>;
|
|
5
5
|
type BpmnRFEdge = Edge<BpmnEdgeData>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-
|
|
1
|
+
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-s2_VvPGf.cjs';
|
|
2
2
|
import '@xyflow/react';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-Dfrt0wVs.cjs';
|
|
4
4
|
|
|
5
5
|
type BpmnValidationSeverity = "error" | "warning" | "info";
|
|
6
6
|
interface BpmnValidationIssue {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-
|
|
1
|
+
import { d as BpmnRFNode, c as BpmnRFEdge } from '../types-rEfHsPr5.js';
|
|
2
2
|
import '@xyflow/react';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-Dfrt0wVs.js';
|
|
4
4
|
|
|
5
5
|
type BpmnValidationSeverity = "error" | "warning" | "info";
|
|
6
6
|
interface BpmnValidationIssue {
|
package/dist/xml/index.cjs
CHANGED
|
@@ -32,6 +32,24 @@ var ARANZA_DESCRIPTOR = {
|
|
|
32
32
|
{ name: "skipExpression", isAttr: true, type: "String" },
|
|
33
33
|
{ name: "businessCalendarName", isAttr: true, type: "String" }
|
|
34
34
|
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
// BusinessRuleTask: simplified inline decision table (JSON-serialized)
|
|
38
|
+
name: "InlineDecision",
|
|
39
|
+
superClass: ["Element"],
|
|
40
|
+
properties: [
|
|
41
|
+
{ name: "hitPolicy", isAttr: true, type: "String" },
|
|
42
|
+
{ name: "tableJson", isAttr: true, type: "String" }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
// MessageFlow: payload schema + correlation key for executable BPMN
|
|
47
|
+
name: "MessageFlowConfig",
|
|
48
|
+
superClass: ["Element"],
|
|
49
|
+
properties: [
|
|
50
|
+
{ name: "payloadSchema", isAttr: true, type: "String" },
|
|
51
|
+
{ name: "correlationKey", isAttr: true, type: "String" }
|
|
52
|
+
]
|
|
35
53
|
}
|
|
36
54
|
],
|
|
37
55
|
enumerations: [],
|
|
@@ -911,7 +929,20 @@ function extractAranzaExtensions(el) {
|
|
|
911
929
|
}
|
|
912
930
|
const ext = el.extensionElements;
|
|
913
931
|
if (!ext) return result;
|
|
914
|
-
const
|
|
932
|
+
const extValues = asElements(ext.values);
|
|
933
|
+
const inlineDecision = extValues.find((v) => v.$type === "aranza:InlineDecision");
|
|
934
|
+
if (inlineDecision) {
|
|
935
|
+
const hitPolicy = asString(inlineDecision.hitPolicy) ?? "UNIQUE";
|
|
936
|
+
const tableJson = asString(inlineDecision.tableJson);
|
|
937
|
+
if (tableJson) {
|
|
938
|
+
try {
|
|
939
|
+
const parsed = JSON.parse(tableJson);
|
|
940
|
+
result.inlineDecisionTable = { hitPolicy, ...parsed };
|
|
941
|
+
} catch {
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
const taskConfig = extValues.find((v) => v.$type === "aranza:TaskConfig");
|
|
915
946
|
if (!taskConfig) return result;
|
|
916
947
|
const priority = asString(taskConfig.priority);
|
|
917
948
|
if (priority === "critical" || priority === "high" || priority === "medium" || priority === "low") {
|
|
@@ -1069,12 +1100,26 @@ function buildEdge(el, edgeType, ctx, edges) {
|
|
|
1069
1100
|
const condExpr = el.conditionExpression;
|
|
1070
1101
|
const rawDir = asString(el.associationDirection);
|
|
1071
1102
|
const associationDirection = edgeType === "association" && rawDir ? rawDir.toLowerCase() : void 0;
|
|
1103
|
+
let payloadSchema;
|
|
1104
|
+
let correlationKey;
|
|
1105
|
+
if (edgeType === "messageFlow") {
|
|
1106
|
+
const mfExt = el.extensionElements;
|
|
1107
|
+
if (mfExt) {
|
|
1108
|
+
const mfConfig = asElements(mfExt.values).find((v) => v.$type === "aranza:MessageFlowConfig");
|
|
1109
|
+
if (mfConfig) {
|
|
1110
|
+
payloadSchema = asString(mfConfig.payloadSchema) || void 0;
|
|
1111
|
+
correlationKey = asString(mfConfig.correlationKey) || void 0;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1072
1115
|
const data = {
|
|
1073
1116
|
edgeType,
|
|
1074
1117
|
...label ? { label } : {},
|
|
1075
1118
|
...documentation ? { documentation } : {},
|
|
1076
1119
|
...condExpr?.body ? { conditionExpression: condExpr.body } : {},
|
|
1077
|
-
...associationDirection ? { associationDirection } : {}
|
|
1120
|
+
...associationDirection ? { associationDirection } : {},
|
|
1121
|
+
...payloadSchema ? { payloadSchema } : {},
|
|
1122
|
+
...correlationKey ? { correlationKey } : {}
|
|
1078
1123
|
};
|
|
1079
1124
|
const waypoints = ctx.waypoints.get(id);
|
|
1080
1125
|
if (waypoints?.length) data.routingPoints = waypoints;
|
|
@@ -1361,8 +1406,19 @@ function buildAranzaExtensionElements(moddle, node) {
|
|
|
1361
1406
|
if (dueDate) configAttrs.dueDate = dueDate;
|
|
1362
1407
|
if (skipExpression) configAttrs.skipExpression = skipExpression;
|
|
1363
1408
|
if (businessCalendarName) configAttrs.businessCalendarName = businessCalendarName;
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1409
|
+
const values = [moddle.create("aranza:TaskConfig", configAttrs)];
|
|
1410
|
+
const inlineDecisionTable = node.data.inlineDecisionTable;
|
|
1411
|
+
if (inlineDecisionTable && typeof inlineDecisionTable === "object") {
|
|
1412
|
+
const tbl = inlineDecisionTable;
|
|
1413
|
+
const { hitPolicy, ...rest } = tbl;
|
|
1414
|
+
values.push(
|
|
1415
|
+
moddle.create("aranza:InlineDecision", {
|
|
1416
|
+
hitPolicy: hitPolicy ?? "UNIQUE",
|
|
1417
|
+
tableJson: JSON.stringify(rest)
|
|
1418
|
+
})
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
return moddle.create("bpmn:ExtensionElements", { values });
|
|
1366
1422
|
}
|
|
1367
1423
|
var ARTIFACT_ELEMENT_TYPES = /* @__PURE__ */ new Set(["Annotation", "Group"]);
|
|
1368
1424
|
function buildSemanticModel(moddle, nodes, edges, opts) {
|
|
@@ -1399,14 +1455,24 @@ function buildSemanticModel(moddle, nodes, edges, opts) {
|
|
|
1399
1455
|
}
|
|
1400
1456
|
const messageFlowEdges = edges.filter((e) => e.data?.edgeType === "messageFlow");
|
|
1401
1457
|
const conversationLinkEdges = edges.filter((e) => e.data?.edgeType === "conversationLink");
|
|
1402
|
-
const messageFlows = messageFlowEdges.map(
|
|
1403
|
-
|
|
1458
|
+
const messageFlows = messageFlowEdges.map((e) => {
|
|
1459
|
+
const ps = typeof e.data?.payloadSchema === "string" ? e.data.payloadSchema : void 0;
|
|
1460
|
+
const ck = typeof e.data?.correlationKey === "string" ? e.data.correlationKey : void 0;
|
|
1461
|
+
const mfAttrs = {
|
|
1404
1462
|
id: e.id,
|
|
1405
1463
|
name: e.data?.label ?? "",
|
|
1406
1464
|
sourceRef: { id: e.source },
|
|
1407
1465
|
targetRef: { id: e.target }
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1466
|
+
};
|
|
1467
|
+
if (ps || ck) {
|
|
1468
|
+
const cfg = moddle.create("aranza:MessageFlowConfig", {
|
|
1469
|
+
...ps ? { payloadSchema: ps } : {},
|
|
1470
|
+
...ck ? { correlationKey: ck } : {}
|
|
1471
|
+
});
|
|
1472
|
+
mfAttrs.extensionElements = moddle.create("bpmn:ExtensionElements", { values: [cfg] });
|
|
1473
|
+
}
|
|
1474
|
+
return moddle.create("bpmn:MessageFlow", mfAttrs);
|
|
1475
|
+
});
|
|
1410
1476
|
const conversationLinks = conversationLinkEdges.map(
|
|
1411
1477
|
(e) => moddle.create("bpmn:ConversationLink", {
|
|
1412
1478
|
id: e.id,
|