@mindlogic-ai/logician-ui 3.1.0 → 3.2.0-alpha.1
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/components/Icon/_constants/iconList.d.ts +1 -1
- package/dist/components/Icon/_constants/iconList.d.ts.map +1 -1
- package/dist/components/Icon/_constants/iconList.js +18 -0
- package/dist/components/Icon/_constants/iconList.js.map +1 -1
- package/dist/components/Icon/_constants/iconList.mjs +20 -2
- package/dist/components/Icon/_constants/iconList.mjs.map +1 -1
- package/dist/components/Icon/index.d.ts +2 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +20 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/index.mjs +4 -2
- package/dist/components/Icon/index.mjs.map +1 -1
- package/dist/components/Tree/Tree.d.ts +20 -0
- package/dist/components/Tree/Tree.d.ts.map +1 -0
- package/dist/components/Tree/Tree.js +43 -0
- package/dist/components/Tree/Tree.js.map +1 -0
- package/dist/components/Tree/Tree.mjs +41 -0
- package/dist/components/Tree/Tree.mjs.map +1 -0
- package/dist/components/Tree/Tree.types.d.ts +21 -0
- package/dist/components/Tree/Tree.types.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranch.d.ts +3 -0
- package/dist/components/Tree/TreeBranch.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranch.js +14 -0
- package/dist/components/Tree/TreeBranch.js.map +1 -0
- package/dist/components/Tree/TreeBranch.mjs +12 -0
- package/dist/components/Tree/TreeBranch.mjs.map +1 -0
- package/dist/components/Tree/TreeBranchContent.d.ts +3 -0
- package/dist/components/Tree/TreeBranchContent.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranchContent.js +14 -0
- package/dist/components/Tree/TreeBranchContent.js.map +1 -0
- package/dist/components/Tree/TreeBranchContent.mjs +12 -0
- package/dist/components/Tree/TreeBranchContent.mjs.map +1 -0
- package/dist/components/Tree/TreeBranchControl.d.ts +3 -0
- package/dist/components/Tree/TreeBranchControl.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranchControl.js +19 -0
- package/dist/components/Tree/TreeBranchControl.js.map +1 -0
- package/dist/components/Tree/TreeBranchControl.mjs +17 -0
- package/dist/components/Tree/TreeBranchControl.mjs.map +1 -0
- package/dist/components/Tree/TreeBranchIndentGuide.d.ts +3 -0
- package/dist/components/Tree/TreeBranchIndentGuide.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranchIndentGuide.js +20 -0
- package/dist/components/Tree/TreeBranchIndentGuide.js.map +1 -0
- package/dist/components/Tree/TreeBranchIndentGuide.mjs +18 -0
- package/dist/components/Tree/TreeBranchIndentGuide.mjs.map +1 -0
- package/dist/components/Tree/TreeBranchIndicator.d.ts +3 -0
- package/dist/components/Tree/TreeBranchIndicator.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranchIndicator.js +15 -0
- package/dist/components/Tree/TreeBranchIndicator.js.map +1 -0
- package/dist/components/Tree/TreeBranchIndicator.mjs +13 -0
- package/dist/components/Tree/TreeBranchIndicator.mjs.map +1 -0
- package/dist/components/Tree/TreeBranchText.d.ts +3 -0
- package/dist/components/Tree/TreeBranchText.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranchText.js +14 -0
- package/dist/components/Tree/TreeBranchText.js.map +1 -0
- package/dist/components/Tree/TreeBranchText.mjs +12 -0
- package/dist/components/Tree/TreeBranchText.mjs.map +1 -0
- package/dist/components/Tree/TreeBranchTrigger.d.ts +3 -0
- package/dist/components/Tree/TreeBranchTrigger.d.ts.map +1 -0
- package/dist/components/Tree/TreeBranchTrigger.js +15 -0
- package/dist/components/Tree/TreeBranchTrigger.js.map +1 -0
- package/dist/components/Tree/TreeBranchTrigger.mjs +13 -0
- package/dist/components/Tree/TreeBranchTrigger.mjs.map +1 -0
- package/dist/components/Tree/TreeItem.d.ts +3 -0
- package/dist/components/Tree/TreeItem.d.ts.map +1 -0
- package/dist/components/Tree/TreeItem.js +25 -0
- package/dist/components/Tree/TreeItem.js.map +1 -0
- package/dist/components/Tree/TreeItem.mjs +23 -0
- package/dist/components/Tree/TreeItem.mjs.map +1 -0
- package/dist/components/Tree/TreeItemIndicator.d.ts +3 -0
- package/dist/components/Tree/TreeItemIndicator.d.ts.map +1 -0
- package/dist/components/Tree/TreeItemIndicator.js +14 -0
- package/dist/components/Tree/TreeItemIndicator.js.map +1 -0
- package/dist/components/Tree/TreeItemIndicator.mjs +12 -0
- package/dist/components/Tree/TreeItemIndicator.mjs.map +1 -0
- package/dist/components/Tree/TreeItemText.d.ts +3 -0
- package/dist/components/Tree/TreeItemText.d.ts.map +1 -0
- package/dist/components/Tree/TreeItemText.js +14 -0
- package/dist/components/Tree/TreeItemText.js.map +1 -0
- package/dist/components/Tree/TreeItemText.mjs +12 -0
- package/dist/components/Tree/TreeItemText.mjs.map +1 -0
- package/dist/components/Tree/TreeLabel.d.ts +3 -0
- package/dist/components/Tree/TreeLabel.d.ts.map +1 -0
- package/dist/components/Tree/TreeLabel.js +14 -0
- package/dist/components/Tree/TreeLabel.js.map +1 -0
- package/dist/components/Tree/TreeLabel.mjs +12 -0
- package/dist/components/Tree/TreeLabel.mjs.map +1 -0
- package/dist/components/Tree/TreeNode.d.ts +5 -0
- package/dist/components/Tree/TreeNode.d.ts.map +1 -0
- package/dist/components/Tree/TreeNode.js +9 -0
- package/dist/components/Tree/TreeNode.js.map +1 -0
- package/dist/components/Tree/TreeNode.mjs +7 -0
- package/dist/components/Tree/TreeNode.mjs.map +1 -0
- package/dist/components/Tree/TreeNodeCheckbox.d.ts +3 -0
- package/dist/components/Tree/TreeNodeCheckbox.d.ts.map +1 -0
- package/dist/components/Tree/TreeNodeCheckbox.js +14 -0
- package/dist/components/Tree/TreeNodeCheckbox.js.map +1 -0
- package/dist/components/Tree/TreeNodeCheckbox.mjs +12 -0
- package/dist/components/Tree/TreeNodeCheckbox.mjs.map +1 -0
- package/dist/components/Tree/TreeNodeContext.d.ts +2 -0
- package/dist/components/Tree/TreeNodeContext.d.ts.map +1 -0
- package/dist/components/Tree/TreeNodeContext.js +9 -0
- package/dist/components/Tree/TreeNodeContext.js.map +1 -0
- package/dist/components/Tree/TreeNodeContext.mjs +7 -0
- package/dist/components/Tree/TreeNodeContext.mjs.map +1 -0
- package/dist/components/Tree/TreeNodeProvider.d.ts +5 -0
- package/dist/components/Tree/TreeNodeProvider.d.ts.map +1 -0
- package/dist/components/Tree/TreeNodeProvider.js +9 -0
- package/dist/components/Tree/TreeNodeProvider.js.map +1 -0
- package/dist/components/Tree/TreeNodeProvider.mjs +7 -0
- package/dist/components/Tree/TreeNodeProvider.mjs.map +1 -0
- package/dist/components/Tree/TreeRoot.d.ts +3 -0
- package/dist/components/Tree/TreeRoot.d.ts.map +1 -0
- package/dist/components/Tree/TreeRoot.js +14 -0
- package/dist/components/Tree/TreeRoot.js.map +1 -0
- package/dist/components/Tree/TreeRoot.mjs +12 -0
- package/dist/components/Tree/TreeRoot.mjs.map +1 -0
- package/dist/components/Tree/TreeTree.d.ts +3 -0
- package/dist/components/Tree/TreeTree.d.ts.map +1 -0
- package/dist/components/Tree/TreeTree.js +14 -0
- package/dist/components/Tree/TreeTree.js.map +1 -0
- package/dist/components/Tree/TreeTree.mjs +12 -0
- package/dist/components/Tree/TreeTree.mjs.map +1 -0
- package/dist/components/Tree/index.d.ts +23 -0
- package/dist/components/Tree/index.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.d.ts +3 -0
- package/dist/components/Workflow/Workflow.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.js +109 -0
- package/dist/components/Workflow/Workflow.js.map +1 -0
- package/dist/components/Workflow/Workflow.mjs +107 -0
- package/dist/components/Workflow/Workflow.mjs.map +1 -0
- package/dist/components/Workflow/Workflow.translations.json.js +164 -0
- package/dist/components/Workflow/Workflow.translations.json.js.map +1 -0
- package/dist/components/Workflow/Workflow.translations.json.mjs +138 -0
- package/dist/components/Workflow/Workflow.translations.json.mjs.map +1 -0
- package/dist/components/Workflow/Workflow.types.d.ts +435 -0
- package/dist/components/Workflow/Workflow.types.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.types.js +19 -0
- package/dist/components/Workflow/Workflow.types.js.map +1 -0
- package/dist/components/Workflow/Workflow.types.mjs +16 -0
- package/dist/components/Workflow/Workflow.types.mjs.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.d.ts +10 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.d.ts.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.js +163 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.js.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.mjs +159 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.mjs.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.types.d.ts +117 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.types.d.ts.map +1 -0
- package/dist/components/Workflow/WorkflowContext/index.d.ts +3 -0
- package/dist/components/Workflow/WorkflowContext/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts +19 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js +44 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs +42 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.d.ts +10 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.js +531 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.mjs +529 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts +53 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js +96 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs +93 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.d.ts +27 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.js +70 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.mjs +68 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.d.ts +10 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js +106 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs +104 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.d.ts +13 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.js +18 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.mjs +16 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/Canvas/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.d.ts +30 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js +34 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs +32 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts +37 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js +33 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs +31 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.d.ts +16 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js +54 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs +52 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.d.ts +27 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js +178 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs +176 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/DrawerShell/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.d.ts +12 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js +68 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs +66 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.d.ts +19 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.js +35 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.js.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.mjs +32 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.mjs.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/EdgeInspector/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.d.ts +54 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js +56 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs +54 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/FieldWrapper/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.d.ts +16 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.js +25 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.js.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.mjs +22 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.mjs.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/FloatingCard/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.d.ts +14 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.js +61 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.js.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.mjs +59 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.mjs.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.types.d.ts +11 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.types.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/GenericNode/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts +15 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js +145 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs +143 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.d.ts +10 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.js +21 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.js.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.mjs +19 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.mjs.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts +18 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js +40 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs +37 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.types.d.ts +15 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.types.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/index.d.ts +4 -0
- package/dist/components/Workflow/canvas/IconTile/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.d.ts +24 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.js +34 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.js.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.mjs +32 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.mjs.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/IssueList/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts +9 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.js +94 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.js.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs +92 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.d.ts +7 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.js +13 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.mjs +10 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts +10 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js +28 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs +26 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/index.d.ts +4 -0
- package/dist/components/Workflow/canvas/NodePalette/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts +3 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.js +137 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.js.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs +135 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts +66 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js +87 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs +77 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts +35 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/index.d.ts +4 -0
- package/dist/components/Workflow/canvas/NodeShell/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts +15 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js +14 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs +12 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/SeverityDot/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.d.ts +23 -0
- package/dist/components/Workflow/canvas/issueSeverity.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.js +51 -0
- package/dist/components/Workflow/canvas/issueSeverity.js.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.mjs +47 -0
- package/dist/components/Workflow/canvas/issueSeverity.mjs.map +1 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.d.ts +14 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.js +48 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.js.map +1 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.mjs +46 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.mjs.map +1 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.d.ts +12 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.js +17 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.js.map +1 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.mjs +15 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.mjs.map +1 -0
- package/dist/components/Workflow/connectionRules.d.ts +59 -0
- package/dist/components/Workflow/connectionRules.d.ts.map +1 -0
- package/dist/components/Workflow/connectionRules.js +150 -0
- package/dist/components/Workflow/connectionRules.js.map +1 -0
- package/dist/components/Workflow/connectionRules.mjs +145 -0
- package/dist/components/Workflow/connectionRules.mjs.map +1 -0
- package/dist/components/Workflow/createNode.d.ts +27 -0
- package/dist/components/Workflow/createNode.d.ts.map +1 -0
- package/dist/components/Workflow/createNode.js +66 -0
- package/dist/components/Workflow/createNode.js.map +1 -0
- package/dist/components/Workflow/createNode.mjs +62 -0
- package/dist/components/Workflow/createNode.mjs.map +1 -0
- package/dist/components/Workflow/graphHistory.d.ts +23 -0
- package/dist/components/Workflow/graphHistory.d.ts.map +1 -0
- package/dist/components/Workflow/graphHistory.js +73 -0
- package/dist/components/Workflow/graphHistory.js.map +1 -0
- package/dist/components/Workflow/graphHistory.mjs +70 -0
- package/dist/components/Workflow/graphHistory.mjs.map +1 -0
- package/dist/components/Workflow/graphObserver.d.ts +13 -0
- package/dist/components/Workflow/graphObserver.d.ts.map +1 -0
- package/dist/components/Workflow/graphObserver.js +11 -0
- package/dist/components/Workflow/graphObserver.js.map +1 -0
- package/dist/components/Workflow/graphObserver.mjs +8 -0
- package/dist/components/Workflow/graphObserver.mjs.map +1 -0
- package/dist/components/Workflow/graphReducer.d.ts +75 -0
- package/dist/components/Workflow/graphReducer.d.ts.map +1 -0
- package/dist/components/Workflow/graphReducer.js +122 -0
- package/dist/components/Workflow/graphReducer.js.map +1 -0
- package/dist/components/Workflow/graphReducer.mjs +119 -0
- package/dist/components/Workflow/graphReducer.mjs.map +1 -0
- package/dist/components/Workflow/index.d.ts +22 -0
- package/dist/components/Workflow/index.d.ts.map +1 -0
- package/dist/components/Workflow/layout/autoLayout.d.ts +49 -0
- package/dist/components/Workflow/layout/autoLayout.d.ts.map +1 -0
- package/dist/components/Workflow/layout/autoLayout.js +149 -0
- package/dist/components/Workflow/layout/autoLayout.js.map +1 -0
- package/dist/components/Workflow/layout/autoLayout.mjs +146 -0
- package/dist/components/Workflow/layout/autoLayout.mjs.map +1 -0
- package/dist/components/Workflow/stories/toyNodeTypes.d.ts +40 -0
- package/dist/components/Workflow/stories/toyNodeTypes.d.ts.map +1 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.d.ts +15 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.d.ts.map +1 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.js +45 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.js.map +1 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.mjs +43 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.mjs.map +1 -0
- package/dist/components/Workflow/useWorkflowKeyboard.d.ts +10 -0
- package/dist/components/Workflow/useWorkflowKeyboard.d.ts.map +1 -0
- package/dist/components/Workflow/useWorkflowKeyboard.js +116 -0
- package/dist/components/Workflow/useWorkflowKeyboard.js.map +1 -0
- package/dist/components/Workflow/useWorkflowKeyboard.mjs +114 -0
- package/dist/components/Workflow/useWorkflowKeyboard.mjs.map +1 -0
- package/dist/icons.js +17 -0
- package/dist/icons.js.map +1 -1
- package/dist/icons.mjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/dist/test-support/setup.d.ts +5 -0
- package/dist/test-support/setup.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/components/Icon/_constants/iconList.ts +35 -0
- package/src/components/Icon/index.tsx +20 -0
- package/src/components/Tree/Tree.stories.tsx +564 -0
- package/src/components/Tree/Tree.tsx +37 -0
- package/src/components/Tree/Tree.types.ts +51 -0
- package/src/components/Tree/TreeBranch.tsx +11 -0
- package/src/components/Tree/TreeBranchContent.tsx +21 -0
- package/src/components/Tree/TreeBranchControl.tsx +28 -0
- package/src/components/Tree/TreeBranchIndentGuide.tsx +20 -0
- package/src/components/Tree/TreeBranchIndicator.tsx +27 -0
- package/src/components/Tree/TreeBranchText.tsx +19 -0
- package/src/components/Tree/TreeBranchTrigger.tsx +25 -0
- package/src/components/Tree/TreeItem.tsx +33 -0
- package/src/components/Tree/TreeItemIndicator.tsx +20 -0
- package/src/components/Tree/TreeItemText.tsx +19 -0
- package/src/components/Tree/TreeLabel.tsx +19 -0
- package/src/components/Tree/TreeNode.tsx +6 -0
- package/src/components/Tree/TreeNodeCheckbox.tsx +12 -0
- package/src/components/Tree/TreeNodeContext.tsx +3 -0
- package/src/components/Tree/TreeNodeProvider.tsx +6 -0
- package/src/components/Tree/TreeRoot.tsx +11 -0
- package/src/components/Tree/TreeTree.tsx +11 -0
- package/src/components/Tree/index.ts +42 -0
- package/src/components/Workflow/README.md +362 -0
- package/src/components/Workflow/Workflow.translations.json +112 -0
- package/src/components/Workflow/Workflow.tsx +189 -0
- package/src/components/Workflow/Workflow.types.ts +496 -0
- package/src/components/Workflow/WorkflowContext/WorkflowContext.tsx +215 -0
- package/src/components/Workflow/WorkflowContext/WorkflowContext.types.ts +122 -0
- package/src/components/Workflow/WorkflowContext/index.ts +10 -0
- package/src/components/Workflow/WorkflowContext/workflowSelection.test.tsx +93 -0
- package/src/components/Workflow/canvas/Canvas/BranchLabelBadge.tsx +69 -0
- package/src/components/Workflow/canvas/Canvas/Canvas.styles.ts +91 -0
- package/src/components/Workflow/canvas/Canvas/Canvas.tsx +773 -0
- package/src/components/Workflow/canvas/Canvas/CanvasControls.tsx +178 -0
- package/src/components/Workflow/canvas/Canvas/LabeledEdge.tsx +198 -0
- package/src/components/Workflow/canvas/Canvas/edgeLabelVariant.test.ts +26 -0
- package/src/components/Workflow/canvas/Canvas/edgeLabelVariant.ts +23 -0
- package/src/components/Workflow/canvas/Canvas/index.ts +1 -0
- package/src/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.tsx +96 -0
- package/src/components/Workflow/canvas/CollapsibleSection/index.ts +4 -0
- package/src/components/Workflow/canvas/DrawerShell/DrawerHeader.tsx +104 -0
- package/src/components/Workflow/canvas/DrawerShell/DrawerIssues.tsx +115 -0
- package/src/components/Workflow/canvas/DrawerShell/DrawerShell.tsx +408 -0
- package/src/components/Workflow/canvas/DrawerShell/index.ts +2 -0
- package/src/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.tsx +135 -0
- package/src/components/Workflow/canvas/EdgeInspector/endpointTitle.ts +38 -0
- package/src/components/Workflow/canvas/EdgeInspector/index.ts +2 -0
- package/src/components/Workflow/canvas/FieldWrapper/FieldWrapper.tsx +118 -0
- package/src/components/Workflow/canvas/FieldWrapper/index.ts +6 -0
- package/src/components/Workflow/canvas/FloatingCard/FloatingCard.tsx +37 -0
- package/src/components/Workflow/canvas/FloatingCard/index.ts +1 -0
- package/src/components/Workflow/canvas/GenericNode/GenericNode.tsx +114 -0
- package/src/components/Workflow/canvas/GenericNode/GenericNode.types.ts +10 -0
- package/src/components/Workflow/canvas/GenericNode/index.ts +5 -0
- package/src/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.tsx +284 -0
- package/src/components/Workflow/canvas/GraphErrorBanner/index.ts +1 -0
- package/src/components/Workflow/canvas/IconTile/IconTile.styles.ts +40 -0
- package/src/components/Workflow/canvas/IconTile/IconTile.tsx +36 -0
- package/src/components/Workflow/canvas/IconTile/IconTile.types.ts +13 -0
- package/src/components/Workflow/canvas/IconTile/index.ts +7 -0
- package/src/components/Workflow/canvas/IssueList/IssueList.tsx +84 -0
- package/src/components/Workflow/canvas/IssueList/index.ts +1 -0
- package/src/components/Workflow/canvas/NodePalette/NodePalette.styles.ts +7 -0
- package/src/components/Workflow/canvas/NodePalette/NodePalette.tsx +180 -0
- package/src/components/Workflow/canvas/NodePalette/NodePaletteToggle.tsx +39 -0
- package/src/components/Workflow/canvas/NodePalette/index.ts +3 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.styles.ts +84 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.tsx +321 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.types.ts +45 -0
- package/src/components/Workflow/canvas/NodeShell/index.ts +8 -0
- package/src/components/Workflow/canvas/SeverityDot/SeverityDot.tsx +33 -0
- package/src/components/Workflow/canvas/SeverityDot/index.ts +1 -0
- package/src/components/Workflow/canvas/issueSeverity.ts +48 -0
- package/src/components/Workflow/canvas/useFieldFocusRequest.ts +54 -0
- package/src/components/Workflow/canvas/workflowLabelProps.ts +11 -0
- package/src/components/Workflow/connectionRules.test.ts +326 -0
- package/src/components/Workflow/connectionRules.ts +190 -0
- package/src/components/Workflow/createNode.test.ts +61 -0
- package/src/components/Workflow/createNode.ts +67 -0
- package/src/components/Workflow/graphHistory.test.ts +178 -0
- package/src/components/Workflow/graphHistory.ts +91 -0
- package/src/components/Workflow/graphObserver.ts +21 -0
- package/src/components/Workflow/graphReducer.test.ts +314 -0
- package/src/components/Workflow/graphReducer.ts +196 -0
- package/src/components/Workflow/index.ts +74 -0
- package/src/components/Workflow/layout/autoLayout.test.ts +170 -0
- package/src/components/Workflow/layout/autoLayout.ts +200 -0
- package/src/components/Workflow/stories/Workflow.stories.tsx +111 -0
- package/src/components/Workflow/stories/toyNodeTypes.tsx +146 -0
- package/src/components/Workflow/useWorkflowIssueMessage.test.ts +101 -0
- package/src/components/Workflow/useWorkflowIssueMessage.ts +49 -0
- package/src/components/Workflow/useWorkflowKeyboard.ts +126 -0
- package/src/index.ts +2 -0
- package/src/test-support/setup.ts +11 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/** Normalize null-vs-undefined for optional handle ids so dedupe works. */
|
|
3
|
+
function normEdge(edge) {
|
|
4
|
+
return {
|
|
5
|
+
...edge,
|
|
6
|
+
sourceHandle: edge.sourceHandle ?? undefined,
|
|
7
|
+
targetHandle: edge.targetHandle ?? undefined,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function normGraph(graph) {
|
|
11
|
+
return { ...graph, edges: graph.edges.map(normEdge) };
|
|
12
|
+
}
|
|
13
|
+
function graphReducer(state, action) {
|
|
14
|
+
switch (action.type) {
|
|
15
|
+
case 'addNode':
|
|
16
|
+
if (state.nodes.some((n) => n.id === action.node.id))
|
|
17
|
+
return state;
|
|
18
|
+
return { ...state, nodes: [...state.nodes, action.node] };
|
|
19
|
+
case 'addNodeWithEdge': {
|
|
20
|
+
if (state.nodes.some((n) => n.id === action.node.id))
|
|
21
|
+
return state;
|
|
22
|
+
const nodes = [...state.nodes, action.node];
|
|
23
|
+
if (!action.autoConnectFrom)
|
|
24
|
+
return { ...state, nodes };
|
|
25
|
+
const edge = normEdge(action.autoConnectFrom.edge);
|
|
26
|
+
// The auto-edge is freshly generated and references a brand-new node id,
|
|
27
|
+
// so it can't collide; append it alongside the node.
|
|
28
|
+
return { nodes, edges: [...state.edges, edge] };
|
|
29
|
+
}
|
|
30
|
+
case 'updateNodePosition':
|
|
31
|
+
return {
|
|
32
|
+
...state,
|
|
33
|
+
nodes: state.nodes.map((n) => n.id === action.id ? { ...n, position: action.position } : n),
|
|
34
|
+
};
|
|
35
|
+
case 'arrangeNodes': {
|
|
36
|
+
// Skip nodes that don't move so an arrange producing the current layout
|
|
37
|
+
// collapses to the same reference — `historyReducer` then treats it as a
|
|
38
|
+
// no-op and records no undo step.
|
|
39
|
+
let moved = false;
|
|
40
|
+
const nodes = state.nodes.map((n) => {
|
|
41
|
+
const next = action.positions[n.id];
|
|
42
|
+
if (!next || (next.x === n.position.x && next.y === n.position.y)) {
|
|
43
|
+
return n;
|
|
44
|
+
}
|
|
45
|
+
moved = true;
|
|
46
|
+
return { ...n, position: next };
|
|
47
|
+
});
|
|
48
|
+
return moved ? { ...state, nodes } : state;
|
|
49
|
+
}
|
|
50
|
+
case 'updateNodeConfig': {
|
|
51
|
+
const nodes = state.nodes.map((n) => n.id === action.id ? { ...n, config: action.config } : n);
|
|
52
|
+
const remap = action.remapEdgeHandle;
|
|
53
|
+
if (!remap)
|
|
54
|
+
return { ...state, nodes };
|
|
55
|
+
const edges = state.edges.map((e) => e.source === action.id && (e.sourceHandle ?? undefined) === remap.from
|
|
56
|
+
? { ...e, sourceHandle: remap.to }
|
|
57
|
+
: e);
|
|
58
|
+
return { ...state, nodes, edges };
|
|
59
|
+
}
|
|
60
|
+
case 'deleteNode':
|
|
61
|
+
return {
|
|
62
|
+
nodes: state.nodes.filter((n) => n.id !== action.id),
|
|
63
|
+
edges: state.edges.filter((e) => e.source !== action.id && e.target !== action.id),
|
|
64
|
+
};
|
|
65
|
+
case 'addEdge': {
|
|
66
|
+
const edge = normEdge(action.edge);
|
|
67
|
+
if (state.edges.some((e) => e.id === edge.id))
|
|
68
|
+
return state;
|
|
69
|
+
const dup = state.edges.some((e) => e.source === edge.source &&
|
|
70
|
+
(e.sourceHandle ?? undefined) === edge.sourceHandle &&
|
|
71
|
+
e.target === edge.target &&
|
|
72
|
+
(e.targetHandle ?? undefined) === edge.targetHandle);
|
|
73
|
+
if (dup)
|
|
74
|
+
return state;
|
|
75
|
+
return { ...state, edges: [...state.edges, edge] };
|
|
76
|
+
}
|
|
77
|
+
case 'reconnectEdge': {
|
|
78
|
+
const existing = state.edges.find((e) => e.id === action.id);
|
|
79
|
+
if (!existing)
|
|
80
|
+
return state;
|
|
81
|
+
const next = normEdge({
|
|
82
|
+
...existing,
|
|
83
|
+
source: action.source,
|
|
84
|
+
target: action.target,
|
|
85
|
+
sourceHandle: action.sourceHandle,
|
|
86
|
+
targetHandle: action.targetHandle,
|
|
87
|
+
});
|
|
88
|
+
// A reconnect can land on endpoints that already have an identical edge;
|
|
89
|
+
// isValidConnection doesn't dedupe, so guard here and no-op the move.
|
|
90
|
+
const dup = state.edges.some((e) => e.id !== next.id &&
|
|
91
|
+
e.source === next.source &&
|
|
92
|
+
(e.sourceHandle ?? undefined) === next.sourceHandle &&
|
|
93
|
+
e.target === next.target &&
|
|
94
|
+
(e.targetHandle ?? undefined) === next.targetHandle);
|
|
95
|
+
if (dup)
|
|
96
|
+
return state;
|
|
97
|
+
return {
|
|
98
|
+
...state,
|
|
99
|
+
edges: state.edges.map((e) => (e.id === next.id ? next : e)),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
case 'deleteEdge':
|
|
103
|
+
return { ...state, edges: state.edges.filter((e) => e.id !== action.id) };
|
|
104
|
+
case 'updateEdge': {
|
|
105
|
+
if (!state.edges.some((e) => e.id === action.id))
|
|
106
|
+
return state;
|
|
107
|
+
return {
|
|
108
|
+
...state,
|
|
109
|
+
edges: state.edges.map((e) => e.id === action.id ? normEdge({ ...e, ...action.patch }) : e),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
case 'replace':
|
|
113
|
+
return normGraph(action.graph);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const emptyGraph = { nodes: [], edges: [] };
|
|
117
|
+
|
|
118
|
+
export { emptyGraph, graphReducer };
|
|
119
|
+
//# sourceMappingURL=graphReducer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphReducer.mjs","sources":["../../../src/components/Workflow/graphReducer.ts"],"sourcesContent":[null],"names":[],"mappings":";AA6DA;AACA,SAAS,QAAQ,CAAC,IAAe,EAAA;IAC/B,OAAO;AACL,QAAA,GAAG,IAAI;AACP,QAAA,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;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,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE;QAE3E,KAAK,YAAY,EAAE;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC;AAAE,gBAAA,OAAO,KAAK;YAC9D,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KACvB,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAC7D;aACF;QACH;AAEA,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;;AAEpC;AAEO,MAAM,UAAU,GAAU,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { CollapsibleSectionProps } from './canvas/CollapsibleSection';
|
|
2
|
+
export { CollapsibleSection } from './canvas/CollapsibleSection';
|
|
3
|
+
export type { NodeInspectorProps } from './canvas/DrawerShell';
|
|
4
|
+
export { NodeInspector } from './canvas/DrawerShell';
|
|
5
|
+
export type { FieldTone, FieldToneState, FieldWrapperProps, } from './canvas/FieldWrapper';
|
|
6
|
+
export { FieldWrapper } from './canvas/FieldWrapper';
|
|
7
|
+
export { FLOATING_CARD_WIDTH, FloatingCard } from './canvas/FloatingCard';
|
|
8
|
+
export type { CategoryTokenMap, CategoryTokens, IconTileProps, } from './canvas/IconTile';
|
|
9
|
+
export { DEFAULT_CATEGORY_TOKENS, getCategoryTokens, IconTile, } from './canvas/IconTile';
|
|
10
|
+
export type { NodeShellProps, PortStyle, RingChrome } from './canvas/NodeShell';
|
|
11
|
+
export { CARD_WIDTH, MAX_META_CHIPS, metaChipStyles, NodeShell, PORT_STYLE, } from './canvas/NodeShell';
|
|
12
|
+
export { workflowLabelProps } from './canvas/workflowLabelProps';
|
|
13
|
+
export type { WorkflowGraphObserver } from './graphObserver';
|
|
14
|
+
export { useWorkflowGraphObserver, WorkflowGraphObserverContext, } from './graphObserver';
|
|
15
|
+
export type { GraphAction } from './graphReducer';
|
|
16
|
+
export { emptyGraph, graphReducer } from './graphReducer';
|
|
17
|
+
export { Workflow } from './Workflow';
|
|
18
|
+
export type { ConnectionCtx, DockSide, DrawerRenderProps, EdgeDrawerRenderProps, Graph, GraphEdge, GraphNode, HandleDef, Issue, IssueSeverity, JSONSchema, MetaChipSpec, MetaChipTone, NodeCategory, NodeRenderProps, NodeTypeDef, NodeTypeRegistry, PlacementRule, Position, RunState, WorkflowProps, WorkflowSelection, WorkflowTranslate, } from './Workflow.types';
|
|
19
|
+
export { defineNodeType, resolveDefaultConfig } from './Workflow.types';
|
|
20
|
+
export type { EditorState, WorkflowContextValue, WorkflowProviderProps, } from './WorkflowContext';
|
|
21
|
+
export { useWorkflow, useWorkflowTranslate, WorkflowProvider, } from './WorkflowContext';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Workflow/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EACV,SAAS,EACT,cAAc,EACd,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY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EACX,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Graph } from '../Workflow.types';
|
|
2
|
+
/**
|
|
3
|
+
* Flow axis of the laid-out graph. `LR` (the default) lays ranks out
|
|
4
|
+
* left-to-right, matching the way a workflow reads: trigger → steps → output.
|
|
5
|
+
*/
|
|
6
|
+
export type LayoutDirection = 'LR' | 'TB';
|
|
7
|
+
/** Rendered footprint of a node, used so ranks don't overlap. */
|
|
8
|
+
export type NodeDimensions = {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
/**
|
|
12
|
+
* Extra room (px) to reserve on the node's trailing (downstream) edge for
|
|
13
|
+
* content that overflows the card — specifically the exit labels a Classify /
|
|
14
|
+
* If-Else node paints to the right of its handles. These are absolutely
|
|
15
|
+
* positioned, so React Flow's measured `width` excludes them; without this
|
|
16
|
+
* the next rank packs right up against the node and the edges leaving those
|
|
17
|
+
* exits get tucked under the label text. See `estimateLabelOverhang`.
|
|
18
|
+
*/
|
|
19
|
+
trailing?: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function estimateLabelOverhang(labels: string[]): number;
|
|
22
|
+
export type AutoLayoutOptions = {
|
|
23
|
+
direction?: LayoutDirection;
|
|
24
|
+
/** Gap between adjacent ranks (along the flow axis). */
|
|
25
|
+
rankGap?: number;
|
|
26
|
+
/** Gap between sibling nodes within a rank (the cross axis). */
|
|
27
|
+
nodeGap?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Per-node order of output handles, keyed by node id — the ordered list of
|
|
30
|
+
* `HandleDef.id`s a node paints top-to-bottom (e.g. a Classify node's
|
|
31
|
+
* categories). Used to lay a node's downstream children out in the same order
|
|
32
|
+
* its exits read, so the child wired to the first exit sits above the one
|
|
33
|
+
* wired to the last (see `orderEdgesForDagre`). Nodes absent from the map (or
|
|
34
|
+
* edges with no `sourceHandle`) keep their order in `graph.edges`.
|
|
35
|
+
*/
|
|
36
|
+
outputOrder?: Record<string, readonly string[]>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Compute a tidy, hierarchical layout for a workflow graph and return a new
|
|
40
|
+
* `Graph` with every node's `position` recomputed (edges untouched). Pure and
|
|
41
|
+
* deterministic — same graph + dimensions in, same positions out — so it's
|
|
42
|
+
* safe to dispatch through the reducer and to snapshot in tests.
|
|
43
|
+
*
|
|
44
|
+
* `dimensions` maps node id → measured size; missing entries fall back to the
|
|
45
|
+
* node-card defaults. Disconnected nodes are placed by dagre in the first rank
|
|
46
|
+
* (never overlapping, thanks to `nodesep`).
|
|
47
|
+
*/
|
|
48
|
+
export declare function autoLayout(graph: Graph, dimensions?: Record<string, NodeDimensions>, options?: AutoLayoutOptions): Graph;
|
|
49
|
+
//# sourceMappingURL=autoLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/Workflow/layout/autoLayout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAY,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,iEAAiE;AACjE,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAYF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAG9D;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CACjD,CAAC;AA0EF;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,KAAK,EACZ,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAM,EAC/C,OAAO,GAAE,iBAAsB,GAC9B,KAAK,CAuDP"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var dagre = require('@dagrejs/dagre');
|
|
5
|
+
var NodeShell_styles = require('../canvas/NodeShell/NodeShell.styles.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Roughly how wide (px) the longest of a node's exit labels renders, so the
|
|
9
|
+
* layout can reserve trailing room for it. The label is absolutely positioned
|
|
10
|
+
* and not in the layout pass, so we approximate from text length rather than
|
|
11
|
+
* measure: a per-glyph width plus the label's inset from the node edge. Korean
|
|
12
|
+
* glyphs are near full-width, so we size for the wider case to stay safe.
|
|
13
|
+
*/
|
|
14
|
+
const LABEL_GLYPH_PX = 8;
|
|
15
|
+
const LABEL_INSET_PX = 18;
|
|
16
|
+
function estimateLabelOverhang(labels) {
|
|
17
|
+
const longest = labels.reduce((max, label) => Math.max(max, label.length), 0);
|
|
18
|
+
return longest === 0 ? 0 : LABEL_INSET_PX + longest * LABEL_GLYPH_PX;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Order `edges` for insertion into dagre so a fan-out node's children come out
|
|
22
|
+
* in exit order — first exit on top, last on the bottom.
|
|
23
|
+
*
|
|
24
|
+
* dagre derives a rank's initial vertical order from a DFS that pushes each
|
|
25
|
+
* node's successors in *edge-insertion order*, and the first-pushed sibling
|
|
26
|
+
* lands at the BOTTOM (largest cross-axis coordinate). Left to the raw
|
|
27
|
+
* `graph.edges` order — which is just whenever the author happened to wire each
|
|
28
|
+
* exit — that yields criss-crossed edges: the first exit's child gets sent to
|
|
29
|
+
* the bottom and the last exit's to the top.
|
|
30
|
+
*
|
|
31
|
+
* So for each source we know the exit order of, we reorder ITS edges in REVERSE
|
|
32
|
+
* exit order to cancel dagre's reversal. Every other edge — a source with no
|
|
33
|
+
* known exit order, or fewer than two edges — keeps its exact slot in
|
|
34
|
+
* `graph.edges`, so the documented fallback path doesn't perturb the layout.
|
|
35
|
+
* Stable: ties (e.g. two edges off one exit) preserve input order.
|
|
36
|
+
*/
|
|
37
|
+
function orderEdgesForDagre(edges, outputOrder) {
|
|
38
|
+
// Collect, per source we can sort, that source's edges in REVERSE exit order.
|
|
39
|
+
const sortedBySource = new Map();
|
|
40
|
+
for (const edge of edges) {
|
|
41
|
+
if (!outputOrder[edge.source])
|
|
42
|
+
continue;
|
|
43
|
+
const group = sortedBySource.get(edge.source);
|
|
44
|
+
if (group)
|
|
45
|
+
group.push(edge);
|
|
46
|
+
else
|
|
47
|
+
sortedBySource.set(edge.source, [edge]);
|
|
48
|
+
}
|
|
49
|
+
for (const [source, group] of sortedBySource) {
|
|
50
|
+
const order = outputOrder[source];
|
|
51
|
+
if (group.length < 2) {
|
|
52
|
+
sortedBySource.delete(source);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const exitIndex = (handle) => {
|
|
56
|
+
// An undefined handle denotes the first output (matches the
|
|
57
|
+
// `resolveHandle` convention in connectionRules), so it ranks as exit 0.
|
|
58
|
+
const i = order.indexOf(handle ?? order[0]);
|
|
59
|
+
return i === -1 ? Number.MAX_SAFE_INTEGER : i;
|
|
60
|
+
};
|
|
61
|
+
// Stable sort keeps ties (e.g. two edges off one exit) in input order.
|
|
62
|
+
group.sort((a, b) => exitIndex(b.sourceHandle) - exitIndex(a.sourceHandle));
|
|
63
|
+
}
|
|
64
|
+
// Nothing to reorder — hand back the original array untouched.
|
|
65
|
+
if (sortedBySource.size === 0)
|
|
66
|
+
return edges;
|
|
67
|
+
// Replay `graph.edges` in place, drawing each sortable source's edges from
|
|
68
|
+
// its reordered queue so only those slots change and all others stay put.
|
|
69
|
+
const cursor = new Map();
|
|
70
|
+
return edges.map((edge) => {
|
|
71
|
+
const group = sortedBySource.get(edge.source);
|
|
72
|
+
if (!group)
|
|
73
|
+
return edge;
|
|
74
|
+
const i = cursor.get(edge.source) ?? 0;
|
|
75
|
+
cursor.set(edge.source, i + 1);
|
|
76
|
+
return group[i];
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Footprint assumed for a node we have no measured size for — e.g. one added
|
|
81
|
+
* but not yet rendered. Width tracks the fixed node-card width (`CARD_WIDTH`);
|
|
82
|
+
* height is a typical two-row card. Callers should pass real measured sizes
|
|
83
|
+
* when available so ranks pack tightly.
|
|
84
|
+
*/
|
|
85
|
+
const FALLBACK_WIDTH = parseInt(NodeShell_styles.CARD_WIDTH, 10);
|
|
86
|
+
const FALLBACK_HEIGHT = 76;
|
|
87
|
+
const DEFAULT_RANK_GAP = 80;
|
|
88
|
+
const DEFAULT_NODE_GAP = 40;
|
|
89
|
+
/**
|
|
90
|
+
* Compute a tidy, hierarchical layout for a workflow graph and return a new
|
|
91
|
+
* `Graph` with every node's `position` recomputed (edges untouched). Pure and
|
|
92
|
+
* deterministic — same graph + dimensions in, same positions out — so it's
|
|
93
|
+
* safe to dispatch through the reducer and to snapshot in tests.
|
|
94
|
+
*
|
|
95
|
+
* `dimensions` maps node id → measured size; missing entries fall back to the
|
|
96
|
+
* node-card defaults. Disconnected nodes are placed by dagre in the first rank
|
|
97
|
+
* (never overlapping, thanks to `nodesep`).
|
|
98
|
+
*/
|
|
99
|
+
function autoLayout(graph, dimensions = {}, options = {}) {
|
|
100
|
+
const { direction = 'LR', rankGap = DEFAULT_RANK_GAP, nodeGap = DEFAULT_NODE_GAP, outputOrder = {}, } = options;
|
|
101
|
+
// Footprint dagre lays out with: the real card height, and a width padded by
|
|
102
|
+
// any trailing exit-label overhang so the next rank clears it. We keep the
|
|
103
|
+
// node left-aligned within that padded box (see the offset below) so the
|
|
104
|
+
// reserved space lands on the trailing edge, where the labels actually are.
|
|
105
|
+
const footprintOf = (id) => {
|
|
106
|
+
const d = dimensions[id];
|
|
107
|
+
return {
|
|
108
|
+
width: (d?.width ?? FALLBACK_WIDTH) + (d?.trailing ?? 0),
|
|
109
|
+
height: d?.height ?? FALLBACK_HEIGHT,
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const g = new dagre.graphlib.Graph();
|
|
113
|
+
g.setGraph({ rankdir: direction, ranksep: rankGap, nodesep: nodeGap });
|
|
114
|
+
// dagre requires an edge-label factory even when we attach no labels.
|
|
115
|
+
g.setDefaultEdgeLabel(() => ({}));
|
|
116
|
+
for (const node of graph.nodes) {
|
|
117
|
+
g.setNode(node.id, footprintOf(node.id));
|
|
118
|
+
}
|
|
119
|
+
for (const edge of orderEdgesForDagre(graph.edges, outputOrder)) {
|
|
120
|
+
// Guard against edges that reference a pruned node so dagre doesn't
|
|
121
|
+
// implicitly create a zero-size node for the dangling endpoint.
|
|
122
|
+
if (g.hasNode(edge.source) && g.hasNode(edge.target)) {
|
|
123
|
+
g.setEdge(edge.source, edge.target);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
dagre.layout(g);
|
|
127
|
+
return {
|
|
128
|
+
...graph,
|
|
129
|
+
nodes: graph.nodes.map((node) => {
|
|
130
|
+
const laidOut = g.node(node.id);
|
|
131
|
+
if (!laidOut)
|
|
132
|
+
return node;
|
|
133
|
+
const { width, height } = footprintOf(node.id);
|
|
134
|
+
// dagre reports the node CENTER; React Flow positions are top-left. The
|
|
135
|
+
// footprint width includes the trailing label pad, so subtracting half of
|
|
136
|
+
// it puts the card's real left edge at the box's left — leaving the pad on
|
|
137
|
+
// the trailing side, under the overflowing exit labels.
|
|
138
|
+
const position = {
|
|
139
|
+
x: laidOut.x - width / 2,
|
|
140
|
+
y: laidOut.y - height / 2,
|
|
141
|
+
};
|
|
142
|
+
return { ...node, position };
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
exports.autoLayout = autoLayout;
|
|
148
|
+
exports.estimateLabelOverhang = estimateLabelOverhang;
|
|
149
|
+
//# sourceMappingURL=autoLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoLayout.js","sources":["../../../../src/components/Workflow/layout/autoLayout.ts"],"sourcesContent":[null],"names":["CARD_WIDTH","graphlib","layout"],"mappings":";;;;;;AA0BA;;;;;;AAMG;AACH,MAAM,cAAc,GAAG,CAAC;AACxB,MAAM,cAAc,GAAG,EAAE;AAEnB,SAAU,qBAAqB,CAAC,MAAgB,EAAA;IACpD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7E,IAAA,OAAO,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,cAAc,GAAG,OAAO,GAAG,cAAc;AACtE;AAmBA;;;;;;;;;;;;;;;;AAgBG;AACH,SAAS,kBAAkB,CACzB,KAAqB,EACrB,WAA8C,EAAA;;AAG9C,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAA0B;AACxD,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACxB,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;YAAE;QAC/B,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;AAC7C,QAAA,IAAI,KAAK;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;;YACtB,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9C;IACA,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,cAAc,EAAE;AAC5C,QAAA,MAAM,KAAK,GAAG,WAAW,CAAC,MAA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,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACrC;IACF;IAEAC,YAAM,CAAC,CAAC,CAAC;IAET,OAAO;AACL,QAAA,GAAG,KAAK;QACR,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAI;YAC9B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/B,YAAA,IAAI,CAAC,OAAO;AAAE,gBAAA,OAAO,IAAI;AACzB,YAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;AAK9C,YAAA,MAAM,QAAQ,GAAa;AACzB,gBAAA,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AACxB,gBAAA,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC;aAC1B;AACD,YAAA,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE;AAC9B,QAAA,CAAC,CAAC;KACH;AACH;;;;;"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { graphlib, layout } from '@dagrejs/dagre';
|
|
3
|
+
import { CARD_WIDTH } from '../canvas/NodeShell/NodeShell.styles.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Roughly how wide (px) the longest of a node's exit labels renders, so the
|
|
7
|
+
* layout can reserve trailing room for it. The label is absolutely positioned
|
|
8
|
+
* and not in the layout pass, so we approximate from text length rather than
|
|
9
|
+
* measure: a per-glyph width plus the label's inset from the node edge. Korean
|
|
10
|
+
* glyphs are near full-width, so we size for the wider case to stay safe.
|
|
11
|
+
*/
|
|
12
|
+
const LABEL_GLYPH_PX = 8;
|
|
13
|
+
const LABEL_INSET_PX = 18;
|
|
14
|
+
function estimateLabelOverhang(labels) {
|
|
15
|
+
const longest = labels.reduce((max, label) => Math.max(max, label.length), 0);
|
|
16
|
+
return longest === 0 ? 0 : LABEL_INSET_PX + longest * LABEL_GLYPH_PX;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Order `edges` for insertion into dagre so a fan-out node's children come out
|
|
20
|
+
* in exit order — first exit on top, last on the bottom.
|
|
21
|
+
*
|
|
22
|
+
* dagre derives a rank's initial vertical order from a DFS that pushes each
|
|
23
|
+
* node's successors in *edge-insertion order*, and the first-pushed sibling
|
|
24
|
+
* lands at the BOTTOM (largest cross-axis coordinate). Left to the raw
|
|
25
|
+
* `graph.edges` order — which is just whenever the author happened to wire each
|
|
26
|
+
* exit — that yields criss-crossed edges: the first exit's child gets sent to
|
|
27
|
+
* the bottom and the last exit's to the top.
|
|
28
|
+
*
|
|
29
|
+
* So for each source we know the exit order of, we reorder ITS edges in REVERSE
|
|
30
|
+
* exit order to cancel dagre's reversal. Every other edge — a source with no
|
|
31
|
+
* known exit order, or fewer than two edges — keeps its exact slot in
|
|
32
|
+
* `graph.edges`, so the documented fallback path doesn't perturb the layout.
|
|
33
|
+
* Stable: ties (e.g. two edges off one exit) preserve input order.
|
|
34
|
+
*/
|
|
35
|
+
function orderEdgesForDagre(edges, outputOrder) {
|
|
36
|
+
// Collect, per source we can sort, that source's edges in REVERSE exit order.
|
|
37
|
+
const sortedBySource = new Map();
|
|
38
|
+
for (const edge of edges) {
|
|
39
|
+
if (!outputOrder[edge.source])
|
|
40
|
+
continue;
|
|
41
|
+
const group = sortedBySource.get(edge.source);
|
|
42
|
+
if (group)
|
|
43
|
+
group.push(edge);
|
|
44
|
+
else
|
|
45
|
+
sortedBySource.set(edge.source, [edge]);
|
|
46
|
+
}
|
|
47
|
+
for (const [source, group] of sortedBySource) {
|
|
48
|
+
const order = outputOrder[source];
|
|
49
|
+
if (group.length < 2) {
|
|
50
|
+
sortedBySource.delete(source);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const exitIndex = (handle) => {
|
|
54
|
+
// An undefined handle denotes the first output (matches the
|
|
55
|
+
// `resolveHandle` convention in connectionRules), so it ranks as exit 0.
|
|
56
|
+
const i = order.indexOf(handle ?? order[0]);
|
|
57
|
+
return i === -1 ? Number.MAX_SAFE_INTEGER : i;
|
|
58
|
+
};
|
|
59
|
+
// Stable sort keeps ties (e.g. two edges off one exit) in input order.
|
|
60
|
+
group.sort((a, b) => exitIndex(b.sourceHandle) - exitIndex(a.sourceHandle));
|
|
61
|
+
}
|
|
62
|
+
// Nothing to reorder — hand back the original array untouched.
|
|
63
|
+
if (sortedBySource.size === 0)
|
|
64
|
+
return edges;
|
|
65
|
+
// Replay `graph.edges` in place, drawing each sortable source's edges from
|
|
66
|
+
// its reordered queue so only those slots change and all others stay put.
|
|
67
|
+
const cursor = new Map();
|
|
68
|
+
return edges.map((edge) => {
|
|
69
|
+
const group = sortedBySource.get(edge.source);
|
|
70
|
+
if (!group)
|
|
71
|
+
return edge;
|
|
72
|
+
const i = cursor.get(edge.source) ?? 0;
|
|
73
|
+
cursor.set(edge.source, i + 1);
|
|
74
|
+
return group[i];
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Footprint assumed for a node we have no measured size for — e.g. one added
|
|
79
|
+
* but not yet rendered. Width tracks the fixed node-card width (`CARD_WIDTH`);
|
|
80
|
+
* height is a typical two-row card. Callers should pass real measured sizes
|
|
81
|
+
* when available so ranks pack tightly.
|
|
82
|
+
*/
|
|
83
|
+
const FALLBACK_WIDTH = parseInt(CARD_WIDTH, 10);
|
|
84
|
+
const FALLBACK_HEIGHT = 76;
|
|
85
|
+
const DEFAULT_RANK_GAP = 80;
|
|
86
|
+
const DEFAULT_NODE_GAP = 40;
|
|
87
|
+
/**
|
|
88
|
+
* Compute a tidy, hierarchical layout for a workflow graph and return a new
|
|
89
|
+
* `Graph` with every node's `position` recomputed (edges untouched). Pure and
|
|
90
|
+
* deterministic — same graph + dimensions in, same positions out — so it's
|
|
91
|
+
* safe to dispatch through the reducer and to snapshot in tests.
|
|
92
|
+
*
|
|
93
|
+
* `dimensions` maps node id → measured size; missing entries fall back to the
|
|
94
|
+
* node-card defaults. Disconnected nodes are placed by dagre in the first rank
|
|
95
|
+
* (never overlapping, thanks to `nodesep`).
|
|
96
|
+
*/
|
|
97
|
+
function autoLayout(graph, dimensions = {}, options = {}) {
|
|
98
|
+
const { direction = 'LR', rankGap = DEFAULT_RANK_GAP, nodeGap = DEFAULT_NODE_GAP, outputOrder = {}, } = options;
|
|
99
|
+
// Footprint dagre lays out with: the real card height, and a width padded by
|
|
100
|
+
// any trailing exit-label overhang so the next rank clears it. We keep the
|
|
101
|
+
// node left-aligned within that padded box (see the offset below) so the
|
|
102
|
+
// reserved space lands on the trailing edge, where the labels actually are.
|
|
103
|
+
const footprintOf = (id) => {
|
|
104
|
+
const d = dimensions[id];
|
|
105
|
+
return {
|
|
106
|
+
width: (d?.width ?? FALLBACK_WIDTH) + (d?.trailing ?? 0),
|
|
107
|
+
height: d?.height ?? FALLBACK_HEIGHT,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const g = new graphlib.Graph();
|
|
111
|
+
g.setGraph({ rankdir: direction, ranksep: rankGap, nodesep: nodeGap });
|
|
112
|
+
// dagre requires an edge-label factory even when we attach no labels.
|
|
113
|
+
g.setDefaultEdgeLabel(() => ({}));
|
|
114
|
+
for (const node of graph.nodes) {
|
|
115
|
+
g.setNode(node.id, footprintOf(node.id));
|
|
116
|
+
}
|
|
117
|
+
for (const edge of orderEdgesForDagre(graph.edges, outputOrder)) {
|
|
118
|
+
// Guard against edges that reference a pruned node so dagre doesn't
|
|
119
|
+
// implicitly create a zero-size node for the dangling endpoint.
|
|
120
|
+
if (g.hasNode(edge.source) && g.hasNode(edge.target)) {
|
|
121
|
+
g.setEdge(edge.source, edge.target);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
layout(g);
|
|
125
|
+
return {
|
|
126
|
+
...graph,
|
|
127
|
+
nodes: graph.nodes.map((node) => {
|
|
128
|
+
const laidOut = g.node(node.id);
|
|
129
|
+
if (!laidOut)
|
|
130
|
+
return node;
|
|
131
|
+
const { width, height } = footprintOf(node.id);
|
|
132
|
+
// dagre reports the node CENTER; React Flow positions are top-left. The
|
|
133
|
+
// footprint width includes the trailing label pad, so subtracting half of
|
|
134
|
+
// it puts the card's real left edge at the box's left — leaving the pad on
|
|
135
|
+
// the trailing side, under the overflowing exit labels.
|
|
136
|
+
const position = {
|
|
137
|
+
x: laidOut.x - width / 2,
|
|
138
|
+
y: laidOut.y - height / 2,
|
|
139
|
+
};
|
|
140
|
+
return { ...node, position };
|
|
141
|
+
}),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { autoLayout, estimateLabelOverhang };
|
|
146
|
+
//# sourceMappingURL=autoLayout.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoLayout.mjs","sources":["../../../../src/components/Workflow/layout/autoLayout.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AA0BA;;;;;;AAMG;AACH,MAAM,cAAc,GAAG,CAAC;AACxB,MAAM,cAAc,GAAG,EAAE;AAEnB,SAAU,qBAAqB,CAAC,MAAgB,EAAA;IACpD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC7E,IAAA,OAAO,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,cAAc,GAAG,OAAO,GAAG,cAAc;AACtE;AAmBA;;;;;;;;;;;;;;;;AAgBG;AACH,SAAS,kBAAkB,CACzB,KAAqB,EACrB,WAA8C,EAAA;;AAG9C,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAA0B;AACxD,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AACxB,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,C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AAE;AAC9B,QAAA,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C;AACA,IAAA,KAAK,MAAM,IAAI,IAAI,kBAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE;;;AAG/D,QAAA,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACpD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACrC;IACF;IAEA,MAAM,CAAC,CAAC,CAAC;IAET,OAAO;AACL,QAAA,GAAG,KAAK;QACR,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAI;YAC9B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/B,YAAA,IAAI,CAAC,OAAO;AAAE,gBAAA,OAAO,IAAI;AACzB,YAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;AAK9C,YAAA,MAAM,QAAQ,GAAa;AACzB,gBAAA,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AACxB,gBAAA,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC;aAC1B;AACD,YAAA,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE;AAC9B,QAAA,CAAC,CAAC;KACH;AACH;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type NodeTypeDef } from '../Workflow.types';
|
|
2
|
+
export declare const toyNodeTypes: NodeTypeDef[];
|
|
3
|
+
/** A small starter graph: two inputs feeding an Add, feeding a Print. */
|
|
4
|
+
export declare const toyGraph: {
|
|
5
|
+
nodes: ({
|
|
6
|
+
id: string;
|
|
7
|
+
kind: string;
|
|
8
|
+
position: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
config: {
|
|
13
|
+
value: number;
|
|
14
|
+
label?: undefined;
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
id: string;
|
|
18
|
+
kind: string;
|
|
19
|
+
position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
config: {
|
|
24
|
+
label: string;
|
|
25
|
+
value?: undefined;
|
|
26
|
+
};
|
|
27
|
+
})[];
|
|
28
|
+
edges: ({
|
|
29
|
+
id: string;
|
|
30
|
+
source: string;
|
|
31
|
+
target: string;
|
|
32
|
+
targetHandle: string;
|
|
33
|
+
} | {
|
|
34
|
+
id: string;
|
|
35
|
+
source: string;
|
|
36
|
+
target: string;
|
|
37
|
+
targetHandle?: undefined;
|
|
38
|
+
})[];
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=toyNodeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toyNodeTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/Workflow/stories/toyNodeTypes.tsx"],"names":[],"mappings":"AASA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqGrE,eAAO,MAAM,YAAY,EAAE,WAAW,EAAqC,CAAC;AAE5E,yEAAyE;AACzE,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCpB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Issue } from './Workflow.types';
|
|
2
|
+
/**
|
|
3
|
+
* Maps backend workflow validation issue codes to translated messages.
|
|
4
|
+
* Mirrors the connectors error-message hook precedent
|
|
5
|
+
* (`useConnectorErrorMessage`): the backend owns validation and returns raw
|
|
6
|
+
* English in `Issue.message` (kept as a fallback for tests / logs), while
|
|
7
|
+
* rendering surfaces resolve the localized copy here.
|
|
8
|
+
*
|
|
9
|
+
* Node kind names (Agent, Classify, etc.) are intentionally kept in English
|
|
10
|
+
* across the UI; issues that interpolate them pass the raw `def.label` string
|
|
11
|
+
* in `messageVars`, and Korean sentences read naturally with the
|
|
12
|
+
* mixed-language token (e.g. "Agent는 최소 1개 이상 필요합니다").
|
|
13
|
+
*/
|
|
14
|
+
export declare const useWorkflowIssueMessage: () => (issue: Issue) => string;
|
|
15
|
+
//# sourceMappingURL=useWorkflowIssueMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkflowIssueMessage.d.ts","sourceRoot":"","sources":["../../../src/components/Workflow/useWorkflowIssueMessage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,gBAIxB,KAAK,KAAG,MAyBnB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var WorkflowContext = require('./WorkflowContext/WorkflowContext.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Maps backend workflow validation issue codes to translated messages.
|
|
9
|
+
* Mirrors the connectors error-message hook precedent
|
|
10
|
+
* (`useConnectorErrorMessage`): the backend owns validation and returns raw
|
|
11
|
+
* English in `Issue.message` (kept as a fallback for tests / logs), while
|
|
12
|
+
* rendering surfaces resolve the localized copy here.
|
|
13
|
+
*
|
|
14
|
+
* Node kind names (Agent, Classify, etc.) are intentionally kept in English
|
|
15
|
+
* across the UI; issues that interpolate them pass the raw `def.label` string
|
|
16
|
+
* in `messageVars`, and Korean sentences read naturally with the
|
|
17
|
+
* mixed-language token (e.g. "Agent는 최소 1개 이상 필요합니다").
|
|
18
|
+
*/
|
|
19
|
+
const useWorkflowIssueMessage = () => {
|
|
20
|
+
const translate = WorkflowContext.useWorkflowTranslate();
|
|
21
|
+
return React.useCallback((issue) => {
|
|
22
|
+
// Coerce all interpolation values to strings — `useTranslate`
|
|
23
|
+
// returns a React-element array when a numeric var is passed,
|
|
24
|
+
// which loses its string-ness through the `as string` cast and
|
|
25
|
+
// breaks downstream code that joins or trims the message.
|
|
26
|
+
const vars = issue.messageVars
|
|
27
|
+
? Object.fromEntries(Object.entries(issue.messageVars).map(([k, v]) => [k, String(v)]))
|
|
28
|
+
: undefined;
|
|
29
|
+
const t = (key) => translate(key, vars);
|
|
30
|
+
// Backend (`INVALID_GRAPH`) issues arrive with the validator's own
|
|
31
|
+
// snake_case `code` (e.g. `agent_model_required`), localized under a
|
|
32
|
+
// deterministic `workflow_be_<code>` key. Normalize defensively so a
|
|
33
|
+
// dotted/uppercased variant still resolves. `useTranslate` returns the
|
|
34
|
+
// key itself when no entry exists, so a missing key falls back to the
|
|
35
|
+
// raw English `issue.message`.
|
|
36
|
+
const beKey = `workflow_be_${issue.code
|
|
37
|
+
.toLowerCase()
|
|
38
|
+
.replace(/[.-]/g, '_')}`;
|
|
39
|
+
const beMessage = t(beKey);
|
|
40
|
+
return beMessage === beKey ? issue.message : beMessage;
|
|
41
|
+
}, [translate]);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.useWorkflowIssueMessage = useWorkflowIssueMessage;
|
|
45
|
+
//# sourceMappingURL=useWorkflowIssueMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkflowIssueMessage.js","sources":["../../../src/components/Workflow/useWorkflowIssueMessage.ts"],"sourcesContent":[null],"names":["useWorkflowTranslate","useCallback"],"mappings":";;;;;;AAOA;;;;;;;;;;;AAWG;AACI,MAAM,uBAAuB,GAAG,MAAK;AAC1C,IAAA,MAAM,SAAS,GAAGA,oCAAoB,EAAE;AAExC,IAAA,OAAOC,iBAAW,CAChB,CAAC,KAAY,KAAY;;;;;AAKvB,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC;AACjB,cAAE,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;cAEnE,SAAS;AACb,QAAA,MAAM,CAAC,GAAG,CAAC,GAAW,KAAK,SAAS,CAAC,GAAG,EAAE,IAAI,CAAW;;;;;;;AAOzD,QAAA,MAAM,KAAK,GAAG,CAAA,YAAA,EAAe,KAAK,CAAC;AAChC,aAAA,WAAW;AACX,aAAA,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;AAC1B,QAAA,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC;AAC1B,QAAA,OAAO,SAAS,KAAK,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,SAAS;AACxD,IAAA,CAAC,EACD,CAAC,SAAS,CAAC,CACZ;AACH;;;;"}
|