@mindlogic-ai/logician-ui 3.1.0-alpha.9 → 3.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icon/_constants/iconList.d.ts +1 -1
- package/dist/components/Icon/_constants/iconList.d.ts.map +1 -1
- package/dist/components/Icon/_constants/iconList.js +18 -0
- package/dist/components/Icon/_constants/iconList.js.map +1 -1
- package/dist/components/Icon/_constants/iconList.mjs +20 -2
- package/dist/components/Icon/_constants/iconList.mjs.map +1 -1
- package/dist/components/Icon/index.d.ts +2 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +20 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Icon/index.mjs +4 -2
- package/dist/components/Icon/index.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +20 -4
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +20 -4
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/Workflow/Workflow.d.ts +3 -0
- package/dist/components/Workflow/Workflow.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.js +109 -0
- package/dist/components/Workflow/Workflow.js.map +1 -0
- package/dist/components/Workflow/Workflow.mjs +107 -0
- package/dist/components/Workflow/Workflow.mjs.map +1 -0
- package/dist/components/Workflow/Workflow.translations.json.js +164 -0
- package/dist/components/Workflow/Workflow.translations.json.js.map +1 -0
- package/dist/components/Workflow/Workflow.translations.json.mjs +138 -0
- package/dist/components/Workflow/Workflow.translations.json.mjs.map +1 -0
- package/dist/components/Workflow/Workflow.types.d.ts +435 -0
- package/dist/components/Workflow/Workflow.types.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.types.js +19 -0
- package/dist/components/Workflow/Workflow.types.js.map +1 -0
- package/dist/components/Workflow/Workflow.types.mjs +16 -0
- package/dist/components/Workflow/Workflow.types.mjs.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.d.ts +10 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.d.ts.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.js +163 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.js.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.mjs +159 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.mjs.map +1 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.types.d.ts +117 -0
- package/dist/components/Workflow/WorkflowContext/WorkflowContext.types.d.ts.map +1 -0
- package/dist/components/Workflow/WorkflowContext/index.d.ts +3 -0
- package/dist/components/Workflow/WorkflowContext/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts +19 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js +44 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs +42 -0
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.d.ts +10 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.js +531 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.mjs +529 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts +53 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js +96 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs +93 -0
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.d.ts +27 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.js +70 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.mjs +68 -0
- package/dist/components/Workflow/canvas/Canvas/CanvasControls.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.d.ts +10 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js +106 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs +104 -0
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.d.ts +13 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.js +18 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.js.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.mjs +16 -0
- package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.mjs.map +1 -0
- package/dist/components/Workflow/canvas/Canvas/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/Canvas/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.d.ts +30 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js +34 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs +32 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs.map +1 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/CollapsibleSection/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts +37 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js +33 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs +31 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.d.ts +16 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js +54 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs +52 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.d.ts +27 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js +178 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs +176 -0
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs.map +1 -0
- package/dist/components/Workflow/canvas/DrawerShell/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/DrawerShell/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.d.ts +12 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js +68 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs +66 -0
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.d.ts +19 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.js +35 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.js.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.mjs +32 -0
- package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.mjs.map +1 -0
- package/dist/components/Workflow/canvas/EdgeInspector/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/EdgeInspector/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.d.ts +54 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js +56 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs +54 -0
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs.map +1 -0
- package/dist/components/Workflow/canvas/FieldWrapper/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/FieldWrapper/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.d.ts +16 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.js +25 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.js.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.mjs +22 -0
- package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.mjs.map +1 -0
- package/dist/components/Workflow/canvas/FloatingCard/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/FloatingCard/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.d.ts +14 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.js +61 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.js.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.mjs +59 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.mjs.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.types.d.ts +11 -0
- package/dist/components/Workflow/canvas/GenericNode/GenericNode.types.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GenericNode/index.d.ts +3 -0
- package/dist/components/Workflow/canvas/GenericNode/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts +15 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js +145 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs +143 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs.map +1 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/GraphErrorBanner/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.d.ts +10 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.js +21 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.js.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.mjs +19 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.mjs.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts +18 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js +40 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs +37 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.types.d.ts +15 -0
- package/dist/components/Workflow/canvas/IconTile/IconTile.types.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IconTile/index.d.ts +4 -0
- package/dist/components/Workflow/canvas/IconTile/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.d.ts +24 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.js +34 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.js.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.mjs +32 -0
- package/dist/components/Workflow/canvas/IssueList/IssueList.mjs.map +1 -0
- package/dist/components/Workflow/canvas/IssueList/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/IssueList/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts +9 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.js +94 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.js.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs +92 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.d.ts +7 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.js +13 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.mjs +10 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts +10 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js +28 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs +26 -0
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodePalette/index.d.ts +4 -0
- package/dist/components/Workflow/canvas/NodePalette/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts +3 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.js +137 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.js.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs +135 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts +66 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js +87 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs +77 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts +35 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/NodeShell/index.d.ts +4 -0
- package/dist/components/Workflow/canvas/NodeShell/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts +15 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js +14 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs +12 -0
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs.map +1 -0
- package/dist/components/Workflow/canvas/SeverityDot/index.d.ts +2 -0
- package/dist/components/Workflow/canvas/SeverityDot/index.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.d.ts +23 -0
- package/dist/components/Workflow/canvas/issueSeverity.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.js +51 -0
- package/dist/components/Workflow/canvas/issueSeverity.js.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.mjs +47 -0
- package/dist/components/Workflow/canvas/issueSeverity.mjs.map +1 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.d.ts +14 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.js +48 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.js.map +1 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.mjs +46 -0
- package/dist/components/Workflow/canvas/useFieldFocusRequest.mjs.map +1 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.d.ts +12 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.js +17 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.js.map +1 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.mjs +15 -0
- package/dist/components/Workflow/canvas/workflowLabelProps.mjs.map +1 -0
- package/dist/components/Workflow/connectionRules.d.ts +59 -0
- package/dist/components/Workflow/connectionRules.d.ts.map +1 -0
- package/dist/components/Workflow/connectionRules.js +150 -0
- package/dist/components/Workflow/connectionRules.js.map +1 -0
- package/dist/components/Workflow/connectionRules.mjs +145 -0
- package/dist/components/Workflow/connectionRules.mjs.map +1 -0
- package/dist/components/Workflow/createNode.d.ts +27 -0
- package/dist/components/Workflow/createNode.d.ts.map +1 -0
- package/dist/components/Workflow/createNode.js +66 -0
- package/dist/components/Workflow/createNode.js.map +1 -0
- package/dist/components/Workflow/createNode.mjs +62 -0
- package/dist/components/Workflow/createNode.mjs.map +1 -0
- package/dist/components/Workflow/graphHistory.d.ts +23 -0
- package/dist/components/Workflow/graphHistory.d.ts.map +1 -0
- package/dist/components/Workflow/graphHistory.js +73 -0
- package/dist/components/Workflow/graphHistory.js.map +1 -0
- package/dist/components/Workflow/graphHistory.mjs +70 -0
- package/dist/components/Workflow/graphHistory.mjs.map +1 -0
- package/dist/components/Workflow/graphObserver.d.ts +13 -0
- package/dist/components/Workflow/graphObserver.d.ts.map +1 -0
- package/dist/components/Workflow/graphObserver.js +11 -0
- package/dist/components/Workflow/graphObserver.js.map +1 -0
- package/dist/components/Workflow/graphObserver.mjs +8 -0
- package/dist/components/Workflow/graphObserver.mjs.map +1 -0
- package/dist/components/Workflow/graphReducer.d.ts +75 -0
- package/dist/components/Workflow/graphReducer.d.ts.map +1 -0
- package/dist/components/Workflow/graphReducer.js +122 -0
- package/dist/components/Workflow/graphReducer.js.map +1 -0
- package/dist/components/Workflow/graphReducer.mjs +119 -0
- package/dist/components/Workflow/graphReducer.mjs.map +1 -0
- package/dist/components/Workflow/index.d.ts +22 -0
- package/dist/components/Workflow/index.d.ts.map +1 -0
- package/dist/components/Workflow/layout/autoLayout.d.ts +49 -0
- package/dist/components/Workflow/layout/autoLayout.d.ts.map +1 -0
- package/dist/components/Workflow/layout/autoLayout.js +149 -0
- package/dist/components/Workflow/layout/autoLayout.js.map +1 -0
- package/dist/components/Workflow/layout/autoLayout.mjs +146 -0
- package/dist/components/Workflow/layout/autoLayout.mjs.map +1 -0
- package/dist/components/Workflow/stories/toyNodeTypes.d.ts +40 -0
- package/dist/components/Workflow/stories/toyNodeTypes.d.ts.map +1 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.d.ts +15 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.d.ts.map +1 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.js +45 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.js.map +1 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.mjs +43 -0
- package/dist/components/Workflow/useWorkflowIssueMessage.mjs.map +1 -0
- package/dist/components/Workflow/useWorkflowKeyboard.d.ts +10 -0
- package/dist/components/Workflow/useWorkflowKeyboard.d.ts.map +1 -0
- package/dist/components/Workflow/useWorkflowKeyboard.js +116 -0
- package/dist/components/Workflow/useWorkflowKeyboard.js.map +1 -0
- package/dist/components/Workflow/useWorkflowKeyboard.mjs +114 -0
- package/dist/components/Workflow/useWorkflowKeyboard.mjs.map +1 -0
- package/dist/icons.js +17 -0
- package/dist/icons.js.map +1 -1
- package/dist/icons.mjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -1
- package/dist/test-support/setup.d.ts +5 -0
- package/dist/test-support/setup.d.ts.map +1 -0
- package/dist/theme/colors.d.ts +196 -44
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +184 -22
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +184 -22
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/global.d.ts.map +1 -1
- package/dist/theme/global.js +30 -2
- package/dist/theme/global.js.map +1 -1
- package/dist/theme/global.mjs +30 -2
- package/dist/theme/global.mjs.map +1 -1
- package/package.json +10 -2
- package/src/components/Icon/_constants/iconList.ts +35 -0
- package/src/components/Icon/index.tsx +20 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +21 -4
- package/src/components/Workflow/README.md +362 -0
- package/src/components/Workflow/Workflow.translations.json +112 -0
- package/src/components/Workflow/Workflow.tsx +189 -0
- package/src/components/Workflow/Workflow.types.ts +496 -0
- package/src/components/Workflow/WorkflowContext/WorkflowContext.tsx +215 -0
- package/src/components/Workflow/WorkflowContext/WorkflowContext.types.ts +122 -0
- package/src/components/Workflow/WorkflowContext/index.ts +10 -0
- package/src/components/Workflow/WorkflowContext/workflowSelection.test.tsx +93 -0
- package/src/components/Workflow/canvas/Canvas/BranchLabelBadge.tsx +69 -0
- package/src/components/Workflow/canvas/Canvas/Canvas.styles.ts +91 -0
- package/src/components/Workflow/canvas/Canvas/Canvas.tsx +773 -0
- package/src/components/Workflow/canvas/Canvas/CanvasControls.tsx +178 -0
- package/src/components/Workflow/canvas/Canvas/LabeledEdge.tsx +198 -0
- package/src/components/Workflow/canvas/Canvas/edgeLabelVariant.test.ts +26 -0
- package/src/components/Workflow/canvas/Canvas/edgeLabelVariant.ts +23 -0
- package/src/components/Workflow/canvas/Canvas/index.ts +1 -0
- package/src/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.tsx +96 -0
- package/src/components/Workflow/canvas/CollapsibleSection/index.ts +4 -0
- package/src/components/Workflow/canvas/DrawerShell/DrawerHeader.tsx +104 -0
- package/src/components/Workflow/canvas/DrawerShell/DrawerIssues.tsx +115 -0
- package/src/components/Workflow/canvas/DrawerShell/DrawerShell.tsx +408 -0
- package/src/components/Workflow/canvas/DrawerShell/index.ts +2 -0
- package/src/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.tsx +135 -0
- package/src/components/Workflow/canvas/EdgeInspector/endpointTitle.ts +38 -0
- package/src/components/Workflow/canvas/EdgeInspector/index.ts +2 -0
- package/src/components/Workflow/canvas/FieldWrapper/FieldWrapper.tsx +118 -0
- package/src/components/Workflow/canvas/FieldWrapper/index.ts +6 -0
- package/src/components/Workflow/canvas/FloatingCard/FloatingCard.tsx +37 -0
- package/src/components/Workflow/canvas/FloatingCard/index.ts +1 -0
- package/src/components/Workflow/canvas/GenericNode/GenericNode.tsx +114 -0
- package/src/components/Workflow/canvas/GenericNode/GenericNode.types.ts +10 -0
- package/src/components/Workflow/canvas/GenericNode/index.ts +5 -0
- package/src/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.tsx +284 -0
- package/src/components/Workflow/canvas/GraphErrorBanner/index.ts +1 -0
- package/src/components/Workflow/canvas/IconTile/IconTile.styles.ts +40 -0
- package/src/components/Workflow/canvas/IconTile/IconTile.tsx +36 -0
- package/src/components/Workflow/canvas/IconTile/IconTile.types.ts +13 -0
- package/src/components/Workflow/canvas/IconTile/index.ts +7 -0
- package/src/components/Workflow/canvas/IssueList/IssueList.tsx +84 -0
- package/src/components/Workflow/canvas/IssueList/index.ts +1 -0
- package/src/components/Workflow/canvas/NodePalette/NodePalette.styles.ts +7 -0
- package/src/components/Workflow/canvas/NodePalette/NodePalette.tsx +180 -0
- package/src/components/Workflow/canvas/NodePalette/NodePaletteToggle.tsx +39 -0
- package/src/components/Workflow/canvas/NodePalette/index.ts +3 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.styles.ts +84 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.tsx +321 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.types.ts +45 -0
- package/src/components/Workflow/canvas/NodeShell/index.ts +8 -0
- package/src/components/Workflow/canvas/SeverityDot/SeverityDot.tsx +33 -0
- package/src/components/Workflow/canvas/SeverityDot/index.ts +1 -0
- package/src/components/Workflow/canvas/issueSeverity.ts +48 -0
- package/src/components/Workflow/canvas/useFieldFocusRequest.ts +54 -0
- package/src/components/Workflow/canvas/workflowLabelProps.ts +11 -0
- package/src/components/Workflow/connectionRules.test.ts +326 -0
- package/src/components/Workflow/connectionRules.ts +190 -0
- package/src/components/Workflow/createNode.test.ts +61 -0
- package/src/components/Workflow/createNode.ts +67 -0
- package/src/components/Workflow/graphHistory.test.ts +178 -0
- package/src/components/Workflow/graphHistory.ts +91 -0
- package/src/components/Workflow/graphObserver.ts +21 -0
- package/src/components/Workflow/graphReducer.test.ts +314 -0
- package/src/components/Workflow/graphReducer.ts +196 -0
- package/src/components/Workflow/index.ts +74 -0
- package/src/components/Workflow/layout/autoLayout.test.ts +170 -0
- package/src/components/Workflow/layout/autoLayout.ts +200 -0
- package/src/components/Workflow/stories/Workflow.stories.tsx +111 -0
- package/src/components/Workflow/stories/toyNodeTypes.tsx +146 -0
- package/src/components/Workflow/useWorkflowIssueMessage.test.ts +101 -0
- package/src/components/Workflow/useWorkflowIssueMessage.ts +49 -0
- package/src/components/Workflow/useWorkflowKeyboard.ts +126 -0
- package/src/index.ts +1 -0
- package/src/test-support/setup.ts +11 -0
- package/src/theme/SemanticTokens.mdx +61 -7
- package/src/theme/colors.ts +216 -26
- package/src/theme/global.ts +31 -2
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from 'react';
|
|
12
|
+
|
|
13
|
+
import type { Issue, RunState } from '../Workflow.types';
|
|
14
|
+
import type {
|
|
15
|
+
DrawerTarget,
|
|
16
|
+
WorkflowContextValue,
|
|
17
|
+
WorkflowProviderProps,
|
|
18
|
+
} from './WorkflowContext.types';
|
|
19
|
+
|
|
20
|
+
const WorkflowContext = createContext<WorkflowContextValue | null>(null);
|
|
21
|
+
|
|
22
|
+
export function useWorkflow(): WorkflowContextValue {
|
|
23
|
+
const ctx = useContext(WorkflowContext);
|
|
24
|
+
if (!ctx) {
|
|
25
|
+
throw new Error('useWorkflow must be used inside a <Workflow> component');
|
|
26
|
+
}
|
|
27
|
+
return ctx;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Convenience accessor for the host-injected translator. Canvas chrome calls
|
|
32
|
+
* this exactly where it would otherwise reach for an app-level `useTranslate`,
|
|
33
|
+
* keeping the core free of any direct i18n dependency.
|
|
34
|
+
*/
|
|
35
|
+
export function useWorkflowTranslate() {
|
|
36
|
+
return useWorkflow().translate;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function WorkflowProvider({
|
|
40
|
+
graph,
|
|
41
|
+
dispatch,
|
|
42
|
+
undo,
|
|
43
|
+
redo,
|
|
44
|
+
canUndo,
|
|
45
|
+
canRedo,
|
|
46
|
+
nodeTypes,
|
|
47
|
+
translate,
|
|
48
|
+
issues,
|
|
49
|
+
onArrange,
|
|
50
|
+
readOnly = false,
|
|
51
|
+
onSelectionChange,
|
|
52
|
+
validating = false,
|
|
53
|
+
categoryTokens,
|
|
54
|
+
hostBridge,
|
|
55
|
+
children,
|
|
56
|
+
}: WorkflowProviderProps) {
|
|
57
|
+
const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
|
|
58
|
+
const [selectedEdgeId, setSelectedEdgeId] = useState<string | null>(null);
|
|
59
|
+
const [drawerTarget, setDrawerTarget] = useState<DrawerTarget | null>(null);
|
|
60
|
+
const [runStates, setRunStates] = useState<Record<string, RunState>>({});
|
|
61
|
+
const [fieldFocusRequest, setFieldFocusRequest] = useState<{
|
|
62
|
+
nodeId: string;
|
|
63
|
+
fieldKey: string;
|
|
64
|
+
} | null>(null);
|
|
65
|
+
|
|
66
|
+
const requestFieldFocus = useCallback((nodeId: string, fieldKey: string) => {
|
|
67
|
+
setFieldFocusRequest({ nodeId, fieldKey });
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
const consumeFieldFocusRequest = useCallback(
|
|
71
|
+
() => setFieldFocusRequest(null),
|
|
72
|
+
[]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const setRunState = useCallback((id: string, state: RunState) => {
|
|
76
|
+
setRunStates((prev) => ({ ...prev, [id]: state }));
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
const resetRunStates = useCallback(() => setRunStates({}), []);
|
|
80
|
+
|
|
81
|
+
// Single entry point for "select this element": every open-intent caller
|
|
82
|
+
// (canvas node/edge click, edge label, error-banner jump) routes through here
|
|
83
|
+
// so selection lives in one place. The host is notified via the
|
|
84
|
+
// `onSelectionChange` effect below.
|
|
85
|
+
const revealInspector = useCallback(
|
|
86
|
+
(target: DrawerTarget) => setDrawerTarget(target),
|
|
87
|
+
[]
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// Notify the host whenever the selected element changes — so it can drive its
|
|
91
|
+
// own inspector / side panel anywhere in its layout. Keyed on the target
|
|
92
|
+
// identity (set fresh per click), so graph edits don't re-fire it; the
|
|
93
|
+
// node/edge snapshot is read at fire time via a ref to avoid stale closures.
|
|
94
|
+
const graphRef = useRef(graph);
|
|
95
|
+
graphRef.current = graph;
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (!onSelectionChange) return;
|
|
98
|
+
if (!drawerTarget) {
|
|
99
|
+
onSelectionChange(null);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const g = graphRef.current;
|
|
103
|
+
if (drawerTarget.type === 'node') {
|
|
104
|
+
const node = g.nodes.find((n) => n.id === drawerTarget.id);
|
|
105
|
+
onSelectionChange(node ? { type: 'node', id: node.id, node } : null);
|
|
106
|
+
} else {
|
|
107
|
+
const edge = g.edges.find((e) => e.id === drawerTarget.id);
|
|
108
|
+
onSelectionChange(edge ? { type: 'edge', id: edge.id, edge } : null);
|
|
109
|
+
}
|
|
110
|
+
// Depends on `drawerTarget` only — fire on selection-identity change, not on
|
|
111
|
+
// every graph edit (the node/edge snapshot is read via `graphRef`).
|
|
112
|
+
}, [drawerTarget]);
|
|
113
|
+
|
|
114
|
+
const getNodeType = useCallback(
|
|
115
|
+
(kind: string) => nodeTypes[kind],
|
|
116
|
+
[nodeTypes]
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const issuesByNode = useMemo(() => {
|
|
120
|
+
const map: Record<string, Issue[]> = {};
|
|
121
|
+
for (const issue of issues) {
|
|
122
|
+
if (!issue.nodeId) continue;
|
|
123
|
+
(map[issue.nodeId] ||= []).push(issue);
|
|
124
|
+
}
|
|
125
|
+
return map;
|
|
126
|
+
}, [issues]);
|
|
127
|
+
|
|
128
|
+
const issuesByEdge = useMemo(() => {
|
|
129
|
+
const map: Record<string, Issue[]> = {};
|
|
130
|
+
for (const issue of issues) {
|
|
131
|
+
if (!issue.edgeId) continue;
|
|
132
|
+
(map[issue.edgeId] ||= []).push(issue);
|
|
133
|
+
}
|
|
134
|
+
return map;
|
|
135
|
+
}, [issues]);
|
|
136
|
+
|
|
137
|
+
const issuesByField = useMemo(() => {
|
|
138
|
+
const map: Record<string, Issue[]> = {};
|
|
139
|
+
for (const issue of issues) {
|
|
140
|
+
if (!issue.nodeId || !issue.fieldKey) continue;
|
|
141
|
+
const key = `${issue.nodeId}.${issue.fieldKey}`;
|
|
142
|
+
(map[key] ||= []).push(issue);
|
|
143
|
+
}
|
|
144
|
+
return map;
|
|
145
|
+
}, [issues]);
|
|
146
|
+
|
|
147
|
+
const value = useMemo<WorkflowContextValue>(
|
|
148
|
+
() => ({
|
|
149
|
+
graph,
|
|
150
|
+
dispatch,
|
|
151
|
+
undo,
|
|
152
|
+
redo,
|
|
153
|
+
canUndo,
|
|
154
|
+
canRedo,
|
|
155
|
+
nodeTypes,
|
|
156
|
+
getNodeType,
|
|
157
|
+
translate,
|
|
158
|
+
issues,
|
|
159
|
+
issuesByNode,
|
|
160
|
+
issuesByEdge,
|
|
161
|
+
issuesByField,
|
|
162
|
+
editor: { selectedNodeId, selectedEdgeId, drawerTarget, runStates },
|
|
163
|
+
onArrange,
|
|
164
|
+
setSelectedNodeId,
|
|
165
|
+
setSelectedEdgeId,
|
|
166
|
+
setDrawerTarget,
|
|
167
|
+
revealInspector,
|
|
168
|
+
setRunState,
|
|
169
|
+
resetRunStates,
|
|
170
|
+
fieldFocusRequest,
|
|
171
|
+
requestFieldFocus,
|
|
172
|
+
consumeFieldFocusRequest,
|
|
173
|
+
readOnly,
|
|
174
|
+
validating,
|
|
175
|
+
categoryTokens,
|
|
176
|
+
hostBridge,
|
|
177
|
+
}),
|
|
178
|
+
[
|
|
179
|
+
graph,
|
|
180
|
+
dispatch,
|
|
181
|
+
undo,
|
|
182
|
+
redo,
|
|
183
|
+
canUndo,
|
|
184
|
+
canRedo,
|
|
185
|
+
nodeTypes,
|
|
186
|
+
getNodeType,
|
|
187
|
+
translate,
|
|
188
|
+
issues,
|
|
189
|
+
issuesByNode,
|
|
190
|
+
issuesByEdge,
|
|
191
|
+
issuesByField,
|
|
192
|
+
onArrange,
|
|
193
|
+
selectedNodeId,
|
|
194
|
+
selectedEdgeId,
|
|
195
|
+
drawerTarget,
|
|
196
|
+
revealInspector,
|
|
197
|
+
runStates,
|
|
198
|
+
setRunState,
|
|
199
|
+
resetRunStates,
|
|
200
|
+
fieldFocusRequest,
|
|
201
|
+
requestFieldFocus,
|
|
202
|
+
consumeFieldFocusRequest,
|
|
203
|
+
readOnly,
|
|
204
|
+
validating,
|
|
205
|
+
categoryTokens,
|
|
206
|
+
hostBridge,
|
|
207
|
+
]
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<WorkflowContext.Provider value={value}>
|
|
212
|
+
{children}
|
|
213
|
+
</WorkflowContext.Provider>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { CategoryTokenMap } from '../canvas/IconTile';
|
|
4
|
+
import type { GraphAction } from '../graphReducer';
|
|
5
|
+
import type {
|
|
6
|
+
Graph,
|
|
7
|
+
Issue,
|
|
8
|
+
NodeTypeDef,
|
|
9
|
+
NodeTypeRegistry,
|
|
10
|
+
RunState,
|
|
11
|
+
WorkflowSelection,
|
|
12
|
+
WorkflowTranslate,
|
|
13
|
+
} from '../Workflow.types';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* What the right-hand inspector drawer is currently showing. A node and an
|
|
17
|
+
* edge share the same drawer surface, so a single discriminated target — set
|
|
18
|
+
* together with the matching canvas-selection id — keeps "what's selected" and
|
|
19
|
+
* "what's inspected" in lockstep without two separate drawer ids.
|
|
20
|
+
*/
|
|
21
|
+
export type DrawerTarget =
|
|
22
|
+
| { type: 'node'; id: string }
|
|
23
|
+
| { type: 'edge'; id: string };
|
|
24
|
+
|
|
25
|
+
export type EditorState = {
|
|
26
|
+
selectedNodeId: string | null;
|
|
27
|
+
/** Currently selected edge id (canvas selection highlight). */
|
|
28
|
+
selectedEdgeId: string | null;
|
|
29
|
+
/** Node or edge whose properties the inspector drawer renders, or null. */
|
|
30
|
+
drawerTarget: DrawerTarget | null;
|
|
31
|
+
runStates: Record<string, RunState>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type WorkflowContextValue = {
|
|
35
|
+
graph: Graph;
|
|
36
|
+
dispatch: (action: GraphAction) => void;
|
|
37
|
+
undo: () => void;
|
|
38
|
+
redo: () => void;
|
|
39
|
+
canUndo: boolean;
|
|
40
|
+
canRedo: boolean;
|
|
41
|
+
nodeTypes: NodeTypeRegistry;
|
|
42
|
+
getNodeType: (kind: string) => NodeTypeDef | undefined;
|
|
43
|
+
/** Host-injected translator for the editor's chrome copy. */
|
|
44
|
+
translate: WorkflowTranslate;
|
|
45
|
+
issues: Issue[];
|
|
46
|
+
issuesByNode: Record<string, Issue[]>;
|
|
47
|
+
/** Issues keyed by `edgeId` — surfaced in the edge inspector drawer. */
|
|
48
|
+
issuesByEdge: Record<string, Issue[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Issues keyed by `${nodeId}.${fieldKey}` for inline field rendering.
|
|
51
|
+
* Issues missing a `fieldKey` (graph-wide checks, generic node issues) do
|
|
52
|
+
* not appear here — those still surface in the canvas validation banner.
|
|
53
|
+
*/
|
|
54
|
+
issuesByField: Record<string, Issue[]>;
|
|
55
|
+
editor: EditorState;
|
|
56
|
+
/**
|
|
57
|
+
* Host hook fired with the laid-out graph when the user runs auto-arrange.
|
|
58
|
+
* See `WorkflowProps.onArrange` — lets the host force-persist the reposition.
|
|
59
|
+
*/
|
|
60
|
+
onArrange?: (graph: Graph) => void;
|
|
61
|
+
setSelectedNodeId: (id: string | null) => void;
|
|
62
|
+
setSelectedEdgeId: (id: string | null) => void;
|
|
63
|
+
/** Set (or clear) the node/edge the inspector drawer renders. */
|
|
64
|
+
setDrawerTarget: (target: DrawerTarget | null) => void;
|
|
65
|
+
setRunState: (id: string, state: RunState) => void;
|
|
66
|
+
resetRunStates: () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Latest `(nodeId, fieldKey)` the user asked to jump to via the canvas
|
|
69
|
+
* validation banner. FieldWrapper subscribes — if its key matches it
|
|
70
|
+
* scrolls into view and focuses the input, then calls
|
|
71
|
+
* `consumeFieldFocusRequest` so a re-render doesn't refocus repeatedly.
|
|
72
|
+
*/
|
|
73
|
+
fieldFocusRequest: { nodeId: string; fieldKey: string } | null;
|
|
74
|
+
requestFieldFocus: (nodeId: string, fieldKey: string) => void;
|
|
75
|
+
consumeFieldFocusRequest: () => void;
|
|
76
|
+
readOnly: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Select a node or edge and make it the inspector's target. Every "open this
|
|
79
|
+
* element's details" entry point — canvas node/edge click, edge label,
|
|
80
|
+
* error-banner jump — routes through here so selection stays in one place
|
|
81
|
+
* (read it via `editor.drawerTarget`; the host is also notified through
|
|
82
|
+
* `WorkflowProps.onSelectionChange`).
|
|
83
|
+
*/
|
|
84
|
+
revealInspector: (target: DrawerTarget) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Issues are being recomputed (host save/validation in flight). Surfaces a
|
|
87
|
+
* loading affordance (e.g. in `GraphErrorBanner`) so an empty `issues` list
|
|
88
|
+
* mid-validation isn't treated as "no issues". See `WorkflowProps.validating`.
|
|
89
|
+
*/
|
|
90
|
+
validating: boolean;
|
|
91
|
+
/** Optional host override for category → token map. */
|
|
92
|
+
categoryTokens?: CategoryTokenMap;
|
|
93
|
+
/**
|
|
94
|
+
* Opaque host bridge threaded down to inspectors so they can reach
|
|
95
|
+
* host-supplied data (live model list, tool catalog, etc.) without the
|
|
96
|
+
* generic Workflow core depending on FactChat APIs. Inspectors narrow it.
|
|
97
|
+
*/
|
|
98
|
+
hostBridge?: unknown;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type WorkflowProviderProps = {
|
|
102
|
+
graph: Graph;
|
|
103
|
+
dispatch: (action: GraphAction) => void;
|
|
104
|
+
undo: () => void;
|
|
105
|
+
redo: () => void;
|
|
106
|
+
canUndo: boolean;
|
|
107
|
+
canRedo: boolean;
|
|
108
|
+
nodeTypes: NodeTypeRegistry;
|
|
109
|
+
/** Host-injected translator for the editor's chrome copy. */
|
|
110
|
+
translate: WorkflowTranslate;
|
|
111
|
+
issues: Issue[];
|
|
112
|
+
/** See `WorkflowContextValue.onArrange`. */
|
|
113
|
+
onArrange?: (graph: Graph) => void;
|
|
114
|
+
readOnly?: boolean;
|
|
115
|
+
/** See `WorkflowProps.onSelectionChange`. Fired by the provider on selection change. */
|
|
116
|
+
onSelectionChange?: (selection: WorkflowSelection | null) => void;
|
|
117
|
+
/** See `WorkflowContextValue.validating`. */
|
|
118
|
+
validating?: boolean;
|
|
119
|
+
categoryTokens?: CategoryTokenMap;
|
|
120
|
+
hostBridge?: unknown;
|
|
121
|
+
children: ReactNode;
|
|
122
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import type { Graph, WorkflowSelection } from '../Workflow.types';
|
|
5
|
+
import { useWorkflow, WorkflowProvider } from './WorkflowContext';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Covers the selection seam added when the inspector became opt-in: the provider
|
|
9
|
+
* must surface the selected node/edge to the host via `onSelectionChange` (the
|
|
10
|
+
* signal a host uses to drive its own inspector anywhere in its layout), and
|
|
11
|
+
* clear it on deselect. Exercised without React Flow — `revealInspector`/
|
|
12
|
+
* `setDrawerTarget` are the same entry points the canvas click handlers use.
|
|
13
|
+
*/
|
|
14
|
+
const graph: Graph = {
|
|
15
|
+
nodes: [
|
|
16
|
+
{ id: 'n1', kind: 'task', position: { x: 0, y: 0 }, config: { v: 1 } },
|
|
17
|
+
],
|
|
18
|
+
edges: [{ id: 'e1', source: 'n1', target: 'n1' }],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function Harness() {
|
|
22
|
+
const { revealInspector, setDrawerTarget } = useWorkflow();
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<button onClick={() => revealInspector({ type: 'node', id: 'n1' })}>
|
|
26
|
+
select-node
|
|
27
|
+
</button>
|
|
28
|
+
<button onClick={() => revealInspector({ type: 'edge', id: 'e1' })}>
|
|
29
|
+
select-edge
|
|
30
|
+
</button>
|
|
31
|
+
<button onClick={() => setDrawerTarget(null)}>clear</button>
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function renderWithProvider(
|
|
37
|
+
onSelectionChange: (s: WorkflowSelection | null) => void
|
|
38
|
+
) {
|
|
39
|
+
return render(
|
|
40
|
+
<WorkflowProvider
|
|
41
|
+
graph={graph}
|
|
42
|
+
dispatch={() => {}}
|
|
43
|
+
undo={() => {}}
|
|
44
|
+
redo={() => {}}
|
|
45
|
+
canUndo={false}
|
|
46
|
+
canRedo={false}
|
|
47
|
+
nodeTypes={{}}
|
|
48
|
+
translate={(key) => key}
|
|
49
|
+
issues={[]}
|
|
50
|
+
onSelectionChange={onSelectionChange}
|
|
51
|
+
>
|
|
52
|
+
<Harness />
|
|
53
|
+
</WorkflowProvider>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
describe('Workflow selection (onSelectionChange)', () => {
|
|
58
|
+
it('fires null initially (nothing selected)', () => {
|
|
59
|
+
const spy = vi.fn();
|
|
60
|
+
renderWithProvider(spy);
|
|
61
|
+
expect(spy).toHaveBeenLastCalledWith(null);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('surfaces the selected node with its snapshot', () => {
|
|
65
|
+
const spy = vi.fn();
|
|
66
|
+
renderWithProvider(spy);
|
|
67
|
+
fireEvent.click(screen.getByText('select-node'));
|
|
68
|
+
expect(spy).toHaveBeenLastCalledWith({
|
|
69
|
+
type: 'node',
|
|
70
|
+
id: 'n1',
|
|
71
|
+
node: graph.nodes[0],
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('surfaces the selected edge with its snapshot', () => {
|
|
76
|
+
const spy = vi.fn();
|
|
77
|
+
renderWithProvider(spy);
|
|
78
|
+
fireEvent.click(screen.getByText('select-edge'));
|
|
79
|
+
expect(spy).toHaveBeenLastCalledWith({
|
|
80
|
+
type: 'edge',
|
|
81
|
+
id: 'e1',
|
|
82
|
+
edge: graph.edges[0],
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('fires null again on deselect', () => {
|
|
87
|
+
const spy = vi.fn();
|
|
88
|
+
renderWithProvider(spy);
|
|
89
|
+
fireEvent.click(screen.getByText('select-node'));
|
|
90
|
+
fireEvent.click(screen.getByText('clear'));
|
|
91
|
+
expect(spy).toHaveBeenLastCalledWith(null);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Badge } from '@/components/Badge';
|
|
6
|
+
import { TbCheck, TbX } from '@/components/Icon';
|
|
7
|
+
|
|
8
|
+
import type { EdgeLabelVariant } from './edgeLabelVariant';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Badge variant per branch-label kind. Pass / Fail are a binary safety outcome
|
|
12
|
+
* so they read semantic (green / red); every routing key (If-Else branches, the
|
|
13
|
+
* If-Else `else` fallback, Classify categories) and any free-text label reads as
|
|
14
|
+
* a single neutral badge so the branch names all look alike.
|
|
15
|
+
*/
|
|
16
|
+
const VARIANT_BADGE: Record<
|
|
17
|
+
EdgeLabelVariant,
|
|
18
|
+
'success' | 'danger' | 'neutral'
|
|
19
|
+
> = {
|
|
20
|
+
pass: 'success',
|
|
21
|
+
fail: 'danger',
|
|
22
|
+
key: 'neutral',
|
|
23
|
+
else: 'neutral',
|
|
24
|
+
default: 'neutral',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The chip that names a node's exit branch. Rendered in two places that must
|
|
29
|
+
* look identical so it reads as the SAME badge relocating: at the node's output
|
|
30
|
+
* handle (while the exit is unconnected) and on the connected edge's midpoint.
|
|
31
|
+
*
|
|
32
|
+
* A drop shadow lifts it off the tinted canvas in light mode; in dark mode a
|
|
33
|
+
* shadow can't lift anything, so the chip trades it for a hairline ring and
|
|
34
|
+
* the neutral variant raises its fill clear of the canvas.
|
|
35
|
+
*/
|
|
36
|
+
export function BranchLabelBadge({
|
|
37
|
+
variant,
|
|
38
|
+
children,
|
|
39
|
+
onClick,
|
|
40
|
+
}: {
|
|
41
|
+
variant: EdgeLabelVariant;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
/** When set, the badge is clickable (the edge uses this to open its
|
|
44
|
+
* inspector); omitted at the node handle, where the badge is inert. */
|
|
45
|
+
onClick?: (e: MouseEvent) => void;
|
|
46
|
+
}) {
|
|
47
|
+
const badgeVariant = VARIANT_BADGE[variant];
|
|
48
|
+
return (
|
|
49
|
+
<Badge
|
|
50
|
+
variant={badgeVariant}
|
|
51
|
+
boxShadow="sm"
|
|
52
|
+
_dark={{
|
|
53
|
+
boxShadow: '0 0 0 1px {colors.border.strong}',
|
|
54
|
+
// slate.300, not the semantically-equivalent bg.emphasized: Chakra
|
|
55
|
+
// resolves `bg.*` tokens referenced inside a nested condition to their
|
|
56
|
+
// BASE value (rendering the light-gray light-mode fill in dark mode);
|
|
57
|
+
// the slate ramp resolves correctly here. No upstream issue filed —
|
|
58
|
+
// verified via rendered-DOM probe, 2026-06-12.
|
|
59
|
+
bgColor: badgeVariant === 'neutral' ? 'slate.300' : undefined,
|
|
60
|
+
}}
|
|
61
|
+
cursor={onClick ? 'pointer' : 'default'}
|
|
62
|
+
onClick={onClick}
|
|
63
|
+
>
|
|
64
|
+
{variant === 'pass' ? <TbCheck boxSize="xs" aria-hidden /> : null}
|
|
65
|
+
{variant === 'fail' ? <TbX boxSize="xs" aria-hidden /> : null}
|
|
66
|
+
{children}
|
|
67
|
+
</Badge>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type DefaultEdgeOptions, MarkerType } from '@xyflow/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Edge defaults. Stroke comes from a theme token (slate.700) via CSS var
|
|
5
|
+
* since React Flow takes SVG-style props, not Chakra ones. The label
|
|
6
|
+
* itself is rendered through the `labeled` custom edge so its
|
|
7
|
+
* typography uses the design system's semantic `Subtext` primitive —
|
|
8
|
+
* see `LabeledEdge.tsx`. The arrowhead makes each edge's direction
|
|
9
|
+
* self-describing rather than implied by left→right placement alone.
|
|
10
|
+
*/
|
|
11
|
+
export const defaultEdgeOptions: DefaultEdgeOptions = {
|
|
12
|
+
type: 'labeled',
|
|
13
|
+
style: {
|
|
14
|
+
stroke: 'var(--chakra-colors-slate-700)',
|
|
15
|
+
strokeWidth: 1.5,
|
|
16
|
+
},
|
|
17
|
+
markerEnd: {
|
|
18
|
+
type: MarkerType.ArrowClosed,
|
|
19
|
+
color: 'var(--chakra-colors-slate-700)',
|
|
20
|
+
width: 18,
|
|
21
|
+
height: 18,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Selection outline for edges. React Flow toggles `.selected` on the
|
|
27
|
+
* edge group; we layer an outline on the path so the user gets visual
|
|
28
|
+
* feedback before pressing Delete. Scoped via the Canvas wrapper's
|
|
29
|
+
* `css` prop rather than a global stylesheet.
|
|
30
|
+
*/
|
|
31
|
+
export const canvasSelectionCss = {
|
|
32
|
+
// Ports paint as 8px dots (see PORT_STYLE) but that's a pixel-hunt drag
|
|
33
|
+
// target; a pseudo-element participates in its parent's hit-testing, so this
|
|
34
|
+
// pads every handle's grab area to ~24px without changing the visual dot.
|
|
35
|
+
'& .react-flow__handle::after': {
|
|
36
|
+
content: '""',
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
inset: '-8px',
|
|
39
|
+
},
|
|
40
|
+
// Hover feedback: thicken/darken the path so an edge reads as grabbable
|
|
41
|
+
// before it's selected. Listed before the `.selected` rule (equal
|
|
42
|
+
// specificity) so selection styling wins when an edge is both.
|
|
43
|
+
'& .react-flow__edge:hover .react-flow__edge-path': {
|
|
44
|
+
stroke: 'var(--chakra-colors-slate-900)',
|
|
45
|
+
strokeWidth: 2,
|
|
46
|
+
},
|
|
47
|
+
'& .react-flow__edge.selected .react-flow__edge-path': {
|
|
48
|
+
stroke: 'var(--chakra-colors-primary-main)',
|
|
49
|
+
strokeWidth: 2.5,
|
|
50
|
+
filter: 'drop-shadow(0 0 4px var(--chakra-colors-primary-lighter))',
|
|
51
|
+
},
|
|
52
|
+
'& .react-flow__edge.selected .react-flow__edge-interaction': {
|
|
53
|
+
stroke: 'var(--chakra-colors-primary-main)',
|
|
54
|
+
},
|
|
55
|
+
// React Flow's stock zoom/lock controls are fixed white — point its theme
|
|
56
|
+
// vars at our tokens so the cluster follows the color mode (light values match
|
|
57
|
+
// the stock look). A solid surface (rather than transparent buttons) keeps the
|
|
58
|
+
// icons legible as the canvas pans content beneath the cluster, and matches the
|
|
59
|
+
// minimap panel in the opposite corner. Frame it like the node cards — md
|
|
60
|
+
// radius + slate.200 border + shadow — so it reads as a deliberate floating
|
|
61
|
+
// toolbar; the border carries the definition in dark mode where the stock
|
|
62
|
+
// shadow is invisible on the dark canvas. `overflow: hidden` clips the stacked
|
|
63
|
+
// buttons to the rounded corners (tooltips portal out, so they aren't clipped).
|
|
64
|
+
'& .react-flow__controls': {
|
|
65
|
+
'--xy-controls-button-background-color': 'var(--chakra-colors-bg-surface)',
|
|
66
|
+
'--xy-controls-button-background-color-hover':
|
|
67
|
+
'var(--chakra-colors-slate-100)',
|
|
68
|
+
'--xy-controls-button-color': 'var(--chakra-colors-slate-1200)',
|
|
69
|
+
'--xy-controls-button-color-hover': 'var(--chakra-colors-slate-1500)',
|
|
70
|
+
'--xy-controls-button-border-color': 'var(--chakra-colors-slate-200)',
|
|
71
|
+
'--xy-controls-box-shadow': 'var(--chakra-shadows-sm)',
|
|
72
|
+
borderRadius: 'var(--chakra-radii-md)',
|
|
73
|
+
border: '1px solid var(--chakra-colors-slate-200)',
|
|
74
|
+
overflow: 'hidden',
|
|
75
|
+
},
|
|
76
|
+
// Our control glyphs (lucide Plus/Minus + Tabler arrows/lock/maximize/sitemap)
|
|
77
|
+
// are stroke-based — `fill="none"`, `stroke="currentColor"`. React Flow's stock
|
|
78
|
+
// CSS forces `fill: currentColor` on control-button SVGs (its own icons are
|
|
79
|
+
// solid), which fills these outline icons into blobs (the lock rendered as a
|
|
80
|
+
// solid lozenge) and, via its `:disabled svg { fill-opacity: .4 }` companion,
|
|
81
|
+
// painted a translucent gray inside the disabled undo/redo arrows. Restore the
|
|
82
|
+
// intended stroke-only rendering.
|
|
83
|
+
'& .react-flow__controls-button svg': {
|
|
84
|
+
fill: 'none',
|
|
85
|
+
},
|
|
86
|
+
// With fill removed, RF's fill-opacity disabled cue is a no-op — dim the whole
|
|
87
|
+
// glyph instead so disabled undo/redo still read as inactive.
|
|
88
|
+
'& .react-flow__controls-button:disabled svg': {
|
|
89
|
+
opacity: 0.4,
|
|
90
|
+
},
|
|
91
|
+
};
|