@powerhousedao/workflow 6.2.3-dev.54 → 6.2.3-dev.56

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 (170) hide show
  1. package/dist/browser/{BlockSelector-CzJnQWsh.js → BlockSelector-DnBab95a.js} +3 -3
  2. package/dist/browser/{BlockSelector-CzJnQWsh.js.map → BlockSelector-DnBab95a.js.map} +1 -1
  3. package/dist/browser/block-type-kX-27vVt.js +44 -0
  4. package/dist/browser/block-type-kX-27vVt.js.map +1 -0
  5. package/dist/browser/{connection-BP17lpt3.js → connection-BXV8I017.js} +2 -2
  6. package/dist/browser/{connection-BP17lpt3.js.map → connection-BXV8I017.js.map} +1 -1
  7. package/dist/browser/{connection-form-cCgfAa1A.js → connection-form-Cy2fyFUR.js} +24 -28
  8. package/dist/browser/connection-form-Cy2fyFUR.js.map +1 -0
  9. package/dist/browser/{data-tree-S_SwaRve.js → data-tree-BvFLAMyE.js} +2 -2
  10. package/dist/browser/{data-tree-S_SwaRve.js.map → data-tree-BvFLAMyE.js.map} +1 -1
  11. package/dist/browser/document-models/connection/index.js +3 -3
  12. package/dist/browser/document-models/index.js +3 -3
  13. package/dist/browser/document-models/workflow/index.js +3 -3
  14. package/dist/browser/{document-models-B08jDa_s.js → document-models-DAAo3Bln.js} +40 -6
  15. package/dist/browser/{document-models-B08jDa_s.js.map → document-models-DAAo3Bln.js.map} +1 -1
  16. package/dist/browser/{editor-CQyfDOIN.js → editor-CEJO-2Ue.js} +138 -127
  17. package/dist/browser/editor-CEJO-2Ue.js.map +1 -0
  18. package/dist/{node/editor-EeTeVS3A.mjs → browser/editor-DVBnS8YM.js} +360 -319
  19. package/dist/browser/editor-DVBnS8YM.js.map +1 -0
  20. package/dist/browser/{editor-CVXRNht0.js → editor-Dc9Q55q1.js} +7 -7
  21. package/dist/browser/{editor-CVXRNht0.js.map → editor-Dc9Q55q1.js.map} +1 -1
  22. package/dist/browser/editors/connection-editor/module.js +1 -1
  23. package/dist/browser/editors/runtime/index.js +2 -0
  24. package/dist/browser/editors/workflow-editor/module.js +1 -1
  25. package/dist/browser/editors/workflow-studio/module.js +1 -1
  26. package/dist/browser/index.js +4 -4
  27. package/dist/browser/{module-B2BMwu5E.js → module-DIQ3tQ2M.js} +97 -2
  28. package/dist/browser/module-DIQ3tQ2M.js.map +1 -0
  29. package/dist/browser/{module-ozS5EVRx.js → module-DxQBeqBh.js} +211 -83
  30. package/dist/browser/module-DxQBeqBh.js.map +1 -0
  31. package/dist/browser/reactor/index.js +2 -2
  32. package/dist/browser/{runtime-queries-2hn7fcKn.js → runtime-queries-DehIdatq.js} +3 -3
  33. package/dist/browser/{runtime-queries-2hn7fcKn.js.map → runtime-queries-DehIdatq.js.map} +1 -1
  34. package/dist/browser/{trigger-text-Cfyx8tMq.js → trigger-text-CfRbN-DV.js} +5 -5
  35. package/dist/browser/trigger-text-CfRbN-DV.js.map +1 -0
  36. package/dist/browser/upgrade-manifests-CAE3ivDp.js +8 -0
  37. package/dist/browser/{upgrade-manifests-DHGmgHKW.js.map → upgrade-manifests-CAE3ivDp.js.map} +1 -1
  38. package/dist/browser/{workflow-DoewHe4K.js → workflow-C003Wutu.js} +2 -2
  39. package/dist/browser/{workflow-DoewHe4K.js.map → workflow-C003Wutu.js.map} +1 -1
  40. package/dist/node/{BlockSelector-g9m3yaJj.mjs → BlockSelector-B77i85CO.mjs} +3 -3
  41. package/dist/node/{BlockSelector-g9m3yaJj.mjs.map → BlockSelector-B77i85CO.mjs.map} +1 -1
  42. package/dist/node/block-type-kX-27vVt.mjs +44 -0
  43. package/dist/node/block-type-kX-27vVt.mjs.map +1 -0
  44. package/dist/node/{connection-BxJoL8js.mjs → connection-BzW9OpKx.mjs} +2 -2
  45. package/dist/node/{connection-BxJoL8js.mjs.map → connection-BzW9OpKx.mjs.map} +1 -1
  46. package/dist/node/{connection-form-h0PidbTI.mjs → connection-form-BCwEO3ll.mjs} +24 -28
  47. package/dist/node/connection-form-BCwEO3ll.mjs.map +1 -0
  48. package/dist/node/{data-tree-CKKeR7qj.mjs → data-tree-CH8KnNSz.mjs} +2 -2
  49. package/dist/node/{data-tree-CKKeR7qj.mjs.map → data-tree-CH8KnNSz.mjs.map} +1 -1
  50. package/dist/node/document-models/connection/index.mjs +3 -3
  51. package/dist/node/document-models/index.mjs +3 -3
  52. package/dist/node/document-models/workflow/index.mjs +3 -3
  53. package/dist/node/{editor-BAbYXi7T.mjs → editor-BYzFMCB8.mjs} +7 -7
  54. package/dist/node/{editor-BAbYXi7T.mjs.map → editor-BYzFMCB8.mjs.map} +1 -1
  55. package/dist/{browser/editor-CbpyTAEC.js → node/editor-CsMRho-A.mjs} +360 -319
  56. package/dist/node/editor-CsMRho-A.mjs.map +1 -0
  57. package/dist/node/{editor-DCsT8WsQ.mjs → editor-DtLyolUn.mjs} +138 -127
  58. package/dist/node/editor-DtLyolUn.mjs.map +1 -0
  59. package/dist/node/editors/connection-editor/module.mjs +1 -1
  60. package/dist/node/editors/runtime/index.mjs +2 -0
  61. package/dist/node/editors/workflow-editor/module.mjs +1 -1
  62. package/dist/node/editors/workflow-studio/module.mjs +1 -1
  63. package/dist/node/index.mjs +41 -7
  64. package/dist/node/index.mjs.map +1 -1
  65. package/dist/node/{module-BlT-atBQ.mjs → module-Bl_4mnxR.mjs} +97 -2
  66. package/dist/node/module-Bl_4mnxR.mjs.map +1 -0
  67. package/dist/node/{module-uKdoLIga.mjs → module-DPg8IYIn.mjs} +211 -83
  68. package/dist/node/module-DPg8IYIn.mjs.map +1 -0
  69. package/dist/node/pieces/reactor/descriptor.json +1 -1
  70. package/dist/node/pieces/reactor/package.json +1 -1
  71. package/dist/node/{runtime-queries-BtTx8FU3.mjs → runtime-queries-CJSpbsBq.mjs} +3 -3
  72. package/dist/node/{runtime-queries-BtTx8FU3.mjs.map → runtime-queries-CJSpbsBq.mjs.map} +1 -1
  73. package/dist/node/{trigger-text-CtSXg0KB.mjs → trigger-text-C6BlOwck.mjs} +5 -5
  74. package/dist/node/trigger-text-C6BlOwck.mjs.map +1 -0
  75. package/dist/node/upgrade-manifests-7SFwDrhd.mjs +8 -0
  76. package/dist/node/{upgrade-manifests-D-pLniUG.mjs.map → upgrade-manifests-7SFwDrhd.mjs.map} +1 -1
  77. package/dist/node/{workflow-Dy-309pE.mjs → workflow-7pmOvHmg.mjs} +2 -2
  78. package/dist/node/{workflow-Dy-309pE.mjs.map → workflow-7pmOvHmg.mjs.map} +1 -1
  79. package/dist/powerhouse.manifest.json +38 -4
  80. package/dist/style.css +29 -14
  81. package/dist/types/document-models/connection/v1/actions.d.ts +2 -0
  82. package/dist/types/document-models/connection/v1/actions.d.ts.map +1 -1
  83. package/dist/types/document-models/connection/v1/gen/config/actions.d.ts +10 -2
  84. package/dist/types/document-models/connection/v1/gen/config/actions.d.ts.map +1 -1
  85. package/dist/types/document-models/connection/v1/gen/config/creators.d.ts +4 -2
  86. package/dist/types/document-models/connection/v1/gen/config/creators.d.ts.map +1 -1
  87. package/dist/types/document-models/connection/v1/gen/config/error.d.ts +15 -1
  88. package/dist/types/document-models/connection/v1/gen/config/error.d.ts.map +1 -1
  89. package/dist/types/document-models/connection/v1/gen/config/operations.d.ts +3 -1
  90. package/dist/types/document-models/connection/v1/gen/config/operations.d.ts.map +1 -1
  91. package/dist/types/document-models/connection/v1/gen/document-model.d.ts.map +1 -1
  92. package/dist/types/document-models/connection/v1/gen/reducer.d.ts.map +1 -1
  93. package/dist/types/document-models/connection/v1/gen/schema/types.d.ts +7 -0
  94. package/dist/types/document-models/connection/v1/gen/schema/types.d.ts.map +1 -1
  95. package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts +3 -1
  96. package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts.map +1 -1
  97. package/dist/types/document-models/connection/v1/module.d.ts +2 -0
  98. package/dist/types/document-models/connection/v1/module.d.ts.map +1 -1
  99. package/dist/types/document-models/connection/v1/src/reducers/config.d.ts.map +1 -1
  100. package/dist/types/document-models/connection/v1/tests/config-values.test.d.ts +2 -0
  101. package/dist/types/document-models/connection/v1/tests/config-values.test.d.ts.map +1 -0
  102. package/dist/types/document-models/document-models.d.ts +5 -0
  103. package/dist/types/document-models/document-models.d.ts.map +1 -1
  104. package/dist/types/document-models/workflow/v1/actions.d.ts +3 -0
  105. package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
  106. package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -1
  107. package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -1
  108. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +16 -0
  109. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
  110. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +5 -1
  111. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
  112. package/dist/types/document-models/workflow/v1/gen/trigger/actions.d.ts +14 -2
  113. package/dist/types/document-models/workflow/v1/gen/trigger/actions.d.ts.map +1 -1
  114. package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts +5 -2
  115. package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts.map +1 -1
  116. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts +32 -1
  117. package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -1
  118. package/dist/types/document-models/workflow/v1/gen/trigger/operations.d.ts +4 -1
  119. package/dist/types/document-models/workflow/v1/gen/trigger/operations.d.ts.map +1 -1
  120. package/dist/types/document-models/workflow/v1/module.d.ts +3 -0
  121. package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
  122. package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -1
  123. package/dist/types/document-models/workflow/v1/tests/trigger-fields.test.d.ts +2 -0
  124. package/dist/types/document-models/workflow/v1/tests/trigger-fields.test.d.ts.map +1 -0
  125. package/dist/types/editors/connection-editor/ReactorConnectionSettings.d.ts.map +1 -1
  126. package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
  127. package/dist/types/editors/connection-editor/connection-form.d.ts +2 -2
  128. package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
  129. package/dist/types/editors/runtime/index.d.ts +21 -0
  130. package/dist/types/editors/runtime/index.d.ts.map +1 -0
  131. package/dist/types/editors/runtime/runtime-export.test.d.ts +2 -0
  132. package/dist/types/editors/runtime/runtime-export.test.d.ts.map +1 -0
  133. package/dist/types/editors/shared/pending-echo.d.ts +9 -0
  134. package/dist/types/editors/shared/pending-echo.d.ts.map +1 -0
  135. package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
  136. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
  137. package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -1
  138. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
  139. package/dist/types/editors/workflow-editor/ui/model.d.ts +6 -0
  140. package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
  141. package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -1
  142. package/dist/types/editors/workflow-studio/components/WorkflowGraph.d.ts.map +1 -1
  143. package/dist/types/editors/workflow-studio/components/chain.d.ts +3 -1
  144. package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -1
  145. package/dist/types/editors/workflow-studio/components/tips.d.ts +23 -0
  146. package/dist/types/editors/workflow-studio/components/tips.d.ts.map +1 -0
  147. package/dist/types/scripts/ui-stack.d.ts.map +1 -1
  148. package/dist/types/test/ui/harness/property-form-echo.d.ts +12 -0
  149. package/dist/types/test/ui/harness/property-form-echo.d.ts.map +1 -0
  150. package/dist/types/test/ui/harness/schedule-builder.d.ts +8 -0
  151. package/dist/types/test/ui/harness/schedule-builder.d.ts.map +1 -0
  152. package/dist/types/test/ui/property-form-echo.spec.d.ts +2 -0
  153. package/dist/types/test/ui/property-form-echo.spec.d.ts.map +1 -0
  154. package/dist/types/test/ui/schedule-builder.spec.d.ts +2 -0
  155. package/dist/types/test/ui/schedule-builder.spec.d.ts.map +1 -0
  156. package/package.json +14 -8
  157. package/dist/browser/connection-form-cCgfAa1A.js.map +0 -1
  158. package/dist/browser/editor-CQyfDOIN.js.map +0 -1
  159. package/dist/browser/editor-CbpyTAEC.js.map +0 -1
  160. package/dist/browser/module-B2BMwu5E.js.map +0 -1
  161. package/dist/browser/module-ozS5EVRx.js.map +0 -1
  162. package/dist/browser/trigger-text-Cfyx8tMq.js.map +0 -1
  163. package/dist/browser/upgrade-manifests-DHGmgHKW.js +0 -8
  164. package/dist/node/connection-form-h0PidbTI.mjs.map +0 -1
  165. package/dist/node/editor-DCsT8WsQ.mjs.map +0 -1
  166. package/dist/node/editor-EeTeVS3A.mjs.map +0 -1
  167. package/dist/node/module-BlT-atBQ.mjs.map +0 -1
  168. package/dist/node/module-uKdoLIga.mjs.map +0 -1
  169. package/dist/node/trigger-text-CtSXg0KB.mjs.map +0 -1
  170. package/dist/node/upgrade-manifests-D-pLniUG.mjs +0 -8
@@ -1,8 +1,8 @@
1
- import { K as CORE_PIECE, it as triggerBlock, l as runsOfPages, nt as stepBlock, q as MANUAL_TRIGGER, tt as sameBlock } from "./runtime-queries-BtTx8FU3.mjs";
2
- import { y as actions } from "./module-uKdoLIga.mjs";
3
- import { A as runStats, Bt as DocumentLoadError, C as canRerun, Ct as Button, D as formatMs, E as formatDuration, F as toneOf, I as workflowHealth, It as textInputClass, Lt as Icon, M as runTimeline, N as runTone, O as formatTrigger, P as statusLabel, S as TONE_TEXT, T as formatAbsolute, Vt as errorMessage, _ as CONNECTION_TONE, _t as useRunPagesQuery, b as STEP_TONE, f as blockMeta, g as usePieceLogos, j as runStatusLabel, k as formatWhen, kt as Select, pt as WorkflowRuntimeProvider, t as BlockLogo, v as RUN_STATUSES, vt as useRunQuery, w as durationMs, x as TONE_DOT, xt as useRuntimeActions, y as RUN_TONE, zt as DocumentErrorBoundary } from "./BlockSelector-g9m3yaJj.mjs";
4
- import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-Dy-309pE.mjs";
5
- import { a as StepError, f as StatusToggle, i as DataViewer, l as PublishState, o as Modal, r as describeTrigger } from "./trigger-text-CtSXg0KB.mjs";
1
+ import { X as CORE_PIECE, Z as MANUAL_TRIGGER, at as sameBlock, ct as triggerBlock, l as runsOfPages, ot as stepBlock } from "./runtime-queries-DehIdatq.js";
2
+ import { A as runStats, Bt as DocumentLoadError, C as canRerun, Ct as Button, D as formatMs, E as formatDuration, F as toneOf, I as workflowHealth, It as textInputClass, Lt as Icon, M as runTimeline, N as runTone, O as formatTrigger, P as statusLabel, S as TONE_TEXT, T as formatAbsolute, Vt as errorMessage, _ as CONNECTION_TONE, _t as useRunPagesQuery, b as STEP_TONE, f as blockMeta, g as usePieceLogos, j as runStatusLabel, k as formatWhen, kt as Select, pt as WorkflowRuntimeProvider, t as BlockLogo, v as RUN_STATUSES, vt as useRunQuery, w as durationMs, x as TONE_DOT, xt as useRuntimeActions, y as RUN_TONE, zt as DocumentErrorBoundary } from "./BlockSelector-DnBab95a.js";
3
+ import { y as actions } from "./module-DxQBeqBh.js";
4
+ import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-C003Wutu.js";
5
+ import { a as StepError, f as StatusToggle, i as DataViewer, l as PublishState, o as Modal, r as describeTrigger } from "./trigger-text-CfRbN-DV.js";
6
6
  import { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { generateId } from "document-model";
@@ -48,6 +48,160 @@ function stepOutline(args) {
48
48
  };
49
49
  }
50
50
  //#endregion
51
+ //#region editors/workflow-studio/components/graph-layout.ts
52
+ const TRIGGER_NODE = "trigger";
53
+ const SIDE_PORTS = /* @__PURE__ */ new Set(["false", "error"]);
54
+ function graphLayout(args) {
55
+ const { rows } = stepOutline(args);
56
+ const nodeId = (id) => id === args.triggerId ? TRIGGER_NODE : id;
57
+ const placed = /* @__PURE__ */ new Map([[TRIGGER_NODE, {
58
+ col: 0,
59
+ lane: 0
60
+ }]]);
61
+ const taken = /* @__PURE__ */ new Set();
62
+ const inbound = /* @__PURE__ */ new Map();
63
+ const outbound = /* @__PURE__ */ new Map();
64
+ for (const edge of args.edges) {
65
+ const list = inbound.get(edge.to) ?? [];
66
+ list.push(edge);
67
+ inbound.set(edge.to, list);
68
+ outbound.set(edge.from, (outbound.get(edge.from) ?? 0) + 1);
69
+ }
70
+ const drops = (edge) => SIDE_PORTS.has(edge.port) && (outbound.get(edge.from) ?? 0) > 1;
71
+ const nodes = [];
72
+ for (const { step } of rows) {
73
+ const from = (inbound.get(step.id) ?? []).filter((edge) => placed.has(nodeId(edge.from)));
74
+ const col = Math.max(1, ...from.map((edge) => placed.get(nodeId(edge.from)).col + 1));
75
+ let lane = Math.min(...from.map((edge) => placed.get(nodeId(edge.from)).lane + (drops(edge) ? 1 : 0)), from.length === 0 ? 0 : Infinity);
76
+ const port = from.length === 1 && from[0].port !== "next" ? from[0].port : null;
77
+ while (taken.has(`${col}:${lane}`)) lane++;
78
+ taken.add(`${col}:${lane}`);
79
+ placed.set(step.id, {
80
+ col,
81
+ lane
82
+ });
83
+ nodes.push({
84
+ step,
85
+ col,
86
+ lane,
87
+ port
88
+ });
89
+ }
90
+ return {
91
+ nodes,
92
+ edges: args.edges.map((edge) => ({
93
+ ...edge,
94
+ from: nodeId(edge.from)
95
+ })).filter((edge) => placed.has(edge.from) && placed.has(edge.to)).map((edge) => {
96
+ const a = placed.get(edge.from);
97
+ const b = placed.get(edge.to);
98
+ const clear = (lane) => !nodes.some((node) => node.lane === lane && node.col > a.col && node.col < b.col);
99
+ const low = Math.max(a.lane, b.lane);
100
+ const high = Math.min(a.lane, b.lane);
101
+ const track = clear(low) ? {
102
+ lane: low,
103
+ under: false
104
+ } : clear(high) ? {
105
+ lane: high,
106
+ under: false
107
+ } : {
108
+ lane: high,
109
+ under: true
110
+ };
111
+ return {
112
+ from: edge.from,
113
+ to: edge.to,
114
+ port: edge.port,
115
+ track
116
+ };
117
+ }),
118
+ cols: Math.max(0, ...nodes.map((node) => node.col)),
119
+ lanes: Math.max(1, ...nodes.map((node) => node.lane + 1))
120
+ };
121
+ }
122
+ //#endregion
123
+ //#region editors/workflow-studio/components/tips.tsx
124
+ function TipProvider(props) {
125
+ return /* @__PURE__ */ jsx(ConnectTooltipProvider, {
126
+ disableHoverableContent: true,
127
+ children: props.children
128
+ });
129
+ }
130
+ function Tip(props) {
131
+ return /* @__PURE__ */ jsx(ConnectTooltip, {
132
+ content: props.content,
133
+ side: "bottom",
134
+ delayDuration: 100,
135
+ className: "max-w-64 rounded-md border-solid border-foreground/10 bg-card px-2.5 py-1.5 text-foreground shadow-lg",
136
+ children: props.children
137
+ });
138
+ }
139
+ const PORT_TEXT = {
140
+ true: "Runs when the condition is true",
141
+ false: "Runs when the condition is false",
142
+ error: "Runs when the step before it fails"
143
+ };
144
+ function stepSummary(record, ran) {
145
+ if (!ran) return "Not run yet";
146
+ if (!record) return "Not reached in the latest run";
147
+ const took = record.startedAt && record.endedAt ? ` · ${formatDuration(record.startedAt, record.endedAt)}` : "";
148
+ return `${statusLabel(record.status)} in the latest run${took}`;
149
+ }
150
+ function StepTip(props) {
151
+ const { step } = props;
152
+ const meta = blockMeta(stepBlock(step));
153
+ return /* @__PURE__ */ jsxs("span", {
154
+ className: "flex flex-col gap-0.5",
155
+ children: [
156
+ /* @__PURE__ */ jsx("span", {
157
+ className: "font-medium",
158
+ children: step.name || step.key
159
+ }),
160
+ /* @__PURE__ */ jsxs("span", {
161
+ className: "text-muted-foreground",
162
+ children: [
163
+ meta.displayName,
164
+ " · ",
165
+ meta.subtitle
166
+ ]
167
+ }),
168
+ props.port ? /* @__PURE__ */ jsx("span", {
169
+ className: "text-muted-foreground",
170
+ children: PORT_TEXT[props.port] ?? `Runs on "${props.port}"`
171
+ }) : null,
172
+ /* @__PURE__ */ jsx("span", {
173
+ className: "mt-1",
174
+ children: stepSummary(props.record, props.ran)
175
+ }),
176
+ props.record?.error ? /* @__PURE__ */ jsx("span", {
177
+ className: "line-clamp-3 text-wf-fail",
178
+ children: props.record.error
179
+ }) : null
180
+ ]
181
+ });
182
+ }
183
+ function TriggerTip(props) {
184
+ const meta = props.trigger ? blockMeta(props.trigger) : null;
185
+ return /* @__PURE__ */ jsxs("span", {
186
+ className: "flex flex-col gap-0.5",
187
+ children: [
188
+ /* @__PURE__ */ jsx("span", {
189
+ className: "font-medium",
190
+ children: meta?.displayName ?? "No trigger"
191
+ }),
192
+ props.text && props.text !== meta?.displayName ? /* @__PURE__ */ jsx("span", { children: props.text }) : null,
193
+ meta ? /* @__PURE__ */ jsx("span", {
194
+ className: "text-muted-foreground",
195
+ children: meta.subtitle
196
+ }) : null,
197
+ /* @__PURE__ */ jsx("span", {
198
+ className: "mt-1",
199
+ children: props.latest ? `Last fired ${formatWhen(props.latest.startedAt)}` : "Not fired yet"
200
+ })
201
+ ]
202
+ });
203
+ }
204
+ //#endregion
51
205
  //#region editors/workflow-studio/components/chain.tsx
52
206
  const RING$2 = {
53
207
  ok: "ring-wf-ok",
@@ -70,7 +224,7 @@ function MiniChain(props) {
70
224
  const shown = overflow ? props.links.slice(0, 5) : props.links;
71
225
  const hidden = props.links.length - shown.length;
72
226
  const tones = shown.map((link) => link.status ? toneOf(STEP_TONE, link.status) : "idle");
73
- return /* @__PURE__ */ jsxs("ol", {
227
+ return /* @__PURE__ */ jsx(TipProvider, { children: /* @__PURE__ */ jsxs("ol", {
74
228
  className: "flex items-center",
75
229
  "aria-label": props.links.map((link) => `${link.label}${link.status ? `: ${link.status.toLowerCase()}` : ""}`).join(", "),
76
230
  children: [shown.map((link, index) => /* @__PURE__ */ jsxs("li", {
@@ -78,28 +232,32 @@ function MiniChain(props) {
78
232
  children: [index > 0 ? /* @__PURE__ */ jsx("span", {
79
233
  "aria-hidden": true,
80
234
  className: `h-0.5 ${md ? "w-5" : "w-3"} ${RAIL$1[tones[index]]}`
81
- }) : null, /* @__PURE__ */ jsx("span", {
82
- title: link.status ? `${link.label}: ${link.status.toLowerCase()}` : link.label,
83
- className: `flex shrink-0 items-center justify-center rounded-full bg-card ${md ? "h-8 w-8" : "h-6 w-6"} ${link.status === "SKIPPED" ? "border-[1.5px] border-dashed border-foreground/40" : `ring-[1.5px] dark:bg-white ${RING$2[tones[index]]}`}`,
235
+ }) : null, /* @__PURE__ */ jsx(Tip, {
236
+ content: link.tip ?? (link.status ? `${link.label}: ${link.status.toLowerCase()}` : link.label),
84
237
  children: /* @__PURE__ */ jsx("span", {
85
- className: link.status === "SKIPPED" ? "flex opacity-40" : "flex",
86
- children: /* @__PURE__ */ jsx(BlockLogo, {
87
- bare: true,
88
- block: link.block,
89
- size: md ? 16 : 14
238
+ className: `flex shrink-0 items-center justify-center rounded-full bg-card ${md ? "h-8 w-8" : "h-6 w-6"} ${link.status === "SKIPPED" ? "border-[1.5px] border-dashed border-foreground/40" : `ring-[1.5px] dark:bg-white ${RING$2[tones[index]]}`}`,
239
+ children: /* @__PURE__ */ jsx("span", {
240
+ className: link.status === "SKIPPED" ? "flex opacity-40" : "flex",
241
+ children: /* @__PURE__ */ jsx(BlockLogo, {
242
+ bare: true,
243
+ block: link.block,
244
+ size: md ? 16 : 14
245
+ })
90
246
  })
91
247
  })
92
248
  })]
93
249
  }, link.id)), overflow ? /* @__PURE__ */ jsxs("li", {
94
250
  "aria-hidden": true,
95
251
  className: "flex items-center",
96
- children: [/* @__PURE__ */ jsx("span", { className: `h-0.5 ${md ? "w-5" : "w-3"} bg-foreground/15` }), /* @__PURE__ */ jsxs("span", {
97
- title: props.links.slice(shown.length).map((link) => link.label).join(", "),
98
- className: `flex shrink-0 items-center justify-center rounded-full bg-muted px-1.5 text-[11px] font-medium tabular-nums text-muted-foreground ${md ? "h-8" : "h-6"}`,
99
- children: ["+", hidden]
252
+ children: [/* @__PURE__ */ jsx("span", { className: `h-0.5 ${md ? "w-5" : "w-3"} bg-foreground/15` }), /* @__PURE__ */ jsx(Tip, {
253
+ content: props.links.slice(shown.length).map((link) => link.label).join(", "),
254
+ children: /* @__PURE__ */ jsxs("span", {
255
+ className: `flex shrink-0 items-center justify-center rounded-full bg-muted px-1.5 text-[11px] font-medium tabular-nums text-muted-foreground ${md ? "h-8" : "h-6"}`,
256
+ children: ["+", hidden]
257
+ })
100
258
  })]
101
259
  }) : null]
102
- });
260
+ }) });
103
261
  }
104
262
  function triggerOfKind(kind) {
105
263
  if (kind.startsWith("piece:")) {
@@ -119,13 +277,22 @@ function triggerOfKind(kind) {
119
277
  }
120
278
  /** A workflow's steps in the order a run reaches them, coloured by a run. */
121
279
  function workflowLinks(workflow, latest) {
122
- const status = new Map((latest?.steps ?? []).map((step) => [step.stepKey, step.status]));
123
- return stepOutline(workflow).rows.map(({ step }) => ({
124
- id: step.id,
125
- block: stepBlock(step),
126
- label: step.name || step.key,
127
- status: status.get(step.key)
128
- }));
280
+ const records = new Map((latest?.steps ?? []).map((record) => [record.stepKey, record]));
281
+ return graphLayout(workflow).nodes.map(({ step, port }) => {
282
+ const record = records.get(step.key);
283
+ return {
284
+ id: step.id,
285
+ block: stepBlock(step),
286
+ label: step.name || step.key,
287
+ status: record?.status,
288
+ tip: /* @__PURE__ */ jsx(StepTip, {
289
+ step,
290
+ port,
291
+ record,
292
+ ran: Boolean(latest)
293
+ })
294
+ };
295
+ });
129
296
  }
130
297
  /** A run's own chain: the trigger, then every step it recorded. */
131
298
  function runLinks(run, trigger) {
@@ -157,18 +324,20 @@ const TICK = {
157
324
  function RunStrip(props) {
158
325
  const recent = props.runs.slice(0, STRIP_LENGTH).reverse();
159
326
  const padding = STRIP_LENGTH - recent.length;
160
- return /* @__PURE__ */ jsxs("span", {
327
+ return /* @__PURE__ */ jsx(TipProvider, { children: /* @__PURE__ */ jsxs("span", {
161
328
  className: `flex h-5 gap-[3px] ${props.centered ? "items-center" : "items-end"}`,
162
329
  "aria-label": recent.length === 0 ? "No runs yet" : `Last ${recent.length} runs: ${recent.map((run) => run.status.toLowerCase()).join(", ")}`,
163
330
  children: [Array.from({ length: padding }, (_, index) => /* @__PURE__ */ jsx("span", {
164
331
  "aria-hidden": true,
165
332
  className: "h-1.5 w-1.5 rounded-full bg-foreground/10"
166
- }, `pad-${index}`)), recent.map((run) => /* @__PURE__ */ jsx("span", {
167
- "aria-hidden": true,
168
- title: `${statusLabel(run.status)}, ${formatAbsolute(run.startedAt)}`,
169
- className: `h-5 w-1.5 rounded-full ${TICK[toneOf(RUN_TONE, run.status)]}`
333
+ }, `pad-${index}`)), recent.map((run) => /* @__PURE__ */ jsx(Tip, {
334
+ content: `${statusLabel(run.status)}, ${formatAbsolute(run.startedAt)}`,
335
+ children: /* @__PURE__ */ jsx("span", {
336
+ "aria-hidden": true,
337
+ className: `h-5 w-1.5 rounded-full ${TICK[toneOf(RUN_TONE, run.status)]}`
338
+ })
170
339
  }, run.id))]
171
- });
340
+ }) });
172
341
  }
173
342
  //#endregion
174
343
  //#region editors/workflow-studio/components/ui.tsx
@@ -1494,78 +1663,6 @@ function useCollapsed() {
1494
1663
  };
1495
1664
  }
1496
1665
  //#endregion
1497
- //#region editors/workflow-studio/components/graph-layout.ts
1498
- const TRIGGER_NODE = "trigger";
1499
- const SIDE_PORTS = /* @__PURE__ */ new Set(["false", "error"]);
1500
- function graphLayout(args) {
1501
- const { rows } = stepOutline(args);
1502
- const nodeId = (id) => id === args.triggerId ? TRIGGER_NODE : id;
1503
- const placed = /* @__PURE__ */ new Map([[TRIGGER_NODE, {
1504
- col: 0,
1505
- lane: 0
1506
- }]]);
1507
- const taken = /* @__PURE__ */ new Set();
1508
- const inbound = /* @__PURE__ */ new Map();
1509
- const outbound = /* @__PURE__ */ new Map();
1510
- for (const edge of args.edges) {
1511
- const list = inbound.get(edge.to) ?? [];
1512
- list.push(edge);
1513
- inbound.set(edge.to, list);
1514
- outbound.set(edge.from, (outbound.get(edge.from) ?? 0) + 1);
1515
- }
1516
- const drops = (edge) => SIDE_PORTS.has(edge.port) && (outbound.get(edge.from) ?? 0) > 1;
1517
- const nodes = [];
1518
- for (const { step } of rows) {
1519
- const from = (inbound.get(step.id) ?? []).filter((edge) => placed.has(nodeId(edge.from)));
1520
- const col = Math.max(1, ...from.map((edge) => placed.get(nodeId(edge.from)).col + 1));
1521
- let lane = Math.min(...from.map((edge) => placed.get(nodeId(edge.from)).lane + (drops(edge) ? 1 : 0)), from.length === 0 ? 0 : Infinity);
1522
- const port = from.length === 1 && from[0].port !== "next" ? from[0].port : null;
1523
- while (taken.has(`${col}:${lane}`)) lane++;
1524
- taken.add(`${col}:${lane}`);
1525
- placed.set(step.id, {
1526
- col,
1527
- lane
1528
- });
1529
- nodes.push({
1530
- step,
1531
- col,
1532
- lane,
1533
- port
1534
- });
1535
- }
1536
- return {
1537
- nodes,
1538
- edges: args.edges.map((edge) => ({
1539
- ...edge,
1540
- from: nodeId(edge.from)
1541
- })).filter((edge) => placed.has(edge.from) && placed.has(edge.to)).map((edge) => {
1542
- const a = placed.get(edge.from);
1543
- const b = placed.get(edge.to);
1544
- const clear = (lane) => !nodes.some((node) => node.lane === lane && node.col > a.col && node.col < b.col);
1545
- const low = Math.max(a.lane, b.lane);
1546
- const high = Math.min(a.lane, b.lane);
1547
- const track = clear(low) ? {
1548
- lane: low,
1549
- under: false
1550
- } : clear(high) ? {
1551
- lane: high,
1552
- under: false
1553
- } : {
1554
- lane: high,
1555
- under: true
1556
- };
1557
- return {
1558
- from: edge.from,
1559
- to: edge.to,
1560
- port: edge.port,
1561
- track
1562
- };
1563
- }),
1564
- cols: Math.max(0, ...nodes.map((node) => node.col)),
1565
- lanes: Math.max(1, ...nodes.map((node) => node.lane + 1))
1566
- };
1567
- }
1568
- //#endregion
1569
1666
  //#region editors/workflow-studio/components/WorkflowGraph.tsx
1570
1667
  const STACK_GAP = 16;
1571
1668
  const MAX_STRETCH = 1.5;
@@ -1650,11 +1747,6 @@ const PORT_PILL = {
1650
1747
  false: "bg-foreground/5 text-muted-foreground ring-foreground/15",
1651
1748
  error: "bg-wf-fail/10 text-wf-fail ring-wf-fail/30"
1652
1749
  };
1653
- const PORT_TEXT = {
1654
- true: "Runs when the condition is true",
1655
- false: "Runs when the condition is false",
1656
- error: "Runs when the step before it fails"
1657
- };
1658
1750
  function roundedPath(points, radius = 6) {
1659
1751
  let d = `M ${points[0][0]} ${points[0][1]}`;
1660
1752
  for (let i = 1; i < points.length - 1; i++) {
@@ -1746,54 +1838,6 @@ function Mark({ label, className, onOpen, children, ref, onClick, ...rest }) {
1746
1838
  children
1747
1839
  });
1748
1840
  }
1749
- function Tip(props) {
1750
- return /* @__PURE__ */ jsx(ConnectTooltip, {
1751
- content: props.content,
1752
- side: "bottom",
1753
- delayDuration: 100,
1754
- className: "max-w-64 rounded-md border-solid border-foreground/10 bg-card px-2.5 py-1.5 text-foreground shadow-lg",
1755
- children: props.children
1756
- });
1757
- }
1758
- function stepSummary(record, ran) {
1759
- if (!ran) return "Not run yet";
1760
- if (!record) return "Not reached in the latest run";
1761
- const took = record.startedAt && record.endedAt ? ` · ${formatDuration(record.startedAt, record.endedAt)}` : "";
1762
- return `${statusLabel(record.status)} in the latest run${took}`;
1763
- }
1764
- function StepTip(props) {
1765
- const { step } = props.node;
1766
- const meta = blockMeta(stepBlock(step));
1767
- return /* @__PURE__ */ jsxs("span", {
1768
- className: "flex flex-col gap-0.5",
1769
- children: [
1770
- /* @__PURE__ */ jsx("span", {
1771
- className: "font-medium",
1772
- children: step.name || step.key
1773
- }),
1774
- /* @__PURE__ */ jsxs("span", {
1775
- className: "text-muted-foreground",
1776
- children: [
1777
- meta.displayName,
1778
- " · ",
1779
- meta.subtitle
1780
- ]
1781
- }),
1782
- props.node.port ? /* @__PURE__ */ jsx("span", {
1783
- className: "text-muted-foreground",
1784
- children: PORT_TEXT[props.node.port] ?? `Runs on "${props.node.port}"`
1785
- }) : null,
1786
- /* @__PURE__ */ jsx("span", {
1787
- className: "mt-1",
1788
- children: stepSummary(props.record, props.ran)
1789
- }),
1790
- props.record?.error ? /* @__PURE__ */ jsx("span", {
1791
- className: "line-clamp-3 text-wf-fail",
1792
- children: props.record.error
1793
- }) : null
1794
- ]
1795
- });
1796
- }
1797
1841
  function WorkflowGraph(props) {
1798
1842
  const { state, latest } = props;
1799
1843
  const frame = useRef(null);
@@ -1886,141 +1930,125 @@ function WorkflowGraph(props) {
1886
1930
  };
1887
1931
  };
1888
1932
  const trigger = state.trigger ? triggerBlock(state.trigger) : null;
1889
- const triggerMeta = trigger ? blockMeta(trigger) : null;
1890
- return /* @__PURE__ */ jsx(ConnectTooltipProvider, {
1891
- disableHoverableContent: true,
1892
- children: /* @__PURE__ */ jsxs("div", {
1893
- ref: frame,
1894
- className: stacked ? "flex flex-col items-start" : "flex items-start",
1895
- children: [/* @__PURE__ */ jsx("span", {
1896
- ref: pill,
1897
- className: "flex shrink-0",
1898
- children: /* @__PURE__ */ jsx(Tip, {
1899
- content: /* @__PURE__ */ jsxs("span", {
1900
- className: "flex flex-col gap-0.5",
1901
- children: [
1902
- /* @__PURE__ */ jsx("span", {
1903
- className: "font-medium",
1904
- children: triggerMeta?.displayName ?? "No trigger"
1905
- }),
1906
- triggerMeta ? /* @__PURE__ */ jsx("span", {
1907
- className: "text-muted-foreground",
1908
- children: triggerMeta.subtitle
1909
- }) : null,
1910
- /* @__PURE__ */ jsx("span", {
1911
- className: "mt-1",
1912
- children: latest ? `Last fired ${formatWhen(latest.startedAt)}` : "Not fired yet"
1913
- })
1914
- ]
1915
- }),
1916
- children: /* @__PURE__ */ jsxs(Mark, {
1917
- label: `Trigger: ${props.triggerText}`,
1918
- onOpen: props.onOpen,
1919
- className: `flex shrink-0 items-center gap-1.5 rounded-full bg-card font-medium text-foreground ring-[1.5px] ${g.pill} ${latest ? RING$1.ok : RING$1.idle}`,
1920
- children: [/* @__PURE__ */ jsx("span", {
1921
- className: `flex items-center justify-center rounded-full dark:bg-white ${g.pillLogo}`,
1922
- children: trigger ? /* @__PURE__ */ jsx(BlockLogo, {
1923
- bare: true,
1924
- block: trigger,
1925
- size: g.logo - 2
1926
- }) : null
1927
- }), props.triggerText]
1928
- })
1933
+ return /* @__PURE__ */ jsx(TipProvider, { children: /* @__PURE__ */ jsxs("div", {
1934
+ ref: frame,
1935
+ className: stacked ? "flex flex-col items-start" : "flex items-start",
1936
+ children: [/* @__PURE__ */ jsx("span", {
1937
+ ref: pill,
1938
+ className: "flex shrink-0",
1939
+ children: /* @__PURE__ */ jsx(Tip, {
1940
+ content: /* @__PURE__ */ jsx(TriggerTip, {
1941
+ trigger,
1942
+ latest
1943
+ }),
1944
+ children: /* @__PURE__ */ jsxs(Mark, {
1945
+ label: `Trigger: ${props.triggerText}`,
1946
+ onOpen: props.onOpen,
1947
+ className: `flex shrink-0 items-center gap-1.5 rounded-full bg-card font-medium text-foreground ring-[1.5px] ${g.pill} ${latest ? RING$1.ok : RING$1.idle}`,
1948
+ children: [/* @__PURE__ */ jsx("span", {
1949
+ className: `flex items-center justify-center rounded-full dark:bg-white ${g.pillLogo}`,
1950
+ children: trigger ? /* @__PURE__ */ jsx(BlockLogo, {
1951
+ bare: true,
1952
+ block: trigger,
1953
+ size: g.logo - 2
1954
+ }) : null
1955
+ }), props.triggerText]
1929
1956
  })
1930
- }), layout.nodes.length > 0 ? /* @__PURE__ */ jsxs("ol", {
1931
- className: `relative shrink-0 ${stacked ? "" : "-ml-px"}`,
1932
- style: {
1957
+ })
1958
+ }), layout.nodes.length > 0 ? /* @__PURE__ */ jsxs("ol", {
1959
+ className: `relative shrink-0 ${stacked ? "" : "-ml-px"}`,
1960
+ style: {
1961
+ width,
1962
+ height,
1963
+ marginTop: stacked ? STACK_GAP : 0
1964
+ },
1965
+ "aria-label": layout.nodes.map((node) => {
1966
+ const status = records.get(node.step.key)?.status;
1967
+ const label = node.step.name || node.step.key;
1968
+ return status ? `${label}: ${status.toLowerCase()}` : label;
1969
+ }).join(", "),
1970
+ children: [
1971
+ /* @__PURE__ */ jsx("svg", {
1972
+ "aria-hidden": true,
1973
+ className: "absolute inset-0 overflow-visible",
1933
1974
  width,
1934
1975
  height,
1935
- marginTop: stacked ? STACK_GAP : 0
1936
- },
1937
- "aria-label": layout.nodes.map((node) => {
1938
- const status = records.get(node.step.key)?.status;
1939
- const label = node.step.name || node.step.key;
1940
- return status ? `${label}: ${status.toLowerCase()}` : label;
1941
- }).join(", "),
1942
- children: [
1943
- /* @__PURE__ */ jsx("svg", {
1944
- "aria-hidden": true,
1945
- className: "absolute inset-0 overflow-visible",
1946
- width,
1947
- height,
1948
- children: routes.map(({ key, edge, route, tone }) => /* @__PURE__ */ jsx("path", {
1949
- d: roundedPath(route.points),
1950
- fill: "none",
1951
- stroke: "currentColor",
1952
- strokeWidth: 2,
1953
- strokeDasharray: edge.port === "error" ? "3 3" : void 0,
1954
- className: STROKE[tone]
1955
- }, key))
1956
- }),
1957
- routes.map(({ key, edge, route }) => PORT_PILL[edge.port] ? /* @__PURE__ */ jsx("span", {
1958
- "aria-hidden": true,
1959
- className: "pointer-events-none absolute z-[1] -translate-x-1/2 -translate-y-1/2 rounded-full bg-card",
1976
+ children: routes.map(({ key, edge, route, tone }) => /* @__PURE__ */ jsx("path", {
1977
+ d: roundedPath(route.points),
1978
+ fill: "none",
1979
+ stroke: "currentColor",
1980
+ strokeWidth: 2,
1981
+ strokeDasharray: edge.port === "error" ? "3 3" : void 0,
1982
+ className: STROKE[tone]
1983
+ }, key))
1984
+ }),
1985
+ routes.map(({ key, edge, route }) => PORT_PILL[edge.port] ? /* @__PURE__ */ jsx("span", {
1986
+ "aria-hidden": true,
1987
+ className: "pointer-events-none absolute z-[1] -translate-x-1/2 -translate-y-1/2 rounded-full bg-card",
1988
+ style: {
1989
+ left: route.label.x,
1990
+ top: route.label.y
1991
+ },
1992
+ children: /* @__PURE__ */ jsx("span", {
1993
+ className: `block rounded-full px-1.5 font-medium leading-4 ring-1 ring-inset ${g.portText} ${PORT_PILL[edge.port]}`,
1994
+ children: edge.port
1995
+ })
1996
+ }, key) : null),
1997
+ layout.nodes.map((node) => {
1998
+ const record = records.get(node.step.key);
1999
+ const skipped = record?.status === "SKIPPED";
2000
+ const name = node.step.name || node.step.key;
2001
+ const { x, y } = spot(node.col, node.lane);
2002
+ const tip = /* @__PURE__ */ jsx(StepTip, {
2003
+ step: node.step,
2004
+ port: node.port,
2005
+ record,
2006
+ ran: Boolean(latest)
2007
+ });
2008
+ return /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx("span", {
2009
+ className: "absolute",
1960
2010
  style: {
1961
- left: route.label.x,
1962
- top: route.label.y
2011
+ left: x - g.r,
2012
+ top: y - g.r
1963
2013
  },
1964
- children: /* @__PURE__ */ jsx("span", {
1965
- className: `block rounded-full px-1.5 font-medium leading-4 ring-1 ring-inset ${g.portText} ${PORT_PILL[edge.port]}`,
1966
- children: edge.port
1967
- })
1968
- }, key) : null),
1969
- layout.nodes.map((node) => {
1970
- const record = records.get(node.step.key);
1971
- const skipped = record?.status === "SKIPPED";
1972
- const name = node.step.name || node.step.key;
1973
- const { x, y } = spot(node.col, node.lane);
1974
- const tip = /* @__PURE__ */ jsx(StepTip, {
1975
- node,
1976
- record,
1977
- ran: Boolean(latest)
1978
- });
1979
- return /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx("span", {
1980
- className: "absolute",
1981
- style: {
1982
- left: x - g.r,
1983
- top: y - g.r
1984
- },
1985
- children: /* @__PURE__ */ jsx(Tip, {
1986
- content: tip,
1987
- children: /* @__PURE__ */ jsx(Mark, {
1988
- label: `${name}: ${record ? record.status.toLowerCase() : "not run"}`,
1989
- onOpen: props.onOpen,
1990
- className: `flex items-center justify-center rounded-full bg-card transition-shadow ${g.circle} ${skipped ? "border-[1.5px] border-dashed border-foreground/40" : `ring-[1.5px] hover:ring-[3px] dark:bg-white ${RING$1[toneOfStep(node.step.key)]}`}`,
1991
- children: /* @__PURE__ */ jsx("span", {
1992
- className: skipped ? "flex opacity-40" : "flex",
1993
- children: /* @__PURE__ */ jsx(BlockLogo, {
1994
- bare: true,
1995
- block: stepBlock(node.step),
1996
- size: g.logo
1997
- })
2014
+ children: /* @__PURE__ */ jsx(Tip, {
2015
+ content: tip,
2016
+ children: /* @__PURE__ */ jsx(Mark, {
2017
+ label: `${name}: ${record ? record.status.toLowerCase() : "not run"}`,
2018
+ onOpen: props.onOpen,
2019
+ className: `flex items-center justify-center rounded-full bg-card transition-shadow ${g.circle} ${skipped ? "border-[1.5px] border-dashed border-foreground/40" : `ring-[1.5px] hover:ring-[3px] dark:bg-white ${RING$1[toneOfStep(node.step.key)]}`}`,
2020
+ children: /* @__PURE__ */ jsx("span", {
2021
+ className: skipped ? "flex opacity-40" : "flex",
2022
+ children: /* @__PURE__ */ jsx(BlockLogo, {
2023
+ bare: true,
2024
+ block: stepBlock(node.step),
2025
+ size: g.logo
1998
2026
  })
1999
2027
  })
2000
2028
  })
2001
- }), g.label ? /* @__PURE__ */ jsxs("span", {
2002
- "aria-hidden": true,
2003
- className: "pointer-events-none absolute flex flex-col items-center text-center",
2004
- style: {
2005
- ...labelBox(x),
2006
- top: y + g.r + 6
2007
- },
2008
- children: [/* @__PURE__ */ jsx(Tip, {
2009
- content: tip,
2010
- children: /* @__PURE__ */ jsx("span", {
2011
- className: `pointer-events-auto line-clamp-2 max-w-full font-medium text-foreground [overflow-wrap:anywhere] ${g.nameText}`,
2012
- children: name
2013
- })
2014
- }), g.subtitle ? /* @__PURE__ */ jsx("span", {
2015
- className: "max-w-full truncate text-xs text-muted-foreground",
2016
- children: blockMeta(stepBlock(node.step)).displayName
2017
- }) : null]
2018
- }) : null] }, node.step.id);
2019
- })
2020
- ]
2021
- }) : null]
2022
- })
2023
- });
2029
+ })
2030
+ }), g.label ? /* @__PURE__ */ jsxs("span", {
2031
+ "aria-hidden": true,
2032
+ className: "pointer-events-none absolute flex flex-col items-center text-center",
2033
+ style: {
2034
+ ...labelBox(x),
2035
+ top: y + g.r + 6
2036
+ },
2037
+ children: [/* @__PURE__ */ jsx(Tip, {
2038
+ content: tip,
2039
+ children: /* @__PURE__ */ jsx("span", {
2040
+ className: `pointer-events-auto line-clamp-2 max-w-full font-medium text-foreground [overflow-wrap:anywhere] ${g.nameText}`,
2041
+ children: name
2042
+ })
2043
+ }), g.subtitle ? /* @__PURE__ */ jsx("span", {
2044
+ className: "max-w-full truncate text-xs text-muted-foreground",
2045
+ children: blockMeta(stepBlock(node.step)).displayName
2046
+ }) : null]
2047
+ }) : null] }, node.step.id);
2048
+ })
2049
+ ]
2050
+ }) : null]
2051
+ }) });
2024
2052
  }
2025
2053
  //#endregion
2026
2054
  //#region editors/workflow-studio/components/WorkflowBoard.tsx
@@ -2033,28 +2061,37 @@ function CollapsedChain(props) {
2033
2061
  }, props.latest);
2034
2062
  return /* @__PURE__ */ jsxs("span", {
2035
2063
  className: "flex min-w-0 items-center",
2036
- children: [/* @__PURE__ */ jsxs("span", {
2037
- title: props.triggerText,
2038
- className: `flex h-6 max-w-full shrink-0 items-center gap-1.5 rounded-full bg-card pl-0.5 pr-2.5 text-[12px] font-medium text-foreground ring-[1.5px] ${props.latest ? "ring-wf-ok" : "ring-foreground/15 dark:ring-foreground/30"}`,
2039
- children: [/* @__PURE__ */ jsx("span", {
2040
- className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full dark:bg-white",
2041
- children: trigger ? /* @__PURE__ */ jsx(BlockLogo, {
2042
- bare: true,
2043
- block: trigger,
2044
- size: 12
2045
- }) : null
2046
- }), /* @__PURE__ */ jsx("span", {
2047
- className: "truncate",
2048
- children: props.triggerText
2049
- })]
2064
+ children: [/* @__PURE__ */ jsx(Tip, {
2065
+ content: /* @__PURE__ */ jsx(TriggerTip, {
2066
+ trigger,
2067
+ latest: props.latest,
2068
+ text: props.triggerText
2069
+ }),
2070
+ children: /* @__PURE__ */ jsx("span", {
2071
+ className: "flex min-w-6 shrink-[100]",
2072
+ children: /* @__PURE__ */ jsxs("span", {
2073
+ className: `flex h-6 min-w-0 max-w-full items-center gap-1.5 overflow-hidden rounded-full bg-card px-0.5 text-[12px] font-medium text-foreground ring-[1.5px] @[26rem]:pr-2.5 ${props.latest ? "ring-wf-ok" : "ring-foreground/15 dark:ring-foreground/30"}`,
2074
+ children: [/* @__PURE__ */ jsx("span", {
2075
+ className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full dark:bg-white",
2076
+ children: trigger ? /* @__PURE__ */ jsx(BlockLogo, {
2077
+ bare: true,
2078
+ block: trigger,
2079
+ size: 12
2080
+ }) : null
2081
+ }), /* @__PURE__ */ jsx("span", {
2082
+ className: "hidden truncate @[26rem]:inline",
2083
+ children: props.triggerText
2084
+ })]
2085
+ })
2086
+ })
2050
2087
  }), links.length > 0 ? /* @__PURE__ */ jsxs("span", {
2051
- className: "flex min-w-0 shrink-[100] items-center",
2088
+ className: "hidden min-w-0 items-center @[26rem]:flex",
2052
2089
  children: [/* @__PURE__ */ jsx("span", {
2053
2090
  "aria-hidden": true,
2054
2091
  className: "h-0.5 w-3 shrink-0 bg-foreground/15 dark:bg-foreground/30"
2055
2092
  }), /* @__PURE__ */ jsx(ScrollFade, {
2056
2093
  clip: true,
2057
- className: "-my-1 min-w-0 py-1 pl-0.5",
2094
+ className: "-my-1 min-w-0 px-0.5 py-1",
2058
2095
  children: /* @__PURE__ */ jsx(MiniChain, { links })
2059
2096
  })]
2060
2097
  }) : null]
@@ -2125,7 +2162,7 @@ function WorkflowBoard(props) {
2125
2162
  className: "mx-auto mt-1 max-w-sm text-[13px] text-muted-foreground",
2126
2163
  children: "A workflow starts on a trigger, like a schedule or a webhook, and runs a chain of steps across your services."
2127
2164
  })]
2128
- }) : /* @__PURE__ */ jsx("ul", {
2165
+ }) : /* @__PURE__ */ jsx(TipProvider, { children: /* @__PURE__ */ jsx("ul", {
2129
2166
  "aria-label": "Workflows",
2130
2167
  className: "rounded-xl border border-solid border-foreground/10 bg-card",
2131
2168
  children: rows.map((row) => {
@@ -2152,17 +2189,19 @@ function WorkflowBoard(props) {
2152
2189
  className: `h-3.5 w-3.5 transition-transform ${collapsed ? "" : "rotate-90"}`
2153
2190
  })
2154
2191
  }), /* @__PURE__ */ jsxs("span", {
2155
- className: `grid w-full grid-rows-[1.5rem] items-center gap-x-6 ${collapsed ? "grid-cols-[minmax(10rem,2fr)_minmax(0,3fr)] @[44rem]:grid-cols-[minmax(10rem,2fr)_minmax(0,3fr)_auto] @[60rem]:grid-cols-[minmax(10rem,2fr)_minmax(0,3fr)_minmax(0,10rem)_auto]" : "grid-cols-[minmax(0,1fr)_auto] md:grid-cols-[minmax(0,1fr)_minmax(0,10rem)_auto]"}`,
2192
+ className: `grid w-full grid-rows-[1.5rem] items-center gap-x-6 ${collapsed ? "grid-cols-[minmax(10rem,1fr)_minmax(0,2fr)] @[44rem]:grid-cols-[minmax(10rem,1fr)_minmax(0,2fr)_auto] @[60rem]:grid-cols-[minmax(10rem,1fr)_minmax(0,2fr)_minmax(0,10rem)_auto]" : "grid-cols-[minmax(0,1fr)_auto] md:grid-cols-[minmax(0,1fr)_minmax(0,10rem)_auto]"}`,
2156
2193
  children: [
2157
2194
  /* @__PURE__ */ jsxs("span", {
2158
2195
  className: "flex min-w-0 items-center gap-2",
2159
2196
  children: [
2160
- /* @__PURE__ */ jsx("span", {
2161
- title: health.label,
2162
- className: "flex",
2163
- children: /* @__PURE__ */ jsx(StatusDot, {
2164
- tone: health.tone,
2165
- hollow: health.hollow
2197
+ /* @__PURE__ */ jsx(Tip, {
2198
+ content: health.label,
2199
+ children: /* @__PURE__ */ jsx("span", {
2200
+ className: "flex",
2201
+ children: /* @__PURE__ */ jsx(StatusDot, {
2202
+ tone: health.tone,
2203
+ hollow: health.hollow
2204
+ })
2166
2205
  })
2167
2206
  }),
2168
2207
  /* @__PURE__ */ jsx("span", {
@@ -2182,14 +2221,16 @@ function WorkflowBoard(props) {
2182
2221
  }) : null,
2183
2222
  /* @__PURE__ */ jsx("span", {
2184
2223
  className: `hidden text-[13px] ${collapsed ? "@[60rem]:block" : "md:block"}`,
2185
- title: latest ? formatAbsolute(latest.startedAt) : void 0,
2186
- children: latest ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
2187
- className: `font-medium ${latestTone === "fail" ? "text-wf-fail" : latestTone === "ok" ? "text-wf-ok" : "text-foreground"}`,
2188
- children: statusLabel(latest.status)
2189
- }), /* @__PURE__ */ jsx("span", {
2190
- className: "ml-1.5 text-xs text-muted-foreground",
2191
- children: formatWhen(latest.startedAt)
2192
- })] }) : /* @__PURE__ */ jsx("span", {
2224
+ children: latest ? /* @__PURE__ */ jsx(Tip, {
2225
+ content: formatAbsolute(latest.startedAt),
2226
+ children: /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
2227
+ className: `font-medium ${latestTone === "fail" ? "text-wf-fail" : latestTone === "ok" ? "text-wf-ok" : "text-foreground"}`,
2228
+ children: statusLabel(latest.status)
2229
+ }), /* @__PURE__ */ jsx("span", {
2230
+ className: "ml-1.5 text-xs text-muted-foreground",
2231
+ children: formatWhen(latest.startedAt)
2232
+ })] })
2233
+ }) : /* @__PURE__ */ jsx("span", {
2193
2234
  className: "text-muted-foreground",
2194
2235
  children: "Not run yet"
2195
2236
  })
@@ -2218,7 +2259,7 @@ function WorkflowBoard(props) {
2218
2259
  children: [
2219
2260
  /* @__PURE__ */ jsxs("span", {
2220
2261
  "aria-hidden": true,
2221
- className: "pointer-events-none absolute right-5 top-1 flex items-center gap-1 text-xs font-medium text-muted-foreground opacity-0 transition-opacity group-hover/content:opacity-100 group-focus-visible/content:opacity-100",
2262
+ className: "pointer-events-none absolute right-4 top-2.5 z-10 flex items-center gap-1 rounded-md bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground opacity-0 shadow-sm transition-opacity group-hover/content:opacity-100 group-focus-visible/content:opacity-100",
2222
2263
  children: ["Open workflow", /* @__PURE__ */ jsx(Icon, {
2223
2264
  name: "arrowRight",
2224
2265
  className: "h-3.5 w-3.5"
@@ -2241,7 +2282,7 @@ function WorkflowBoard(props) {
2241
2282
  })]
2242
2283
  }, row.id);
2243
2284
  })
2244
- })]
2285
+ }) })]
2245
2286
  });
2246
2287
  }
2247
2288
  //#endregion
@@ -2662,4 +2703,4 @@ function Editor(props) {
2662
2703
  //#endregion
2663
2704
  export { Editor as default };
2664
2705
 
2665
- //# sourceMappingURL=editor-EeTeVS3A.mjs.map
2706
+ //# sourceMappingURL=editor-DVBnS8YM.js.map