@mindlogic-ai/logician-ui 3.1.0-alpha.9 → 3.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +20 -4
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +20 -4
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- 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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -0
- 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/dist/theme/colors.d.ts +196 -44
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +184 -22
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +184 -22
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/global.d.ts.map +1 -1
- package/dist/theme/global.js +30 -2
- package/dist/theme/global.js.map +1 -1
- package/dist/theme/global.mjs +30 -2
- package/dist/theme/global.mjs.map +1 -1
- 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/SegmentedControl/SegmentedControl.tsx +21 -4
- 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 +1 -0
- package/src/test-support/setup.ts +11 -0
- package/src/theme/SemanticTokens.mdx +61 -7
- package/src/theme/colors.ts +216 -26
- package/src/theme/global.ts +31 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import '@chakra-ui/react';
|
|
4
|
+
import { toastStyles } from '../../Toast/Toast.styles.mjs';
|
|
5
|
+
import '../../Icon/index.mjs';
|
|
6
|
+
import '../../Toast/Toaster.mjs';
|
|
7
|
+
import 'react';
|
|
8
|
+
|
|
9
|
+
const SEVERITY_PRECEDENCE = {
|
|
10
|
+
error: 2,
|
|
11
|
+
warning: 1,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The single issue a one-slot surface should represent: highest severity
|
|
15
|
+
* wins, first-listed breaks ties. Shared by every "tint by worst issue"
|
|
16
|
+
* consumer (field borders, the header title editor) so precedence can't
|
|
17
|
+
* drift between surfaces.
|
|
18
|
+
*/
|
|
19
|
+
const pickPrimaryIssue = (issues) => {
|
|
20
|
+
if (issues.length === 0)
|
|
21
|
+
return null;
|
|
22
|
+
let primary = issues[0];
|
|
23
|
+
for (let i = 1; i < issues.length; i += 1) {
|
|
24
|
+
if (SEVERITY_PRECEDENCE[issues[i].severity] >
|
|
25
|
+
SEVERITY_PRECEDENCE[primary.severity]) {
|
|
26
|
+
primary = issues[i];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return primary;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Semantic color token for an issue severity — shared across issue list UIs.
|
|
33
|
+
* `tone` selects the shade: the default `'main'` for text/icons, or `'dark'`
|
|
34
|
+
* where `.main` is too light to read (e.g. the small list-bullet markers in
|
|
35
|
+
* drawer issue callouts, which need extra contrast against the tinted bg).
|
|
36
|
+
*/
|
|
37
|
+
const severityColorToken = (severity, tone = 'main') => (severity === 'error' ? `danger.${tone}` : `warning.${tone}`);
|
|
38
|
+
/**
|
|
39
|
+
* Tinted callout styling (bg / border / text) for an issue severity. Reuses the
|
|
40
|
+
* `Toast` component's golden-ratio combo — the documented WCAG AA pairing — so
|
|
41
|
+
* the boxed inspector callouts stay in lockstep with it instead of restating
|
|
42
|
+
* the tokens. `IssueSeverity` is a subset of the toast statuses.
|
|
43
|
+
*/
|
|
44
|
+
const severityCalloutStyle = (severity) => toastStyles[severity];
|
|
45
|
+
|
|
46
|
+
export { pickPrimaryIssue, severityCalloutStyle, severityColorToken };
|
|
47
|
+
//# sourceMappingURL=issueSeverity.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issueSeverity.mjs","sources":["../../../../src/components/Workflow/canvas/issueSeverity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAIA,MAAM,mBAAmB,GAAkC;AACzD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,OAAO,EAAE,CAAC;CACX;AAED;;;;;AAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,MAAe,KAAkB;AAChE,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AACpC,IAAA,IAAI,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACvB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACzC,IACE,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACvC,YAAA,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,EACrC;AACA,YAAA,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;QACrB;IACF;AACA,IAAA,OAAO,OAAO;AAChB;AAEA;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAChC,QAAuB,EACvB,IAAA,GAAwB,MAAM,MAClB,QAAQ,KAAK,OAAO,GAAG,CAAA,OAAA,EAAU,IAAI,CAAA,CAAE,GAAG,CAAA,QAAA,EAAW,IAAI,CAAA,CAAE;AAEzE;;;;;AAKG;AACI,MAAM,oBAAoB,GAAG,CAAC,QAAuB,KAC1D,WAAW,CAAC,QAAQ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Wires a field surface into the `fieldFocusRequest` channel: when the canvas
|
|
4
|
+
* validation banner asks to jump to `(nodeId, fieldKey)`, the matching
|
|
5
|
+
* container scrolls into view and its first focusable element is focused,
|
|
6
|
+
* then the request is consumed so a re-render doesn't refocus repeatedly.
|
|
7
|
+
*
|
|
8
|
+
* Shared by `FieldWrapper` (body fields) and `NodeTitleEditable` (the header
|
|
9
|
+
* rename editor) so the jump protocol can't drift between them. The selector
|
|
10
|
+
* includes the editable's `[data-part="preview"]` — focusing it activates
|
|
11
|
+
* edit mode (activationMode "focus"); mid-edit its `input` matches first.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useFieldFocusRequest(nodeId: string, fieldKey: string, containerRef: RefObject<HTMLDivElement | null>): void;
|
|
14
|
+
//# sourceMappingURL=useFieldFocusRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldFocusRequest.d.ts","sourceRoot":"","sources":["../../../../src/components/Workflow/canvas/useFieldFocusRequest.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAIlD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,GAC7C,IAAI,CAgCN"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var WorkflowContext = require('../WorkflowContext/WorkflowContext.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Wires a field surface into the `fieldFocusRequest` channel: when the canvas
|
|
9
|
+
* validation banner asks to jump to `(nodeId, fieldKey)`, the matching
|
|
10
|
+
* container scrolls into view and its first focusable element is focused,
|
|
11
|
+
* then the request is consumed so a re-render doesn't refocus repeatedly.
|
|
12
|
+
*
|
|
13
|
+
* Shared by `FieldWrapper` (body fields) and `NodeTitleEditable` (the header
|
|
14
|
+
* rename editor) so the jump protocol can't drift between them. The selector
|
|
15
|
+
* includes the editable's `[data-part="preview"]` — focusing it activates
|
|
16
|
+
* edit mode (activationMode "focus"); mid-edit its `input` matches first.
|
|
17
|
+
*/
|
|
18
|
+
function useFieldFocusRequest(nodeId, fieldKey, containerRef) {
|
|
19
|
+
const { fieldFocusRequest, consumeFieldFocusRequest } = WorkflowContext.useWorkflow();
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (fieldFocusRequest?.nodeId !== nodeId ||
|
|
22
|
+
fieldFocusRequest.fieldKey !== fieldKey) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
// Defer one frame so a freshly-mounted drawer has painted before we
|
|
26
|
+
// try to scroll/focus inside it.
|
|
27
|
+
const handle = requestAnimationFrame(() => {
|
|
28
|
+
const root = containerRef.current;
|
|
29
|
+
if (root) {
|
|
30
|
+
root.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
31
|
+
root
|
|
32
|
+
.querySelector('input, textarea, [contenteditable="true"], select, button, [data-part="preview"]')
|
|
33
|
+
?.focus();
|
|
34
|
+
}
|
|
35
|
+
consumeFieldFocusRequest();
|
|
36
|
+
});
|
|
37
|
+
return () => cancelAnimationFrame(handle);
|
|
38
|
+
}, [
|
|
39
|
+
fieldFocusRequest,
|
|
40
|
+
nodeId,
|
|
41
|
+
fieldKey,
|
|
42
|
+
containerRef,
|
|
43
|
+
consumeFieldFocusRequest,
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.useFieldFocusRequest = useFieldFocusRequest;
|
|
48
|
+
//# sourceMappingURL=useFieldFocusRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldFocusRequest.js","sources":["../../../../src/components/Workflow/canvas/useFieldFocusRequest.ts"],"sourcesContent":[null],"names":["useWorkflow","useEffect"],"mappings":";;;;;;AAMA;;;;;;;;;;AAUG;SACa,oBAAoB,CAClC,MAAc,EACd,QAAgB,EAChB,YAA8C,EAAA;IAE9C,MAAM,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,GAAGA,2BAAW,EAAE;IAErEC,eAAS,CAAC,MAAK;AACb,QAAA,IACE,iBAAiB,EAAE,MAAM,KAAK,MAAM;AACpC,YAAA,iBAAiB,CAAC,QAAQ,KAAK,QAAQ,EACvC;YACA;QACF;;;AAGA,QAAA,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAK;AACxC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO;YACjC,IAAI,IAAI,EAAE;AACR,gBAAA,IAAI,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBAC5D;qBACG,aAAa,CACZ,kFAAkF;sBAElF,KAAK,EAAE;YACb;AACA,YAAA,wBAAwB,EAAE;AAC5B,QAAA,CAAC,CAAC;AACF,QAAA,OAAO,MAAM,oBAAoB,CAAC,MAAM,CAAC;AAC3C,IAAA,CAAC,EAAE;QACD,iBAAiB;QACjB,MAAM;QACN,QAAQ;QACR,YAAY;QACZ,wBAAwB;AACzB,KAAA,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { useWorkflow } from '../WorkflowContext/WorkflowContext.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Wires a field surface into the `fieldFocusRequest` channel: when the canvas
|
|
7
|
+
* validation banner asks to jump to `(nodeId, fieldKey)`, the matching
|
|
8
|
+
* container scrolls into view and its first focusable element is focused,
|
|
9
|
+
* then the request is consumed so a re-render doesn't refocus repeatedly.
|
|
10
|
+
*
|
|
11
|
+
* Shared by `FieldWrapper` (body fields) and `NodeTitleEditable` (the header
|
|
12
|
+
* rename editor) so the jump protocol can't drift between them. The selector
|
|
13
|
+
* includes the editable's `[data-part="preview"]` — focusing it activates
|
|
14
|
+
* edit mode (activationMode "focus"); mid-edit its `input` matches first.
|
|
15
|
+
*/
|
|
16
|
+
function useFieldFocusRequest(nodeId, fieldKey, containerRef) {
|
|
17
|
+
const { fieldFocusRequest, consumeFieldFocusRequest } = useWorkflow();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (fieldFocusRequest?.nodeId !== nodeId ||
|
|
20
|
+
fieldFocusRequest.fieldKey !== fieldKey) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// Defer one frame so a freshly-mounted drawer has painted before we
|
|
24
|
+
// try to scroll/focus inside it.
|
|
25
|
+
const handle = requestAnimationFrame(() => {
|
|
26
|
+
const root = containerRef.current;
|
|
27
|
+
if (root) {
|
|
28
|
+
root.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
29
|
+
root
|
|
30
|
+
.querySelector('input, textarea, [contenteditable="true"], select, button, [data-part="preview"]')
|
|
31
|
+
?.focus();
|
|
32
|
+
}
|
|
33
|
+
consumeFieldFocusRequest();
|
|
34
|
+
});
|
|
35
|
+
return () => cancelAnimationFrame(handle);
|
|
36
|
+
}, [
|
|
37
|
+
fieldFocusRequest,
|
|
38
|
+
nodeId,
|
|
39
|
+
fieldKey,
|
|
40
|
+
containerRef,
|
|
41
|
+
consumeFieldFocusRequest,
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useFieldFocusRequest };
|
|
46
|
+
//# sourceMappingURL=useFieldFocusRequest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldFocusRequest.mjs","sources":["../../../../src/components/Workflow/canvas/useFieldFocusRequest.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAMA;;;;;;;;;;AAUG;SACa,oBAAoB,CAClC,MAAc,EACd,QAAgB,EAChB,YAA8C,EAAA;IAE9C,MAAM,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,GAAG,WAAW,EAAE;IAErE,SAAS,CAAC,MAAK;AACb,QAAA,IACE,iBAAiB,EAAE,MAAM,KAAK,MAAM;AACpC,YAAA,iBAAiB,CAAC,QAAQ,KAAK,QAAQ,EACvC;YACA;QACF;;;AAGA,QAAA,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAK;AACxC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO;YACjC,IAAI,IAAI,EAAE;AACR,gBAAA,IAAI,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBAC5D;qBACG,aAAa,CACZ,kFAAkF;sBAElF,KAAK,EAAE;YACb;AACA,YAAA,wBAAwB,EAAE;AAC5B,QAAA,CAAC,CAAC;AACF,QAAA,OAAO,MAAM,oBAAoB,CAAC,MAAM,CAAC;AAC3C,IAAA,CAAC,EAAE;QACD,iBAAiB;QACjB,MAAM;QACN,QAAQ;QACR,YAAY;QACZ,wBAAwB;AACzB,KAAA,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared label styling for inputs inside the workflow editor's drawer.
|
|
3
|
+
* Mirrors the outer ChatbotForm's `FieldLabel` heading tokens so the
|
|
4
|
+
* editor's inspector reads as the same form surface; the Workflow
|
|
5
|
+
* canvas can't import from the studio `app/` route, so this lives at
|
|
6
|
+
* the canvas layer instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const workflowLabelProps: {
|
|
9
|
+
readonly fontWeight: "semibold";
|
|
10
|
+
readonly color: "slate.1300";
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=workflowLabelProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowLabelProps.d.ts","sourceRoot":"","sources":["../../../../src/components/Workflow/canvas/workflowLabelProps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared label styling for inputs inside the workflow editor's drawer.
|
|
6
|
+
* Mirrors the outer ChatbotForm's `FieldLabel` heading tokens so the
|
|
7
|
+
* editor's inspector reads as the same form surface; the Workflow
|
|
8
|
+
* canvas can't import from the studio `app/` route, so this lives at
|
|
9
|
+
* the canvas layer instead.
|
|
10
|
+
*/
|
|
11
|
+
const workflowLabelProps = {
|
|
12
|
+
fontWeight: 'semibold',
|
|
13
|
+
color: 'slate.1300',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.workflowLabelProps = workflowLabelProps;
|
|
17
|
+
//# sourceMappingURL=workflowLabelProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowLabelProps.js","sources":["../../../../src/components/Workflow/canvas/workflowLabelProps.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;;;;;AAMG;AACI,MAAM,kBAAkB,GAAG;AAChC,IAAA,UAAU,EAAE,UAAU;AACtB,IAAA,KAAK,EAAE,YAAY;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* Shared label styling for inputs inside the workflow editor's drawer.
|
|
4
|
+
* Mirrors the outer ChatbotForm's `FieldLabel` heading tokens so the
|
|
5
|
+
* editor's inspector reads as the same form surface; the Workflow
|
|
6
|
+
* canvas can't import from the studio `app/` route, so this lives at
|
|
7
|
+
* the canvas layer instead.
|
|
8
|
+
*/
|
|
9
|
+
const workflowLabelProps = {
|
|
10
|
+
fontWeight: 'semibold',
|
|
11
|
+
color: 'slate.1300',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { workflowLabelProps };
|
|
15
|
+
//# sourceMappingURL=workflowLabelProps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowLabelProps.mjs","sources":["../../../../src/components/Workflow/canvas/workflowLabelProps.ts"],"sourcesContent":[null],"names":[],"mappings":";AAAA;;;;;;AAMG;AACI,MAAM,kBAAkB,GAAG;AAChC,IAAA,UAAU,EAAE,UAAU;AACtB,IAAA,KAAK,EAAE,YAAY;;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Connection } from '@xyflow/react';
|
|
2
|
+
import type { Graph, GraphEdge, NodeTypeDef } from './Workflow.types';
|
|
3
|
+
/** Resolves a node-type definition by kind. */
|
|
4
|
+
type GetNodeType = (kind: string) => NodeTypeDef | undefined;
|
|
5
|
+
/** A prospective connection; mirrors React Flow's `Connection` (handles nullable). */
|
|
6
|
+
type ProposedConnection = Pick<Connection, 'source' | 'target' | 'sourceHandle' | 'targetHandle'>;
|
|
7
|
+
/**
|
|
8
|
+
* Validates a proposed connection against node-type handle declarations and the
|
|
9
|
+
* optional `canConnect` rules of both endpoints. Shared by the canvas
|
|
10
|
+
* `isValidConnection`, manual `onConnect`, edge reconnect, and palette
|
|
11
|
+
* auto-connect so every path enforces the same constraints:
|
|
12
|
+
* - no self-connections,
|
|
13
|
+
* - the source must expose an output handle (Start/Agent/etc., never End),
|
|
14
|
+
* - the target must expose an input handle (End/Agent/etc., never Start),
|
|
15
|
+
* - a named `sourceHandle`/`targetHandle` must be a declared handle id,
|
|
16
|
+
* - connections run exit→entry only: the `sourceHandle` must be an output of
|
|
17
|
+
* the source and the `targetHandle` an input of the target — never the
|
|
18
|
+
* reverse (no exit→exit / entry→entry wiring),
|
|
19
|
+
* - any node-type `canConnect` hook on either endpoint must return `true`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isValidConnection(connection: ProposedConnection, graph: Graph, getNodeType: GetNodeType): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The existing outbound edge from a node's given handle, if any. Each exit
|
|
24
|
+
* point holds at most one edge: a single-output node is "taken" once it has any
|
|
25
|
+
* outbound edge; named handles (classify categories, if/else branches,
|
|
26
|
+
* guardrail pass/fail) are tracked individually by their `sourceHandle` id.
|
|
27
|
+
*
|
|
28
|
+
* Used by the canvas to decide whether a fresh drag from an exit should create
|
|
29
|
+
* a new edge or MOVE the one already there.
|
|
30
|
+
*/
|
|
31
|
+
export declare function existingEdgeFromHandle(graph: Graph, getNodeType: GetNodeType, source: string, sourceHandle: string | undefined): GraphEdge | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The sole inbound edge to a node's given input handle, or `undefined` when the
|
|
34
|
+
* handle has zero or more than one. Unlike exits (one edge each), entries allow
|
|
35
|
+
* fan-in: several sources can converge on one input. So "grab the existing edge
|
|
36
|
+
* and re-route it" is only unambiguous when exactly one edge points at the
|
|
37
|
+
* handle — with two or more there's no single edge to grab, and the drag should
|
|
38
|
+
* fall back to adding another fan-in edge.
|
|
39
|
+
*
|
|
40
|
+
* Used by the canvas to decide whether a drag that *starts* from an occupied
|
|
41
|
+
* entry should move that edge's source endpoint instead of creating a new edge.
|
|
42
|
+
*/
|
|
43
|
+
export declare function soleEdgeToHandle(graph: Graph, getNodeType: GetNodeType, target: string, targetHandle: string | undefined): GraphEdge | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Detects a single output-handle id rename between two configs of the same
|
|
46
|
+
* node, so the edge on that handle can move with it instead of being orphaned.
|
|
47
|
+
* Handle ids that derive from mutable config (Classify's `cat_<name>`) change
|
|
48
|
+
* when the author edits a name; diffing the declared outputs yields the rename.
|
|
49
|
+
*
|
|
50
|
+
* Returns the pair only for an unambiguous 1:1 rename — a pure add or remove
|
|
51
|
+
* (which the per-field drawer does one at a time) yields `undefined`, leaving
|
|
52
|
+
* edges to their normal add/prune behaviour.
|
|
53
|
+
*/
|
|
54
|
+
export declare function renamedOutputHandle(handles: NodeTypeDef['handles'], oldConfig: unknown, newConfig: unknown): {
|
|
55
|
+
from: string;
|
|
56
|
+
to: string;
|
|
57
|
+
} | undefined;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=connectionRules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionRules.d.ts","sourceRoot":"","sources":["../../../src/components/Workflow/connectionRules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEtE,+CAA+C;AAC/C,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;AAE7D,sFAAsF;AACtF,KAAK,kBAAkB,GAAG,IAAI,CAC5B,UAAU,EACV,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,CACtD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,GACvB,OAAO,CA6DT;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,SAAS,GAAG,SAAS,CAWvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,SAAS,GAAG,SAAS,CAYvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,EAC/B,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,OAAO,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAS1C"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validates a proposed connection against node-type handle declarations and the
|
|
6
|
+
* optional `canConnect` rules of both endpoints. Shared by the canvas
|
|
7
|
+
* `isValidConnection`, manual `onConnect`, edge reconnect, and palette
|
|
8
|
+
* auto-connect so every path enforces the same constraints:
|
|
9
|
+
* - no self-connections,
|
|
10
|
+
* - the source must expose an output handle (Start/Agent/etc., never End),
|
|
11
|
+
* - the target must expose an input handle (End/Agent/etc., never Start),
|
|
12
|
+
* - a named `sourceHandle`/`targetHandle` must be a declared handle id,
|
|
13
|
+
* - connections run exit→entry only: the `sourceHandle` must be an output of
|
|
14
|
+
* the source and the `targetHandle` an input of the target — never the
|
|
15
|
+
* reverse (no exit→exit / entry→entry wiring),
|
|
16
|
+
* - any node-type `canConnect` hook on either endpoint must return `true`.
|
|
17
|
+
*/
|
|
18
|
+
function isValidConnection(connection, graph, getNodeType) {
|
|
19
|
+
if (!connection.source || !connection.target)
|
|
20
|
+
return false;
|
|
21
|
+
if (connection.source === connection.target)
|
|
22
|
+
return false;
|
|
23
|
+
const source = graph.nodes.find((n) => n.id === connection.source);
|
|
24
|
+
const target = graph.nodes.find((n) => n.id === connection.target);
|
|
25
|
+
if (!source || !target)
|
|
26
|
+
return false;
|
|
27
|
+
const sourceDef = getNodeType(source.kind);
|
|
28
|
+
const targetDef = getNodeType(target.kind);
|
|
29
|
+
if (!sourceDef || !targetDef)
|
|
30
|
+
return false;
|
|
31
|
+
const sourceHandles = sourceDef.handles(source.config);
|
|
32
|
+
const targetHandles = targetDef.handles(target.config);
|
|
33
|
+
const sourceOutputs = sourceHandles.outputs;
|
|
34
|
+
const targetInputs = targetHandles.inputs;
|
|
35
|
+
// Source must be able to emit and target must be able to receive.
|
|
36
|
+
if (sourceOutputs.length === 0)
|
|
37
|
+
return false;
|
|
38
|
+
if (targetInputs.length === 0)
|
|
39
|
+
return false;
|
|
40
|
+
// A requested named handle must actually exist on the node.
|
|
41
|
+
if (connection.sourceHandle &&
|
|
42
|
+
!sourceOutputs.some((h) => h.id === connection.sourceHandle)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
if (connection.targetHandle &&
|
|
46
|
+
!targetInputs.some((h) => h.id === connection.targetHandle)) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
// Exit→entry only. React Flow's strict connection mode already blocks
|
|
50
|
+
// output↔output (exit→exit) and input↔input drags, but enforce it here too so
|
|
51
|
+
// every path — manual connect, reconnect, programmatic edges — agrees: reject
|
|
52
|
+
// a `sourceHandle` that is actually an input of the source, or a `targetHandle`
|
|
53
|
+
// that is actually an output of the target.
|
|
54
|
+
if (connection.sourceHandle &&
|
|
55
|
+
sourceHandles.inputs.some((h) => h.id === connection.sourceHandle)) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (connection.targetHandle &&
|
|
59
|
+
targetHandles.outputs.some((h) => h.id === connection.targetHandle)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const ctx = {
|
|
63
|
+
source,
|
|
64
|
+
sourceHandle: connection.sourceHandle ?? undefined,
|
|
65
|
+
target,
|
|
66
|
+
targetHandle: connection.targetHandle ?? undefined,
|
|
67
|
+
graph,
|
|
68
|
+
};
|
|
69
|
+
for (const def of [sourceDef, targetDef]) {
|
|
70
|
+
if (def.canConnect && def.canConnect(ctx) !== true)
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolves a possibly-omitted handle id to the port it actually attaches to.
|
|
77
|
+
* Edges loaded from the backend / fixtures may omit the handle id for a node's
|
|
78
|
+
* default port, while the canvas renders every port with a concrete id (see
|
|
79
|
+
* `NodeShell`). React Flow attaches a handle-less edge to the node's first port
|
|
80
|
+
* of that type, so `undefined` and that first id denote the same port — collapse
|
|
81
|
+
* them before comparing or the lookup misses the edge (and we'd duplicate it).
|
|
82
|
+
*/
|
|
83
|
+
function resolveHandle(handle, ports) {
|
|
84
|
+
return handle ?? ports[0]?.id;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The existing outbound edge from a node's given handle, if any. Each exit
|
|
88
|
+
* point holds at most one edge: a single-output node is "taken" once it has any
|
|
89
|
+
* outbound edge; named handles (classify categories, if/else branches,
|
|
90
|
+
* guardrail pass/fail) are tracked individually by their `sourceHandle` id.
|
|
91
|
+
*
|
|
92
|
+
* Used by the canvas to decide whether a fresh drag from an exit should create
|
|
93
|
+
* a new edge or MOVE the one already there.
|
|
94
|
+
*/
|
|
95
|
+
function existingEdgeFromHandle(graph, getNodeType, source, sourceHandle) {
|
|
96
|
+
const node = graph.nodes.find((n) => n.id === source);
|
|
97
|
+
const outputs = node
|
|
98
|
+
? (getNodeType(node.kind)?.handles(node.config).outputs ?? [])
|
|
99
|
+
: [];
|
|
100
|
+
const want = resolveHandle(sourceHandle, outputs);
|
|
101
|
+
return graph.edges.find((e) => e.source === source &&
|
|
102
|
+
resolveHandle(e.sourceHandle ?? undefined, outputs) === want);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The sole inbound edge to a node's given input handle, or `undefined` when the
|
|
106
|
+
* handle has zero or more than one. Unlike exits (one edge each), entries allow
|
|
107
|
+
* fan-in: several sources can converge on one input. So "grab the existing edge
|
|
108
|
+
* and re-route it" is only unambiguous when exactly one edge points at the
|
|
109
|
+
* handle — with two or more there's no single edge to grab, and the drag should
|
|
110
|
+
* fall back to adding another fan-in edge.
|
|
111
|
+
*
|
|
112
|
+
* Used by the canvas to decide whether a drag that *starts* from an occupied
|
|
113
|
+
* entry should move that edge's source endpoint instead of creating a new edge.
|
|
114
|
+
*/
|
|
115
|
+
function soleEdgeToHandle(graph, getNodeType, target, targetHandle) {
|
|
116
|
+
const node = graph.nodes.find((n) => n.id === target);
|
|
117
|
+
const inputs = node
|
|
118
|
+
? (getNodeType(node.kind)?.handles(node.config).inputs ?? [])
|
|
119
|
+
: [];
|
|
120
|
+
const want = resolveHandle(targetHandle, inputs);
|
|
121
|
+
const inbound = graph.edges.filter((e) => e.target === target &&
|
|
122
|
+
resolveHandle(e.targetHandle ?? undefined, inputs) === want);
|
|
123
|
+
return inbound.length === 1 ? inbound[0] : undefined;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Detects a single output-handle id rename between two configs of the same
|
|
127
|
+
* node, so the edge on that handle can move with it instead of being orphaned.
|
|
128
|
+
* Handle ids that derive from mutable config (Classify's `cat_<name>`) change
|
|
129
|
+
* when the author edits a name; diffing the declared outputs yields the rename.
|
|
130
|
+
*
|
|
131
|
+
* Returns the pair only for an unambiguous 1:1 rename — a pure add or remove
|
|
132
|
+
* (which the per-field drawer does one at a time) yields `undefined`, leaving
|
|
133
|
+
* edges to their normal add/prune behaviour.
|
|
134
|
+
*/
|
|
135
|
+
function renamedOutputHandle(handles, oldConfig, newConfig) {
|
|
136
|
+
const oldIds = handles(oldConfig).outputs.map((h) => h.id);
|
|
137
|
+
const newIds = handles(newConfig).outputs.map((h) => h.id);
|
|
138
|
+
const removed = oldIds.filter((id) => !newIds.includes(id));
|
|
139
|
+
const added = newIds.filter((id) => !oldIds.includes(id));
|
|
140
|
+
if (removed.length === 1 && added.length === 1) {
|
|
141
|
+
return { from: removed[0], to: added[0] };
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
exports.existingEdgeFromHandle = existingEdgeFromHandle;
|
|
147
|
+
exports.isValidConnection = isValidConnection;
|
|
148
|
+
exports.renamedOutputHandle = renamedOutputHandle;
|
|
149
|
+
exports.soleEdgeToHandle = soleEdgeToHandle;
|
|
150
|
+
//# sourceMappingURL=connectionRules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionRules.js","sources":["../../../src/components/Workflow/connectionRules.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAaA;;;;;;;;;;;;;AAaG;SACa,iBAAiB,CAC/B,UAA8B,EAC9B,KAAY,EACZ,WAAwB,EAAA;IAExB,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAC1D,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM;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,CAAC,EAAE,CAAC;IAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAC1D,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC3D,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACzD,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9C,QAAA,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;IAC3C;AACA,IAAA,OAAO,SAAS;AAClB;;;;;;;"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* Validates a proposed connection against node-type handle declarations and the
|
|
4
|
+
* optional `canConnect` rules of both endpoints. Shared by the canvas
|
|
5
|
+
* `isValidConnection`, manual `onConnect`, edge reconnect, and palette
|
|
6
|
+
* auto-connect so every path enforces the same constraints:
|
|
7
|
+
* - no self-connections,
|
|
8
|
+
* - the source must expose an output handle (Start/Agent/etc., never End),
|
|
9
|
+
* - the target must expose an input handle (End/Agent/etc., never Start),
|
|
10
|
+
* - a named `sourceHandle`/`targetHandle` must be a declared handle id,
|
|
11
|
+
* - connections run exit→entry only: the `sourceHandle` must be an output of
|
|
12
|
+
* the source and the `targetHandle` an input of the target — never the
|
|
13
|
+
* reverse (no exit→exit / entry→entry wiring),
|
|
14
|
+
* - any node-type `canConnect` hook on either endpoint must return `true`.
|
|
15
|
+
*/
|
|
16
|
+
function isValidConnection(connection, graph, getNodeType) {
|
|
17
|
+
if (!connection.source || !connection.target)
|
|
18
|
+
return false;
|
|
19
|
+
if (connection.source === connection.target)
|
|
20
|
+
return false;
|
|
21
|
+
const source = graph.nodes.find((n) => n.id === connection.source);
|
|
22
|
+
const target = graph.nodes.find((n) => n.id === connection.target);
|
|
23
|
+
if (!source || !target)
|
|
24
|
+
return false;
|
|
25
|
+
const sourceDef = getNodeType(source.kind);
|
|
26
|
+
const targetDef = getNodeType(target.kind);
|
|
27
|
+
if (!sourceDef || !targetDef)
|
|
28
|
+
return false;
|
|
29
|
+
const sourceHandles = sourceDef.handles(source.config);
|
|
30
|
+
const targetHandles = targetDef.handles(target.config);
|
|
31
|
+
const sourceOutputs = sourceHandles.outputs;
|
|
32
|
+
const targetInputs = targetHandles.inputs;
|
|
33
|
+
// Source must be able to emit and target must be able to receive.
|
|
34
|
+
if (sourceOutputs.length === 0)
|
|
35
|
+
return false;
|
|
36
|
+
if (targetInputs.length === 0)
|
|
37
|
+
return false;
|
|
38
|
+
// A requested named handle must actually exist on the node.
|
|
39
|
+
if (connection.sourceHandle &&
|
|
40
|
+
!sourceOutputs.some((h) => h.id === connection.sourceHandle)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (connection.targetHandle &&
|
|
44
|
+
!targetInputs.some((h) => h.id === connection.targetHandle)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
// Exit→entry only. React Flow's strict connection mode already blocks
|
|
48
|
+
// output↔output (exit→exit) and input↔input drags, but enforce it here too so
|
|
49
|
+
// every path — manual connect, reconnect, programmatic edges — agrees: reject
|
|
50
|
+
// a `sourceHandle` that is actually an input of the source, or a `targetHandle`
|
|
51
|
+
// that is actually an output of the target.
|
|
52
|
+
if (connection.sourceHandle &&
|
|
53
|
+
sourceHandles.inputs.some((h) => h.id === connection.sourceHandle)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if (connection.targetHandle &&
|
|
57
|
+
targetHandles.outputs.some((h) => h.id === connection.targetHandle)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const ctx = {
|
|
61
|
+
source,
|
|
62
|
+
sourceHandle: connection.sourceHandle ?? undefined,
|
|
63
|
+
target,
|
|
64
|
+
targetHandle: connection.targetHandle ?? undefined,
|
|
65
|
+
graph,
|
|
66
|
+
};
|
|
67
|
+
for (const def of [sourceDef, targetDef]) {
|
|
68
|
+
if (def.canConnect && def.canConnect(ctx) !== true)
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolves a possibly-omitted handle id to the port it actually attaches to.
|
|
75
|
+
* Edges loaded from the backend / fixtures may omit the handle id for a node's
|
|
76
|
+
* default port, while the canvas renders every port with a concrete id (see
|
|
77
|
+
* `NodeShell`). React Flow attaches a handle-less edge to the node's first port
|
|
78
|
+
* of that type, so `undefined` and that first id denote the same port — collapse
|
|
79
|
+
* them before comparing or the lookup misses the edge (and we'd duplicate it).
|
|
80
|
+
*/
|
|
81
|
+
function resolveHandle(handle, ports) {
|
|
82
|
+
return handle ?? ports[0]?.id;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The existing outbound edge from a node's given handle, if any. Each exit
|
|
86
|
+
* point holds at most one edge: a single-output node is "taken" once it has any
|
|
87
|
+
* outbound edge; named handles (classify categories, if/else branches,
|
|
88
|
+
* guardrail pass/fail) are tracked individually by their `sourceHandle` id.
|
|
89
|
+
*
|
|
90
|
+
* Used by the canvas to decide whether a fresh drag from an exit should create
|
|
91
|
+
* a new edge or MOVE the one already there.
|
|
92
|
+
*/
|
|
93
|
+
function existingEdgeFromHandle(graph, getNodeType, source, sourceHandle) {
|
|
94
|
+
const node = graph.nodes.find((n) => n.id === source);
|
|
95
|
+
const outputs = node
|
|
96
|
+
? (getNodeType(node.kind)?.handles(node.config).outputs ?? [])
|
|
97
|
+
: [];
|
|
98
|
+
const want = resolveHandle(sourceHandle, outputs);
|
|
99
|
+
return graph.edges.find((e) => e.source === source &&
|
|
100
|
+
resolveHandle(e.sourceHandle ?? undefined, outputs) === want);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The sole inbound edge to a node's given input handle, or `undefined` when the
|
|
104
|
+
* handle has zero or more than one. Unlike exits (one edge each), entries allow
|
|
105
|
+
* fan-in: several sources can converge on one input. So "grab the existing edge
|
|
106
|
+
* and re-route it" is only unambiguous when exactly one edge points at the
|
|
107
|
+
* handle — with two or more there's no single edge to grab, and the drag should
|
|
108
|
+
* fall back to adding another fan-in edge.
|
|
109
|
+
*
|
|
110
|
+
* Used by the canvas to decide whether a drag that *starts* from an occupied
|
|
111
|
+
* entry should move that edge's source endpoint instead of creating a new edge.
|
|
112
|
+
*/
|
|
113
|
+
function soleEdgeToHandle(graph, getNodeType, target, targetHandle) {
|
|
114
|
+
const node = graph.nodes.find((n) => n.id === target);
|
|
115
|
+
const inputs = node
|
|
116
|
+
? (getNodeType(node.kind)?.handles(node.config).inputs ?? [])
|
|
117
|
+
: [];
|
|
118
|
+
const want = resolveHandle(targetHandle, inputs);
|
|
119
|
+
const inbound = graph.edges.filter((e) => e.target === target &&
|
|
120
|
+
resolveHandle(e.targetHandle ?? undefined, inputs) === want);
|
|
121
|
+
return inbound.length === 1 ? inbound[0] : undefined;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Detects a single output-handle id rename between two configs of the same
|
|
125
|
+
* node, so the edge on that handle can move with it instead of being orphaned.
|
|
126
|
+
* Handle ids that derive from mutable config (Classify's `cat_<name>`) change
|
|
127
|
+
* when the author edits a name; diffing the declared outputs yields the rename.
|
|
128
|
+
*
|
|
129
|
+
* Returns the pair only for an unambiguous 1:1 rename — a pure add or remove
|
|
130
|
+
* (which the per-field drawer does one at a time) yields `undefined`, leaving
|
|
131
|
+
* edges to their normal add/prune behaviour.
|
|
132
|
+
*/
|
|
133
|
+
function renamedOutputHandle(handles, oldConfig, newConfig) {
|
|
134
|
+
const oldIds = handles(oldConfig).outputs.map((h) => h.id);
|
|
135
|
+
const newIds = handles(newConfig).outputs.map((h) => h.id);
|
|
136
|
+
const removed = oldIds.filter((id) => !newIds.includes(id));
|
|
137
|
+
const added = newIds.filter((id) => !oldIds.includes(id));
|
|
138
|
+
if (removed.length === 1 && added.length === 1) {
|
|
139
|
+
return { from: removed[0], to: added[0] };
|
|
140
|
+
}
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { existingEdgeFromHandle, isValidConnection, renamedOutputHandle, soleEdgeToHandle };
|
|
145
|
+
//# sourceMappingURL=connectionRules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionRules.mjs","sources":["../../../src/components/Workflow/connectionRules.ts"],"sourcesContent":[null],"names":[],"mappings":";AAaA;;;;;;;;;;;;;AAaG;SACa,iBAAiB,CAC/B,UAA8B,EAC9B,KAAY,EACZ,WAAwB,EAAA;IAExB,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAC1D,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;IAEzD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,MAAM,CAAC;IAClE,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,MAAM,CAAC;AAClE,IAAA,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;IAEpC,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1C,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CA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,EAAE;AAC9C,QAAA,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;IAC3C;AACA,IAAA,OAAO,SAAS;AAClB;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GraphNode } from './Workflow.types';
|
|
2
|
+
/**
|
|
3
|
+
* Unique id for edges and other internal graph elements that aren't referenced
|
|
4
|
+
* by name in user content. Node IDs use `nextNodeId` for memorable
|
|
5
|
+
* `{kind}_{N}` ids instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare function genId(prefix: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Next sequential id for a node of the given kind, given the current node
|
|
10
|
+
* list. Returns ids like `agent_1`, `classify_2`, `guardrail_1`, etc., so
|
|
11
|
+
* authors can type them verbatim into `{{...}}` references.
|
|
12
|
+
*
|
|
13
|
+
* Start is a singleton — always `start`. Existing seeded graphs use hand-named
|
|
14
|
+
* ids like `agent_main` / `guard_out`; those don't match the `kind_<digits>`
|
|
15
|
+
* pattern and are ignored when computing the next number, so a fresh `agent`
|
|
16
|
+
* dropped next to `agent_main` becomes `agent_1`, not `agent_2`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function nextNodeId(kind: string, nodes: ReadonlyArray<GraphNode>): string;
|
|
19
|
+
/**
|
|
20
|
+
* A copy of `node` with a fresh sequential id, a deep-cloned config, and a
|
|
21
|
+
* slight offset. Pass the current node list so the duplicate's id continues
|
|
22
|
+
* the per-kind counter. If two duplicates race within the same React batch
|
|
23
|
+
* the second collides and the reducer's existing `addNode` dedupe drops it
|
|
24
|
+
* — one missing duplicate, no corrupt state.
|
|
25
|
+
*/
|
|
26
|
+
export declare function cloneNode(node: GraphNode, nodes: ReadonlyArray<GraphNode>): GraphNode;
|
|
27
|
+
//# sourceMappingURL=createNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createNode.d.ts","sourceRoot":"","sources":["../../../src/components/Workflow/createNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAO5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAC9B,MAAM,CAYR;AAKD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAC9B,SAAS,CAUX"}
|