@powerhousedao/workflow 6.2.3-dev.54 → 6.2.3-dev.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{BlockSelector-CzJnQWsh.js → BlockSelector-DnBab95a.js} +3 -3
- package/dist/browser/{BlockSelector-CzJnQWsh.js.map → BlockSelector-DnBab95a.js.map} +1 -1
- package/dist/browser/block-type-kX-27vVt.js +44 -0
- package/dist/browser/block-type-kX-27vVt.js.map +1 -0
- package/dist/browser/{connection-BP17lpt3.js → connection-BXV8I017.js} +2 -2
- package/dist/browser/{connection-BP17lpt3.js.map → connection-BXV8I017.js.map} +1 -1
- package/dist/browser/{connection-form-cCgfAa1A.js → connection-form-Cy2fyFUR.js} +24 -28
- package/dist/browser/connection-form-Cy2fyFUR.js.map +1 -0
- package/dist/browser/{data-tree-S_SwaRve.js → data-tree-BvFLAMyE.js} +2 -2
- package/dist/browser/{data-tree-S_SwaRve.js.map → data-tree-BvFLAMyE.js.map} +1 -1
- package/dist/browser/document-models/connection/index.js +3 -3
- package/dist/browser/document-models/index.js +3 -3
- package/dist/browser/document-models/workflow/index.js +3 -3
- package/dist/browser/{document-models-B08jDa_s.js → document-models-CncHyXAk.js} +3 -3
- package/dist/browser/{document-models-B08jDa_s.js.map → document-models-CncHyXAk.js.map} +1 -1
- package/dist/browser/{editor-CQyfDOIN.js → editor-CEJO-2Ue.js} +138 -127
- package/dist/browser/editor-CEJO-2Ue.js.map +1 -0
- package/dist/{node/editor-EeTeVS3A.mjs → browser/editor-DVBnS8YM.js} +360 -319
- package/dist/browser/editor-DVBnS8YM.js.map +1 -0
- package/dist/browser/{editor-CVXRNht0.js → editor-Dc9Q55q1.js} +7 -7
- package/dist/browser/{editor-CVXRNht0.js.map → editor-Dc9Q55q1.js.map} +1 -1
- package/dist/browser/editors/connection-editor/module.js +1 -1
- package/dist/browser/editors/runtime/index.js +2 -0
- package/dist/browser/editors/workflow-editor/module.js +1 -1
- package/dist/browser/editors/workflow-studio/module.js +1 -1
- package/dist/browser/index.js +4 -4
- package/dist/browser/{module-B2BMwu5E.js → module-DIQ3tQ2M.js} +97 -2
- package/dist/browser/module-DIQ3tQ2M.js.map +1 -0
- package/dist/browser/{module-ozS5EVRx.js → module-DxQBeqBh.js} +211 -83
- package/dist/browser/module-DxQBeqBh.js.map +1 -0
- package/dist/browser/reactor/index.js +2 -2
- package/dist/browser/{runtime-queries-2hn7fcKn.js → runtime-queries-DehIdatq.js} +3 -3
- package/dist/browser/{runtime-queries-2hn7fcKn.js.map → runtime-queries-DehIdatq.js.map} +1 -1
- package/dist/browser/{trigger-text-Cfyx8tMq.js → trigger-text-CfRbN-DV.js} +5 -5
- package/dist/browser/trigger-text-CfRbN-DV.js.map +1 -0
- package/dist/browser/upgrade-manifests-CAE3ivDp.js +8 -0
- package/dist/browser/{upgrade-manifests-DHGmgHKW.js.map → upgrade-manifests-CAE3ivDp.js.map} +1 -1
- package/dist/browser/{workflow-DoewHe4K.js → workflow-C003Wutu.js} +2 -2
- package/dist/browser/{workflow-DoewHe4K.js.map → workflow-C003Wutu.js.map} +1 -1
- package/dist/node/{BlockSelector-g9m3yaJj.mjs → BlockSelector-B77i85CO.mjs} +3 -3
- package/dist/node/{BlockSelector-g9m3yaJj.mjs.map → BlockSelector-B77i85CO.mjs.map} +1 -1
- package/dist/node/block-type-kX-27vVt.mjs +44 -0
- package/dist/node/block-type-kX-27vVt.mjs.map +1 -0
- package/dist/node/{connection-BxJoL8js.mjs → connection-BzW9OpKx.mjs} +2 -2
- package/dist/node/{connection-BxJoL8js.mjs.map → connection-BzW9OpKx.mjs.map} +1 -1
- package/dist/node/{connection-form-h0PidbTI.mjs → connection-form-BCwEO3ll.mjs} +24 -28
- package/dist/node/connection-form-BCwEO3ll.mjs.map +1 -0
- package/dist/node/{data-tree-CKKeR7qj.mjs → data-tree-CH8KnNSz.mjs} +2 -2
- package/dist/node/{data-tree-CKKeR7qj.mjs.map → data-tree-CH8KnNSz.mjs.map} +1 -1
- package/dist/node/document-models/connection/index.mjs +3 -3
- package/dist/node/document-models/index.mjs +3 -3
- package/dist/node/document-models/workflow/index.mjs +3 -3
- package/dist/node/{editor-BAbYXi7T.mjs → editor-BYzFMCB8.mjs} +7 -7
- package/dist/node/{editor-BAbYXi7T.mjs.map → editor-BYzFMCB8.mjs.map} +1 -1
- package/dist/{browser/editor-CbpyTAEC.js → node/editor-CsMRho-A.mjs} +360 -319
- package/dist/node/editor-CsMRho-A.mjs.map +1 -0
- package/dist/node/{editor-DCsT8WsQ.mjs → editor-DtLyolUn.mjs} +138 -127
- package/dist/node/editor-DtLyolUn.mjs.map +1 -0
- package/dist/node/editors/connection-editor/module.mjs +1 -1
- package/dist/node/editors/runtime/index.mjs +2 -0
- package/dist/node/editors/workflow-editor/module.mjs +1 -1
- package/dist/node/editors/workflow-studio/module.mjs +1 -1
- package/dist/node/index.mjs +4 -4
- package/dist/node/{module-BlT-atBQ.mjs → module-Bl_4mnxR.mjs} +97 -2
- package/dist/node/module-Bl_4mnxR.mjs.map +1 -0
- package/dist/node/{module-uKdoLIga.mjs → module-DPg8IYIn.mjs} +211 -83
- package/dist/node/module-DPg8IYIn.mjs.map +1 -0
- package/dist/node/pieces/reactor/descriptor.json +1 -1
- package/dist/node/pieces/reactor/package.json +1 -1
- package/dist/node/{runtime-queries-BtTx8FU3.mjs → runtime-queries-CJSpbsBq.mjs} +3 -3
- package/dist/node/{runtime-queries-BtTx8FU3.mjs.map → runtime-queries-CJSpbsBq.mjs.map} +1 -1
- package/dist/node/{trigger-text-CtSXg0KB.mjs → trigger-text-C6BlOwck.mjs} +5 -5
- package/dist/node/trigger-text-C6BlOwck.mjs.map +1 -0
- package/dist/node/upgrade-manifests-7SFwDrhd.mjs +8 -0
- package/dist/node/{upgrade-manifests-D-pLniUG.mjs.map → upgrade-manifests-7SFwDrhd.mjs.map} +1 -1
- package/dist/node/{workflow-Dy-309pE.mjs → workflow-7pmOvHmg.mjs} +2 -2
- package/dist/node/{workflow-Dy-309pE.mjs.map → workflow-7pmOvHmg.mjs.map} +1 -1
- package/dist/powerhouse.manifest.json +1 -1
- package/dist/style.css +29 -14
- package/dist/types/document-models/connection/v1/actions.d.ts +2 -0
- package/dist/types/document-models/connection/v1/actions.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/config/actions.d.ts +10 -2
- package/dist/types/document-models/connection/v1/gen/config/actions.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/config/creators.d.ts +4 -2
- package/dist/types/document-models/connection/v1/gen/config/creators.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/config/error.d.ts +15 -1
- package/dist/types/document-models/connection/v1/gen/config/error.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/config/operations.d.ts +3 -1
- package/dist/types/document-models/connection/v1/gen/config/operations.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/document-model.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/reducer.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/schema/types.d.ts +7 -0
- package/dist/types/document-models/connection/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts +3 -1
- package/dist/types/document-models/connection/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/module.d.ts +2 -0
- package/dist/types/document-models/connection/v1/module.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/src/reducers/config.d.ts.map +1 -1
- package/dist/types/document-models/connection/v1/tests/config-values.test.d.ts +2 -0
- package/dist/types/document-models/connection/v1/tests/config-values.test.d.ts.map +1 -0
- package/dist/types/document-models/document-models.d.ts +5 -0
- package/dist/types/document-models/document-models.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/actions.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +16 -0
- package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +5 -1
- package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/actions.d.ts +14 -2
- package/dist/types/document-models/workflow/v1/gen/trigger/actions.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts +5 -2
- package/dist/types/document-models/workflow/v1/gen/trigger/creators.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts +32 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/error.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/operations.d.ts +4 -1
- package/dist/types/document-models/workflow/v1/gen/trigger/operations.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/module.d.ts +3 -0
- package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/src/reducers/trigger.d.ts.map +1 -1
- package/dist/types/document-models/workflow/v1/tests/trigger-fields.test.d.ts +2 -0
- package/dist/types/document-models/workflow/v1/tests/trigger-fields.test.d.ts.map +1 -0
- package/dist/types/editors/connection-editor/ReactorConnectionSettings.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-callbacks.d.ts.map +1 -1
- package/dist/types/editors/connection-editor/connection-form.d.ts +2 -2
- package/dist/types/editors/connection-editor/connection-form.d.ts.map +1 -1
- package/dist/types/editors/runtime/index.d.ts +21 -0
- package/dist/types/editors/runtime/index.d.ts.map +1 -0
- package/dist/types/editors/runtime/runtime-export.test.d.ts +2 -0
- package/dist/types/editors/runtime/runtime-export.test.d.ts.map +1 -0
- package/dist/types/editors/shared/pending-echo.d.ts +9 -0
- package/dist/types/editors/shared/pending-echo.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/ScheduleBuilder.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/model.d.ts +6 -0
- package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowBoard.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowGraph.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/chain.d.ts +3 -1
- package/dist/types/editors/workflow-studio/components/chain.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/tips.d.ts +23 -0
- package/dist/types/editors/workflow-studio/components/tips.d.ts.map +1 -0
- package/dist/types/scripts/ui-stack.d.ts.map +1 -1
- package/dist/types/test/ui/harness/property-form-echo.d.ts +12 -0
- package/dist/types/test/ui/harness/property-form-echo.d.ts.map +1 -0
- package/dist/types/test/ui/harness/schedule-builder.d.ts +8 -0
- package/dist/types/test/ui/harness/schedule-builder.d.ts.map +1 -0
- package/dist/types/test/ui/property-form-echo.spec.d.ts +2 -0
- package/dist/types/test/ui/property-form-echo.spec.d.ts.map +1 -0
- package/dist/types/test/ui/schedule-builder.spec.d.ts +2 -0
- package/dist/types/test/ui/schedule-builder.spec.d.ts.map +1 -0
- package/package.json +14 -8
- package/dist/browser/connection-form-cCgfAa1A.js.map +0 -1
- package/dist/browser/editor-CQyfDOIN.js.map +0 -1
- package/dist/browser/editor-CbpyTAEC.js.map +0 -1
- package/dist/browser/module-B2BMwu5E.js.map +0 -1
- package/dist/browser/module-ozS5EVRx.js.map +0 -1
- package/dist/browser/trigger-text-Cfyx8tMq.js.map +0 -1
- package/dist/browser/upgrade-manifests-DHGmgHKW.js +0 -8
- package/dist/node/connection-form-h0PidbTI.mjs.map +0 -1
- package/dist/node/editor-DCsT8WsQ.mjs.map +0 -1
- package/dist/node/editor-EeTeVS3A.mjs.map +0 -1
- package/dist/node/module-BlT-atBQ.mjs.map +0 -1
- package/dist/node/module-uKdoLIga.mjs.map +0 -1
- package/dist/node/trigger-text-CtSXg0KB.mjs.map +0 -1
- package/dist/node/upgrade-manifests-D-pLniUG.mjs +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { y as
|
|
3
|
-
import {
|
|
4
|
-
import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-
|
|
5
|
-
import { a as StepError, f as StatusToggle, i as DataViewer, l as PublishState, o as Modal, r as describeTrigger } from "./trigger-text-
|
|
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-CJSpbsBq.mjs";
|
|
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-B77i85CO.mjs";
|
|
3
|
+
import { y as actions } from "./module-DPg8IYIn.mjs";
|
|
4
|
+
import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-7pmOvHmg.mjs";
|
|
5
|
+
import { a as StepError, f as StatusToggle, i as DataViewer, l as PublishState, o as Modal, r as describeTrigger } from "./trigger-text-C6BlOwck.mjs";
|
|
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(
|
|
82
|
-
|
|
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" ? "
|
|
86
|
-
children: /* @__PURE__ */ jsx(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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__ */
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
children: /* @__PURE__ */
|
|
1893
|
-
ref:
|
|
1894
|
-
className:
|
|
1895
|
-
children:
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
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
|
-
})
|
|
1931
|
-
|
|
1932
|
-
|
|
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
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
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:
|
|
1962
|
-
top:
|
|
2011
|
+
left: x - g.r,
|
|
2012
|
+
top: y - g.r
|
|
1963
2013
|
},
|
|
1964
|
-
children: /* @__PURE__ */ jsx(
|
|
1965
|
-
|
|
1966
|
-
children:
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
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
|
-
})
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
})
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
}) : null]
|
|
2019
|
-
})
|
|
2020
|
-
|
|
2021
|
-
|
|
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__ */
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
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: "
|
|
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
|
|
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,
|
|
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(
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
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
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
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-
|
|
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-
|
|
2706
|
+
//# sourceMappingURL=editor-CsMRho-A.mjs.map
|