@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.
Files changed (396) hide show
  1. package/dist/components/Icon/_constants/iconList.d.ts +1 -1
  2. package/dist/components/Icon/_constants/iconList.d.ts.map +1 -1
  3. package/dist/components/Icon/_constants/iconList.js +18 -0
  4. package/dist/components/Icon/_constants/iconList.js.map +1 -1
  5. package/dist/components/Icon/_constants/iconList.mjs +20 -2
  6. package/dist/components/Icon/_constants/iconList.mjs.map +1 -1
  7. package/dist/components/Icon/index.d.ts +2 -1
  8. package/dist/components/Icon/index.d.ts.map +1 -1
  9. package/dist/components/Icon/index.js +20 -1
  10. package/dist/components/Icon/index.js.map +1 -1
  11. package/dist/components/Icon/index.mjs +4 -2
  12. package/dist/components/Icon/index.mjs.map +1 -1
  13. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  14. package/dist/components/SegmentedControl/SegmentedControl.js +20 -4
  15. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  16. package/dist/components/SegmentedControl/SegmentedControl.mjs +20 -4
  17. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  18. package/dist/components/Workflow/Workflow.d.ts +3 -0
  19. package/dist/components/Workflow/Workflow.d.ts.map +1 -0
  20. package/dist/components/Workflow/Workflow.js +109 -0
  21. package/dist/components/Workflow/Workflow.js.map +1 -0
  22. package/dist/components/Workflow/Workflow.mjs +107 -0
  23. package/dist/components/Workflow/Workflow.mjs.map +1 -0
  24. package/dist/components/Workflow/Workflow.translations.json.js +164 -0
  25. package/dist/components/Workflow/Workflow.translations.json.js.map +1 -0
  26. package/dist/components/Workflow/Workflow.translations.json.mjs +138 -0
  27. package/dist/components/Workflow/Workflow.translations.json.mjs.map +1 -0
  28. package/dist/components/Workflow/Workflow.types.d.ts +435 -0
  29. package/dist/components/Workflow/Workflow.types.d.ts.map +1 -0
  30. package/dist/components/Workflow/Workflow.types.js +19 -0
  31. package/dist/components/Workflow/Workflow.types.js.map +1 -0
  32. package/dist/components/Workflow/Workflow.types.mjs +16 -0
  33. package/dist/components/Workflow/Workflow.types.mjs.map +1 -0
  34. package/dist/components/Workflow/WorkflowContext/WorkflowContext.d.ts +10 -0
  35. package/dist/components/Workflow/WorkflowContext/WorkflowContext.d.ts.map +1 -0
  36. package/dist/components/Workflow/WorkflowContext/WorkflowContext.js +163 -0
  37. package/dist/components/Workflow/WorkflowContext/WorkflowContext.js.map +1 -0
  38. package/dist/components/Workflow/WorkflowContext/WorkflowContext.mjs +159 -0
  39. package/dist/components/Workflow/WorkflowContext/WorkflowContext.mjs.map +1 -0
  40. package/dist/components/Workflow/WorkflowContext/WorkflowContext.types.d.ts +117 -0
  41. package/dist/components/Workflow/WorkflowContext/WorkflowContext.types.d.ts.map +1 -0
  42. package/dist/components/Workflow/WorkflowContext/index.d.ts +3 -0
  43. package/dist/components/Workflow/WorkflowContext/index.d.ts.map +1 -0
  44. package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts +19 -0
  45. package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts.map +1 -0
  46. package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js +44 -0
  47. package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js.map +1 -0
  48. package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs +42 -0
  49. package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs.map +1 -0
  50. package/dist/components/Workflow/canvas/Canvas/Canvas.d.ts +10 -0
  51. package/dist/components/Workflow/canvas/Canvas/Canvas.d.ts.map +1 -0
  52. package/dist/components/Workflow/canvas/Canvas/Canvas.js +531 -0
  53. package/dist/components/Workflow/canvas/Canvas/Canvas.js.map +1 -0
  54. package/dist/components/Workflow/canvas/Canvas/Canvas.mjs +529 -0
  55. package/dist/components/Workflow/canvas/Canvas/Canvas.mjs.map +1 -0
  56. package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts +53 -0
  57. package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts.map +1 -0
  58. package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js +96 -0
  59. package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js.map +1 -0
  60. package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs +93 -0
  61. package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs.map +1 -0
  62. package/dist/components/Workflow/canvas/Canvas/CanvasControls.d.ts +27 -0
  63. package/dist/components/Workflow/canvas/Canvas/CanvasControls.d.ts.map +1 -0
  64. package/dist/components/Workflow/canvas/Canvas/CanvasControls.js +70 -0
  65. package/dist/components/Workflow/canvas/Canvas/CanvasControls.js.map +1 -0
  66. package/dist/components/Workflow/canvas/Canvas/CanvasControls.mjs +68 -0
  67. package/dist/components/Workflow/canvas/Canvas/CanvasControls.mjs.map +1 -0
  68. package/dist/components/Workflow/canvas/Canvas/LabeledEdge.d.ts +10 -0
  69. package/dist/components/Workflow/canvas/Canvas/LabeledEdge.d.ts.map +1 -0
  70. package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js +106 -0
  71. package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js.map +1 -0
  72. package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs +104 -0
  73. package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs.map +1 -0
  74. package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.d.ts +13 -0
  75. package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.d.ts.map +1 -0
  76. package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.js +18 -0
  77. package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.js.map +1 -0
  78. package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.mjs +16 -0
  79. package/dist/components/Workflow/canvas/Canvas/edgeLabelVariant.mjs.map +1 -0
  80. package/dist/components/Workflow/canvas/Canvas/index.d.ts +2 -0
  81. package/dist/components/Workflow/canvas/Canvas/index.d.ts.map +1 -0
  82. package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.d.ts +30 -0
  83. package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.d.ts.map +1 -0
  84. package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js +34 -0
  85. package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js.map +1 -0
  86. package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs +32 -0
  87. package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs.map +1 -0
  88. package/dist/components/Workflow/canvas/CollapsibleSection/index.d.ts +2 -0
  89. package/dist/components/Workflow/canvas/CollapsibleSection/index.d.ts.map +1 -0
  90. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts +37 -0
  91. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts.map +1 -0
  92. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js +33 -0
  93. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js.map +1 -0
  94. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs +31 -0
  95. package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs.map +1 -0
  96. package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.d.ts +16 -0
  97. package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.d.ts.map +1 -0
  98. package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js +54 -0
  99. package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js.map +1 -0
  100. package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs +52 -0
  101. package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs.map +1 -0
  102. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.d.ts +27 -0
  103. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.d.ts.map +1 -0
  104. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js +178 -0
  105. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js.map +1 -0
  106. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs +176 -0
  107. package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs.map +1 -0
  108. package/dist/components/Workflow/canvas/DrawerShell/index.d.ts +3 -0
  109. package/dist/components/Workflow/canvas/DrawerShell/index.d.ts.map +1 -0
  110. package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.d.ts +12 -0
  111. package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.d.ts.map +1 -0
  112. package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js +68 -0
  113. package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js.map +1 -0
  114. package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs +66 -0
  115. package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs.map +1 -0
  116. package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.d.ts +19 -0
  117. package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.d.ts.map +1 -0
  118. package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.js +35 -0
  119. package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.js.map +1 -0
  120. package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.mjs +32 -0
  121. package/dist/components/Workflow/canvas/EdgeInspector/endpointTitle.mjs.map +1 -0
  122. package/dist/components/Workflow/canvas/EdgeInspector/index.d.ts +3 -0
  123. package/dist/components/Workflow/canvas/EdgeInspector/index.d.ts.map +1 -0
  124. package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.d.ts +54 -0
  125. package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.d.ts.map +1 -0
  126. package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js +56 -0
  127. package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js.map +1 -0
  128. package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs +54 -0
  129. package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs.map +1 -0
  130. package/dist/components/Workflow/canvas/FieldWrapper/index.d.ts +3 -0
  131. package/dist/components/Workflow/canvas/FieldWrapper/index.d.ts.map +1 -0
  132. package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.d.ts +16 -0
  133. package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.d.ts.map +1 -0
  134. package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.js +25 -0
  135. package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.js.map +1 -0
  136. package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.mjs +22 -0
  137. package/dist/components/Workflow/canvas/FloatingCard/FloatingCard.mjs.map +1 -0
  138. package/dist/components/Workflow/canvas/FloatingCard/index.d.ts +2 -0
  139. package/dist/components/Workflow/canvas/FloatingCard/index.d.ts.map +1 -0
  140. package/dist/components/Workflow/canvas/GenericNode/GenericNode.d.ts +14 -0
  141. package/dist/components/Workflow/canvas/GenericNode/GenericNode.d.ts.map +1 -0
  142. package/dist/components/Workflow/canvas/GenericNode/GenericNode.js +61 -0
  143. package/dist/components/Workflow/canvas/GenericNode/GenericNode.js.map +1 -0
  144. package/dist/components/Workflow/canvas/GenericNode/GenericNode.mjs +59 -0
  145. package/dist/components/Workflow/canvas/GenericNode/GenericNode.mjs.map +1 -0
  146. package/dist/components/Workflow/canvas/GenericNode/GenericNode.types.d.ts +11 -0
  147. package/dist/components/Workflow/canvas/GenericNode/GenericNode.types.d.ts.map +1 -0
  148. package/dist/components/Workflow/canvas/GenericNode/index.d.ts +3 -0
  149. package/dist/components/Workflow/canvas/GenericNode/index.d.ts.map +1 -0
  150. package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts +15 -0
  151. package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts.map +1 -0
  152. package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js +145 -0
  153. package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js.map +1 -0
  154. package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs +143 -0
  155. package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs.map +1 -0
  156. package/dist/components/Workflow/canvas/GraphErrorBanner/index.d.ts +2 -0
  157. package/dist/components/Workflow/canvas/GraphErrorBanner/index.d.ts.map +1 -0
  158. package/dist/components/Workflow/canvas/IconTile/IconTile.d.ts +10 -0
  159. package/dist/components/Workflow/canvas/IconTile/IconTile.d.ts.map +1 -0
  160. package/dist/components/Workflow/canvas/IconTile/IconTile.js +21 -0
  161. package/dist/components/Workflow/canvas/IconTile/IconTile.js.map +1 -0
  162. package/dist/components/Workflow/canvas/IconTile/IconTile.mjs +19 -0
  163. package/dist/components/Workflow/canvas/IconTile/IconTile.mjs.map +1 -0
  164. package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts +18 -0
  165. package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts.map +1 -0
  166. package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js +40 -0
  167. package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js.map +1 -0
  168. package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs +37 -0
  169. package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs.map +1 -0
  170. package/dist/components/Workflow/canvas/IconTile/IconTile.types.d.ts +15 -0
  171. package/dist/components/Workflow/canvas/IconTile/IconTile.types.d.ts.map +1 -0
  172. package/dist/components/Workflow/canvas/IconTile/index.d.ts +4 -0
  173. package/dist/components/Workflow/canvas/IconTile/index.d.ts.map +1 -0
  174. package/dist/components/Workflow/canvas/IssueList/IssueList.d.ts +24 -0
  175. package/dist/components/Workflow/canvas/IssueList/IssueList.d.ts.map +1 -0
  176. package/dist/components/Workflow/canvas/IssueList/IssueList.js +34 -0
  177. package/dist/components/Workflow/canvas/IssueList/IssueList.js.map +1 -0
  178. package/dist/components/Workflow/canvas/IssueList/IssueList.mjs +32 -0
  179. package/dist/components/Workflow/canvas/IssueList/IssueList.mjs.map +1 -0
  180. package/dist/components/Workflow/canvas/IssueList/index.d.ts +2 -0
  181. package/dist/components/Workflow/canvas/IssueList/index.d.ts.map +1 -0
  182. package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts +9 -0
  183. package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts.map +1 -0
  184. package/dist/components/Workflow/canvas/NodePalette/NodePalette.js +94 -0
  185. package/dist/components/Workflow/canvas/NodePalette/NodePalette.js.map +1 -0
  186. package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs +92 -0
  187. package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs.map +1 -0
  188. package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.d.ts +7 -0
  189. package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.d.ts.map +1 -0
  190. package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.js +13 -0
  191. package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.js.map +1 -0
  192. package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.mjs +10 -0
  193. package/dist/components/Workflow/canvas/NodePalette/NodePalette.styles.mjs.map +1 -0
  194. package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts +10 -0
  195. package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts.map +1 -0
  196. package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js +28 -0
  197. package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js.map +1 -0
  198. package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs +26 -0
  199. package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs.map +1 -0
  200. package/dist/components/Workflow/canvas/NodePalette/index.d.ts +4 -0
  201. package/dist/components/Workflow/canvas/NodePalette/index.d.ts.map +1 -0
  202. package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts +3 -0
  203. package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts.map +1 -0
  204. package/dist/components/Workflow/canvas/NodeShell/NodeShell.js +137 -0
  205. package/dist/components/Workflow/canvas/NodeShell/NodeShell.js.map +1 -0
  206. package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs +135 -0
  207. package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs.map +1 -0
  208. package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts +66 -0
  209. package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts.map +1 -0
  210. package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js +87 -0
  211. package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js.map +1 -0
  212. package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs +77 -0
  213. package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs.map +1 -0
  214. package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts +35 -0
  215. package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts.map +1 -0
  216. package/dist/components/Workflow/canvas/NodeShell/index.d.ts +4 -0
  217. package/dist/components/Workflow/canvas/NodeShell/index.d.ts.map +1 -0
  218. package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts +15 -0
  219. package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts.map +1 -0
  220. package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js +14 -0
  221. package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js.map +1 -0
  222. package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs +12 -0
  223. package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs.map +1 -0
  224. package/dist/components/Workflow/canvas/SeverityDot/index.d.ts +2 -0
  225. package/dist/components/Workflow/canvas/SeverityDot/index.d.ts.map +1 -0
  226. package/dist/components/Workflow/canvas/issueSeverity.d.ts +23 -0
  227. package/dist/components/Workflow/canvas/issueSeverity.d.ts.map +1 -0
  228. package/dist/components/Workflow/canvas/issueSeverity.js +51 -0
  229. package/dist/components/Workflow/canvas/issueSeverity.js.map +1 -0
  230. package/dist/components/Workflow/canvas/issueSeverity.mjs +47 -0
  231. package/dist/components/Workflow/canvas/issueSeverity.mjs.map +1 -0
  232. package/dist/components/Workflow/canvas/useFieldFocusRequest.d.ts +14 -0
  233. package/dist/components/Workflow/canvas/useFieldFocusRequest.d.ts.map +1 -0
  234. package/dist/components/Workflow/canvas/useFieldFocusRequest.js +48 -0
  235. package/dist/components/Workflow/canvas/useFieldFocusRequest.js.map +1 -0
  236. package/dist/components/Workflow/canvas/useFieldFocusRequest.mjs +46 -0
  237. package/dist/components/Workflow/canvas/useFieldFocusRequest.mjs.map +1 -0
  238. package/dist/components/Workflow/canvas/workflowLabelProps.d.ts +12 -0
  239. package/dist/components/Workflow/canvas/workflowLabelProps.d.ts.map +1 -0
  240. package/dist/components/Workflow/canvas/workflowLabelProps.js +17 -0
  241. package/dist/components/Workflow/canvas/workflowLabelProps.js.map +1 -0
  242. package/dist/components/Workflow/canvas/workflowLabelProps.mjs +15 -0
  243. package/dist/components/Workflow/canvas/workflowLabelProps.mjs.map +1 -0
  244. package/dist/components/Workflow/connectionRules.d.ts +59 -0
  245. package/dist/components/Workflow/connectionRules.d.ts.map +1 -0
  246. package/dist/components/Workflow/connectionRules.js +150 -0
  247. package/dist/components/Workflow/connectionRules.js.map +1 -0
  248. package/dist/components/Workflow/connectionRules.mjs +145 -0
  249. package/dist/components/Workflow/connectionRules.mjs.map +1 -0
  250. package/dist/components/Workflow/createNode.d.ts +27 -0
  251. package/dist/components/Workflow/createNode.d.ts.map +1 -0
  252. package/dist/components/Workflow/createNode.js +66 -0
  253. package/dist/components/Workflow/createNode.js.map +1 -0
  254. package/dist/components/Workflow/createNode.mjs +62 -0
  255. package/dist/components/Workflow/createNode.mjs.map +1 -0
  256. package/dist/components/Workflow/graphHistory.d.ts +23 -0
  257. package/dist/components/Workflow/graphHistory.d.ts.map +1 -0
  258. package/dist/components/Workflow/graphHistory.js +73 -0
  259. package/dist/components/Workflow/graphHistory.js.map +1 -0
  260. package/dist/components/Workflow/graphHistory.mjs +70 -0
  261. package/dist/components/Workflow/graphHistory.mjs.map +1 -0
  262. package/dist/components/Workflow/graphObserver.d.ts +13 -0
  263. package/dist/components/Workflow/graphObserver.d.ts.map +1 -0
  264. package/dist/components/Workflow/graphObserver.js +11 -0
  265. package/dist/components/Workflow/graphObserver.js.map +1 -0
  266. package/dist/components/Workflow/graphObserver.mjs +8 -0
  267. package/dist/components/Workflow/graphObserver.mjs.map +1 -0
  268. package/dist/components/Workflow/graphReducer.d.ts +75 -0
  269. package/dist/components/Workflow/graphReducer.d.ts.map +1 -0
  270. package/dist/components/Workflow/graphReducer.js +122 -0
  271. package/dist/components/Workflow/graphReducer.js.map +1 -0
  272. package/dist/components/Workflow/graphReducer.mjs +119 -0
  273. package/dist/components/Workflow/graphReducer.mjs.map +1 -0
  274. package/dist/components/Workflow/index.d.ts +22 -0
  275. package/dist/components/Workflow/index.d.ts.map +1 -0
  276. package/dist/components/Workflow/layout/autoLayout.d.ts +49 -0
  277. package/dist/components/Workflow/layout/autoLayout.d.ts.map +1 -0
  278. package/dist/components/Workflow/layout/autoLayout.js +149 -0
  279. package/dist/components/Workflow/layout/autoLayout.js.map +1 -0
  280. package/dist/components/Workflow/layout/autoLayout.mjs +146 -0
  281. package/dist/components/Workflow/layout/autoLayout.mjs.map +1 -0
  282. package/dist/components/Workflow/stories/toyNodeTypes.d.ts +40 -0
  283. package/dist/components/Workflow/stories/toyNodeTypes.d.ts.map +1 -0
  284. package/dist/components/Workflow/useWorkflowIssueMessage.d.ts +15 -0
  285. package/dist/components/Workflow/useWorkflowIssueMessage.d.ts.map +1 -0
  286. package/dist/components/Workflow/useWorkflowIssueMessage.js +45 -0
  287. package/dist/components/Workflow/useWorkflowIssueMessage.js.map +1 -0
  288. package/dist/components/Workflow/useWorkflowIssueMessage.mjs +43 -0
  289. package/dist/components/Workflow/useWorkflowIssueMessage.mjs.map +1 -0
  290. package/dist/components/Workflow/useWorkflowKeyboard.d.ts +10 -0
  291. package/dist/components/Workflow/useWorkflowKeyboard.d.ts.map +1 -0
  292. package/dist/components/Workflow/useWorkflowKeyboard.js +116 -0
  293. package/dist/components/Workflow/useWorkflowKeyboard.js.map +1 -0
  294. package/dist/components/Workflow/useWorkflowKeyboard.mjs +114 -0
  295. package/dist/components/Workflow/useWorkflowKeyboard.mjs.map +1 -0
  296. package/dist/icons.js +17 -0
  297. package/dist/icons.js.map +1 -1
  298. package/dist/icons.mjs +1 -1
  299. package/dist/index.d.ts +1 -0
  300. package/dist/index.d.ts.map +1 -1
  301. package/dist/index.js +38 -0
  302. package/dist/index.js.map +1 -1
  303. package/dist/index.mjs +14 -0
  304. package/dist/index.mjs.map +1 -1
  305. package/dist/test-support/setup.d.ts +5 -0
  306. package/dist/test-support/setup.d.ts.map +1 -0
  307. package/dist/theme/colors.d.ts +196 -44
  308. package/dist/theme/colors.d.ts.map +1 -1
  309. package/dist/theme/colors.js +184 -22
  310. package/dist/theme/colors.js.map +1 -1
  311. package/dist/theme/colors.mjs +184 -22
  312. package/dist/theme/colors.mjs.map +1 -1
  313. package/dist/theme/global.d.ts.map +1 -1
  314. package/dist/theme/global.js +30 -2
  315. package/dist/theme/global.js.map +1 -1
  316. package/dist/theme/global.mjs +30 -2
  317. package/dist/theme/global.mjs.map +1 -1
  318. package/package.json +10 -2
  319. package/src/components/Icon/_constants/iconList.ts +35 -0
  320. package/src/components/Icon/index.tsx +20 -0
  321. package/src/components/SegmentedControl/SegmentedControl.tsx +21 -4
  322. package/src/components/Workflow/README.md +362 -0
  323. package/src/components/Workflow/Workflow.translations.json +112 -0
  324. package/src/components/Workflow/Workflow.tsx +189 -0
  325. package/src/components/Workflow/Workflow.types.ts +496 -0
  326. package/src/components/Workflow/WorkflowContext/WorkflowContext.tsx +215 -0
  327. package/src/components/Workflow/WorkflowContext/WorkflowContext.types.ts +122 -0
  328. package/src/components/Workflow/WorkflowContext/index.ts +10 -0
  329. package/src/components/Workflow/WorkflowContext/workflowSelection.test.tsx +93 -0
  330. package/src/components/Workflow/canvas/Canvas/BranchLabelBadge.tsx +69 -0
  331. package/src/components/Workflow/canvas/Canvas/Canvas.styles.ts +91 -0
  332. package/src/components/Workflow/canvas/Canvas/Canvas.tsx +773 -0
  333. package/src/components/Workflow/canvas/Canvas/CanvasControls.tsx +178 -0
  334. package/src/components/Workflow/canvas/Canvas/LabeledEdge.tsx +198 -0
  335. package/src/components/Workflow/canvas/Canvas/edgeLabelVariant.test.ts +26 -0
  336. package/src/components/Workflow/canvas/Canvas/edgeLabelVariant.ts +23 -0
  337. package/src/components/Workflow/canvas/Canvas/index.ts +1 -0
  338. package/src/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.tsx +96 -0
  339. package/src/components/Workflow/canvas/CollapsibleSection/index.ts +4 -0
  340. package/src/components/Workflow/canvas/DrawerShell/DrawerHeader.tsx +104 -0
  341. package/src/components/Workflow/canvas/DrawerShell/DrawerIssues.tsx +115 -0
  342. package/src/components/Workflow/canvas/DrawerShell/DrawerShell.tsx +408 -0
  343. package/src/components/Workflow/canvas/DrawerShell/index.ts +2 -0
  344. package/src/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.tsx +135 -0
  345. package/src/components/Workflow/canvas/EdgeInspector/endpointTitle.ts +38 -0
  346. package/src/components/Workflow/canvas/EdgeInspector/index.ts +2 -0
  347. package/src/components/Workflow/canvas/FieldWrapper/FieldWrapper.tsx +118 -0
  348. package/src/components/Workflow/canvas/FieldWrapper/index.ts +6 -0
  349. package/src/components/Workflow/canvas/FloatingCard/FloatingCard.tsx +37 -0
  350. package/src/components/Workflow/canvas/FloatingCard/index.ts +1 -0
  351. package/src/components/Workflow/canvas/GenericNode/GenericNode.tsx +114 -0
  352. package/src/components/Workflow/canvas/GenericNode/GenericNode.types.ts +10 -0
  353. package/src/components/Workflow/canvas/GenericNode/index.ts +5 -0
  354. package/src/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.tsx +284 -0
  355. package/src/components/Workflow/canvas/GraphErrorBanner/index.ts +1 -0
  356. package/src/components/Workflow/canvas/IconTile/IconTile.styles.ts +40 -0
  357. package/src/components/Workflow/canvas/IconTile/IconTile.tsx +36 -0
  358. package/src/components/Workflow/canvas/IconTile/IconTile.types.ts +13 -0
  359. package/src/components/Workflow/canvas/IconTile/index.ts +7 -0
  360. package/src/components/Workflow/canvas/IssueList/IssueList.tsx +84 -0
  361. package/src/components/Workflow/canvas/IssueList/index.ts +1 -0
  362. package/src/components/Workflow/canvas/NodePalette/NodePalette.styles.ts +7 -0
  363. package/src/components/Workflow/canvas/NodePalette/NodePalette.tsx +180 -0
  364. package/src/components/Workflow/canvas/NodePalette/NodePaletteToggle.tsx +39 -0
  365. package/src/components/Workflow/canvas/NodePalette/index.ts +3 -0
  366. package/src/components/Workflow/canvas/NodeShell/NodeShell.styles.ts +84 -0
  367. package/src/components/Workflow/canvas/NodeShell/NodeShell.tsx +321 -0
  368. package/src/components/Workflow/canvas/NodeShell/NodeShell.types.ts +45 -0
  369. package/src/components/Workflow/canvas/NodeShell/index.ts +8 -0
  370. package/src/components/Workflow/canvas/SeverityDot/SeverityDot.tsx +33 -0
  371. package/src/components/Workflow/canvas/SeverityDot/index.ts +1 -0
  372. package/src/components/Workflow/canvas/issueSeverity.ts +48 -0
  373. package/src/components/Workflow/canvas/useFieldFocusRequest.ts +54 -0
  374. package/src/components/Workflow/canvas/workflowLabelProps.ts +11 -0
  375. package/src/components/Workflow/connectionRules.test.ts +326 -0
  376. package/src/components/Workflow/connectionRules.ts +190 -0
  377. package/src/components/Workflow/createNode.test.ts +61 -0
  378. package/src/components/Workflow/createNode.ts +67 -0
  379. package/src/components/Workflow/graphHistory.test.ts +178 -0
  380. package/src/components/Workflow/graphHistory.ts +91 -0
  381. package/src/components/Workflow/graphObserver.ts +21 -0
  382. package/src/components/Workflow/graphReducer.test.ts +314 -0
  383. package/src/components/Workflow/graphReducer.ts +196 -0
  384. package/src/components/Workflow/index.ts +74 -0
  385. package/src/components/Workflow/layout/autoLayout.test.ts +170 -0
  386. package/src/components/Workflow/layout/autoLayout.ts +200 -0
  387. package/src/components/Workflow/stories/Workflow.stories.tsx +111 -0
  388. package/src/components/Workflow/stories/toyNodeTypes.tsx +146 -0
  389. package/src/components/Workflow/useWorkflowIssueMessage.test.ts +101 -0
  390. package/src/components/Workflow/useWorkflowIssueMessage.ts +49 -0
  391. package/src/components/Workflow/useWorkflowKeyboard.ts +126 -0
  392. package/src/index.ts +1 -0
  393. package/src/test-support/setup.ts +11 -0
  394. package/src/theme/SemanticTokens.mdx +61 -7
  395. package/src/theme/colors.ts +216 -26
  396. package/src/theme/global.ts +31 -2
@@ -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
+ }
@@ -34,7 +34,7 @@ primitive depending on the active color mode.
34
34
  Two payoffs:
35
35
 
36
36
  1. **Dark mode for free.** Add `color="fg.default"` and it's `gray.1300` in
37
- light and `gray.50` in dark — no `useColorMode`, no conditionals.
37
+ light and a light neutral in dark — no `useColorMode`, no conditionals.
38
38
  2. **Intent, not value.** `border.subtle` always reads as "a low-emphasis
39
39
  divider," whatever the mode. The intent is encoded once, in the theme.
40
40
 
@@ -49,21 +49,38 @@ have no semantic meaning.
49
49
  These cover text, surfaces, and borders — the bulk of any UI. Each flips
50
50
  between a light and a dark value.
51
51
 
52
+ > **Dark neutrals are desaturated.** The `Dark` columns below name the `gray`
53
+ > step each token mirrors, but in dark mode every neutral actually resolves to a
54
+ > _halved-saturation_ counterpart of that step (the blue-tinted `gray` ramp is
55
+ > right for light surfaces but muddy as a dark one). Light values are exactly the
56
+ > named `gray` step. You never reference the desaturated values directly — use
57
+ > the tokens.
58
+
52
59
  ### Foreground — `fg.*` (text & icons)
53
60
 
54
61
  | Token | Light | Dark | Use for |
55
62
  | --- | --- | --- | --- |
56
- | `fg.default` | `gray.1300` | `gray.200` | Primary text, headings, icons |
57
- | `fg.muted` | `gray.900` | `gray.300` | Secondary text, captions, supporting icons |
58
- | `fg.subtle` | `gray.700` | `gray.600` | Tertiary text, placeholders, disabled-ish labels |
63
+ | `fg.emphasized` | `gray.1300` | `gray.200` | Headings, titles, key figures, strong emphasis |
64
+ | `fg.default` | `gray.1000` | `gray.300` | Primary **body** text |
65
+ | `fg.muted` | `gray.900` | `gray.400` | Secondary text, captions, supporting icons |
66
+ | `fg.subtle` | `gray.700` | `gray.600`† | Tertiary text, placeholders, icons |
59
67
  | `fg.inverse` | `gray.0` | `gray.1400` | Text on an **inverse** surface (e.g. tooltip) |
60
68
 
69
+ † `fg.subtle`'s dark value is bumped one step lighter than the straight mirror so
70
+ helper/secondary text clears WCAG AA 4.5:1 on `bg.muted`.
71
+
72
+ > `fg.default` is the body weight; `fg.emphasized` is the strongest step (the
73
+ > near-black `gray.1300` `fg.default` used to be). Reach for `emphasized` only
74
+ > when you want maximum contrast — headings, key numbers.
75
+
61
76
  ### Background — `bg.*` (surfaces & fills)
62
77
 
63
78
  | Token | Light | Dark | Use for |
64
79
  | --- | --- | --- | --- |
65
80
  | `bg.canvas` | `gray.0` | `gray.1500` | App/page background |
66
81
  | `bg.surface` | `white` | `gray.1400` | Raised surface — cards, popovers, menus, modals |
82
+ | `bg.raised` | `white` | `gray.1100` | Strongly-raised neutral — one level above `surface` (e.g. a selected segment); tops the dark ramp so it reads as lifted |
83
+ | `bg.sunken` | `gray.50` | `gray.1500` | Sunken page wash for list/overview surfaces, so `bg.surface` cards read as raised above it |
67
84
  | `bg.subtle` | `gray.50` | `gray.1300` | Subtle fill, hover background, secondary surface |
68
85
  | `bg.muted` | `gray.100` | `gray.1200` | Muted fill, tertiary surface, neutral chips |
69
86
  | `bg.inverse` | `gray.1300` | `gray.50` | High-contrast/inverse surface (flips with mode) |
@@ -86,6 +103,30 @@ between a light and a dark value.
86
103
  </Box>
87
104
  ```
88
105
 
106
+ ### `slate.*` — foundational mode-aware neutral family
107
+
108
+ `slate.0`–`slate.1500` is a **first-class neutral palette**, sitting alongside
109
+ the raw `gray.*` primitives but **mode-aware**: `slate.N` is `gray.N` in light
110
+ and the desaturated counterpart in dark, so one token holds the same tonal level
111
+ in both modes (`slate.300` is a light divider in light and the matching dark
112
+ divider in dark — no `_dark={{…}}` at the call site). It lives under
113
+ `semanticTokens` only because Chakra requires that for the `_dark` flip;
114
+ conceptually it's a **foundation** (a tonal scale), not a **role**.
115
+
116
+ ```tsx
117
+ // Use a role token when one matches the intent (carries semantics + AA tuning):
118
+ <Text color="fg.muted" />
119
+
120
+ // Reach for slate when you need a specific neutral step no role names — the
121
+ // mode-aware equivalent of dropping to a raw gray.N:
122
+ <Box borderColor="slate.300" bg="slate.50" />
123
+ ```
124
+
125
+ > `slate` and the role tokens (`fg`/`bg`/`border`) are **distinct ramps** —
126
+ > `slate` is a mechanical light↔dark mirror, while the roles carry hand-tuned
127
+ > dark values (AA bumps, hierarchy). They share light values but **diverge in
128
+ > dark**, so they are not drop-in interchangeable. Pick by intent, not by value.
129
+
89
130
  ---
90
131
 
91
132
  ## The brand tokens
@@ -110,6 +151,18 @@ flips in dark mode:
110
151
  In dark mode these steps lighten so they keep contrast on dark surfaces — e.g.
111
152
  `primary.main` is `blue.500` in light and lifts to `blue.300` in dark.
112
153
 
154
+ ### Solid brand fills — `primary.fill` / `primary.fillStrong`
155
+
156
+ For a **solid blue surface with white text/icons on top** (modal headers, hero
157
+ banners, brand badges), use `primary.fill` (or `primary.fillStrong` for a deeper
158
+ shade) rather than `primary.main`. The `*.main`/`*.dark` steps lighten in dark —
159
+ right for foreground, but too light to carry white text as a fill — so the
160
+ `fill*` tokens stay deep blue in both modes.
161
+
162
+ ```tsx
163
+ <ModalHeader bg="primary.fill" color="white">Upgrade</ModalHeader>
164
+ ```
165
+
113
166
  ---
114
167
 
115
168
  ## Migration cheat-sheet
@@ -119,9 +172,10 @@ the nearest semantic token:
119
172
 
120
173
  | Was (primitive) | Use (semantic) |
121
174
  | --- | --- |
122
- | `gray.1000`–`gray.1500` as text | `fg.default` |
123
- | `gray.800`–`gray.900` as text | `fg.muted` |
124
- | `gray.500`–`gray.700` as text/icon | `fg.subtle` |
175
+ | `gray.1200`–`gray.1500` as heading/strong text | `fg.emphasized` |
176
+ | `gray.1000`–`gray.1100` as body text | `fg.default` |
177
+ | `gray.900` as secondary text | `fg.muted` |
178
+ | `gray.500`–`gray.800` as tertiary text/icon | `fg.subtle` |
125
179
  | `white` / `gray.0` surface | `bg.surface` / `bg.canvas` |
126
180
  | `gray.50` / `gray.100` fill | `bg.subtle` / `bg.muted` |
127
181
  | `gray.200` / `gray.300` border | `border.subtle` / `border.default` |