@mindlogic-ai/logician-ui 3.1.0 → 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/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/package.json +10 -2
- package/src/components/Icon/_constants/iconList.ts +35 -0
- package/src/components/Icon/index.tsx +20 -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 +1 -0
- package/src/test-support/setup.ts +11 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ReactNode, useMemo, useRef } from 'react';
|
|
4
|
+
import { HStack, Stack } from '@chakra-ui/react';
|
|
5
|
+
|
|
6
|
+
import { AlertTriangle, TbAlertCircle } from '@/components/Icon';
|
|
7
|
+
import { Subtext } from '@/components/Typography';
|
|
8
|
+
|
|
9
|
+
import { useWorkflowIssueMessage } from '../../useWorkflowIssueMessage';
|
|
10
|
+
import { useWorkflow } from '../../WorkflowContext';
|
|
11
|
+
import { pickPrimaryIssue, severityColorToken } from '../issueSeverity';
|
|
12
|
+
import { useFieldFocusRequest } from '../useFieldFocusRequest';
|
|
13
|
+
|
|
14
|
+
export type FieldTone = 'default' | 'danger' | 'warning';
|
|
15
|
+
|
|
16
|
+
export type FieldToneState = {
|
|
17
|
+
tone: FieldTone;
|
|
18
|
+
/**
|
|
19
|
+
* Resolved Chakra color token for the current tone, or undefined when
|
|
20
|
+
* tone is 'default'. Pass directly to a child input's `borderColor` —
|
|
21
|
+
* Chakra leaves the input's default border in place when undefined.
|
|
22
|
+
*/
|
|
23
|
+
borderColor: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* True when the field is in an error state — pass to logician-ui controls
|
|
26
|
+
* (e.g. `SelectField`, `ComboboxField`) whose API exposes `invalid`
|
|
27
|
+
* instead of accepting a raw `borderColor`. Warning state does not flip
|
|
28
|
+
* this — the helper text below already conveys it.
|
|
29
|
+
*/
|
|
30
|
+
invalid: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type FieldWrapperProps = {
|
|
34
|
+
/** Owning node — used to look up field-level issues. */
|
|
35
|
+
nodeId: string;
|
|
36
|
+
/** Stable key — must match the `fieldKey` emitted by `def.validate()`. */
|
|
37
|
+
fieldKey: string;
|
|
38
|
+
label: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Render-prop. Receives the resolved tone for the field so the input
|
|
41
|
+
* can apply its own `borderColor` directly — avoids drawing a wrapping
|
|
42
|
+
* ring on top of the input's own border (which double-borders).
|
|
43
|
+
*/
|
|
44
|
+
children: (state: FieldToneState) => ReactNode;
|
|
45
|
+
/** Optional helper text shown beneath the input when no issue is present. */
|
|
46
|
+
helperText?: ReactNode;
|
|
47
|
+
/** Optional trailing slot in the label row — e.g. an info popover trigger. */
|
|
48
|
+
labelAction?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Layout wrapper for a single inspector field. Reads the field's validation
|
|
53
|
+
* state from WorkflowContext (`issuesByField[`${nodeId}.${fieldKey}`]`) and
|
|
54
|
+
* passes a resolved tone to the render-prop child so the input applies its
|
|
55
|
+
* own `borderColor` — no wrapping ring, no double border.
|
|
56
|
+
*
|
|
57
|
+
* Deliberately not a Chakra `FormControl`: the editor's child controls
|
|
58
|
+
* (SelectField, Switch) bring their own `Field.Root`, and double-wrapping
|
|
59
|
+
* triggers zag's duplicate-id collision (see the schema-fields block in
|
|
60
|
+
* `agentNodeType` for the prior fix). Children own their own label/id
|
|
61
|
+
* association; this wrapper just decorates the layout.
|
|
62
|
+
*
|
|
63
|
+
* Also wires the `fieldFocusRequest` channel: when the canvas validation
|
|
64
|
+
* banner asks to jump to `(nodeId, fieldKey)`, the matching wrapper scrolls
|
|
65
|
+
* into view and focuses its input, then clears the request so a re-render
|
|
66
|
+
* doesn't refocus repeatedly.
|
|
67
|
+
*/
|
|
68
|
+
export function FieldWrapper({
|
|
69
|
+
nodeId,
|
|
70
|
+
fieldKey,
|
|
71
|
+
label,
|
|
72
|
+
children,
|
|
73
|
+
helperText,
|
|
74
|
+
labelAction,
|
|
75
|
+
}: FieldWrapperProps) {
|
|
76
|
+
const { issuesByField } = useWorkflow();
|
|
77
|
+
const resolveIssueMessage = useWorkflowIssueMessage();
|
|
78
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
79
|
+
const issues = issuesByField[`${nodeId}.${fieldKey}`] ?? [];
|
|
80
|
+
const issue = useMemo(() => pickPrimaryIssue(issues), [issues]);
|
|
81
|
+
|
|
82
|
+
const tone: FieldTone =
|
|
83
|
+
issue?.severity === 'error'
|
|
84
|
+
? 'danger'
|
|
85
|
+
: issue?.severity === 'warning'
|
|
86
|
+
? 'warning'
|
|
87
|
+
: 'default';
|
|
88
|
+
const toneColor =
|
|
89
|
+
tone === 'default' ? undefined : severityColorToken(issue!.severity);
|
|
90
|
+
|
|
91
|
+
useFieldFocusRequest(nodeId, fieldKey, containerRef);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Stack ref={containerRef} gap={1.5}>
|
|
95
|
+
<HStack justify="space-between" align="center" gap={2}>
|
|
96
|
+
<Subtext fontWeight="semibold" color="slate.1300">
|
|
97
|
+
{label}
|
|
98
|
+
</Subtext>
|
|
99
|
+
{labelAction ?? null}
|
|
100
|
+
</HStack>
|
|
101
|
+
{children({ tone, borderColor: toneColor, invalid: tone === 'danger' })}
|
|
102
|
+
{issue ? (
|
|
103
|
+
<HStack gap={1} align="center">
|
|
104
|
+
<Subtext color={toneColor} display="flex" alignItems="center">
|
|
105
|
+
{tone === 'danger' ? (
|
|
106
|
+
<TbAlertCircle boxSize="xs" />
|
|
107
|
+
) : (
|
|
108
|
+
<AlertTriangle boxSize="xs" />
|
|
109
|
+
)}
|
|
110
|
+
</Subtext>
|
|
111
|
+
<Subtext color={toneColor}>{resolveIssueMessage(issue)}</Subtext>
|
|
112
|
+
</HStack>
|
|
113
|
+
) : helperText ? (
|
|
114
|
+
<Subtext color="slate.900">{helperText}</Subtext>
|
|
115
|
+
) : null}
|
|
116
|
+
</Stack>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { PropsWithChildren } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Card, type CardProps } from '@/components/Card';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shared width token (Chakra sizes scale) for the cards that float over the
|
|
9
|
+
* workflow canvas. Kept in one place so the inspector drawer and any host
|
|
10
|
+
* surface that takes the same slot (e.g. the studio test-chat card) can't drift.
|
|
11
|
+
*/
|
|
12
|
+
export const FLOATING_CARD_WIDTH = '96';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Shared chrome for a card floating over the workflow canvas: fixed width,
|
|
16
|
+
* rounded corners, drop shadow, clipped overflow. Positioning is left to the
|
|
17
|
+
* caller (the inspector docks it in its own column; a host may absolutely
|
|
18
|
+
* position it) — pass any `CardProps` through to place and size it.
|
|
19
|
+
*/
|
|
20
|
+
export function FloatingCard({
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
}: PropsWithChildren<CardProps>) {
|
|
24
|
+
return (
|
|
25
|
+
<Card
|
|
26
|
+
width={FLOATING_CARD_WIDTH}
|
|
27
|
+
p={0}
|
|
28
|
+
borderRadius="lg"
|
|
29
|
+
boxShadow="md"
|
|
30
|
+
minHeight={0}
|
|
31
|
+
overflow="hidden"
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</Card>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FLOATING_CARD_WIDTH, FloatingCard } from './FloatingCard';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo, useMemo } from 'react';
|
|
4
|
+
import type { NodeProps } from '@xyflow/react';
|
|
5
|
+
|
|
6
|
+
import { AlertOctagon } from '@/components/Icon';
|
|
7
|
+
|
|
8
|
+
import type { GraphNode } from '../../Workflow.types';
|
|
9
|
+
import { useWorkflow } from '../../WorkflowContext';
|
|
10
|
+
import { NodeShell } from '../NodeShell';
|
|
11
|
+
import type { WorkflowReactFlowNode } from './GenericNode.types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Single React Flow node renderer used for every node kind. Looks up the
|
|
15
|
+
* registered NodeTypeDef and pulls declarative content from
|
|
16
|
+
* `getInstanceTitle` + `getMetaChips`. Nodes whose body doesn't fit that
|
|
17
|
+
* shape (e.g. Note) provide a `renderNode` escape hatch.
|
|
18
|
+
*
|
|
19
|
+
* Data passed via React Flow is just the node id — we resolve everything
|
|
20
|
+
* else from context. This keeps the React Flow node payload small and
|
|
21
|
+
* ensures every component reads the same source of truth.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export const GenericNode = memo(function GenericNode(
|
|
25
|
+
props: NodeProps<WorkflowReactFlowNode>
|
|
26
|
+
) {
|
|
27
|
+
const { data, selected } = props;
|
|
28
|
+
const { graph, getNodeType, issuesByNode, editor, categoryTokens } =
|
|
29
|
+
useWorkflow();
|
|
30
|
+
|
|
31
|
+
const node = graph.nodes.find((n) => n.id === data.nodeId) as
|
|
32
|
+
| GraphNode
|
|
33
|
+
| undefined;
|
|
34
|
+
const def = node ? getNodeType(node.kind) : undefined;
|
|
35
|
+
|
|
36
|
+
// Exits that already have an edge: their name shows on the edge's label badge,
|
|
37
|
+
// so NodeShell suppresses the duplicate handle label for them. Memoized so the
|
|
38
|
+
// Set identity is stable across renders — a fresh Set every render would defeat
|
|
39
|
+
// NodeShell's own `memo`. Computed before the early return to keep the hook
|
|
40
|
+
// call unconditional; an unmatched `node?.id` just yields an empty set.
|
|
41
|
+
const connectedOutputIds = useMemo(
|
|
42
|
+
() =>
|
|
43
|
+
new Set(
|
|
44
|
+
graph.edges
|
|
45
|
+
.filter((e) => e.source === node?.id && e.sourceHandle)
|
|
46
|
+
.map((e) => e.sourceHandle as string)
|
|
47
|
+
),
|
|
48
|
+
[graph.edges, node?.id]
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
if (!node || !def) {
|
|
52
|
+
return (
|
|
53
|
+
<NodeShell
|
|
54
|
+
label={node?.kind ?? 'unknown'}
|
|
55
|
+
instanceTitle="unregistered kind"
|
|
56
|
+
// safety category surfaces the broken-ness in the icon tile, not
|
|
57
|
+
// only in the error ring chrome.
|
|
58
|
+
category="safety"
|
|
59
|
+
icon={AlertOctagon}
|
|
60
|
+
selected={!!selected}
|
|
61
|
+
runState="error"
|
|
62
|
+
issues={[
|
|
63
|
+
{
|
|
64
|
+
severity: 'error',
|
|
65
|
+
code: 'node.unknown_kind',
|
|
66
|
+
message: `Unknown node kind: ${node?.kind ?? ''}`,
|
|
67
|
+
},
|
|
68
|
+
]}
|
|
69
|
+
inputs={[]}
|
|
70
|
+
outputs={[]}
|
|
71
|
+
categoryTokens={categoryTokens}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const { inputs, outputs } = def.handles(node.config);
|
|
77
|
+
const backendIssues = issuesByNode[node.id] ?? [];
|
|
78
|
+
// FE-computed, graph-aware advisories (e.g. an unconnected Guardrail exit)
|
|
79
|
+
// surface in the same warning/error chrome as backend issues.
|
|
80
|
+
const graphIssues = def.getGraphIssues?.({ node, graph }) ?? [];
|
|
81
|
+
const issues = graphIssues.length
|
|
82
|
+
? [...backendIssues, ...graphIssues]
|
|
83
|
+
: backendIssues;
|
|
84
|
+
const runState = editor.runStates[node.id] ?? 'idle';
|
|
85
|
+
|
|
86
|
+
const CustomRender = def.renderNode;
|
|
87
|
+
const customBody = CustomRender ? (
|
|
88
|
+
<CustomRender
|
|
89
|
+
id={node.id}
|
|
90
|
+
config={node.config}
|
|
91
|
+
selected={!!selected}
|
|
92
|
+
runState={runState}
|
|
93
|
+
issues={issues}
|
|
94
|
+
/>
|
|
95
|
+
) : undefined;
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<NodeShell
|
|
99
|
+
label={def.label}
|
|
100
|
+
instanceTitle={def.getInstanceTitle?.(node.config) ?? node.id}
|
|
101
|
+
metaChips={def.getMetaChips?.(node.config)}
|
|
102
|
+
category={def.category}
|
|
103
|
+
icon={def.icon}
|
|
104
|
+
selected={!!selected}
|
|
105
|
+
runState={runState}
|
|
106
|
+
issues={issues}
|
|
107
|
+
inputs={inputs}
|
|
108
|
+
outputs={outputs}
|
|
109
|
+
connectedOutputIds={connectedOutputIds}
|
|
110
|
+
categoryTokens={categoryTokens}
|
|
111
|
+
customBody={customBody}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Node } from '@xyflow/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The payload React Flow passes to our custom node renderer. We only ship
|
|
5
|
+
* the node id; everything else is resolved from `useWorkflow()` so React
|
|
6
|
+
* Flow's internal state stays small.
|
|
7
|
+
*/
|
|
8
|
+
export type WorkflowNodeData = { nodeId: string };
|
|
9
|
+
|
|
10
|
+
export type WorkflowReactFlowNode = Node<WorkflowNodeData, 'workflow'>;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
|
+
import { Box, Flex, VStack } from '@chakra-ui/react';
|
|
5
|
+
import { useReactFlow } from '@xyflow/react';
|
|
6
|
+
|
|
7
|
+
import { TbChevronDown } from '@/components/Icon';
|
|
8
|
+
import { Spinner } from '@/components/Spinner';
|
|
9
|
+
import { Subtext, Text } from '@/components/Typography';
|
|
10
|
+
|
|
11
|
+
import { useWorkflowIssueMessage } from '../../useWorkflowIssueMessage';
|
|
12
|
+
import type { GraphNode, Issue, NodeTypeDef } from '../../Workflow.types';
|
|
13
|
+
import { useWorkflow, useWorkflowTranslate } from '../../WorkflowContext';
|
|
14
|
+
import { endpointTitle } from '../EdgeInspector';
|
|
15
|
+
import { IssueList } from '../IssueList';
|
|
16
|
+
|
|
17
|
+
const NODELESS_GROUP = '__graph__';
|
|
18
|
+
|
|
19
|
+
type NodeIssueBucket = {
|
|
20
|
+
/** Stable key — node id, or NODELESS_GROUP for graph-wide issues. */
|
|
21
|
+
key: string;
|
|
22
|
+
/** Resolved node + label when the group is tied to a specific node. */
|
|
23
|
+
node: GraphNode | null;
|
|
24
|
+
def: NodeTypeDef | null;
|
|
25
|
+
errors: Issue[];
|
|
26
|
+
warnings: Issue[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Same fallback chain as everywhere else (instance title → kind label → id),
|
|
30
|
+
// so an unnamed node groups under "End", not its raw `end_1` id.
|
|
31
|
+
const getNodeTitle = (node: GraphNode, def: NodeTypeDef | null): string =>
|
|
32
|
+
endpointTitle(node, def ?? undefined, node.id);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Floating banner listing the current graph's validation issues — both the
|
|
36
|
+
* live validator output and backend `INVALID_GRAPH` errors fed in via
|
|
37
|
+
* `externalIssues`. Issues group by node (then severity); clicking an issue
|
|
38
|
+
* selects and pans to its node. Hidden in read-only mode (the Behavior-tab
|
|
39
|
+
* preview).
|
|
40
|
+
*
|
|
41
|
+
* `paletteToggleVisible` shifts the banner clear of the floating `+` palette
|
|
42
|
+
* toggle, which docks in the same top-left corner once the palette is
|
|
43
|
+
* collapsed — otherwise the two overlays would overlap.
|
|
44
|
+
*/
|
|
45
|
+
export function GraphErrorBanner({
|
|
46
|
+
paletteToggleVisible = false,
|
|
47
|
+
}: {
|
|
48
|
+
paletteToggleVisible?: boolean;
|
|
49
|
+
}) {
|
|
50
|
+
const {
|
|
51
|
+
issues,
|
|
52
|
+
graph,
|
|
53
|
+
readOnly,
|
|
54
|
+
validating,
|
|
55
|
+
getNodeType,
|
|
56
|
+
setSelectedNodeId,
|
|
57
|
+
revealInspector,
|
|
58
|
+
requestFieldFocus,
|
|
59
|
+
} = useWorkflow();
|
|
60
|
+
const { fitView } = useReactFlow();
|
|
61
|
+
const translate = useWorkflowTranslate();
|
|
62
|
+
const resolveIssueMessage = useWorkflowIssueMessage();
|
|
63
|
+
const [open, setOpen] = useState(false);
|
|
64
|
+
|
|
65
|
+
// Stringify counts before interpolation — see `useWorkflowIssueMessage`
|
|
66
|
+
// for the underlying `useTranslate` quirk this guards against.
|
|
67
|
+
const summarize = (errorCount: number, warningCount: number): string => {
|
|
68
|
+
const parts: string[] = [];
|
|
69
|
+
if (errorCount > 0) {
|
|
70
|
+
parts.push(
|
|
71
|
+
translate('workflow_issues_summary_errors', {
|
|
72
|
+
count: String(errorCount),
|
|
73
|
+
}) as string
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
if (warningCount > 0) {
|
|
77
|
+
parts.push(
|
|
78
|
+
translate('workflow_issues_summary_warnings', {
|
|
79
|
+
count: String(warningCount),
|
|
80
|
+
}) as string
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return parts.join(', ');
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const { errorCount, warningCount, groups } = useMemo(() => {
|
|
87
|
+
let errors = 0;
|
|
88
|
+
let warnings = 0;
|
|
89
|
+
// Preserve insertion order from `graph.nodes` so the dropdown matches
|
|
90
|
+
// canvas left-to-right reading order; graph-wide issues are appended last.
|
|
91
|
+
const byKey = new Map<string, NodeIssueBucket>();
|
|
92
|
+
const nodeById = new Map(graph.nodes.map((n) => [n.id, n] as const));
|
|
93
|
+
|
|
94
|
+
const getOrCreate = (key: string): NodeIssueBucket => {
|
|
95
|
+
let g = byKey.get(key);
|
|
96
|
+
if (!g) {
|
|
97
|
+
const node = nodeById.get(key) ?? null;
|
|
98
|
+
g = {
|
|
99
|
+
key,
|
|
100
|
+
node,
|
|
101
|
+
def: node ? (getNodeType(node.kind) ?? null) : null,
|
|
102
|
+
errors: [],
|
|
103
|
+
warnings: [],
|
|
104
|
+
};
|
|
105
|
+
byKey.set(key, g);
|
|
106
|
+
}
|
|
107
|
+
return g;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
for (const issue of issues) {
|
|
111
|
+
if (issue.severity === 'error') errors += 1;
|
|
112
|
+
else warnings += 1;
|
|
113
|
+
const key = issue.nodeId ?? NODELESS_GROUP;
|
|
114
|
+
const g = getOrCreate(key);
|
|
115
|
+
if (issue.severity === 'error') g.errors.push(issue);
|
|
116
|
+
else g.warnings.push(issue);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Order: graph-wide bucket first (cycle / unreachable / etc. block the
|
|
120
|
+
// whole canvas and deserve top billing), then per-node buckets in
|
|
121
|
+
// canvas order.
|
|
122
|
+
const ordered: NodeIssueBucket[] = [];
|
|
123
|
+
const graphWide = byKey.get(NODELESS_GROUP);
|
|
124
|
+
if (graphWide) ordered.push(graphWide);
|
|
125
|
+
for (const node of graph.nodes) {
|
|
126
|
+
const g = byKey.get(node.id);
|
|
127
|
+
if (g) ordered.push(g);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return { errorCount: errors, warningCount: warnings, groups: ordered };
|
|
131
|
+
}, [issues, graph.nodes, getNodeType]);
|
|
132
|
+
|
|
133
|
+
// Noise guard: only surface the "validating" affordance when we're
|
|
134
|
+
// re-checking a graph that ALREADY shows issues (the retained `displayIssues`
|
|
135
|
+
// the host passes in during a save). A clean graph (no issues) stays hidden
|
|
136
|
+
// mid-save — the header save-status spinner already covers that case — so
|
|
137
|
+
// editing a valid graph never flashes a banner on every keystroke.
|
|
138
|
+
if (readOnly || issues.length === 0) return null;
|
|
139
|
+
|
|
140
|
+
const showValidating = validating;
|
|
141
|
+
|
|
142
|
+
const jumpToNode = (nodeId?: string) => {
|
|
143
|
+
if (!nodeId || !graph.nodes.some((n) => n.id === nodeId)) return;
|
|
144
|
+
setSelectedNodeId(nodeId);
|
|
145
|
+
// revealInspector so jumping to a node from the banner also restores the
|
|
146
|
+
// inspector when it's parked (test mode), not just sets the drawer target.
|
|
147
|
+
revealInspector({ type: 'node', id: nodeId });
|
|
148
|
+
void fitView({ nodes: [{ id: nodeId }], duration: 400, maxZoom: 1.2 });
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const jumpToIssue = (issue: Issue) => {
|
|
152
|
+
if (!issue.nodeId) return;
|
|
153
|
+
jumpToNode(issue.nodeId);
|
|
154
|
+
if (issue.fieldKey) {
|
|
155
|
+
requestFieldFocus(issue.nodeId, issue.fieldKey);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<Box
|
|
161
|
+
position="absolute"
|
|
162
|
+
top={3}
|
|
163
|
+
// Clear the floating `+` palette toggle (md IconButton at left={4}) when
|
|
164
|
+
// it's showing, so the banner sits beside it rather than under it.
|
|
165
|
+
left={paletteToggleVisible ? 16 : 3}
|
|
166
|
+
zIndex={5}
|
|
167
|
+
maxW="md"
|
|
168
|
+
bg="bg.surface"
|
|
169
|
+
borderWidth="1px"
|
|
170
|
+
borderColor={errorCount > 0 ? 'danger.main' : 'warning.main'}
|
|
171
|
+
borderRadius="md"
|
|
172
|
+
boxShadow="sm"
|
|
173
|
+
overflow="hidden"
|
|
174
|
+
>
|
|
175
|
+
{showValidating ? (
|
|
176
|
+
<Flex
|
|
177
|
+
align="center"
|
|
178
|
+
gap={2}
|
|
179
|
+
px={3}
|
|
180
|
+
py={2}
|
|
181
|
+
bg="slate.50"
|
|
182
|
+
borderBottomWidth="1px"
|
|
183
|
+
borderColor="slate.200"
|
|
184
|
+
>
|
|
185
|
+
<Spinner size="xs" />
|
|
186
|
+
<Subtext fontWeight="semibold" color="slate.1100">
|
|
187
|
+
{translate('workflow_issues_validating') as string}
|
|
188
|
+
</Subtext>
|
|
189
|
+
</Flex>
|
|
190
|
+
) : null}
|
|
191
|
+
<Box
|
|
192
|
+
as="button"
|
|
193
|
+
w="100%"
|
|
194
|
+
display="flex"
|
|
195
|
+
alignItems="center"
|
|
196
|
+
justifyContent="space-between"
|
|
197
|
+
gap={3}
|
|
198
|
+
px={3}
|
|
199
|
+
py={2}
|
|
200
|
+
bg="transparent"
|
|
201
|
+
border="none"
|
|
202
|
+
cursor="pointer"
|
|
203
|
+
opacity={showValidating ? 0.6 : 1}
|
|
204
|
+
transition="opacity 0.15s"
|
|
205
|
+
onClick={() => setOpen((o) => !o)}
|
|
206
|
+
>
|
|
207
|
+
<Text fontSize="sm" fontWeight="semibold" color="slate.1300">
|
|
208
|
+
{summarize(errorCount, warningCount)}
|
|
209
|
+
</Text>
|
|
210
|
+
<TbChevronDown
|
|
211
|
+
boxSize="xs"
|
|
212
|
+
color="slate.900"
|
|
213
|
+
transform={open ? 'rotate(180deg)' : 'none'}
|
|
214
|
+
transition="transform 0.15s"
|
|
215
|
+
/>
|
|
216
|
+
</Box>
|
|
217
|
+
{open ? (
|
|
218
|
+
<VStack
|
|
219
|
+
align="stretch"
|
|
220
|
+
gap={0}
|
|
221
|
+
maxH="80"
|
|
222
|
+
overflowY="auto"
|
|
223
|
+
opacity={showValidating ? 0.6 : 1}
|
|
224
|
+
transition="opacity 0.15s"
|
|
225
|
+
borderTopWidth="1px"
|
|
226
|
+
borderColor="slate.200"
|
|
227
|
+
>
|
|
228
|
+
{groups.map((group, gi) => (
|
|
229
|
+
<Box
|
|
230
|
+
key={group.key}
|
|
231
|
+
borderTopWidth={gi === 0 ? 0 : '1px'}
|
|
232
|
+
borderColor="slate.200"
|
|
233
|
+
>
|
|
234
|
+
<Flex
|
|
235
|
+
align="center"
|
|
236
|
+
gap={2}
|
|
237
|
+
px={3}
|
|
238
|
+
py={1.5}
|
|
239
|
+
bg="slate.50"
|
|
240
|
+
cursor={group.node ? 'pointer' : 'default'}
|
|
241
|
+
_hover={group.node ? { bg: 'slate.100' } : undefined}
|
|
242
|
+
onClick={group.node ? () => jumpToNode(group.key) : undefined}
|
|
243
|
+
>
|
|
244
|
+
{group.def?.icon ? (
|
|
245
|
+
<Box
|
|
246
|
+
color="slate.1100"
|
|
247
|
+
display="flex"
|
|
248
|
+
alignItems="center"
|
|
249
|
+
flexShrink={0}
|
|
250
|
+
>
|
|
251
|
+
<group.def.icon boxSize="xs" />
|
|
252
|
+
</Box>
|
|
253
|
+
) : null}
|
|
254
|
+
<Subtext fontWeight="semibold" color="slate.1300" truncate>
|
|
255
|
+
{group.node
|
|
256
|
+
? getNodeTitle(group.node, group.def)
|
|
257
|
+
: translate('workflow_drawer_graph_group_title')}
|
|
258
|
+
</Subtext>
|
|
259
|
+
</Flex>
|
|
260
|
+
{group.errors.length > 0 ? (
|
|
261
|
+
<IssueList
|
|
262
|
+
label={translate('workflow_issues_errors_label') as string}
|
|
263
|
+
tone="error"
|
|
264
|
+
issues={group.errors}
|
|
265
|
+
onIssueClick={group.node ? jumpToIssue : undefined}
|
|
266
|
+
resolveMessage={resolveIssueMessage}
|
|
267
|
+
/>
|
|
268
|
+
) : null}
|
|
269
|
+
{group.warnings.length > 0 ? (
|
|
270
|
+
<IssueList
|
|
271
|
+
label={translate('workflow_issues_warnings_label') as string}
|
|
272
|
+
tone="warning"
|
|
273
|
+
issues={group.warnings}
|
|
274
|
+
onIssueClick={group.node ? jumpToIssue : undefined}
|
|
275
|
+
resolveMessage={resolveIssueMessage}
|
|
276
|
+
/>
|
|
277
|
+
) : null}
|
|
278
|
+
</Box>
|
|
279
|
+
))}
|
|
280
|
+
</VStack>
|
|
281
|
+
) : null}
|
|
282
|
+
</Box>
|
|
283
|
+
);
|
|
284
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GraphErrorBanner } from './GraphErrorBanner';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { NodeCategory } from '../../Workflow.types';
|
|
2
|
+
import type { CategoryTokenMap, CategoryTokens } from './IconTile.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Default mapping from the six categories to logician-ui semantic color
|
|
6
|
+
* tokens. "fg" tints the icon, "bg" fills the tile background. Output and
|
|
7
|
+
* Note don't map cleanly to a `colorPalette` so they're spelled out with
|
|
8
|
+
* raw token pairs.
|
|
9
|
+
*
|
|
10
|
+
* Host apps that want to retheme can override the map via the
|
|
11
|
+
* `categoryTokens` prop on `<Workflow>` — see WorkflowContext.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_CATEGORY_TOKENS: CategoryTokenMap = {
|
|
14
|
+
trigger: {
|
|
15
|
+
bg: 'success.lightest',
|
|
16
|
+
fg: 'success.main',
|
|
17
|
+
border: 'slate.300',
|
|
18
|
+
},
|
|
19
|
+
ai: { bg: 'primary.lightest', fg: 'primary.main', border: 'slate.300' },
|
|
20
|
+
logic: {
|
|
21
|
+
bg: 'secondary.lightest',
|
|
22
|
+
fg: 'secondary.main',
|
|
23
|
+
border: 'slate.300',
|
|
24
|
+
},
|
|
25
|
+
safety: { bg: 'danger.lightest', fg: 'danger.main', border: 'slate.300' },
|
|
26
|
+
output: { bg: 'slate.50', fg: 'slate.1200', border: 'slate.300' },
|
|
27
|
+
// Note's `border` doubles as the body border so it reads as warm, not gray.
|
|
28
|
+
note: { bg: 'warning.lightest', fg: 'warning.dark', border: 'warning.light' },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns tokens for a category, falling back to `output` if a host passes
|
|
33
|
+
* an unknown category (e.g. from a JSON graph payload).
|
|
34
|
+
*/
|
|
35
|
+
export function getCategoryTokens(
|
|
36
|
+
category: NodeCategory,
|
|
37
|
+
map: CategoryTokenMap = DEFAULT_CATEGORY_TOKENS
|
|
38
|
+
): CategoryTokens {
|
|
39
|
+
return map[category] ?? DEFAULT_CATEGORY_TOKENS.output;
|
|
40
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Box } from '@chakra-ui/react';
|
|
4
|
+
|
|
5
|
+
import { getCategoryTokens } from './IconTile.styles';
|
|
6
|
+
import type { IconTileProps } from './IconTile.types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The 24×24 tile that carries the only category-derived color in a node.
|
|
10
|
+
* Background uses the category's `bg` token; icon uses the `fg` token.
|
|
11
|
+
*
|
|
12
|
+
* `size` is the tile's outer side in px; the icon renders at the `xs`
|
|
13
|
+
* t-shirt token (16px) to match logician-ui's Icon sizing scale.
|
|
14
|
+
*/
|
|
15
|
+
export function IconTile({
|
|
16
|
+
category,
|
|
17
|
+
icon: Icon,
|
|
18
|
+
size = 24,
|
|
19
|
+
tokens,
|
|
20
|
+
}: IconTileProps) {
|
|
21
|
+
const c = getCategoryTokens(category, tokens);
|
|
22
|
+
return (
|
|
23
|
+
<Box
|
|
24
|
+
width={`${size}px`}
|
|
25
|
+
height={`${size}px`}
|
|
26
|
+
borderRadius="sm"
|
|
27
|
+
bg={c.bg}
|
|
28
|
+
color={c.fg}
|
|
29
|
+
display="grid"
|
|
30
|
+
placeItems="center"
|
|
31
|
+
flexShrink={0}
|
|
32
|
+
>
|
|
33
|
+
<Icon boxSize="xs" />
|
|
34
|
+
</Box>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CreatedIcon } from '@/components/Icon';
|
|
2
|
+
|
|
3
|
+
import type { NodeCategory } from '../../Workflow.types';
|
|
4
|
+
|
|
5
|
+
export type CategoryTokens = { bg: string; fg: string; border: string };
|
|
6
|
+
export type CategoryTokenMap = Record<NodeCategory, CategoryTokens>;
|
|
7
|
+
|
|
8
|
+
export type IconTileProps = {
|
|
9
|
+
category: NodeCategory;
|
|
10
|
+
icon: CreatedIcon;
|
|
11
|
+
size?: number;
|
|
12
|
+
tokens?: CategoryTokenMap;
|
|
13
|
+
};
|