@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,111 @@
|
|
|
1
|
+
import { Box, HStack, VStack } from '@chakra-ui/react';
|
|
2
|
+
import type { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Subtext, Subtitle } from '@/components/Typography';
|
|
6
|
+
|
|
7
|
+
import { NodeInspector } from '../canvas/DrawerShell';
|
|
8
|
+
import { Workflow } from '../Workflow';
|
|
9
|
+
import type { Graph, WorkflowSelection } from '../Workflow.types';
|
|
10
|
+
import { toyGraph, toyNodeTypes } from './toyNodeTypes';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The Workflow editor wired with toy (domain-free) node types. The same
|
|
14
|
+
* component powers FactChat's studio editor; the difference is entirely in the
|
|
15
|
+
* registered `nodeTypes` + the surrounding chrome the host composes.
|
|
16
|
+
*/
|
|
17
|
+
const meta: Meta<typeof Workflow> = {
|
|
18
|
+
title: 'Components/Workflow',
|
|
19
|
+
component: Workflow,
|
|
20
|
+
parameters: { layout: 'fullscreen' },
|
|
21
|
+
decorators: [
|
|
22
|
+
(Story) => (
|
|
23
|
+
<Box h="600px" w="100%" borderWidth="1px" borderColor="border.default">
|
|
24
|
+
<Story />
|
|
25
|
+
</Box>
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Default: palette + canvas + the built-in `<NodeInspector>` drawer. Drag a node
|
|
33
|
+
* from the palette, connect handles, undo/redo, auto-arrange, and click a node
|
|
34
|
+
* to edit it in the drawer.
|
|
35
|
+
*/
|
|
36
|
+
export const Default: StoryFn<typeof Workflow> = () => (
|
|
37
|
+
<Workflow nodeTypes={toyNodeTypes} defaultGraph={toyGraph as Graph}>
|
|
38
|
+
<NodeInspector />
|
|
39
|
+
</Workflow>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
/** Empty canvas — only the palette. Proves the cold-start (no nodes) path. */
|
|
43
|
+
export const Empty: StoryFn<typeof Workflow> = () => (
|
|
44
|
+
<Workflow nodeTypes={toyNodeTypes}>
|
|
45
|
+
<NodeInspector />
|
|
46
|
+
</Workflow>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* No `<NodeInspector>` — the host owns inspection. Clicking a node drives a panel
|
|
51
|
+
* rendered *outside* the canvas via `onSelectionChange`. This is the seam for
|
|
52
|
+
* "clicking a node controls a different part of the UI".
|
|
53
|
+
*/
|
|
54
|
+
export const CustomSelectionPanel: StoryFn<typeof Workflow> = () => {
|
|
55
|
+
const [selection, setSelection] = useState<WorkflowSelection | null>(null);
|
|
56
|
+
return (
|
|
57
|
+
<HStack h="100%" gap={0} align="stretch">
|
|
58
|
+
<Box flex="1" minW={0}>
|
|
59
|
+
<Workflow
|
|
60
|
+
nodeTypes={toyNodeTypes}
|
|
61
|
+
defaultGraph={toyGraph as Graph}
|
|
62
|
+
onSelectionChange={setSelection}
|
|
63
|
+
/>
|
|
64
|
+
</Box>
|
|
65
|
+
<VStack
|
|
66
|
+
w="280px"
|
|
67
|
+
p={4}
|
|
68
|
+
align="stretch"
|
|
69
|
+
borderLeftWidth="1px"
|
|
70
|
+
borderColor="border.default"
|
|
71
|
+
bg="bg.surface"
|
|
72
|
+
>
|
|
73
|
+
<Subtitle>My own panel</Subtitle>
|
|
74
|
+
<Subtext
|
|
75
|
+
color={selection ? undefined : 'slate.500'}
|
|
76
|
+
data-testid="selection-readout"
|
|
77
|
+
>
|
|
78
|
+
{selection
|
|
79
|
+
? `Selected ${selection.type}: ${selection.id}`
|
|
80
|
+
: 'Click a node or edge…'}
|
|
81
|
+
</Subtext>
|
|
82
|
+
</VStack>
|
|
83
|
+
</HStack>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Read-only preview: no palette, the inspector renders as a legible non-editing
|
|
89
|
+
* view (controls disabled). Used for embedded thumbnails / version previews.
|
|
90
|
+
*/
|
|
91
|
+
export const ReadOnly: StoryFn<typeof Workflow> = () => (
|
|
92
|
+
<Workflow
|
|
93
|
+
nodeTypes={toyNodeTypes}
|
|
94
|
+
defaultGraph={toyGraph as Graph}
|
|
95
|
+
readOnly
|
|
96
|
+
showPalette={false}
|
|
97
|
+
>
|
|
98
|
+
<NodeInspector />
|
|
99
|
+
</Workflow>
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
/** Inspector docked on the left (e.g. when another surface owns the right rail). */
|
|
103
|
+
export const LeftDockedInspector: StoryFn<typeof Workflow> = () => (
|
|
104
|
+
<Workflow
|
|
105
|
+
nodeTypes={toyNodeTypes}
|
|
106
|
+
defaultGraph={toyGraph as Graph}
|
|
107
|
+
showPalette={false}
|
|
108
|
+
>
|
|
109
|
+
<NodeInspector dock="left" />
|
|
110
|
+
</Workflow>
|
|
111
|
+
);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { VStack } from '@chakra-ui/react';
|
|
4
|
+
|
|
5
|
+
import { FormControl } from '@/components/FormControl';
|
|
6
|
+
import { FormLabel } from '@/components/FormLabel';
|
|
7
|
+
import { Bulb, Plus, Sparkles } from '@/components/Icon';
|
|
8
|
+
import { Input } from '@/components/Input';
|
|
9
|
+
|
|
10
|
+
import { defineNodeType, type NodeTypeDef } from '../Workflow.types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Toy node kinds used only by the stories. They prove the Workflow component is
|
|
14
|
+
* domain-free — these math primitives have nothing to do with any host app, yet
|
|
15
|
+
* exercise the full contract (handles, drawers, placement, output schema).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type InputCfg = { value: number };
|
|
19
|
+
type AddCfg = { label: string };
|
|
20
|
+
type OutputCfg = { label: string };
|
|
21
|
+
|
|
22
|
+
const inputNode = defineNodeType<InputCfg>({
|
|
23
|
+
kind: 'math.input',
|
|
24
|
+
label: 'Number',
|
|
25
|
+
description: 'Constant input',
|
|
26
|
+
category: 'trigger',
|
|
27
|
+
icon: Sparkles,
|
|
28
|
+
defaultConfig: () => ({ value: 1 }),
|
|
29
|
+
placement: { role: 'start' },
|
|
30
|
+
handles: () => ({ inputs: [], outputs: [{ id: 'out' }] }),
|
|
31
|
+
outputSchema: () => ({
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: { value: { type: 'number' } },
|
|
34
|
+
required: ['value'],
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
}),
|
|
37
|
+
getInstanceTitle: (cfg) => `${cfg.value}`,
|
|
38
|
+
renderDrawer: ({ config, onChange, readOnly }) => (
|
|
39
|
+
<FormControl>
|
|
40
|
+
<FormLabel>Value</FormLabel>
|
|
41
|
+
<Input
|
|
42
|
+
type="number"
|
|
43
|
+
value={config.value}
|
|
44
|
+
disabled={readOnly}
|
|
45
|
+
onChange={(e) =>
|
|
46
|
+
onChange({ ...config, value: Number(e.target.value) || 0 })
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
</FormControl>
|
|
50
|
+
),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const addNode = defineNodeType<AddCfg>({
|
|
54
|
+
kind: 'math.add',
|
|
55
|
+
label: 'Add',
|
|
56
|
+
description: 'a + b',
|
|
57
|
+
category: 'logic',
|
|
58
|
+
icon: Plus,
|
|
59
|
+
defaultConfig: () => ({ label: 'sum' }),
|
|
60
|
+
handles: () => ({
|
|
61
|
+
inputs: [
|
|
62
|
+
{ id: 'a', label: 'a' },
|
|
63
|
+
{ id: 'b', label: 'b' },
|
|
64
|
+
],
|
|
65
|
+
outputs: [{ id: 'out' }],
|
|
66
|
+
}),
|
|
67
|
+
outputSchema: () => ({
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: { value: { type: 'number' } },
|
|
70
|
+
required: ['value'],
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
}),
|
|
73
|
+
getInstanceTitle: (cfg) => cfg.label,
|
|
74
|
+
getMetaChips: (cfg) => [cfg.label],
|
|
75
|
+
renderDrawer: ({ config, onChange, readOnly }) => (
|
|
76
|
+
<VStack align="stretch" gap={3}>
|
|
77
|
+
<FormControl>
|
|
78
|
+
<FormLabel>Label</FormLabel>
|
|
79
|
+
<Input
|
|
80
|
+
value={config.label}
|
|
81
|
+
disabled={readOnly}
|
|
82
|
+
onChange={(e) => onChange({ ...config, label: e.target.value })}
|
|
83
|
+
/>
|
|
84
|
+
</FormControl>
|
|
85
|
+
</VStack>
|
|
86
|
+
),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const outputNode = defineNodeType<OutputCfg>({
|
|
90
|
+
kind: 'math.output',
|
|
91
|
+
label: 'Print',
|
|
92
|
+
description: 'Terminal output',
|
|
93
|
+
category: 'output',
|
|
94
|
+
icon: Bulb,
|
|
95
|
+
defaultConfig: () => ({ label: 'result' }),
|
|
96
|
+
placement: { minCount: 1, role: 'end' },
|
|
97
|
+
handles: () => ({ inputs: [{ id: 'in' }], outputs: [] }),
|
|
98
|
+
getInstanceTitle: (cfg) => cfg.label,
|
|
99
|
+
renderDrawer: ({ config, onChange, readOnly }) => (
|
|
100
|
+
<FormControl>
|
|
101
|
+
<FormLabel>Label</FormLabel>
|
|
102
|
+
<Input
|
|
103
|
+
value={config.label}
|
|
104
|
+
disabled={readOnly}
|
|
105
|
+
onChange={(e) => onChange({ ...config, label: e.target.value })}
|
|
106
|
+
/>
|
|
107
|
+
</FormControl>
|
|
108
|
+
),
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export const toyNodeTypes: NodeTypeDef[] = [inputNode, addNode, outputNode];
|
|
112
|
+
|
|
113
|
+
/** A small starter graph: two inputs feeding an Add, feeding a Print. */
|
|
114
|
+
export const toyGraph = {
|
|
115
|
+
nodes: [
|
|
116
|
+
{
|
|
117
|
+
id: 'a',
|
|
118
|
+
kind: 'math.input',
|
|
119
|
+
position: { x: 0, y: 0 },
|
|
120
|
+
config: { value: 2 },
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: 'b',
|
|
124
|
+
kind: 'math.input',
|
|
125
|
+
position: { x: 0, y: 140 },
|
|
126
|
+
config: { value: 3 },
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'sum',
|
|
130
|
+
kind: 'math.add',
|
|
131
|
+
position: { x: 280, y: 70 },
|
|
132
|
+
config: { label: 'sum' },
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'print',
|
|
136
|
+
kind: 'math.output',
|
|
137
|
+
position: { x: 560, y: 70 },
|
|
138
|
+
config: { label: 'result' },
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
edges: [
|
|
142
|
+
{ id: 'e1', source: 'a', target: 'sum', targetHandle: 'a' },
|
|
143
|
+
{ id: 'e2', source: 'b', target: 'sum', targetHandle: 'b' },
|
|
144
|
+
{ id: 'e3', source: 'sum', target: 'print' },
|
|
145
|
+
],
|
|
146
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { createElement, type ReactNode } from 'react';
|
|
2
|
+
import { renderHook } from '@testing-library/react';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
import { emptyGraph } from './graphReducer';
|
|
6
|
+
import { useWorkflowIssueMessage } from './useWorkflowIssueMessage';
|
|
7
|
+
import type { Issue, WorkflowTranslate } from './Workflow.types';
|
|
8
|
+
import { WorkflowProvider } from './WorkflowContext';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The hook is domain-free: it maps an issue's `code` to a deterministic
|
|
12
|
+
* `workflow_be_<code>` key and resolves it through the host-injected
|
|
13
|
+
* translator, falling back to the raw `issue.message` when the host has no
|
|
14
|
+
* matching key. These tests inject a stub translator that mimics the common
|
|
15
|
+
* "return the key when it's missing" contract, so they assert the mapping /
|
|
16
|
+
* normalization / fallback behavior without depending on any host catalog.
|
|
17
|
+
*/
|
|
18
|
+
const CATALOG: Record<string, string> = {
|
|
19
|
+
workflow_be_agent_model_required: 'Pick a model for the agent.',
|
|
20
|
+
workflow_be_cycle_detected: 'The graph has a cycle.',
|
|
21
|
+
workflow_be_if_else_input_attribute_unknown:
|
|
22
|
+
'Unknown attribute {invalidPath}; try {suggestedPath}.',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const translate: WorkflowTranslate = (key, vars) => {
|
|
26
|
+
const template = CATALOG[key];
|
|
27
|
+
if (template === undefined) return key; // mirror "missing key → key"
|
|
28
|
+
return template.replace(/\{(\w+)\}/g, (_, name) =>
|
|
29
|
+
String(vars?.[name] ?? `{${name}}`)
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const wrapper = ({ children }: { children: ReactNode }) =>
|
|
34
|
+
createElement(
|
|
35
|
+
WorkflowProvider,
|
|
36
|
+
{
|
|
37
|
+
graph: emptyGraph,
|
|
38
|
+
dispatch: () => {},
|
|
39
|
+
undo: () => {},
|
|
40
|
+
redo: () => {},
|
|
41
|
+
canUndo: false,
|
|
42
|
+
canRedo: false,
|
|
43
|
+
nodeTypes: {},
|
|
44
|
+
translate,
|
|
45
|
+
issues: [],
|
|
46
|
+
},
|
|
47
|
+
children
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const renderResolver = () =>
|
|
51
|
+
renderHook(() => useWorkflowIssueMessage(), { wrapper }).result;
|
|
52
|
+
|
|
53
|
+
describe('useWorkflowIssueMessage', () => {
|
|
54
|
+
it('resolves the workflow_be_<code> key via the injected translator', () => {
|
|
55
|
+
const result = renderResolver();
|
|
56
|
+
const issue: Issue = {
|
|
57
|
+
severity: 'error',
|
|
58
|
+
code: 'agent_model_required',
|
|
59
|
+
message: 'RAW_BE_FALLBACK',
|
|
60
|
+
};
|
|
61
|
+
expect(result.current(issue)).toBe('Pick a model for the agent.');
|
|
62
|
+
expect(result.current(issue)).not.toBe('RAW_BE_FALLBACK');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('falls back to issue.message for an unknown code', () => {
|
|
66
|
+
const result = renderResolver();
|
|
67
|
+
const issue: Issue = {
|
|
68
|
+
severity: 'error',
|
|
69
|
+
code: 'totally_unknown_code',
|
|
70
|
+
message: 'RAW_BE_FALLBACK',
|
|
71
|
+
};
|
|
72
|
+
expect(result.current(issue)).toBe('RAW_BE_FALLBACK');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('normalizes a dotted/uppercased code to the snake_case key', () => {
|
|
76
|
+
const result = renderResolver();
|
|
77
|
+
const issue: Issue = {
|
|
78
|
+
severity: 'error',
|
|
79
|
+
code: 'CYCLE.DETECTED',
|
|
80
|
+
message: 'RAW_BE_FALLBACK',
|
|
81
|
+
};
|
|
82
|
+
expect(result.current(issue)).toBe('The graph has a cycle.');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('interpolates messageVars into the resolved copy', () => {
|
|
86
|
+
const result = renderResolver();
|
|
87
|
+
const issue: Issue = {
|
|
88
|
+
severity: 'error',
|
|
89
|
+
code: 'if_else_input_attribute_unknown',
|
|
90
|
+
message: 'RAW_BE_FALLBACK',
|
|
91
|
+
messageVars: {
|
|
92
|
+
invalidPath: 'input.answer',
|
|
93
|
+
suggestedPath: 'input.parsed.answer',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const message = result.current(issue);
|
|
97
|
+
expect(message).toContain('input.answer');
|
|
98
|
+
expect(message).toContain('input.parsed.answer');
|
|
99
|
+
expect(message).not.toBe('RAW_BE_FALLBACK');
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
|
|
5
|
+
import type { Issue } from './Workflow.types';
|
|
6
|
+
import { useWorkflowTranslate } from './WorkflowContext';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Maps backend workflow validation issue codes to translated messages.
|
|
10
|
+
* Mirrors the connectors error-message hook precedent
|
|
11
|
+
* (`useConnectorErrorMessage`): the backend owns validation and returns raw
|
|
12
|
+
* English in `Issue.message` (kept as a fallback for tests / logs), while
|
|
13
|
+
* rendering surfaces resolve the localized copy here.
|
|
14
|
+
*
|
|
15
|
+
* Node kind names (Agent, Classify, etc.) are intentionally kept in English
|
|
16
|
+
* across the UI; issues that interpolate them pass the raw `def.label` string
|
|
17
|
+
* in `messageVars`, and Korean sentences read naturally with the
|
|
18
|
+
* mixed-language token (e.g. "Agent는 최소 1개 이상 필요합니다").
|
|
19
|
+
*/
|
|
20
|
+
export const useWorkflowIssueMessage = () => {
|
|
21
|
+
const translate = useWorkflowTranslate();
|
|
22
|
+
|
|
23
|
+
return useCallback(
|
|
24
|
+
(issue: Issue): string => {
|
|
25
|
+
// Coerce all interpolation values to strings — `useTranslate`
|
|
26
|
+
// returns a React-element array when a numeric var is passed,
|
|
27
|
+
// which loses its string-ness through the `as string` cast and
|
|
28
|
+
// breaks downstream code that joins or trims the message.
|
|
29
|
+
const vars = issue.messageVars
|
|
30
|
+
? Object.fromEntries(
|
|
31
|
+
Object.entries(issue.messageVars).map(([k, v]) => [k, String(v)])
|
|
32
|
+
)
|
|
33
|
+
: undefined;
|
|
34
|
+
const t = (key: string) => translate(key, vars) as string;
|
|
35
|
+
// Backend (`INVALID_GRAPH`) issues arrive with the validator's own
|
|
36
|
+
// snake_case `code` (e.g. `agent_model_required`), localized under a
|
|
37
|
+
// deterministic `workflow_be_<code>` key. Normalize defensively so a
|
|
38
|
+
// dotted/uppercased variant still resolves. `useTranslate` returns the
|
|
39
|
+
// key itself when no entry exists, so a missing key falls back to the
|
|
40
|
+
// raw English `issue.message`.
|
|
41
|
+
const beKey = `workflow_be_${issue.code
|
|
42
|
+
.toLowerCase()
|
|
43
|
+
.replace(/[.-]/g, '_')}`;
|
|
44
|
+
const beMessage = t(beKey);
|
|
45
|
+
return beMessage === beKey ? issue.message : beMessage;
|
|
46
|
+
},
|
|
47
|
+
[translate]
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
import { cloneNode } from './createNode';
|
|
6
|
+
import type { GraphNode } from './Workflow.types';
|
|
7
|
+
import { useWorkflow } from './WorkflowContext';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* True while a keystroke is being typed into a form field. Graph-level
|
|
11
|
+
* shortcuts must yield so the field keeps normal text editing — including
|
|
12
|
+
* its own native undo.
|
|
13
|
+
*/
|
|
14
|
+
const isEditingText = (target: EventTarget | null): boolean => {
|
|
15
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
16
|
+
return (
|
|
17
|
+
target.tagName === 'INPUT' ||
|
|
18
|
+
target.tagName === 'TEXTAREA' ||
|
|
19
|
+
target.isContentEditable
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Keyboard shortcuts for the workflow editor: undo/redo, copy/paste and
|
|
25
|
+
* duplicate of the selected node, Delete/Backspace to remove the selected node
|
|
26
|
+
* OR edge, and Escape to close the inspector. No-ops in read-only mode (the
|
|
27
|
+
* Behavior-tab preview). React Flow's own Delete/Backspace binding still fires
|
|
28
|
+
* for canvas-focused selections; this mirrors it so a selection made elsewhere
|
|
29
|
+
* (e.g. via the inspector) is still removable.
|
|
30
|
+
*/
|
|
31
|
+
export function useWorkflowKeyboard(): void {
|
|
32
|
+
const {
|
|
33
|
+
undo,
|
|
34
|
+
redo,
|
|
35
|
+
readOnly,
|
|
36
|
+
graph,
|
|
37
|
+
dispatch,
|
|
38
|
+
editor,
|
|
39
|
+
getNodeType,
|
|
40
|
+
setDrawerTarget,
|
|
41
|
+
setSelectedNodeId,
|
|
42
|
+
setSelectedEdgeId,
|
|
43
|
+
} = useWorkflow();
|
|
44
|
+
const clipboardRef = useRef<GraphNode | null>(null);
|
|
45
|
+
const selectedNodeId = editor.selectedNodeId;
|
|
46
|
+
const selectedEdgeId = editor.selectedEdgeId;
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (readOnly) return;
|
|
50
|
+
|
|
51
|
+
const pickSelected = (): GraphNode | null => {
|
|
52
|
+
const node = graph.nodes.find((n) => n.id === selectedNodeId);
|
|
53
|
+
if (!node || getNodeType(node.kind)?.placement?.pinned) return null;
|
|
54
|
+
return node;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const onKeyDown = (e: KeyboardEvent) => {
|
|
58
|
+
// Text-editing shortcuts belong to the focused field, not the graph.
|
|
59
|
+
if (isEditingText(e.target)) return;
|
|
60
|
+
|
|
61
|
+
if (e.key === 'Escape') {
|
|
62
|
+
setDrawerTarget(null);
|
|
63
|
+
setSelectedNodeId(null);
|
|
64
|
+
setSelectedEdgeId(null);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
69
|
+
// Delete a selected edge (node deletion stays with React Flow's own
|
|
70
|
+
// binding, which also clears edges attached to the removed node).
|
|
71
|
+
if (
|
|
72
|
+
selectedEdgeId &&
|
|
73
|
+
graph.edges.some((ed) => ed.id === selectedEdgeId)
|
|
74
|
+
) {
|
|
75
|
+
dispatch({ type: 'deleteEdge', id: selectedEdgeId });
|
|
76
|
+
setSelectedEdgeId(null);
|
|
77
|
+
setDrawerTarget(null);
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!e.metaKey && !e.ctrlKey) return;
|
|
83
|
+
const key = e.key.toLowerCase();
|
|
84
|
+
|
|
85
|
+
if (key === 'z') {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
if (e.shiftKey) redo();
|
|
88
|
+
else undo();
|
|
89
|
+
} else if (key === 'y') {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
redo();
|
|
92
|
+
} else if (key === 'c') {
|
|
93
|
+
const node = pickSelected();
|
|
94
|
+
if (node) clipboardRef.current = node;
|
|
95
|
+
} else if (key === 'v') {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
if (clipboardRef.current) {
|
|
98
|
+
dispatch({
|
|
99
|
+
type: 'addNode',
|
|
100
|
+
node: cloneNode(clipboardRef.current, graph.nodes),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
} else if (key === 'd') {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
const node = pickSelected();
|
|
106
|
+
if (node)
|
|
107
|
+
dispatch({ type: 'addNode', node: cloneNode(node, graph.nodes) });
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
window.addEventListener('keydown', onKeyDown);
|
|
112
|
+
return () => window.removeEventListener('keydown', onKeyDown);
|
|
113
|
+
}, [
|
|
114
|
+
undo,
|
|
115
|
+
redo,
|
|
116
|
+
readOnly,
|
|
117
|
+
graph,
|
|
118
|
+
dispatch,
|
|
119
|
+
selectedNodeId,
|
|
120
|
+
selectedEdgeId,
|
|
121
|
+
getNodeType,
|
|
122
|
+
setDrawerTarget,
|
|
123
|
+
setSelectedNodeId,
|
|
124
|
+
setSelectedEdgeId,
|
|
125
|
+
]);
|
|
126
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -88,6 +88,7 @@ export * from './components/Tag';
|
|
|
88
88
|
export * from './components/Textarea';
|
|
89
89
|
export * from './components/Toast';
|
|
90
90
|
export * from './components/Tooltip';
|
|
91
|
+
export * from './components/Workflow';
|
|
91
92
|
// Typography Components (excluding Link to avoid conflict with Link component)
|
|
92
93
|
export {
|
|
93
94
|
H1,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest test setup — loaded before the suite runs.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import '@testing-library/jest-dom/vitest';
|
|
6
|
+
|
|
7
|
+
// jsdom doesn't implement element scrolling; canvas components that autoscroll
|
|
8
|
+
// (e.g. focusing a field) call scrollTo on container elements in tests.
|
|
9
|
+
if (!Element.prototype.scrollTo) {
|
|
10
|
+
Element.prototype.scrollTo = () => {};
|
|
11
|
+
}
|