@burdenoff/microfe-subscriberbot 2026.1102.4 → 2026.1102.6
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/stories/pages/DashboardPage.stories.d.ts +4 -0
- package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts +5 -0
- package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +14 -0
- package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +1 -0
- package/dist/stories/pages/WorkflowsPage.stories.d.ts +1 -0
- package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +1 -1
- package/dist/stories/support/fixtures.d.ts +6 -1
- package/dist/stories/support/fixtures.d.ts.map +1 -1
- package/dist/stories/support/handlers.d.ts.map +1 -1
- package/dist/stories/support/phoneViewport.d.ts +4 -0
- package/dist/stories/support/phoneViewport.d.ts.map +1 -0
- package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +27 -23
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +3 -3
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +18 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +247 -0
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +10 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +217 -0
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +26 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.js +46 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +10 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +25 -0
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -0
- package/dist/subscriberbot/components/mobile/index.d.ts +9 -0
- package/dist/subscriberbot/components/mobile/index.d.ts.map +1 -0
- package/dist/subscriberbot/components/mobile/index.js +4 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -0
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts +13 -0
- package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useCompactViewport.js +21 -0
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +10 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +113 -79
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +166 -189
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +4 -4
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +201 -190
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +120 -119
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +226 -212
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +3 -0
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -0
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +648 -0
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +60 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +122 -0
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -0
- package/dist/subscriberbot/types/index.d.ts +65 -0
- package/dist/subscriberbot/types/index.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +21 -13
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.d.ts +106 -0
- package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -0
- package/dist/subscriberbot/utils/portfolio.js +151 -0
- package/dist/subscriberbot/utils/portfolio.js.map +1 -0
- package/package.json +3 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { useSubscriberBot as e } from "../context/SubscriberBotContext.js";
|
|
2
|
+
import { PageLayout as t } from "../components/PageLayout.js";
|
|
3
|
+
import { MetricsCard as n } from "../components/MetricsCard.js";
|
|
4
|
+
import { formatRelativeTime as r } from "../utils/formatters.js";
|
|
5
|
+
import { StatusBadge as i } from "../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as a } from "../components/EmptyState.js";
|
|
7
|
+
import { Modal as o } from "../components/Modal.js";
|
|
8
|
+
import { useTr as s } from "../hooks/useTr.js";
|
|
9
|
+
import { ErrorView as c, LoadingView as l } from "../components/StateViews.js";
|
|
9
10
|
import "../components/index.js";
|
|
10
|
-
import { useActivateWorkflow as
|
|
11
|
-
import { useRouteSelection as
|
|
12
|
-
import { useState as
|
|
13
|
-
import { ArrowRight as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { GlassCard as
|
|
11
|
+
import { useActivateWorkflow as u, useCreateWorkflow as d, useWorkflows as f } from "../hooks/useSubscriberBotApi.js";
|
|
12
|
+
import { useRouteSelection as p } from "../hooks/useRouteSelection.js";
|
|
13
|
+
import { useState as m } from "react";
|
|
14
|
+
import { ArrowRight as h, CheckCircle2 as g, Clock as _, PencilRuler as v, Play as y, Plus as b, Sparkles as x, Workflow as S, X as C, Zap as w } from "lucide-react";
|
|
15
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
16
|
+
import { GlassCard as O, PagePurpose as ee } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/subscriberbot/pages/WorkflowsPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var k = [
|
|
18
19
|
{
|
|
19
20
|
value: "",
|
|
20
21
|
labelKey: "workflows.filters.allStatuses",
|
|
@@ -40,30 +41,30 @@ var O = [
|
|
|
40
41
|
labelKey: "workflows.filters.archived",
|
|
41
42
|
fallback: "Archived"
|
|
42
43
|
}
|
|
43
|
-
],
|
|
44
|
-
function
|
|
45
|
-
return /* @__PURE__ */
|
|
44
|
+
], A = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", j = "mb-1 block text-xs font-medium text-text-secondary";
|
|
45
|
+
function M({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
|
|
46
|
+
return /* @__PURE__ */ D("div", {
|
|
46
47
|
className: "w-48 shrink-0 overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
|
|
47
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ E("div", {
|
|
48
49
|
className: `h-1 w-full ${i === "done" ? "bg-status-success-text" : i === "run" ? "bg-status-warning-text" : "bg-[var(--color-accent-indigo)]"}`,
|
|
49
50
|
"aria-hidden": !0
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ D("div", {
|
|
51
52
|
className: "p-3",
|
|
52
53
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ E("span", {
|
|
54
55
|
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
55
56
|
children: e
|
|
56
57
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ E("p", {
|
|
58
59
|
className: "mt-2 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
|
|
59
60
|
children: t
|
|
60
61
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ E("p", {
|
|
62
63
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
63
64
|
title: n,
|
|
64
65
|
children: n
|
|
65
66
|
}),
|
|
66
|
-
r && /* @__PURE__ */
|
|
67
|
+
r && /* @__PURE__ */ E("p", {
|
|
67
68
|
className: "mt-0.5 truncate text-xs text-text-secondary",
|
|
68
69
|
children: r
|
|
69
70
|
})
|
|
@@ -71,251 +72,261 @@ function j({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
|
|
|
71
72
|
})]
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
let
|
|
75
|
+
function N({ workflow: e, onClose: t, onActivate: n, onOpenBuilder: a, activating: o }) {
|
|
76
|
+
let c = s(), l = /* @__PURE__ */ D("div", {
|
|
76
77
|
className: "flex shrink-0 items-center px-1 text-text-secondary",
|
|
77
78
|
"aria-hidden": !0,
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
-
}),
|
|
80
|
-
return /* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ E("span", { className: "h-px w-4 bg-border-seam sm:w-6" }), /* @__PURE__ */ E(h, { className: "h-4 w-4" })]
|
|
80
|
+
}), u = e.status.charAt(0) + e.status.slice(1).toLowerCase();
|
|
81
|
+
return /* @__PURE__ */ D(O, {
|
|
81
82
|
treatment: "glass",
|
|
82
83
|
glow: !0,
|
|
83
84
|
className: "mt-6 p-5",
|
|
84
85
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ D("div", {
|
|
86
87
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ D("div", {
|
|
88
89
|
className: "min-w-0",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ D("div", {
|
|
90
91
|
className: "flex flex-wrap items-center gap-2",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ E("p", {
|
|
92
93
|
className: "text-base font-semibold text-text-primary",
|
|
93
94
|
children: e.name
|
|
94
|
-
}), /* @__PURE__ */
|
|
95
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ E(i, { status: e.status })]
|
|
96
|
+
}), /* @__PURE__ */ D("p", {
|
|
96
97
|
className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ E("span", {
|
|
98
99
|
className: "tabular-nums",
|
|
99
|
-
children:
|
|
100
|
-
}), e.lastRunAt && /* @__PURE__ */
|
|
100
|
+
children: c("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount })
|
|
101
|
+
}), e.lastRunAt && /* @__PURE__ */ D("span", {
|
|
101
102
|
className: "inline-flex items-center gap-1",
|
|
102
103
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ E(_, {
|
|
104
105
|
className: "h-3 w-3",
|
|
105
106
|
"aria-hidden": !0
|
|
106
107
|
}),
|
|
107
108
|
" ",
|
|
108
|
-
|
|
109
|
+
c("workflows.flow.lastRun", "last {{when}}", { when: r(e.lastRunAt) })
|
|
109
110
|
]
|
|
110
111
|
})]
|
|
111
112
|
})]
|
|
112
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ E("button", {
|
|
113
114
|
type: "button",
|
|
114
115
|
onClick: t,
|
|
115
|
-
"aria-label":
|
|
116
|
+
"aria-label": c("workflows.flow.closeAriaLabel", "Close flow"),
|
|
116
117
|
className: "rounded-lg border border-border-subtle p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ E(C, { className: "h-4 w-4" })
|
|
118
119
|
})]
|
|
119
120
|
}),
|
|
120
|
-
e.description && /* @__PURE__ */
|
|
121
|
+
e.description && /* @__PURE__ */ E("p", {
|
|
121
122
|
className: "mt-2 max-w-3xl text-sm text-text-secondary",
|
|
122
123
|
children: e.description
|
|
123
124
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ E("div", {
|
|
125
126
|
className: "mt-4 overflow-x-auto pb-2",
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ D("div", {
|
|
127
128
|
className: "flex min-w-max items-stretch",
|
|
128
129
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ E(M, {
|
|
130
131
|
accent: "trigger",
|
|
131
|
-
kicker:
|
|
132
|
-
icon: /* @__PURE__ */ w
|
|
132
|
+
kicker: c("workflows.flow.trigger", "When"),
|
|
133
|
+
icon: /* @__PURE__ */ E(w, { className: "h-4 w-4" }),
|
|
133
134
|
title: e.triggerEvent,
|
|
134
|
-
sub:
|
|
135
|
+
sub: c("workflows.flow.triggerEvent", "Trigger event")
|
|
135
136
|
}),
|
|
136
|
-
|
|
137
|
-
/* @__PURE__ */
|
|
137
|
+
l,
|
|
138
|
+
/* @__PURE__ */ E(M, {
|
|
138
139
|
accent: "run",
|
|
139
|
-
kicker:
|
|
140
|
-
icon: /* @__PURE__ */
|
|
140
|
+
kicker: c("workflows.flow.run", "Run"),
|
|
141
|
+
icon: /* @__PURE__ */ E(x, { className: "h-4 w-4" }),
|
|
141
142
|
title: e.name,
|
|
142
|
-
sub:
|
|
143
|
+
sub: c("workflows.flow.automation", "Automation")
|
|
143
144
|
}),
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
l,
|
|
146
|
+
/* @__PURE__ */ E(M, {
|
|
146
147
|
accent: "done",
|
|
147
|
-
kicker:
|
|
148
|
-
icon: /* @__PURE__ */
|
|
149
|
-
title: e.status === "ACTIVE" ?
|
|
150
|
-
sub:
|
|
148
|
+
kicker: c("workflows.flow.then", "Then"),
|
|
149
|
+
icon: /* @__PURE__ */ E(g, { className: "h-4 w-4" }),
|
|
150
|
+
title: e.status === "ACTIVE" ? c("workflows.flow.live", "Live") : c("workflows.flow.awaitingActivation", "Awaiting activation"),
|
|
151
|
+
sub: c("workflows.flow.status", "Status: {{status}}", { status: u })
|
|
151
152
|
})
|
|
152
153
|
]
|
|
153
154
|
})
|
|
154
155
|
}),
|
|
155
|
-
|
|
156
|
-
className: "mt-3 flex justify-end",
|
|
157
|
-
children: /* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ D("div", {
|
|
157
|
+
className: "mt-3 flex flex-wrap justify-end gap-2",
|
|
158
|
+
children: [/* @__PURE__ */ D("button", {
|
|
158
159
|
type: "button",
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
onClick: a,
|
|
161
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ E(v, { className: "h-4 w-4" }),
|
|
164
|
+
" ",
|
|
165
|
+
c("workflows.flow.openBuilder", "Open builder")
|
|
166
|
+
]
|
|
167
|
+
}), e.status !== "ACTIVE" && /* @__PURE__ */ D("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
disabled: o,
|
|
170
|
+
onClick: n,
|
|
161
171
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
162
172
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ E(y, { className: "h-4 w-4" }),
|
|
164
174
|
" ",
|
|
165
|
-
|
|
175
|
+
o ? c("common.activating", "Activating…") : c("workflows.flow.activate", "Activate workflow")
|
|
166
176
|
]
|
|
167
|
-
})
|
|
177
|
+
})]
|
|
168
178
|
})
|
|
169
179
|
]
|
|
170
180
|
});
|
|
171
181
|
}
|
|
172
|
-
function
|
|
173
|
-
let [
|
|
174
|
-
|
|
182
|
+
function P() {
|
|
183
|
+
let [h, g] = m(""), [_, v] = m(!1), [x, C] = p("workflows"), M = s(), { navigateTo: P } = e(), F = (e) => P(`/workflows/${encodeURIComponent(e)}/builder`), { data: I, isLoading: L, isError: R, refetch: z } = f(h || void 0), B = d(), V = u(), [H, U] = m(""), [W, G] = m(""), [K, q] = m(""), [J, Y] = m(null), X = I ?? [], Z = X.find((e) => e.id === x) ?? null, te = X.filter((e) => e.status === "ACTIVE").length, ne = X.reduce((e, t) => e + (t.runCount || 0), 0), Q = () => {
|
|
184
|
+
U(""), G(""), q(""), Y(null);
|
|
175
185
|
}, $ = () => {
|
|
176
|
-
|
|
186
|
+
v(!1), Q();
|
|
177
187
|
};
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
title:
|
|
180
|
-
description:
|
|
181
|
-
actions: /* @__PURE__ */
|
|
188
|
+
return /* @__PURE__ */ D(t, {
|
|
189
|
+
title: M("workflows.title", "Workflows"),
|
|
190
|
+
description: M("workflows.description", "Event-driven automation across your portfolio"),
|
|
191
|
+
actions: /* @__PURE__ */ D("button", {
|
|
182
192
|
type: "button",
|
|
183
|
-
onClick: () =>
|
|
193
|
+
onClick: () => v(!0),
|
|
184
194
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
185
195
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ E(b, { className: "h-4 w-4" }),
|
|
187
197
|
" ",
|
|
188
|
-
|
|
198
|
+
M("workflows.newWorkflow", "New workflow")
|
|
189
199
|
]
|
|
190
200
|
}),
|
|
191
201
|
children: [
|
|
192
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ E(ee, {
|
|
193
203
|
className: "mb-4",
|
|
194
|
-
children:
|
|
204
|
+
children: M("workflows.purpose", "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready.")
|
|
195
205
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ E("div", {
|
|
197
207
|
className: "flex flex-wrap items-center gap-3",
|
|
198
|
-
children: /* @__PURE__ */
|
|
199
|
-
"aria-label":
|
|
200
|
-
value:
|
|
201
|
-
onChange: (e) =>
|
|
208
|
+
children: /* @__PURE__ */ E("select", {
|
|
209
|
+
"aria-label": M("common.filter", "Filter"),
|
|
210
|
+
value: h,
|
|
211
|
+
onChange: (e) => g(e.target.value),
|
|
202
212
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
203
|
-
children:
|
|
213
|
+
children: k.map((e) => /* @__PURE__ */ E("option", {
|
|
204
214
|
value: e.value,
|
|
205
|
-
children:
|
|
215
|
+
children: M(e.labelKey, e.fallback)
|
|
206
216
|
}, e.value))
|
|
207
217
|
})
|
|
208
218
|
}),
|
|
209
|
-
|
|
210
|
-
message:
|
|
211
|
-
onRetry: () => void
|
|
212
|
-
}) :
|
|
219
|
+
L ? /* @__PURE__ */ E(l, { label: M("workflows.loading", "Loading workflows…") }) : R ? /* @__PURE__ */ E(c, {
|
|
220
|
+
message: M("workflows.error", "Could not load workflows."),
|
|
221
|
+
onRetry: () => void z()
|
|
222
|
+
}) : X.length === 0 ? /* @__PURE__ */ E("div", {
|
|
213
223
|
className: "mt-6",
|
|
214
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ E(a, {
|
|
215
225
|
illustration: "empty-data",
|
|
216
|
-
icon: /* @__PURE__ */
|
|
217
|
-
title:
|
|
218
|
-
description:
|
|
219
|
-
action: /* @__PURE__ */
|
|
226
|
+
icon: /* @__PURE__ */ E(S, { className: "h-12 w-12" }),
|
|
227
|
+
title: M("workflows.empty.title", "No workflows yet"),
|
|
228
|
+
description: M("workflows.empty.description", "Create your first event-driven workflow to automate your recurring portfolio."),
|
|
229
|
+
action: /* @__PURE__ */ E("button", {
|
|
220
230
|
type: "button",
|
|
221
|
-
onClick: () =>
|
|
231
|
+
onClick: () => v(!0),
|
|
222
232
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
223
|
-
children:
|
|
233
|
+
children: M("workflows.newWorkflow", "New workflow")
|
|
224
234
|
})
|
|
225
235
|
})
|
|
226
|
-
}) : /* @__PURE__ */ T
|
|
227
|
-
/* @__PURE__ */
|
|
236
|
+
}) : /* @__PURE__ */ D(T, { children: [
|
|
237
|
+
/* @__PURE__ */ D("div", {
|
|
228
238
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
229
239
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
icon: /* @__PURE__ */
|
|
232
|
-
value:
|
|
233
|
-
label:
|
|
240
|
+
/* @__PURE__ */ E(n, {
|
|
241
|
+
icon: /* @__PURE__ */ E(S, { className: "h-5 w-5" }),
|
|
242
|
+
value: X.length,
|
|
243
|
+
label: M("workflows.metrics.workflows", "Workflows")
|
|
234
244
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
icon: /* @__PURE__ */ w
|
|
237
|
-
value:
|
|
238
|
-
label:
|
|
245
|
+
/* @__PURE__ */ E(n, {
|
|
246
|
+
icon: /* @__PURE__ */ E(w, { className: "h-5 w-5" }),
|
|
247
|
+
value: te,
|
|
248
|
+
label: M("workflows.metrics.active", "Active")
|
|
239
249
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
icon: /* @__PURE__ */
|
|
242
|
-
value:
|
|
243
|
-
label:
|
|
250
|
+
/* @__PURE__ */ E(n, {
|
|
251
|
+
icon: /* @__PURE__ */ E(y, { className: "h-5 w-5" }),
|
|
252
|
+
value: ne,
|
|
253
|
+
label: M("workflows.metrics.totalRuns", "Total runs")
|
|
244
254
|
})
|
|
245
255
|
]
|
|
246
256
|
}),
|
|
247
|
-
|
|
248
|
-
workflow:
|
|
249
|
-
onClose: () =>
|
|
250
|
-
onActivate: () =>
|
|
251
|
-
|
|
257
|
+
Z && /* @__PURE__ */ E(N, {
|
|
258
|
+
workflow: Z,
|
|
259
|
+
onClose: () => C(null),
|
|
260
|
+
onActivate: () => V.mutate(Z.id),
|
|
261
|
+
onOpenBuilder: () => F(Z.id),
|
|
262
|
+
activating: V.isPending
|
|
252
263
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ E("div", {
|
|
254
265
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
255
|
-
children:
|
|
266
|
+
children: X.map((e) => {
|
|
256
267
|
let t = e.id === x;
|
|
257
|
-
return /* @__PURE__ */
|
|
268
|
+
return /* @__PURE__ */ D(O, {
|
|
258
269
|
treatment: "metric",
|
|
259
270
|
glow: t || e.status === "ACTIVE",
|
|
260
271
|
role: "button",
|
|
261
272
|
tabIndex: 0,
|
|
262
273
|
"aria-pressed": t,
|
|
263
|
-
"aria-label":
|
|
264
|
-
onClick: () =>
|
|
274
|
+
"aria-label": M("workflows.card.viewAriaLabel", "View flow for {{name}}", { name: e.name }),
|
|
275
|
+
onClick: () => C(t ? null : e.id),
|
|
265
276
|
onKeyDown: (n) => {
|
|
266
|
-
(n.key === "Enter" || n.key === " ") && (n.preventDefault(),
|
|
277
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), C(t ? null : e.id));
|
|
267
278
|
},
|
|
268
279
|
className: "flex cursor-pointer flex-col p-5 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
269
280
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ D("div", {
|
|
271
282
|
className: "flex items-start justify-between gap-2",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ E("span", {
|
|
273
284
|
className: "flex size-10 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
274
|
-
children: /* @__PURE__ */
|
|
275
|
-
}), /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ E(S, { className: "h-5 w-5" })
|
|
286
|
+
}), /* @__PURE__ */ E(i, { status: e.status })]
|
|
276
287
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ E("p", {
|
|
278
289
|
className: "mt-3 truncate text-sm font-semibold text-text-primary",
|
|
279
290
|
children: e.name
|
|
280
291
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ D("p", {
|
|
282
293
|
className: "flex items-center gap-1 truncate text-xs text-text-secondary",
|
|
283
294
|
children: [
|
|
284
|
-
/* @__PURE__ */ w
|
|
295
|
+
/* @__PURE__ */ E(w, {
|
|
285
296
|
className: "h-3 w-3 shrink-0",
|
|
286
297
|
"aria-hidden": !0
|
|
287
298
|
}),
|
|
288
299
|
" ",
|
|
289
|
-
|
|
300
|
+
M("workflows.card.onTrigger", "on {{trigger}}", { trigger: e.triggerEvent })
|
|
290
301
|
]
|
|
291
302
|
}),
|
|
292
|
-
e.description && /* @__PURE__ */
|
|
303
|
+
e.description && /* @__PURE__ */ E("p", {
|
|
293
304
|
className: "mt-2 line-clamp-2 min-h-[2rem] text-xs text-text-secondary",
|
|
294
305
|
children: e.description
|
|
295
306
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ D("p", {
|
|
297
308
|
className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary tabular-nums",
|
|
298
309
|
children: [
|
|
299
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ E(y, {
|
|
300
311
|
className: "h-3.5 w-3.5",
|
|
301
312
|
"aria-hidden": !0
|
|
302
313
|
}),
|
|
303
314
|
" ",
|
|
304
|
-
|
|
305
|
-
e.lastRunAt ? ` · ${
|
|
315
|
+
M("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount }),
|
|
316
|
+
e.lastRunAt ? ` · ${M("workflows.flow.lastRun", "last {{when}}", { when: r(e.lastRunAt) })}` : ""
|
|
306
317
|
]
|
|
307
318
|
}),
|
|
308
|
-
e.status !== "ACTIVE" && /* @__PURE__ */
|
|
319
|
+
e.status !== "ACTIVE" && /* @__PURE__ */ D("button", {
|
|
309
320
|
type: "button",
|
|
310
|
-
disabled:
|
|
321
|
+
disabled: V.isPending,
|
|
311
322
|
onClick: (t) => {
|
|
312
|
-
t.stopPropagation(),
|
|
323
|
+
t.stopPropagation(), V.mutate(e.id);
|
|
313
324
|
},
|
|
314
325
|
className: "mt-4 inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
|
|
315
326
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ E(y, { className: "h-3.5 w-3.5" }),
|
|
317
328
|
" ",
|
|
318
|
-
|
|
329
|
+
M("common.activate", "Activate")
|
|
319
330
|
]
|
|
320
331
|
})
|
|
321
332
|
]
|
|
@@ -323,97 +334,97 @@ function N() {
|
|
|
323
334
|
})
|
|
324
335
|
})
|
|
325
336
|
] }),
|
|
326
|
-
|
|
327
|
-
title:
|
|
337
|
+
_ && /* @__PURE__ */ E(o, {
|
|
338
|
+
title: M("workflows.newWorkflow", "New workflow"),
|
|
328
339
|
onClose: $,
|
|
329
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ D("form", {
|
|
330
341
|
onSubmit: (e) => {
|
|
331
|
-
if (e.preventDefault(),
|
|
332
|
-
|
|
342
|
+
if (e.preventDefault(), Y(null), !H.trim() || !W.trim()) {
|
|
343
|
+
Y(M("workflows.form.nameRequired", "Name and trigger event are required."));
|
|
333
344
|
return;
|
|
334
345
|
}
|
|
335
346
|
let t = {
|
|
336
|
-
name:
|
|
337
|
-
triggerEvent:
|
|
338
|
-
...
|
|
347
|
+
name: H.trim(),
|
|
348
|
+
triggerEvent: W.trim(),
|
|
349
|
+
...K.trim() ? { description: K.trim() } : {}
|
|
339
350
|
};
|
|
340
|
-
|
|
341
|
-
onSuccess: () => {
|
|
342
|
-
Q(),
|
|
351
|
+
B.mutate(t, {
|
|
352
|
+
onSuccess: (e) => {
|
|
353
|
+
Q(), v(!1), F(e.id);
|
|
343
354
|
},
|
|
344
|
-
onError: (e) =>
|
|
355
|
+
onError: (e) => Y(e instanceof Error ? e.message : M("common.error", "An error occurred"))
|
|
345
356
|
});
|
|
346
357
|
},
|
|
347
358
|
className: "space-y-4",
|
|
348
359
|
children: [
|
|
349
|
-
|
|
360
|
+
J && /* @__PURE__ */ E("div", {
|
|
350
361
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
351
|
-
children:
|
|
362
|
+
children: J
|
|
352
363
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("label", {
|
|
354
365
|
htmlFor: "wf-name",
|
|
355
|
-
className:
|
|
366
|
+
className: j,
|
|
356
367
|
children: [
|
|
357
|
-
|
|
368
|
+
M("workflows.form.nameLabel", "Name"),
|
|
358
369
|
" ",
|
|
359
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ E("span", {
|
|
360
371
|
className: "text-status-error-text",
|
|
361
372
|
children: "*"
|
|
362
373
|
})
|
|
363
374
|
]
|
|
364
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ E("input", {
|
|
365
376
|
id: "wf-name",
|
|
366
377
|
type: "text",
|
|
367
|
-
value:
|
|
368
|
-
onChange: (e) =>
|
|
369
|
-
placeholder:
|
|
370
|
-
className:
|
|
378
|
+
value: H,
|
|
379
|
+
onChange: (e) => U(e.target.value),
|
|
380
|
+
placeholder: M("workflows.form.namePlaceholder", "e.g. Invoice → notify finance"),
|
|
381
|
+
className: A,
|
|
371
382
|
required: !0
|
|
372
383
|
})] }),
|
|
373
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("label", {
|
|
374
385
|
htmlFor: "wf-trigger",
|
|
375
|
-
className:
|
|
386
|
+
className: j,
|
|
376
387
|
children: [
|
|
377
|
-
|
|
388
|
+
M("workflows.form.triggerLabel", "Trigger event"),
|
|
378
389
|
" ",
|
|
379
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ E("span", {
|
|
380
391
|
className: "text-status-error-text",
|
|
381
392
|
children: "*"
|
|
382
393
|
})
|
|
383
394
|
]
|
|
384
|
-
}), /* @__PURE__ */
|
|
395
|
+
}), /* @__PURE__ */ E("input", {
|
|
385
396
|
id: "wf-trigger",
|
|
386
397
|
type: "text",
|
|
387
|
-
value:
|
|
388
|
-
onChange: (e) =>
|
|
389
|
-
placeholder:
|
|
390
|
-
className:
|
|
398
|
+
value: W,
|
|
399
|
+
onChange: (e) => G(e.target.value),
|
|
400
|
+
placeholder: M("workflows.form.triggerPlaceholder", "e.g. InvoiceReceived, RenewalDetected"),
|
|
401
|
+
className: A,
|
|
391
402
|
required: !0
|
|
392
403
|
})] }),
|
|
393
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
394
405
|
htmlFor: "wf-desc",
|
|
395
|
-
className:
|
|
396
|
-
children:
|
|
397
|
-
}), /* @__PURE__ */
|
|
406
|
+
className: j,
|
|
407
|
+
children: M("workflows.form.descriptionLabel", "Description")
|
|
408
|
+
}), /* @__PURE__ */ E("textarea", {
|
|
398
409
|
id: "wf-desc",
|
|
399
|
-
value:
|
|
400
|
-
onChange: (e) =>
|
|
410
|
+
value: K,
|
|
411
|
+
onChange: (e) => q(e.target.value),
|
|
401
412
|
rows: 3,
|
|
402
|
-
placeholder:
|
|
403
|
-
className:
|
|
413
|
+
placeholder: M("workflows.form.descriptionPlaceholder", "What should this workflow do when the event fires?"),
|
|
414
|
+
className: A
|
|
404
415
|
})] }),
|
|
405
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ D("div", {
|
|
406
417
|
className: "flex justify-end gap-3",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ E("button", {
|
|
408
419
|
type: "button",
|
|
409
420
|
onClick: $,
|
|
410
421
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
411
|
-
children:
|
|
412
|
-
}), /* @__PURE__ */
|
|
422
|
+
children: M("common.cancel", "Cancel")
|
|
423
|
+
}), /* @__PURE__ */ E("button", {
|
|
413
424
|
type: "submit",
|
|
414
|
-
disabled:
|
|
425
|
+
disabled: B.isPending,
|
|
415
426
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
416
|
-
children:
|
|
427
|
+
children: B.isPending ? M("workflows.creating", "Creating…") : M("workflows.createWorkflow", "Create workflow")
|
|
417
428
|
})]
|
|
418
429
|
})
|
|
419
430
|
]
|
|
@@ -423,6 +434,6 @@ function N() {
|
|
|
423
434
|
});
|
|
424
435
|
}
|
|
425
436
|
//#endregion
|
|
426
|
-
export {
|
|
437
|
+
export { P as WorkflowsPage };
|
|
427
438
|
|
|
428
439
|
//# sourceMappingURL=WorkflowsPage.js.map
|