@xyne/workflow-ui 1.3.34 → 1.3.36

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 (188) hide show
  1. package/dist/components/builder/v3/WorkflowBuilderV3.d.ts +20 -1
  2. package/dist/components/builder/v3/WorkflowBuilderV3.d.ts.map +1 -1
  3. package/dist/components/builder/v3/WorkflowBuilderV3.js +15 -1
  4. package/dist/components/builder/v3/WorkflowBuilderV3.js.map +1 -1
  5. package/dist/components/dashboard/WorkflowDashboard.d.ts +5 -1
  6. package/dist/components/dashboard/WorkflowDashboard.d.ts.map +1 -1
  7. package/dist/components/dashboard/WorkflowDashboard.js +2 -2
  8. package/dist/components/dashboard/WorkflowDashboard.js.map +1 -1
  9. package/dist/components/provider/WorkflowUIProvider.d.ts +1 -1
  10. package/dist/components/provider/WorkflowUIProvider.d.ts.map +1 -1
  11. package/dist/components/provider/WorkflowUIProvider.js +3 -2
  12. package/dist/components/provider/WorkflowUIProvider.js.map +1 -1
  13. package/dist/components/provider/workflow-ui-context.d.ts +11 -0
  14. package/dist/components/provider/workflow-ui-context.d.ts.map +1 -1
  15. package/dist/components/provider/workflow-ui-context.js.map +1 -1
  16. package/dist/components/workflows/WorkflowApp.d.ts +6 -1
  17. package/dist/components/workflows/WorkflowApp.d.ts.map +1 -1
  18. package/dist/components/workflows/WorkflowApp.js +62 -32
  19. package/dist/components/workflows/WorkflowApp.js.map +1 -1
  20. package/dist/components/workflows/WorkflowHome.d.ts +10 -1
  21. package/dist/components/workflows/WorkflowHome.d.ts.map +1 -1
  22. package/dist/components/workflows/WorkflowHome.js +8 -8
  23. package/dist/components/workflows/WorkflowHome.js.map +1 -1
  24. package/dist/hooks/queries.d.ts +45 -0
  25. package/dist/hooks/queries.d.ts.map +1 -0
  26. package/dist/hooks/queries.js +57 -0
  27. package/dist/hooks/queries.js.map +1 -0
  28. package/dist/index.d.ts +5 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +11 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/live/LiveEventsProvider.d.ts +18 -0
  33. package/dist/live/LiveEventsProvider.d.ts.map +1 -0
  34. package/dist/live/LiveEventsProvider.js +113 -0
  35. package/dist/live/LiveEventsProvider.js.map +1 -0
  36. package/dist/live/live-context.d.ts +34 -0
  37. package/dist/live/live-context.d.ts.map +1 -0
  38. package/dist/live/live-context.js +10 -0
  39. package/dist/live/live-context.js.map +1 -0
  40. package/dist/live/use-live-workflow.d.ts +22 -0
  41. package/dist/live/use-live-workflow.d.ts.map +1 -0
  42. package/dist/live/use-live-workflow.js +47 -0
  43. package/dist/live/use-live-workflow.js.map +1 -0
  44. package/package.json +1 -1
  45. package/dist/components/builder/AddStepButton.d.ts +0 -6
  46. package/dist/components/builder/AddStepButton.d.ts.map +0 -1
  47. package/dist/components/builder/AddStepButton.js +0 -7
  48. package/dist/components/builder/AddStepButton.js.map +0 -1
  49. package/dist/components/builder/BranchEdge.d.ts +0 -3
  50. package/dist/components/builder/BranchEdge.d.ts.map +0 -1
  51. package/dist/components/builder/BranchEdge.js +0 -19
  52. package/dist/components/builder/BranchEdge.js.map +0 -1
  53. package/dist/components/builder/BuilderToolbar.d.ts +0 -10
  54. package/dist/components/builder/BuilderToolbar.d.ts.map +0 -1
  55. package/dist/components/builder/BuilderToolbar.js +0 -16
  56. package/dist/components/builder/BuilderToolbar.js.map +0 -1
  57. package/dist/components/builder/StepConfigDrawer.d.ts +0 -11
  58. package/dist/components/builder/StepConfigDrawer.d.ts.map +0 -1
  59. package/dist/components/builder/StepConfigDrawer.js +0 -21
  60. package/dist/components/builder/StepConfigDrawer.js.map +0 -1
  61. package/dist/components/builder/StepNode.d.ts +0 -15
  62. package/dist/components/builder/StepNode.d.ts.map +0 -1
  63. package/dist/components/builder/StepNode.js +0 -56
  64. package/dist/components/builder/StepNode.js.map +0 -1
  65. package/dist/components/builder/StepPalette.d.ts +0 -7
  66. package/dist/components/builder/StepPalette.d.ts.map +0 -1
  67. package/dist/components/builder/StepPalette.js +0 -83
  68. package/dist/components/builder/StepPalette.js.map +0 -1
  69. package/dist/components/builder/StepPicker.d.ts +0 -9
  70. package/dist/components/builder/StepPicker.d.ts.map +0 -1
  71. package/dist/components/builder/StepPicker.js +0 -95
  72. package/dist/components/builder/StepPicker.js.map +0 -1
  73. package/dist/components/builder/TriggerConfigPanel.d.ts +0 -10
  74. package/dist/components/builder/TriggerConfigPanel.d.ts.map +0 -1
  75. package/dist/components/builder/TriggerConfigPanel.js +0 -49
  76. package/dist/components/builder/TriggerConfigPanel.js.map +0 -1
  77. package/dist/components/builder/TriggerNode.d.ts +0 -9
  78. package/dist/components/builder/TriggerNode.d.ts.map +0 -1
  79. package/dist/components/builder/TriggerNode.js +0 -30
  80. package/dist/components/builder/TriggerNode.js.map +0 -1
  81. package/dist/components/builder/TriggerPicker.d.ts +0 -8
  82. package/dist/components/builder/TriggerPicker.d.ts.map +0 -1
  83. package/dist/components/builder/TriggerPicker.js +0 -61
  84. package/dist/components/builder/TriggerPicker.js.map +0 -1
  85. package/dist/components/builder/WorkflowBuilder.d.ts +0 -20
  86. package/dist/components/builder/WorkflowBuilder.d.ts.map +0 -1
  87. package/dist/components/builder/WorkflowBuilder.js +0 -157
  88. package/dist/components/builder/WorkflowBuilder.js.map +0 -1
  89. package/dist/components/builder/edge-types.d.ts +0 -3
  90. package/dist/components/builder/edge-types.d.ts.map +0 -1
  91. package/dist/components/builder/edge-types.js +0 -5
  92. package/dist/components/builder/edge-types.js.map +0 -1
  93. package/dist/components/builder/node-types.d.ts +0 -3
  94. package/dist/components/builder/node-types.d.ts.map +0 -1
  95. package/dist/components/builder/node-types.js +0 -11
  96. package/dist/components/builder/node-types.js.map +0 -1
  97. package/dist/components/builder/v2/AddStepButton.d.ts +0 -6
  98. package/dist/components/builder/v2/AddStepButton.d.ts.map +0 -1
  99. package/dist/components/builder/v2/AddStepButton.js +0 -6
  100. package/dist/components/builder/v2/AddStepButton.js.map +0 -1
  101. package/dist/components/builder/v2/BranchEdge.d.ts +0 -3
  102. package/dist/components/builder/v2/BranchEdge.d.ts.map +0 -1
  103. package/dist/components/builder/v2/BranchEdge.js +0 -46
  104. package/dist/components/builder/v2/BranchEdge.js.map +0 -1
  105. package/dist/components/builder/v2/LoopBodyEdge.d.ts +0 -7
  106. package/dist/components/builder/v2/LoopBodyEdge.d.ts.map +0 -1
  107. package/dist/components/builder/v2/LoopBodyEdge.js +0 -19
  108. package/dist/components/builder/v2/LoopBodyEdge.js.map +0 -1
  109. package/dist/components/builder/v2/LoopbackEdge.d.ts +0 -10
  110. package/dist/components/builder/v2/LoopbackEdge.d.ts.map +0 -1
  111. package/dist/components/builder/v2/LoopbackEdge.js +0 -26
  112. package/dist/components/builder/v2/LoopbackEdge.js.map +0 -1
  113. package/dist/components/builder/v2/StepNode.d.ts +0 -21
  114. package/dist/components/builder/v2/StepNode.d.ts.map +0 -1
  115. package/dist/components/builder/v2/StepNode.js +0 -36
  116. package/dist/components/builder/v2/StepNode.js.map +0 -1
  117. package/dist/components/builder/v2/StepPicker.d.ts +0 -8
  118. package/dist/components/builder/v2/StepPicker.d.ts.map +0 -1
  119. package/dist/components/builder/v2/StepPicker.js +0 -73
  120. package/dist/components/builder/v2/StepPicker.js.map +0 -1
  121. package/dist/components/builder/v2/TerminalNode.d.ts +0 -6
  122. package/dist/components/builder/v2/TerminalNode.d.ts.map +0 -1
  123. package/dist/components/builder/v2/TerminalNode.js +0 -7
  124. package/dist/components/builder/v2/TerminalNode.js.map +0 -1
  125. package/dist/components/builder/v2/TriggerNode.d.ts +0 -10
  126. package/dist/components/builder/v2/TriggerNode.d.ts.map +0 -1
  127. package/dist/components/builder/v2/TriggerNode.js +0 -20
  128. package/dist/components/builder/v2/TriggerNode.js.map +0 -1
  129. package/dist/components/builder/v2/TriggerPicker.d.ts +0 -7
  130. package/dist/components/builder/v2/TriggerPicker.d.ts.map +0 -1
  131. package/dist/components/builder/v2/TriggerPicker.js +0 -45
  132. package/dist/components/builder/v2/TriggerPicker.js.map +0 -1
  133. package/dist/components/builder/v2/WorkflowBuilder.d.ts +0 -14
  134. package/dist/components/builder/v2/WorkflowBuilder.d.ts.map +0 -1
  135. package/dist/components/builder/v2/WorkflowBuilder.js +0 -189
  136. package/dist/components/builder/v2/WorkflowBuilder.js.map +0 -1
  137. package/dist/components/builder/v2/edge-types.d.ts +0 -3
  138. package/dist/components/builder/v2/edge-types.d.ts.map +0 -1
  139. package/dist/components/builder/v2/edge-types.js +0 -9
  140. package/dist/components/builder/v2/edge-types.js.map +0 -1
  141. package/dist/components/builder/v2/icons.d.ts +0 -25
  142. package/dist/components/builder/v2/icons.d.ts.map +0 -1
  143. package/dist/components/builder/v2/icons.js +0 -43
  144. package/dist/components/builder/v2/icons.js.map +0 -1
  145. package/dist/components/builder/v2/layout-engine.d.ts +0 -76
  146. package/dist/components/builder/v2/layout-engine.d.ts.map +0 -1
  147. package/dist/components/builder/v2/layout-engine.js +0 -465
  148. package/dist/components/builder/v2/layout-engine.js.map +0 -1
  149. package/dist/components/builder/v2/node-types.d.ts +0 -3
  150. package/dist/components/builder/v2/node-types.d.ts.map +0 -1
  151. package/dist/components/builder/v2/node-types.js +0 -11
  152. package/dist/components/builder/v2/node-types.js.map +0 -1
  153. package/dist/components/builder/v2/theme.d.ts +0 -28
  154. package/dist/components/builder/v2/theme.d.ts.map +0 -1
  155. package/dist/components/builder/v2/theme.js +0 -63
  156. package/dist/components/builder/v2/theme.js.map +0 -1
  157. package/dist/components/dashboard/WorkflowSummaryEditor.d.ts +0 -11
  158. package/dist/components/dashboard/WorkflowSummaryEditor.d.ts.map +0 -1
  159. package/dist/components/dashboard/WorkflowSummaryEditor.js +0 -46
  160. package/dist/components/dashboard/WorkflowSummaryEditor.js.map +0 -1
  161. package/dist/components/execution/ExecutionEdge.d.ts +0 -4
  162. package/dist/components/execution/ExecutionEdge.d.ts.map +0 -1
  163. package/dist/components/execution/ExecutionEdge.js +0 -27
  164. package/dist/components/execution/ExecutionEdge.js.map +0 -1
  165. package/dist/components/execution/ExecutionJourney.d.ts +0 -24
  166. package/dist/components/execution/ExecutionJourney.d.ts.map +0 -1
  167. package/dist/components/execution/ExecutionJourney.js +0 -268
  168. package/dist/components/execution/ExecutionJourney.js.map +0 -1
  169. package/dist/components/execution/ExecutionStepNode.d.ts +0 -14
  170. package/dist/components/execution/ExecutionStepNode.d.ts.map +0 -1
  171. package/dist/components/execution/ExecutionStepNode.js +0 -47
  172. package/dist/components/execution/ExecutionStepNode.js.map +0 -1
  173. package/dist/components/execution/ExecutionTriggerNode.d.ts +0 -9
  174. package/dist/components/execution/ExecutionTriggerNode.d.ts.map +0 -1
  175. package/dist/components/execution/ExecutionTriggerNode.js +0 -15
  176. package/dist/components/execution/ExecutionTriggerNode.js.map +0 -1
  177. package/dist/components/execution/StepAgentPanels.d.ts +0 -9
  178. package/dist/components/execution/StepAgentPanels.d.ts.map +0 -1
  179. package/dist/components/execution/StepAgentPanels.js +0 -133
  180. package/dist/components/execution/StepAgentPanels.js.map +0 -1
  181. package/dist/components/execution/execution-layout.d.ts +0 -31
  182. package/dist/components/execution/execution-layout.d.ts.map +0 -1
  183. package/dist/components/execution/execution-layout.js +0 -90
  184. package/dist/components/execution/execution-layout.js.map +0 -1
  185. package/dist/components/shared/JsonTreeViewer.d.ts +0 -9
  186. package/dist/components/shared/JsonTreeViewer.d.ts.map +0 -1
  187. package/dist/components/shared/JsonTreeViewer.js +0 -46
  188. package/dist/components/shared/JsonTreeViewer.js.map +0 -1
@@ -17,7 +17,7 @@ const TABS = [
17
17
  * approvals, and credentials. Workflow UI owns every fixed tab; hosts may
18
18
  * customize product-specific credential metadata through the display slot.
19
19
  */
20
- export function WorkflowHome({ path, onPathChange, onSelectWorkflow, onViewRun, approvalId, onApprovalSelect, onToast, defaultTab = 'workflows', tab: controlledTab, onTabChange, detailView, onLeaveDetail, className, }) {
20
+ export function WorkflowHome({ path, onPathChange, onSelectWorkflow, onViewRun, approvalId, onApprovalSelect, onToast, defaultTab = 'workflows', tab: controlledTab, onTabChange, detailView, onLeaveDetail, headerActions, className, }) {
21
21
  const [internalTab, setInternalTab] = useState(defaultTab);
22
22
  const tab = controlledTab ?? internalTab;
23
23
  const selectTab = (key) => {
@@ -29,12 +29,12 @@ export function WorkflowHome({ path, onPathChange, onSelectWorkflow, onViewRun,
29
29
  const polledCount = useApprovalCount();
30
30
  const [liveCount, setLiveCount] = useState(null);
31
31
  const approvalCount = liveCount ?? polledCount;
32
- return (_jsxs("div", { className: cn('flex h-full min-h-0 flex-col bg-[var(--wui-bg)]', className), children: [_jsx("div", { role: "tablist", "aria-label": "Workflow sections", className: "flex shrink-0 items-center gap-1 border-b border-[var(--wui-border)] px-4", children: TABS.map(({ key, label }) => {
33
- const active = tab === key;
34
- const showBadge = key === 'approvals' && approvalCount > 0;
35
- return (_jsxs("button", { type: "button", role: "tab", "aria-selected": active, onClick: () => { selectTab(key); }, className: cn('relative -mb-px flex items-center gap-2 border-b-2 px-3 py-3 text-[13px] font-medium transition-colors', active
36
- ? 'border-[var(--wui-primary)] text-[var(--wui-fg)]'
37
- : 'border-transparent text-[var(--wui-fg-muted)] hover:text-[var(--wui-fg)]'), children: [label, showBadge && (_jsx("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-[var(--wui-primary)] px-1.5 text-[11px] font-semibold leading-none text-[var(--wui-primary-fg)]", "aria-label": `${approvalCount} pending`, children: approvalCount > 99 ? '99+' : approvalCount }))] }, key));
38
- }) }), _jsx("div", { className: "min-h-0 flex-1", children: detailView ?? (_jsxs(_Fragment, { children: [tab === 'workflows' && (_jsx(WorkflowBrowser, { className: "h-full", hideApprovals: true, path: path, onPathChange: onPathChange, onSelectWorkflow: onSelectWorkflow, onViewRun: onViewRun, ...(onToast ? { onToast } : {}) })), tab === 'executions' && (_jsx(RunsView, { className: "h-full", onSelectExecution: (id) => onViewRun(id, 'Execution') })), tab === 'approvals' && (_jsx(ApprovalsView, { className: "h-full", onViewRun: onViewRun, onCountChange: setLiveCount, selectedId: approvalId, ...(onApprovalSelect ? { onSelect: onApprovalSelect } : {}) })), tab === 'credentials' && (_jsx("div", { className: "h-full overflow-auto", children: _jsx(CredentialVault, { ...(onToast ? { onToast } : {}) }) }))] })) })] }));
32
+ return (_jsxs("div", { className: cn('flex h-full min-h-0 flex-col bg-[var(--wui-bg)]', className), children: [_jsxs("div", { role: "tablist", "aria-label": "Workflow sections", className: "flex shrink-0 items-center gap-1 border-b border-[var(--wui-border)] px-4", children: [TABS.map(({ key, label }) => {
33
+ const active = tab === key;
34
+ const showBadge = key === 'approvals' && approvalCount > 0;
35
+ return (_jsxs("button", { type: "button", role: "tab", "aria-selected": active, onClick: () => { selectTab(key); }, className: cn('relative -mb-px flex items-center gap-2 border-b-2 px-3 py-3 text-[13px] font-medium transition-colors', active
36
+ ? 'border-[var(--wui-primary)] text-[var(--wui-fg)]'
37
+ : 'border-transparent text-[var(--wui-fg-muted)] hover:text-[var(--wui-fg)]'), children: [label, showBadge && (_jsx("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-[var(--wui-primary)] px-1.5 text-[11px] font-semibold leading-none text-[var(--wui-primary-fg)]", "aria-label": `${approvalCount} pending`, children: approvalCount > 99 ? '99+' : approvalCount }))] }, key));
38
+ }), headerActions ? (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-1 pl-2", children: headerActions })) : null] }), _jsx("div", { className: "min-h-0 flex-1", children: detailView ?? (_jsxs(_Fragment, { children: [tab === 'workflows' && (_jsx(WorkflowBrowser, { className: "h-full", hideApprovals: true, path: path, onPathChange: onPathChange, onSelectWorkflow: onSelectWorkflow, onViewRun: onViewRun, ...(onToast ? { onToast } : {}) })), tab === 'executions' && (_jsx(RunsView, { className: "h-full", onSelectExecution: (id) => onViewRun(id, 'Execution') })), tab === 'approvals' && (_jsx(ApprovalsView, { className: "h-full", onViewRun: onViewRun, onCountChange: setLiveCount, selectedId: approvalId, ...(onApprovalSelect ? { onSelect: onApprovalSelect } : {}) })), tab === 'credentials' && (_jsx("div", { className: "h-full overflow-auto", children: _jsx(CredentialVault, { ...(onToast ? { onToast } : {}) }) }))] })) })] }));
39
39
  }
40
40
  //# sourceMappingURL=WorkflowHome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowHome.js","sourceRoot":"","sources":["../../../src/components/workflows/WorkflowHome.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AA+BrC,MAAM,IAAI,GAA2D;IACnE,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACxC,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC1C,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACxC,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EACJ,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,UAAU,GAAG,WAAW,EACxB,GAAG,EAAE,aAAa,EAClB,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,GACS;IAClB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAkB,UAAU,CAAC,CAAC;IAC5E,MAAM,GAAG,GAAG,aAAa,IAAI,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,CAAC,CAAC,CAAC,EAAE,CAAC,GAChC,CACH,EACA,GAAG,KAAK,YAAY,IAAI,CACvB,KAAC,QAAQ,IACP,SAAS,EAAC,QAAQ,EAClB,iBAAiB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,WAAW,CAAC,GACrD,CACH,EACA,GAAG,KAAK,WAAW,IAAI,CACtB,KAAC,aAAa,IACZ,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,YAAY,EAC3B,UAAU,EAAE,UAAU,KAClB,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAC5D,CACH,EACA,GAAG,KAAK,aAAa,IAAI,CACxB,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,eAAe,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAI,GACjD,CACP,IACA,CACJ,GACG,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The query layer: cache keys, and the reads that live under them.
3
+ *
4
+ * These exist so that a change notification has something to invalidate. The
5
+ * package previously fetched with `useEffect` + `useState` in every component,
6
+ * which cannot be told "that is stale now" from outside — a notification would
7
+ * have had nowhere to land. React Query was already a declared peer dependency;
8
+ * until now nothing used it.
9
+ */
10
+ import { type UseQueryResult } from '@tanstack/react-query';
11
+ import type { WorkflowConfig, Action } from '@xyne/workflow-sdk';
12
+ import type { WorkflowClient } from '@xyne/workflow-sdk/client';
13
+ /**
14
+ * Cache keys, in one place.
15
+ *
16
+ * Hierarchical and built from `all` downward so a broad invalidation reaches
17
+ * everything beneath it. Hand-written key arrays scattered across components are
18
+ * how invalidation silently stops matching.
19
+ */
20
+ export declare const wfKeys: {
21
+ readonly all: readonly ["xyne-workflow-ui"];
22
+ readonly workflow: (workflowId: string) => readonly ["xyne-workflow-ui", "workflow", string];
23
+ readonly workflowList: (folderId?: string) => readonly ["xyne-workflow-ui", "workflow-list", string | null];
24
+ };
25
+ /** A workflow, with its JSON columns already parsed. */
26
+ export interface WorkflowDetail {
27
+ workflowId: string;
28
+ name: string;
29
+ config: WorkflowConfig | undefined;
30
+ summary?: string;
31
+ permittedActions?: readonly Action[];
32
+ }
33
+ /**
34
+ * `metadata` and `config` are stored as JSON strings, so every reader would
35
+ * otherwise parse them itself — and disagree about what a malformed one means.
36
+ */
37
+ export declare function toWorkflowDetail(workflowId: string, record: Awaited<ReturnType<WorkflowClient['workflows']['get']>>): WorkflowDetail;
38
+ /**
39
+ * Read one workflow.
40
+ *
41
+ * Pass `undefined` to read nothing — the query stays disabled rather than the
42
+ * caller having to branch around the hook, which it could not do anyway.
43
+ */
44
+ export declare function useWorkflowDetail(workflowId: string | undefined): UseQueryResult<WorkflowDetail>;
45
+ //# sourceMappingURL=queries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/hooks/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;;oCAEM,MAAM;uCACH,MAAM;CAExB,CAAC;AAEX,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAC9D,cAAc,CAehB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,cAAc,CAAC,cAAc,CAAC,CAQhC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The query layer: cache keys, and the reads that live under them.
3
+ *
4
+ * These exist so that a change notification has something to invalidate. The
5
+ * package previously fetched with `useEffect` + `useState` in every component,
6
+ * which cannot be told "that is stale now" from outside — a notification would
7
+ * have had nowhere to land. React Query was already a declared peer dependency;
8
+ * until now nothing used it.
9
+ */
10
+ import { useQuery } from '@tanstack/react-query';
11
+ import { useWorkflowUI } from '../components/provider/workflow-ui-context.js';
12
+ /**
13
+ * Cache keys, in one place.
14
+ *
15
+ * Hierarchical and built from `all` downward so a broad invalidation reaches
16
+ * everything beneath it. Hand-written key arrays scattered across components are
17
+ * how invalidation silently stops matching.
18
+ */
19
+ export const wfKeys = {
20
+ all: ['xyne-workflow-ui'],
21
+ workflow: (workflowId) => [...wfKeys.all, 'workflow', workflowId],
22
+ workflowList: (folderId) => [...wfKeys.all, 'workflow-list', folderId ?? null],
23
+ };
24
+ /**
25
+ * `metadata` and `config` are stored as JSON strings, so every reader would
26
+ * otherwise parse them itself — and disagree about what a malformed one means.
27
+ */
28
+ export function toWorkflowDetail(workflowId, record) {
29
+ const meta = record.metadata
30
+ ? JSON.parse(record.metadata)
31
+ : {};
32
+ const config = record.config
33
+ ? JSON.parse(record.config)
34
+ : undefined;
35
+ return {
36
+ workflowId,
37
+ name: meta.name ?? workflowId,
38
+ config,
39
+ ...(record.summary != null ? { summary: record.summary } : {}),
40
+ ...(record.permittedActions ? { permittedActions: record.permittedActions } : {}),
41
+ };
42
+ }
43
+ /**
44
+ * Read one workflow.
45
+ *
46
+ * Pass `undefined` to read nothing — the query stays disabled rather than the
47
+ * caller having to branch around the hook, which it could not do anyway.
48
+ */
49
+ export function useWorkflowDetail(workflowId) {
50
+ const { client } = useWorkflowUI();
51
+ return useQuery({
52
+ queryKey: wfKeys.workflow(workflowId ?? ''),
53
+ queryFn: async () => toWorkflowDetail(workflowId, await client.workflows.get(workflowId)),
54
+ enabled: Boolean(workflowId),
55
+ });
56
+ }
57
+ //# sourceMappingURL=queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/hooks/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAuB,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,EAAE,CAAC,kBAAkB,CAAU;IAClC,QAAQ,EAAE,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAU;IAClF,YAAY,EAAE,CAAC,QAAiB,EAAE,EAAE,CAClC,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,IAAI,IAAI,CAAU;CACrD,CAAC;AAWX;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAkB,EAClB,MAA+D;IAE/D,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ;QAC1B,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAuB;QACpD,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;QAC1B,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAoB;QAC/C,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO;QACL,UAAU;QACV,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,UAAU;QAC7B,MAAM;QACN,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IAEnC,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3C,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,UAAW,EAAE,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,UAAW,CAAC,CAAC;QAC3F,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC;KAC7B,CAAC,CAAC;AACL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@
19
19
  export { WorkflowUIProvider, useWorkflowUI, useSlot, cn, StatusBadge, EmptyState, LoadingSpinner, ErrorBoundary, WorkflowBuilder, computeLayout, SchemaFormRenderer, RunsView, RunsTable, RunsFilters, ExecutionViewer, ExecutionTree, ExecutionHeader, StepDetailPanel, SummaryPanel, SidePanelShell, PauseInteractionPanel, SchemaAwareRenderer, WorkflowDashboard, SummaryButton, SummaryDialog, MarkdownView, CitationArrow, CitationMarks, AppShell, Sidebar, Breadcrumb, PageHeader, AutomationCard, AutomationListView, CreateWorkflowDialog, AnalyticsDashboard, WorkflowBrowser, WorkflowHome, WorkflowApp, CredentialVault, } from './components/index.js';
20
20
  export type { WorkflowUIConfig, StatusBadgeProps, StatusVariant, EmptyStateProps, LoadingSpinnerProps, ErrorBoundaryProps, WorkflowBuilderProps, LayoutNode, LayoutEdge, LayoutResult, SchemaFormRendererProps, RunsViewProps, RunsTableProps, RunsFiltersProps, ExecutionViewerProps, ExecutionTreeProps, ExecutionHeaderProps, StepDetailPanelProps, SummaryPanelProps, SidePanelShellProps, PauseInteractionPanelProps, SchemaAwareRendererProps, WorkflowDashboardProps, SummaryButtonProps, SummaryDialogProps, MarkdownViewProps, CitationArrowProps, CitationMarksProps, AppShellProps, SidebarProps, SidebarItem, BreadcrumbProps, BreadcrumbItem, PageHeaderProps, AutomationCardProps, AutomationListViewProps, CreateWorkflowDialogProps, AnalyticsDashboardProps, WorkflowBrowserProps, FolderCrumb, WorkflowHomeProps, WorkflowHomeTab, WorkflowAppProps, CredentialVaultProps, } from './components/index.js';
21
21
  export { canPerform, isPermissionDenied, friendlyMutationError } from './utils/permissions.js';
22
+ export { useLiveWorkflow, useWorkflowChanges } from './live/use-live-workflow.js';
23
+ export { useLiveContext } from './live/live-context.js';
24
+ export type { LiveChange, LiveContextValue } from './live/live-context.js';
25
+ export { wfKeys, useWorkflowDetail, toWorkflowDetail } from './hooks/queries.js';
26
+ export type { WorkflowDetail } from './hooks/queries.js';
22
27
  export { useAnalytics } from './hooks/use-analytics.js';
23
28
  export { useApprovalCount } from './hooks/use-approval-count.js';
24
29
  export { ApprovalsView } from './components/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAEL,kBAAkB,EAClB,aAAa,EACb,OAAO,EAEP,EAAE,EACF,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EAEb,eAAe,EACf,aAAa,EAEb,kBAAkB,EAElB,QAAQ,EACR,SAAS,EACT,WAAW,EAEX,eAAe,EACf,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,q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B,EAAE,MAAM,0BAA0B,CAAC;AAGlG,YAAY,EACV,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,gCAAgC,EAChC,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAEL,kBAAkB,EAClB,aAAa,EACb,OAAO,EAEP,EAAE,EACF,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EAEb,eAAe,EACf,aAAa,EAEb,kBAAkB,EAElB,QAAQ,EACR,SAAS,EACT,WAAW,EAEX,eAAe,EACf,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EAEnB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EAEb,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU,EAEV,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EAEpB,kBAAkB,EAElB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,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A2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC"}
package/dist/index.js CHANGED
@@ -43,6 +43,17 @@ WorkflowBrowser, WorkflowHome, WorkflowApp, CredentialVault, } from './component
43
43
  // ─── Authorization (UI reflection helpers) ───
44
44
  export { canPerform, isPermissionDenied, friendlyMutationError } from './utils/permissions.js';
45
45
  // ─── Analytics hooks ───
46
+ // ─── Live change notifications ───
47
+ //
48
+ // The provider owns one multiplexed connection; these are how a component
49
+ // registers interest in it. `useLiveWorkflow` keeps a cached workflow honest on
50
+ // its own; `useWorkflowChanges` is for the cases where refreshing is the wrong
51
+ // answer, such as an editor holding unsaved work.
52
+ export { useLiveWorkflow, useWorkflowChanges } from './live/use-live-workflow.js';
53
+ export { useLiveContext } from './live/live-context.js';
54
+ // Query keys and reads, so a host can prime or invalidate the same cache the
55
+ // components use.
56
+ export { wfKeys, useWorkflowDetail, toWorkflowDetail } from './hooks/queries.js';
46
57
  export { useAnalytics } from './hooks/use-analytics.js';
47
58
  // ─── Approvals ───
48
59
  export { useApprovalCount } from './hooks/use-approval-count.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qBAAqB;AACrB,OAAO;AACL,WAAW;AACX,kBAAkB,EAClB,aAAa,EACb,OAAO;AACP,SAAS;AACT,EAAE,EACF,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa;AACb,UAAU;AACV,eAAe,EACf,aAAa;AACb,cAAc;AACd,kBAAkB;AAClB,OAAO;AACP,QAAQ,EACR,SAAS,EACT,WAAW;AACX,YAAY;AACZ,eAAe,EACf,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,mBAAmB;AACnB,YAAY;AACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa;AACb,SAAS;AACT,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU;AACV,cAAc;AACd,cAAc,EACd,kBAAkB,EAClB,oBAAoB;AACpB,YAAY;AACZ,kBAAkB;AAClB,mBAAmB;AACnB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAqD/B,gDAAgD;AAChD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,0BAA0B;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AActD,oEAAoE;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qBAAqB;AACrB,OAAO;AACL,WAAW;AACX,kBAAkB,EAClB,aAAa,EACb,OAAO;AACP,SAAS;AACT,EAAE,EACF,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa;AACb,UAAU;AACV,eAAe,EACf,aAAa;AACb,cAAc;AACd,kBAAkB;AAClB,OAAO;AACP,QAAQ,EACR,SAAS,EACT,WAAW;AACX,YAAY;AACZ,eAAe,EACf,aAAa,EACb,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,mBAAmB;AACnB,YAAY;AACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa;AACb,SAAS;AACT,QAAQ,EACR,OAAO,EACP,UAAU,EACV,UAAU;AACV,cAAc;AACd,cAAc,EACd,kBAAkB,EAClB,oBAAoB;AACpB,YAAY;AACZ,kBAAkB;AAClB,mBAAmB;AACnB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAqD/B,gDAAgD;AAChD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,0BAA0B;AAC1B,oCAAoC;AACpC,EAAE;AACF,0EAA0E;AAC1E,gFAAgF;AAChF,+EAA+E;AAC/E,kDAAkD;AAClD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,6EAA6E;AAC7E,kBAAkB;AAClB,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGjF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AActD,oEAAoE;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import type { WorkflowClient } from '@xyne/workflow-sdk/client';
3
+ /**
4
+ * Owns the single change-notification connection for everything below it.
5
+ *
6
+ * One connection, not one per component. Browsers cap concurrent connections per
7
+ * origin (six, on HTTP/1.1), and a screen showing a list, a builder and a run
8
+ * would spend most of that budget on streams that could share one.
9
+ *
10
+ * Membership is reconciled from a registry rather than driven by props: watchers
11
+ * come and go with navigation, and the connection should follow them without any
12
+ * component having to know about the others.
13
+ */
14
+ export declare function LiveEventsProvider({ client, children, }: {
15
+ client: WorkflowClient;
16
+ children: React.ReactNode;
17
+ }): React.JSX.Element;
18
+ //# sourceMappingURL=LiveEventsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveEventsProvider.d.ts","sourceRoot":"","sources":["../../src/live/LiveEventsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAYhE;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAwGA"}
@@ -0,0 +1,113 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { LiveContext } from './live-context.js';
4
+ /**
5
+ * How long the watched set must hold still before the connection is rebuilt.
6
+ *
7
+ * Mounting a screen registers several watchers in the same tick, and navigation
8
+ * unregisters a batch and registers another. Reconnecting on each would open and
9
+ * discard a connection per component; waiting for the set to settle opens one.
10
+ */
11
+ const RECONCILE_DELAY_MS = 150;
12
+ /**
13
+ * Owns the single change-notification connection for everything below it.
14
+ *
15
+ * One connection, not one per component. Browsers cap concurrent connections per
16
+ * origin (six, on HTTP/1.1), and a screen showing a list, a builder and a run
17
+ * would spend most of that budget on streams that could share one.
18
+ *
19
+ * Membership is reconciled from a registry rather than driven by props: watchers
20
+ * come and go with navigation, and the connection should follow them without any
21
+ * component having to know about the others.
22
+ */
23
+ export function LiveEventsProvider({ client, children, }) {
24
+ const registry = React.useRef(new Map());
25
+ const timer = React.useRef(undefined);
26
+ // Sorted, comma-joined: a stable string, so an unchanged set cannot re-render
27
+ // or re-subscribe just because a new array was allocated.
28
+ const [topicKey, setTopicKey] = React.useState('');
29
+ const [connected, setConnected] = React.useState(false);
30
+ const reconcile = React.useCallback(() => {
31
+ if (timer.current !== undefined)
32
+ clearTimeout(timer.current);
33
+ timer.current = setTimeout(() => {
34
+ const next = [...registry.current.keys()].sort().join(',');
35
+ setTopicKey((prev) => (prev === next ? prev : next));
36
+ }, RECONCILE_DELAY_MS);
37
+ }, []);
38
+ const watch = React.useCallback((workflowId, listener) => {
39
+ let listeners = registry.current.get(workflowId);
40
+ if (!listeners) {
41
+ listeners = new Set();
42
+ registry.current.set(workflowId, listeners);
43
+ }
44
+ const own = listeners;
45
+ own.add(listener);
46
+ reconcile();
47
+ return () => {
48
+ // Identity guard: this handle may outlive the entry it created, and must
49
+ // not evict whatever replaced it.
50
+ if (registry.current.get(workflowId) !== own)
51
+ return;
52
+ own.delete(listener);
53
+ if (own.size === 0)
54
+ registry.current.delete(workflowId);
55
+ reconcile();
56
+ };
57
+ }, [reconcile]);
58
+ const emit = React.useCallback((workflowId, change) => {
59
+ const listeners = registry.current.get(workflowId);
60
+ if (!listeners)
61
+ return;
62
+ // Snapshot: a listener may unregister itself while being notified.
63
+ for (const listener of [...listeners])
64
+ listener(change);
65
+ }, []);
66
+ React.useEffect(() => {
67
+ if (topicKey === '') {
68
+ setConnected(false);
69
+ return;
70
+ }
71
+ const workflows = topicKey.split(',');
72
+ const stop = client.events.subscribe({ workflows }, {
73
+ onEvent: (event) => {
74
+ if (event.event !== 'workflow_changed')
75
+ return;
76
+ const { data } = event;
77
+ // Drop the echo of our own write. Suppressed here, once, rather than in
78
+ // every consumer: an editor that cannot tell its own save from someone
79
+ // else's reports the user's own work as a conflict.
80
+ if (data.origin && data.origin === client.origin)
81
+ return;
82
+ emit(data.workflowId, {
83
+ workflowId: data.workflowId,
84
+ reason: 'changed',
85
+ change: data.change,
86
+ });
87
+ },
88
+ onOpen: ({ reconnected }) => {
89
+ setConnected(true);
90
+ if (!reconnected)
91
+ return;
92
+ // Nothing was buffered while we were away, so every watcher re-reads.
93
+ for (const workflowId of [...registry.current.keys()]) {
94
+ emit(workflowId, { workflowId, reason: 'resync' });
95
+ }
96
+ },
97
+ onError: () => {
98
+ setConnected(false);
99
+ },
100
+ });
101
+ return () => {
102
+ stop();
103
+ setConnected(false);
104
+ };
105
+ }, [client, topicKey, emit]);
106
+ React.useEffect(() => () => {
107
+ if (timer.current !== undefined)
108
+ clearTimeout(timer.current);
109
+ }, []);
110
+ const value = React.useMemo(() => ({ watch, connected }), [watch, connected]);
111
+ return _jsx(LiveContext.Provider, { value: value, children: children });
112
+ }
113
+ //# sourceMappingURL=LiveEventsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveEventsProvider.js","sourceRoot":"","sources":["../../src/live/LiveEventsProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAA4C,MAAM,mBAAmB,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,GAIT;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,EAA6B,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAA4C,SAAS,CAAC,CAAC;IACjF,8EAA8E;IAC9E,0DAA0D;IAC1D,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExD,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACvC,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;YAAE,YAA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;gBACnB,IAAI,CAAC,WAAW;oBAAE,OAAO;gBACzB,sEAAsE;gBACtE,KAAK,MAAM,UAAU,IAAI,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;oBACtD,IAAI,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;YACD,OAAO,EAAE,GAAG,EAAE;gBACZ,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;SACF,CACF,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,IAAI,EAAE,CAAC;YACP,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAE7B,KAAK,CAAC,SAAS,CACb,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACzB,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAC5B,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAwB,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { WorkflowChangeKind } from '@xyne/workflow-sdk';
2
+ /**
3
+ * Why a subscriber is being told to look again.
4
+ *
5
+ * - `changed` — a specific change arrived, and `change` says what kind.
6
+ * - `resync` — the connection came back after a drop. The stream cannot replay,
7
+ * so anything published while it was down is gone: re-read regardless of
8
+ * whether a change was actually missed. The recovery path and the happy path
9
+ * then run the same code, which is the only way the rare one stays correct.
10
+ */
11
+ export interface LiveChange {
12
+ workflowId: string;
13
+ reason: 'changed' | 'resync';
14
+ change?: WorkflowChangeKind;
15
+ }
16
+ export type LiveListener = (change: LiveChange) => void;
17
+ export interface LiveContextValue {
18
+ /**
19
+ * Register interest in a workflow. Returns a cleanup that deregisters it.
20
+ *
21
+ * Registering is not the same as connecting: the provider pools every watcher
22
+ * into one connection and reopens it when the set settles.
23
+ */
24
+ watch: (workflowId: string, listener: LiveListener) => () => void;
25
+ /** False while no connection is open — nothing is watched, or it is retrying. */
26
+ connected: boolean;
27
+ }
28
+ /**
29
+ * Null when the host has not mounted the live layer. Every consumer degrades to
30
+ * "no live updates" rather than throwing, so a host can leave it off.
31
+ */
32
+ export declare const LiveContext: import("react").Context<LiveContextValue | null>;
33
+ export declare function useLiveContext(): LiveContextValue | null;
34
+ //# sourceMappingURL=live-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-context.d.ts","sourceRoot":"","sources":["../../src/live/live-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,KAAK,MAAM,IAAI,CAAC;IAClE,iFAAiF;IACjF,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,kDAA+C,CAAC;AAExE,wBAAgB,cAAc,IAAI,gBAAgB,GAAG,IAAI,CAExD"}
@@ -0,0 +1,10 @@
1
+ import { createContext, useContext } from 'react';
2
+ /**
3
+ * Null when the host has not mounted the live layer. Every consumer degrades to
4
+ * "no live updates" rather than throwing, so a host can leave it off.
5
+ */
6
+ export const LiveContext = createContext(null);
7
+ export function useLiveContext() {
8
+ return useContext(LiveContext);
9
+ }
10
+ //# sourceMappingURL=live-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-context.js","sourceRoot":"","sources":["../../src/live/live-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAgClD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAA0B,IAAI,CAAC,CAAC;AAExE,MAAM,UAAU,cAAc;IAC5B,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type LiveChange } from './live-context.js';
2
+ /**
3
+ * Be told when a workflow changes somewhere other than here.
4
+ *
5
+ * The low-level hook: it reports, and the caller decides. Most callers want
6
+ * {@link useLiveWorkflow} instead — reach for this one when "refresh" is the
7
+ * wrong answer, as it is in an editor holding unsaved work.
8
+ *
9
+ * A no-op when the host has not mounted the live layer, or while `workflowId` is
10
+ * undefined, so a caller never has to guard the call.
11
+ */
12
+ export declare function useWorkflowChanges(workflowId: string | undefined, onChange: (change: LiveChange) => void): void;
13
+ /**
14
+ * Keep a workflow's cached copy honest: re-read it whenever it changes elsewhere.
15
+ *
16
+ * Invalidates rather than patching from the event, because the event carries no
17
+ * workflow — deliberately. The re-read goes through the ordinary authorized GET,
18
+ * which is what keeps access control on the read path instead of at a fan-out
19
+ * layer that knows nothing about who is listening.
20
+ */
21
+ export declare function useLiveWorkflow(workflowId: string | undefined): void;
22
+ //# sourceMappingURL=use-live-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-live-workflow.d.ts","sourceRoot":"","sources":["../../src/live/use-live-workflow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GACrC,IAAI,CAgBN;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOpE"}
@@ -0,0 +1,47 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { useQueryClient } from '@tanstack/react-query';
3
+ import { wfKeys } from '../hooks/queries.js';
4
+ import { useLiveContext } from './live-context.js';
5
+ /**
6
+ * Be told when a workflow changes somewhere other than here.
7
+ *
8
+ * The low-level hook: it reports, and the caller decides. Most callers want
9
+ * {@link useLiveWorkflow} instead — reach for this one when "refresh" is the
10
+ * wrong answer, as it is in an editor holding unsaved work.
11
+ *
12
+ * A no-op when the host has not mounted the live layer, or while `workflowId` is
13
+ * undefined, so a caller never has to guard the call.
14
+ */
15
+ export function useWorkflowChanges(workflowId, onChange) {
16
+ const live = useLiveContext();
17
+ // Held in a ref so that an inline arrow — which almost every caller passes —
18
+ // does not tear down and reopen the subscription on every render.
19
+ const handler = useRef(onChange);
20
+ useEffect(() => {
21
+ handler.current = onChange;
22
+ }, [onChange]);
23
+ useEffect(() => {
24
+ if (!live || !workflowId)
25
+ return;
26
+ return live.watch(workflowId, (change) => {
27
+ handler.current(change);
28
+ });
29
+ }, [live, workflowId]);
30
+ }
31
+ /**
32
+ * Keep a workflow's cached copy honest: re-read it whenever it changes elsewhere.
33
+ *
34
+ * Invalidates rather than patching from the event, because the event carries no
35
+ * workflow — deliberately. The re-read goes through the ordinary authorized GET,
36
+ * which is what keeps access control on the read path instead of at a fan-out
37
+ * layer that knows nothing about who is listening.
38
+ */
39
+ export function useLiveWorkflow(workflowId) {
40
+ const queryClient = useQueryClient();
41
+ useWorkflowChanges(workflowId, () => {
42
+ if (!workflowId)
43
+ return;
44
+ void queryClient.invalidateQueries({ queryKey: wfKeys.workflow(workflowId) });
45
+ });
46
+ }
47
+ //# sourceMappingURL=use-live-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-live-workflow.js","sourceRoot":"","sources":["../../src/live/use-live-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA8B,EAC9B,QAAsC;IAEtC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,kEAAkE;IAClE,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC7B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU;YAAE,OAAO;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE;YACvC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,UAA8B;IAC5D,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE;QAClC,IAAI,CAAC,UAAU;YAAE,OAAO;QACxB,KAAK,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyne/workflow-ui",
3
- "version": "1.3.34",
3
+ "version": "1.3.36",
4
4
  "description": "Workflow builder + execution-viewer React UI for @xyne/workflow-sdk.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1,6 +0,0 @@
1
- import type { NodeProps } from '@xyflow/react';
2
- export interface AddStepButtonData {
3
- afterStepId: string;
4
- }
5
- export declare function AddStepButton(_props: NodeProps): import("react").JSX.Element;
6
- //# sourceMappingURL=AddStepButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddStepButton.d.ts","sourceRoot":"","sources":["../../../src/components/builder/AddStepButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,+BAqB9C"}
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Handle, Position } from '@xyflow/react';
3
- export function AddStepButton(_props) {
4
- // Click is handled by onNodeClick on the ReactFlow component.
5
- return (_jsxs("div", { className: "flex w-[220px] items-center justify-center", children: [_jsx(Handle, { type: "target", position: Position.Top, className: "!opacity-0" }), _jsx("div", { className: "group flex h-6 w-6 items-center justify-center rounded-full border border-slate-300 bg-white cursor-pointer transition-all duration-150 hover:border-indigo-400 hover:shadow-sm hover:scale-110 active:scale-100", title: "Add step", children: _jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", className: "text-slate-400 group-hover:text-indigo-500 transition-colors duration-150", children: [_jsx("path", { d: "M12 5v14" }), _jsx("path", { d: "M5 12h14" })] }) }), _jsx(Handle, { type: "source", position: Position.Bottom, className: "!opacity-0" })] }));
6
- }
7
- //# sourceMappingURL=AddStepButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddStepButton.js","sourceRoot":"","sources":["../../../src/components/builder/AddStepButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMjD,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,8DAA8D;IAC9D,OAAO,CACL,eAAK,SAAS,EAAC,4CAA4C,aACzD,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAC,YAAY,GAAG,EAEvE,cACE,SAAS,EAAC,kNAAkN,EAC5N,KAAK,EAAC,UAAU,YAEhB,eACE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,KAAK,EAAC,aAAa,EAAC,OAAO,EACpH,SAAS,EAAC,2EAA2E,aAErF,eAAM,CAAC,EAAC,UAAU,GAAE,EAAA,eAAM,CAAC,EAAC,UAAU,GAAE,IACpC,GACF,EAEN,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAC,YAAY,GAAG,IACtE,CACP,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type EdgeProps } from '@xyflow/react';
2
- export declare function BranchEdge({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, style, }: EdgeProps): import("react").JSX.Element;
3
- //# sourceMappingURL=BranchEdge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BranchEdge.d.ts","sourceRoot":"","sources":["../../../src/components/builder/BranchEdge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAExE,wBAAgB,UAAU,CAAC,EACzB,EAAE,EACF,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,KAAK,EACL,KAAK,GACN,EAAE,SAAS,+BAuCX"}
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { BaseEdge, getBezierPath } from '@xyflow/react';
3
- export function BranchEdge({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, style, }) {
4
- const [edgePath, labelX, labelY] = getBezierPath({
5
- sourceX,
6
- sourceY,
7
- sourcePosition,
8
- targetX,
9
- targetY,
10
- targetPosition,
11
- });
12
- return (_jsxs(_Fragment, { children: [_jsx(BaseEdge, { id: id, path: edgePath, style: {
13
- stroke: '#cbd5e1',
14
- strokeWidth: 1,
15
- strokeDasharray: '5 3',
16
- ...style,
17
- } }), label && (_jsx("foreignObject", { width: 80, height: 22, x: labelX - 40, y: labelY - 11, requiredExtensions: "http://www.w3.org/1999/xhtml", children: _jsx("div", { className: "flex h-full items-center justify-center", children: _jsx("span", { className: "rounded border border-slate-200 bg-white px-2 py-0.5 text-[10px] font-medium text-slate-400 uppercase tracking-wider", children: label }) }) }))] }));
18
- }
19
- //# sourceMappingURL=BranchEdge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BranchEdge.js","sourceRoot":"","sources":["../../../src/components/builder/BranchEdge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AAExE,MAAM,UAAU,UAAU,CAAC,EACzB,EAAE,EACF,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,KAAK,EACL,KAAK,GACK;IACV,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC;QAC/C,OAAO;QACP,OAAO;QACP,cAAc;QACd,OAAO;QACP,OAAO;QACP,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE;oBACL,MAAM,EAAE,SAAS;oBACjB,WAAW,EAAE,CAAC;oBACd,eAAe,EAAE,KAAK;oBACtB,GAAG,KAAK;iBACT,GACD,EACD,KAAK,IAAI,CACR,wBACE,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,CAAC,EAAE,MAAM,GAAG,EAAE,EACd,CAAC,EAAE,MAAM,GAAG,EAAE,EACd,kBAAkB,EAAC,8BAA8B,YAEjD,cAAK,SAAS,EAAC,yCAAyC,YACtD,eAAM,SAAS,EAAC,sHAAsH,YACnI,KAAK,GACD,GACH,GACQ,CACjB,IACA,CACJ,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { UseWorkflowBuilderReturn } from '../../hooks/use-workflow-builder.js';
2
- export interface BuilderToolbarProps {
3
- builder: UseWorkflowBuilderReturn;
4
- onSave?: (() => void) | undefined;
5
- onTestRun?: (() => void) | undefined;
6
- isSaving?: boolean | undefined;
7
- className?: string | undefined;
8
- }
9
- export declare function BuilderToolbar({ builder, onSave, onTestRun, isSaving, className, }: BuilderToolbarProps): import("react").JSX.Element;
10
- //# sourceMappingURL=BuilderToolbar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BuilderToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/builder/BuilderToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAGpF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAClC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,+BA6GrB"}
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { cn } from '../shared/cn.js';
3
- export function BuilderToolbar({ builder, onSave, onTestRun, isSaving, className, }) {
4
- const { isDirty, canUndo, canRedo, undo, redo, isValidating, validation } = builder;
5
- const hasErrors = validation !== null && !validation.valid;
6
- return (_jsxs("div", { className: cn('flex items-center gap-3 border-t border-slate-200/80 bg-white px-4 py-2', className), children: [_jsxs("div", { className: "flex items-center rounded-lg border border-slate-200/80 bg-slate-50/50 p-0.5", children: [_jsx("button", { onClick: undo, disabled: !canUndo, className: cn('flex h-7 w-7 items-center justify-center rounded-md transition-all duration-100', canUndo
7
- ? 'text-slate-500 hover:bg-white hover:text-slate-700 hover:shadow-sm'
8
- : 'text-slate-300 cursor-not-allowed'), title: "Undo", children: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M3 7v6h6" }), _jsx("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })] }) }), _jsx("div", { className: "w-px h-4 bg-slate-200/60" }), _jsx("button", { onClick: redo, disabled: !canRedo, className: cn('flex h-7 w-7 items-center justify-center rounded-md transition-all duration-100', canRedo
9
- ? 'text-slate-500 hover:bg-white hover:text-slate-700 hover:shadow-sm'
10
- : 'text-slate-300 cursor-not-allowed'), title: "Redo", children: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M21 7v6h-6" }), _jsx("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13" })] }) })] }), isValidating && (_jsxs("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [_jsxs("svg", { className: "h-3 w-3 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: [_jsx("circle", { cx: "12", cy: "12", r: "10", strokeOpacity: "0.2" }), _jsx("path", { d: "M12 2a10 10 0 0 1 10 10", strokeOpacity: "0.7" })] }), "Validating"] })), hasErrors && !isValidating && (_jsxs("span", { className: "flex items-center gap-1.5 rounded-lg bg-red-50 px-2.5 py-1 text-[11px] font-semibold text-red-500 ring-1 ring-red-200/50", children: [_jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M12 8v4" }), _jsx("path", { d: "M12 16h.01" })] }), validation && 'errors' in validation && Array.isArray(validation['errors'])
11
- ? `${validation['errors'].length} error${validation['errors'].length === 1 ? '' : 's'}`
12
- : 'Errors'] })), _jsx("div", { className: "flex-1" }), onTestRun && (_jsxs("button", { onClick: onTestRun, className: cn('flex items-center gap-2 rounded-lg border border-slate-200 px-3.5 py-1.5 text-[13px] font-medium transition-all duration-100', 'text-slate-600 hover:bg-slate-50 hover:border-slate-300 hover:text-slate-800 active:scale-[0.98]'), children: [_jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", className: "text-emerald-500", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }), "Test Run"] })), onSave && (_jsx("button", { onClick: onSave, disabled: !isDirty || isSaving, className: cn('flex items-center gap-2 rounded-lg px-4 py-1.5 text-[13px] font-semibold transition-all duration-100', isDirty && !isSaving
13
- ? 'bg-indigo-500 text-white shadow-sm shadow-indigo-200 hover:bg-indigo-600 active:scale-[0.98]'
14
- : 'bg-slate-100 text-slate-400 cursor-not-allowed'), children: isSaving ? (_jsxs(_Fragment, { children: [_jsxs("svg", { className: "h-3 w-3 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: [_jsx("circle", { cx: "12", cy: "12", r: "10", strokeOpacity: "0.3" }), _jsx("path", { d: "M12 2a10 10 0 0 1 10 10" })] }), "Saving"] })) : 'Save' }))] }));
15
- }
16
- //# sourceMappingURL=BuilderToolbar.js.map