@burdenoff/microfe-headshotmarketing 2026.1205.1 → 2026.1206.1
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/generated/global-types.d.ts +3589 -380
- package/dist/generated/wspace-operations.d.ts +101 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +61782 -2332
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/EntityTagPicker.js +29 -28
- package/dist/headshotmarketing/components/EntityTagPicker.js.map +1 -1
- package/dist/headshotmarketing/components/InfluencerModals.js +264 -263
- package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -1
- package/dist/headshotmarketing/components/QueryStateBoundary.js +31 -22
- package/dist/headshotmarketing/components/QueryStateBoundary.js.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
- package/dist/headshotmarketing/components/Toast.js +3 -3
- package/dist/headshotmarketing/components/Toast.js.map +1 -1
- package/dist/headshotmarketing/components/TrackedLinksPanel.js +97 -96
- package/dist/headshotmarketing/components/TrackedLinksPanel.js.map +1 -1
- package/dist/headshotmarketing/hooks/useAssetUpload.js +41 -40
- package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -1
- package/dist/headshotmarketing/pages/HomePage.js +6 -6
- package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js +47 -46
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js +66 -65
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +273 -272
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativeTestsSection.js +3 -3
- package/dist/headshotmarketing/pages/ads/AdCreativeTestsSection.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +125 -124
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +33 -32
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformSyncPanel.js +108 -107
- package/dist/headshotmarketing/pages/ads/AdPlatformSyncPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdReachEstimatePanel.js +65 -60
- package/dist/headshotmarketing/pages/ads/AdReachEstimatePanel.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdsPage.js +4 -4
- package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js +287 -286
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +59 -54
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js +96 -95
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js.map +1 -1
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.js +5 -5
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.js.map +1 -1
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.js +179 -178
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js +156 -151
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +222 -217
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js +59 -58
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js +152 -151
- package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +34 -33
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.js +6 -6
- package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +235 -234
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js +24 -23
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +4 -4
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -1
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +339 -338
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js +95 -94
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +82 -81
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +107 -106
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +104 -103
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +262 -261
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CreateTemplateModal.js +68 -67
- package/dist/headshotmarketing/pages/campaigns/CreateTemplateModal.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +204 -203
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +177 -176
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +373 -372
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js +4 -4
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/ConvertLeadButton.js +51 -50
- package/dist/headshotmarketing/pages/crm/ConvertLeadButton.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js +100 -99
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js +134 -133
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreatePipelineModal.js +66 -65
- package/dist/headshotmarketing/pages/crm/CreatePipelineModal.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmActions.js +229 -228
- package/dist/headshotmarketing/pages/crm/CrmActions.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js +62 -61
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js +126 -125
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js +93 -92
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.js +5 -5
- package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/CreateEventPage.js +127 -126
- package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/EventDetailsPage.js +76 -75
- package/dist/headshotmarketing/pages/events/EventDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +8 -8
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +4 -4
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +4 -4
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoScorePanel.js +1 -1
- package/dist/headshotmarketing/pages/seo/SeoScorePanel.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +104 -103
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js +102 -101
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js +59 -58
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/MediaDropZone.js +1 -1
- package/dist/headshotmarketing/pages/social-media/MediaDropZone.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +103 -102
- package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +123 -122
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +4 -4
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
- package/dist/headshotmarketing/utils/index.d.ts +1 -0
- package/dist/headshotmarketing/utils/readableError.d.ts +16 -0
- package/dist/headshotmarketing/utils/readableError.js +12 -0
- package/dist/headshotmarketing/utils/readableError.js.map +1 -0
- package/package.json +5 -3
|
@@ -5,38 +5,39 @@ import { PageLayout as a } from "../../components/PageLayout.js";
|
|
|
5
5
|
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
6
6
|
import { ToastContainer as s } from "../../components/Toast.js";
|
|
7
7
|
import { useHeadshotMarketing as c } from "../../context/HeadshotMarketingContext.js";
|
|
8
|
-
import { ACTION_TYPES as l, CHIP_TONE as u, TRIGGER_TYPES as ee, actionMeta as te, defaultConfig as ne, inPort as
|
|
9
|
-
import { WorkflowCompileError as ae, compileGraph as oe, decompileWorkflow as se, layoutGraph as ce, seedGraph as
|
|
10
|
-
import { WorkflowCanvasNode as
|
|
11
|
-
import { WorkflowConfigEmpty as
|
|
12
|
-
import { WorkflowRunsPanel as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { ACTION_TYPES as l, CHIP_TONE as u, TRIGGER_TYPES as ee, actionMeta as te, defaultConfig as ne, inPort as re, isConditionNode as d, nodeSubtitle as ie, outPort as f } from "./workflowBuilderModel.js";
|
|
9
|
+
import { WorkflowCompileError as ae, compileGraph as oe, decompileWorkflow as se, layoutGraph as ce, seedGraph as le } from "./workflowCompiler.js";
|
|
10
|
+
import { WorkflowCanvasNode as ue } from "./WorkflowCanvasNode.js";
|
|
11
|
+
import { WorkflowConfigEmpty as de, WorkflowNodeConfigPanel as fe } from "./WorkflowNodeConfigPanel.js";
|
|
12
|
+
import { WorkflowRunsPanel as pe } from "./WorkflowRunsPanel.js";
|
|
13
|
+
import { readableErrorOrNull as me } from "../../utils/readableError.js";
|
|
14
|
+
import { useCallback as p, useEffect as he, useMemo as ge, useRef as m, useState as h } from "react";
|
|
15
|
+
import { ChevronRight as _e, Maximize2 as ve, Minus as ye, Move as be, Play as xe, Plus as Se, Save as Ce } from "lucide-react";
|
|
16
|
+
import { useSearchParams as we } from "react-router";
|
|
17
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
18
|
+
import { PagePurpose as Te } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
// src/headshotmarketing/pages/automation/WorkflowBuilderPage.tsx
|
|
19
|
-
var
|
|
20
|
+
var Ee = 1600, De = 1400, v = .5, y = 1.4, b = .82, x = {
|
|
20
21
|
x: 12,
|
|
21
22
|
y: 12
|
|
22
23
|
};
|
|
23
|
-
function
|
|
24
|
+
function S(e) {
|
|
24
25
|
return e === "yes" ? "var(--color-status-success-text)" : e === "no" ? "var(--color-status-error-text)" : "var(--color-action-primary-bg)";
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function Oe(e) {
|
|
27
28
|
return e === "yes" ? "wf-arrow-yes" : e === "no" ? "wf-arrow-no" : "wf-arrow-accent";
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function C(e, t) {
|
|
30
31
|
return e instanceof Error && e.message ? e.message : t;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function w(e, t, n) {
|
|
33
34
|
let r = e.find((e) => e.id === n);
|
|
34
35
|
if (!r || r.kind === "trigger") return {
|
|
35
36
|
nodes: e,
|
|
36
37
|
edges: t
|
|
37
38
|
};
|
|
38
39
|
let i = t.filter((e) => e.target === n), a = t.filter((e) => e.source === n), o = i.find((e) => e.branch !== "no") ?? i[0], s = t.filter((e) => e.source !== n && e.target !== n), c = a.length === 1 ? a[0] : void 0;
|
|
39
|
-
return o && c && !
|
|
40
|
+
return o && c && !d(r) && s.push({
|
|
40
41
|
id: `edge-${o.source}-${c.target}-${Date.now()}`,
|
|
41
42
|
source: o.source,
|
|
42
43
|
target: c.target,
|
|
@@ -46,11 +47,11 @@ function S(e, t, n) {
|
|
|
46
47
|
edges: s
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function T(e, t, n, r, i) {
|
|
50
51
|
let a = e.find((e) => e.id === n);
|
|
51
52
|
if (!a) return { error: "Select the step to add after." };
|
|
52
53
|
let o = t.filter((e) => e.source === n);
|
|
53
|
-
if (
|
|
54
|
+
if (d(a)) {
|
|
54
55
|
let a = o.some((e) => e.branch === "yes"), s = o.some((e) => e.branch === "no");
|
|
55
56
|
return a && s ? { error: "This condition already has a Yes and a No path — select a step on one of them to add after it." } : {
|
|
56
57
|
nodes: [...e, r],
|
|
@@ -72,69 +73,69 @@ function Ae(e, t, n, r, i) {
|
|
|
72
73
|
id: `edge-${i}-next`,
|
|
73
74
|
source: r.id,
|
|
74
75
|
target: s.target,
|
|
75
|
-
branch:
|
|
76
|
+
branch: d(r) ? "yes" : null
|
|
76
77
|
}), {
|
|
77
78
|
nodes: [...e, r],
|
|
78
79
|
edges: [...c, ...l]
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
|
-
var
|
|
82
|
-
let { navigate:
|
|
83
|
-
variables: { id:
|
|
84
|
-
skip: !
|
|
82
|
+
var E = () => {
|
|
83
|
+
let { navigate: d, basePath: E } = c(), [ke, Ae] = we(), D = ke.get("id"), { data: je, loading: Me, error: Ne } = n({
|
|
84
|
+
variables: { id: D ?? "" },
|
|
85
|
+
skip: !D,
|
|
85
86
|
fetchPolicy: "network-only"
|
|
86
|
-
}), [
|
|
87
|
-
|
|
88
|
-
if (!
|
|
89
|
-
|
|
90
|
-
let e = se(
|
|
91
|
-
|
|
92
|
-
}, [
|
|
93
|
-
let [
|
|
87
|
+
}), [Pe] = t(), [Fe] = r(), [Ie] = e(), [O, Le] = h("New Workflow"), [k, A] = h(null), [j, M] = h(() => le().nodes), [N, P] = h(() => le().edges), [F, I] = h(null), [Re, ze] = h(null), [Be, L] = h(null), [R, z] = h(null), [Ve, He] = h(!1), [Ue, We] = h([]), B = m(null), V = je?.headshotmarketingAutomationWorkflow ?? null;
|
|
88
|
+
he(() => {
|
|
89
|
+
if (!V || B.current === V.id) return;
|
|
90
|
+
B.current = V.id;
|
|
91
|
+
let e = se(V);
|
|
92
|
+
M(e.nodes), P(e.edges), Le(V.name), A(V), I(null);
|
|
93
|
+
}, [V]);
|
|
94
|
+
let [H, Ge] = h(b), [U, Ke] = h(x), W = m(null), qe = m(null), G = ge(() => {
|
|
94
95
|
let e = /* @__PURE__ */ new Map();
|
|
95
|
-
for (let t of
|
|
96
|
+
for (let t of j) e.set(t.id, t);
|
|
96
97
|
return e;
|
|
97
|
-
}, [
|
|
98
|
-
|
|
99
|
-
}, []),
|
|
98
|
+
}, [j]), K = F ? G.get(F) ?? null : null, q = ge(() => j.find((e) => e.kind === "trigger") ?? null, [j]), J = p((e) => {
|
|
99
|
+
We((t) => t.filter((t) => t.id !== e));
|
|
100
|
+
}, []), Y = p((e) => {
|
|
100
101
|
let t = `toast-${Date.now()}-${Math.round(performance.now())}`;
|
|
101
|
-
|
|
102
|
+
We((n) => [...n, {
|
|
102
103
|
...e,
|
|
103
104
|
id: t
|
|
104
|
-
}]), window.setTimeout(() =>
|
|
105
|
-
}, [
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
105
|
+
}]), window.setTimeout(() => J(t), 5e3);
|
|
106
|
+
}, [J]), X = () => {
|
|
107
|
+
ze(null), L(null);
|
|
108
|
+
}, Je = p((e, t, n) => {
|
|
109
|
+
M((r) => r.map((r) => r.id === e ? {
|
|
109
110
|
...r,
|
|
110
111
|
x: t,
|
|
111
112
|
y: n
|
|
112
113
|
} : r));
|
|
113
|
-
}, []),
|
|
114
|
-
|
|
114
|
+
}, []), Ye = p((e, t) => {
|
|
115
|
+
M((n) => n.map((n) => n.id === e ? {
|
|
115
116
|
...n,
|
|
116
117
|
label: t
|
|
117
118
|
} : n));
|
|
118
|
-
}, []),
|
|
119
|
-
|
|
119
|
+
}, []), Xe = p((e, t) => {
|
|
120
|
+
M((n) => n.map((n) => n.id === e ? {
|
|
120
121
|
...n,
|
|
121
122
|
config: {
|
|
122
123
|
...n.config,
|
|
123
124
|
...t
|
|
124
125
|
}
|
|
125
126
|
} : n));
|
|
126
|
-
}, []),
|
|
127
|
-
|
|
127
|
+
}, []), Ze = p((e) => {
|
|
128
|
+
M((t) => t.map((t) => t.kind === "trigger" ? {
|
|
128
129
|
...t,
|
|
129
130
|
actionType: e
|
|
130
131
|
} : t));
|
|
131
|
-
}, []),
|
|
132
|
-
let t =
|
|
133
|
-
|
|
134
|
-
}, [
|
|
132
|
+
}, []), Qe = p((e) => {
|
|
133
|
+
let t = w(j, N, e);
|
|
134
|
+
M(ce(t.nodes, t.edges)), P(t.edges), I((t) => t === e ? null : t), X();
|
|
135
|
+
}, [j, N]), $e = p((e) => {
|
|
135
136
|
let t = te(e);
|
|
136
137
|
if (!t) return;
|
|
137
|
-
let n =
|
|
138
|
+
let n = K?.id ?? q?.id ?? null;
|
|
138
139
|
if (!n) return;
|
|
139
140
|
let r = Date.now(), i = {
|
|
140
141
|
id: `node-${r}`,
|
|
@@ -144,304 +145,304 @@ var C = () => {
|
|
|
144
145
|
x: 0,
|
|
145
146
|
y: 0,
|
|
146
147
|
config: ne(e)
|
|
147
|
-
}, a =
|
|
148
|
-
"error" in a ?
|
|
148
|
+
}, a = T(j, N, n, i, r);
|
|
149
|
+
"error" in a ? L(a.error) : (M(ce(a.nodes, a.edges)), P(a.edges), I(i.id), X());
|
|
149
150
|
}, [
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
K,
|
|
152
|
+
q,
|
|
153
|
+
j,
|
|
154
|
+
N
|
|
154
155
|
]);
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
he(() => {
|
|
157
|
+
F && typeof window < "u" && window.innerWidth < 1280 && qe.current?.scrollIntoView({
|
|
157
158
|
behavior: "smooth",
|
|
158
159
|
block: "nearest"
|
|
159
160
|
});
|
|
160
|
-
}, [
|
|
161
|
-
let
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
|
|
161
|
+
}, [F]);
|
|
162
|
+
let Z = (e) => Ge((t) => Math.min(y, Math.max(v, Math.round((t + e) * 100) / 100))), et = () => {
|
|
163
|
+
Ge(b), Ke(x);
|
|
164
|
+
}, tt = (e) => {
|
|
165
|
+
W.current = {
|
|
165
166
|
startX: e.clientX,
|
|
166
167
|
startY: e.clientY,
|
|
167
|
-
originX:
|
|
168
|
-
originY:
|
|
168
|
+
originX: U.x,
|
|
169
|
+
originY: U.y,
|
|
169
170
|
moved: !1
|
|
170
171
|
}, e.currentTarget.setPointerCapture(e.pointerId);
|
|
171
|
-
},
|
|
172
|
-
let t =
|
|
172
|
+
}, nt = (e) => {
|
|
173
|
+
let t = W.current;
|
|
173
174
|
if (!t) return;
|
|
174
175
|
let n = e.clientX - t.startX, r = e.clientY - t.startY;
|
|
175
|
-
!t.moved && Math.hypot(n, r) < 3 || (t.moved = !0,
|
|
176
|
+
!t.moved && Math.hypot(n, r) < 3 || (t.moved = !0, Ke({
|
|
176
177
|
x: t.originX + n,
|
|
177
178
|
y: t.originY + r
|
|
178
179
|
}));
|
|
179
|
-
},
|
|
180
|
-
let t =
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
if (!
|
|
180
|
+
}, rt = (e) => {
|
|
181
|
+
let t = W.current;
|
|
182
|
+
W.current = null, e.currentTarget.releasePointerCapture?.(e.pointerId), t && !t.moved && I(null);
|
|
183
|
+
}, Q = () => {
|
|
184
|
+
if (!O.trim()) return L("Give the workflow a name."), null;
|
|
184
185
|
try {
|
|
185
|
-
let e = oe(
|
|
186
|
-
return
|
|
186
|
+
let e = oe(j, N);
|
|
187
|
+
return X(), e;
|
|
187
188
|
} catch (e) {
|
|
188
|
-
if (e instanceof ae) return
|
|
189
|
+
if (e instanceof ae) return L(e.message), ze(e.nodeId), e.nodeId && I(e.nodeId), null;
|
|
189
190
|
throw e;
|
|
190
191
|
}
|
|
191
|
-
},
|
|
192
|
-
let t = e.triggerType, n =
|
|
193
|
-
if (
|
|
194
|
-
id:
|
|
192
|
+
}, it = async (e) => {
|
|
193
|
+
let t = e.triggerType, n = k?.description ?? null;
|
|
194
|
+
if (k) return (await Fe({ variables: {
|
|
195
|
+
id: k.id,
|
|
195
196
|
input: {
|
|
196
|
-
name:
|
|
197
|
+
name: O.trim(),
|
|
197
198
|
description: n,
|
|
198
199
|
triggerType: t,
|
|
199
200
|
triggerConfig: e.triggerConfig,
|
|
200
201
|
steps: e.steps
|
|
201
202
|
}
|
|
202
203
|
} })).data?.updateHeadshotmarketingAutomationWorkflow ?? null;
|
|
203
|
-
let r = (await
|
|
204
|
-
name:
|
|
204
|
+
let r = (await Pe({ variables: { input: {
|
|
205
|
+
name: O.trim(),
|
|
205
206
|
description: n,
|
|
206
207
|
triggerType: t,
|
|
207
208
|
triggerConfig: e.triggerConfig,
|
|
208
209
|
steps: e.steps
|
|
209
210
|
} } })).data?.createHeadshotmarketingAutomationWorkflow ?? null;
|
|
210
|
-
return r && (
|
|
211
|
-
},
|
|
212
|
-
let e =
|
|
211
|
+
return r && (B.current = r.id, Ae({ id: r.id }, { replace: !0 })), r;
|
|
212
|
+
}, at = async () => {
|
|
213
|
+
let e = Q();
|
|
213
214
|
if (e) {
|
|
214
|
-
|
|
215
|
+
z("save");
|
|
215
216
|
try {
|
|
216
|
-
let t = await
|
|
217
|
-
t && (
|
|
217
|
+
let t = await it(e);
|
|
218
|
+
t && (A(t), Y({
|
|
218
219
|
title: "Workflow saved",
|
|
219
220
|
description: t.status === "ACTIVE" ? "Changes are live for new runs." : "Saved as a draft. Publish it to start running.",
|
|
220
221
|
variant: "success"
|
|
221
222
|
}));
|
|
222
223
|
} catch (e) {
|
|
223
|
-
let t =
|
|
224
|
-
|
|
224
|
+
let t = C(e, "Failed to save the workflow.");
|
|
225
|
+
L(t), Y({
|
|
225
226
|
title: "Save failed",
|
|
226
227
|
description: t,
|
|
227
228
|
variant: "error"
|
|
228
229
|
});
|
|
229
230
|
} finally {
|
|
230
|
-
|
|
231
|
+
z(null);
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
|
-
},
|
|
234
|
-
let e =
|
|
234
|
+
}, ot = async () => {
|
|
235
|
+
let e = Q();
|
|
235
236
|
if (e) {
|
|
236
|
-
|
|
237
|
+
z("publish");
|
|
237
238
|
try {
|
|
238
|
-
let t = await
|
|
239
|
-
t && t.status !== "ACTIVE" && (t = (await
|
|
239
|
+
let t = await it(e);
|
|
240
|
+
t && t.status !== "ACTIVE" && (t = (await Ie({ variables: { id: t.id } })).data?.activateHeadshotmarketingAutomationWorkflow ?? t), t && A(t), d(E + "/automation/workflows");
|
|
240
241
|
} catch (e) {
|
|
241
|
-
let t =
|
|
242
|
-
|
|
242
|
+
let t = C(e, "Failed to publish the workflow.");
|
|
243
|
+
L(t), Y({
|
|
243
244
|
title: "Publish failed",
|
|
244
245
|
description: t,
|
|
245
246
|
variant: "error"
|
|
246
247
|
});
|
|
247
248
|
} finally {
|
|
248
|
-
|
|
249
|
+
z(null);
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
|
-
},
|
|
252
|
-
let e =
|
|
253
|
-
e && (
|
|
252
|
+
}, st = () => {
|
|
253
|
+
let e = Q();
|
|
254
|
+
e && (k?.status === "ACTIVE" ? He(!0) : Y({
|
|
254
255
|
title: "Workflow is valid",
|
|
255
256
|
description: `${e.steps.length} engine step${e.steps.length === 1 ? "" : "s"}. Publish it to run it for a lead.`,
|
|
256
257
|
variant: "success"
|
|
257
258
|
}));
|
|
258
|
-
},
|
|
259
|
-
return
|
|
259
|
+
}, ct = Math.round(H * 100), $ = q?.actionType ?? "LEAD_CREATED";
|
|
260
|
+
return D && Me && !k ? /* @__PURE__ */ g(a, {
|
|
260
261
|
title: "Workflow Builder",
|
|
261
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ g("p", {
|
|
262
263
|
className: "text-sm text-text-secondary",
|
|
263
264
|
children: "Loading workflow…"
|
|
264
265
|
})
|
|
265
|
-
}) :
|
|
266
|
+
}) : D && !Me && !V && !k ? /* @__PURE__ */ _(a, {
|
|
266
267
|
title: "Workflow Builder",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
268
|
-
className: "rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-sm text-status-error-text",
|
|
269
|
-
children:
|
|
270
|
-
}), /* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ g("div", {
|
|
269
|
+
className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
270
|
+
children: Ne ? `Could not load this workflow: ${me(Ne)}` : "This workflow does not exist or was deleted."
|
|
271
|
+
}), /* @__PURE__ */ g("button", {
|
|
271
272
|
type: "button",
|
|
272
|
-
onClick: () =>
|
|
273
|
+
onClick: () => d(E + "/automation/workflows"),
|
|
273
274
|
className: "inline-flex min-h-10 w-fit items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
274
275
|
children: "Back to workflows"
|
|
275
276
|
})]
|
|
276
|
-
}) : /* @__PURE__ */
|
|
277
|
+
}) : /* @__PURE__ */ _(a, {
|
|
277
278
|
title: "Workflow Builder",
|
|
278
|
-
header: /* @__PURE__ */
|
|
279
|
+
header: /* @__PURE__ */ _("nav", {
|
|
279
280
|
"aria-label": "Breadcrumb",
|
|
280
281
|
className: "flex min-w-0 items-center gap-1.5 text-base font-normal sm:text-lg",
|
|
281
282
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ g("button", {
|
|
283
284
|
type: "button",
|
|
284
|
-
onClick: () =>
|
|
285
|
+
onClick: () => d(E + "/automation/workflows"),
|
|
285
286
|
className: "text-text-secondary hover:text-text-primary",
|
|
286
287
|
children: "Automation"
|
|
287
288
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ g(_e, {
|
|
289
290
|
className: "h-4 w-4 flex-shrink-0 text-text-secondary",
|
|
290
291
|
"aria-hidden": !0
|
|
291
292
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ g("input", {
|
|
293
294
|
type: "text",
|
|
294
|
-
value:
|
|
295
|
-
onChange: (e) =>
|
|
295
|
+
value: O,
|
|
296
|
+
onChange: (e) => Le(e.target.value),
|
|
296
297
|
"aria-label": "Workflow name",
|
|
297
298
|
className: "min-w-0 flex-1 rounded-md border border-transparent bg-transparent px-1 py-0.5 font-semibold text-text-primary outline-none hover:border-border-subtle focus:border-border-strong",
|
|
298
299
|
placeholder: "Workflow name"
|
|
299
300
|
}),
|
|
300
|
-
|
|
301
|
-
status:
|
|
301
|
+
k && /* @__PURE__ */ g(o, {
|
|
302
|
+
status: k.status.toLowerCase(),
|
|
302
303
|
className: "ms-1"
|
|
303
304
|
})
|
|
304
305
|
]
|
|
305
306
|
}),
|
|
306
|
-
actions: /* @__PURE__ */
|
|
307
|
+
actions: /* @__PURE__ */ _("div", {
|
|
307
308
|
className: "flex flex-wrap items-center gap-2",
|
|
308
309
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
onClick:
|
|
311
|
-
disabled:
|
|
310
|
+
/* @__PURE__ */ _("button", {
|
|
311
|
+
onClick: st,
|
|
312
|
+
disabled: R !== null,
|
|
312
313
|
className: "inline-flex min-h-10 items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ g(xe, { className: "h-4 w-4" }), "Test"]
|
|
314
315
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
onClick: () => void
|
|
317
|
-
disabled:
|
|
316
|
+
/* @__PURE__ */ _("button", {
|
|
317
|
+
onClick: () => void at(),
|
|
318
|
+
disabled: R !== null,
|
|
318
319
|
className: "inline-flex min-h-10 items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ g(Ce, { className: "h-4 w-4" }), R === "save" ? "Saving…" : "Save draft"]
|
|
320
321
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
onClick: () => void
|
|
323
|
-
disabled:
|
|
322
|
+
/* @__PURE__ */ g("button", {
|
|
323
|
+
onClick: () => void ot(),
|
|
324
|
+
disabled: R !== null,
|
|
324
325
|
className: "inline-flex min-h-10 items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bgHover disabled:opacity-60",
|
|
325
|
-
children:
|
|
326
|
+
children: R === "publish" ? "Publishing…" : k?.status === "ACTIVE" ? "Publish changes" : "Publish"
|
|
326
327
|
})
|
|
327
328
|
]
|
|
328
329
|
}),
|
|
329
330
|
children: [
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
|
|
331
|
+
/* @__PURE__ */ g(Te, { children: "Design an automation visually. Pick the trigger that starts it, add the steps it should run — email, notify your team, wait, branch on a condition, tag, update a field, call a webhook — and Publish to put it to work on every new lead or contact. Save a draft while you iterate." }),
|
|
332
|
+
Be && /* @__PURE__ */ g("div", {
|
|
332
333
|
role: "alert",
|
|
333
|
-
className: "rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-sm text-status-error-text",
|
|
334
|
-
children:
|
|
334
|
+
className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
335
|
+
children: Be
|
|
335
336
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ _("div", {
|
|
337
338
|
className: "overflow-hidden rounded-card border border-border-seam bg-gloss-card shadow-pop",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ _("div", {
|
|
339
340
|
className: "flex items-center justify-between gap-3 border-b border-border-subtle px-4 py-3",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ _("div", {
|
|
341
342
|
className: "min-w-0",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
343
344
|
className: "text-sm font-semibold uppercase tracking-wide text-text-primary",
|
|
344
345
|
children: "Workflow Builder"
|
|
345
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ _("p", {
|
|
346
347
|
className: "text-xs text-text-secondary",
|
|
347
348
|
children: [
|
|
348
|
-
|
|
349
|
+
j.length - 1,
|
|
349
350
|
" step",
|
|
350
|
-
|
|
351
|
+
j.length === 2 ? "" : "s",
|
|
351
352
|
" ·",
|
|
352
353
|
" ",
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ _("span", {
|
|
354
355
|
className: "hidden sm:inline",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ g(be, { className: "me-1 inline h-3.5 w-3.5" }), "drag nodes · drag the canvas to pan"]
|
|
356
357
|
})
|
|
357
358
|
]
|
|
358
359
|
})]
|
|
359
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ _("div", {
|
|
360
361
|
className: "flex items-center gap-0.5 rounded-lg border border-border-seam bg-gloss-card p-1",
|
|
361
362
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ g("button", {
|
|
363
364
|
type: "button",
|
|
364
|
-
onClick: () =>
|
|
365
|
-
disabled:
|
|
365
|
+
onClick: () => Z(-.1),
|
|
366
|
+
disabled: H <= v,
|
|
366
367
|
"aria-label": "Zoom out",
|
|
367
368
|
className: "flex h-8 w-8 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:opacity-40",
|
|
368
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ g(ye, { className: "h-4 w-4" })
|
|
369
370
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ _("span", {
|
|
371
372
|
className: "min-w-11 text-center text-xs font-medium tabular-nums text-text-secondary",
|
|
372
|
-
children: [
|
|
373
|
+
children: [ct, "%"]
|
|
373
374
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ g("button", {
|
|
375
376
|
type: "button",
|
|
376
|
-
onClick: () =>
|
|
377
|
-
disabled:
|
|
377
|
+
onClick: () => Z(.1),
|
|
378
|
+
disabled: H >= y,
|
|
378
379
|
"aria-label": "Zoom in",
|
|
379
380
|
className: "flex h-8 w-8 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:opacity-40",
|
|
380
|
-
children: /* @__PURE__ */
|
|
381
|
+
children: /* @__PURE__ */ g(Se, { className: "h-4 w-4" })
|
|
381
382
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ g("span", {
|
|
383
384
|
className: "mx-0.5 h-5 w-px bg-border-subtle",
|
|
384
385
|
"aria-hidden": !0
|
|
385
386
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ g("button", {
|
|
387
388
|
type: "button",
|
|
388
|
-
onClick:
|
|
389
|
+
onClick: et,
|
|
389
390
|
"aria-label": "Reset view",
|
|
390
391
|
className: "flex h-8 w-8 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
391
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ g(ve, { className: "h-4 w-4" })
|
|
392
393
|
})
|
|
393
394
|
]
|
|
394
395
|
})]
|
|
395
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ _("div", {
|
|
396
397
|
className: "grid grid-cols-1 lg:grid-cols-[104px_minmax(0,1fr)]",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ g("div", {
|
|
398
399
|
className: "flex gap-2 overflow-x-auto border-b border-border-subtle p-3 lg:flex-col lg:overflow-visible lg:border-b-0 lg:border-e",
|
|
399
400
|
"aria-label": "Add a step",
|
|
400
401
|
children: l.map((e) => {
|
|
401
402
|
let t = e.icon;
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
+
return /* @__PURE__ */ _("button", {
|
|
403
404
|
type: "button",
|
|
404
|
-
onClick: () =>
|
|
405
|
+
onClick: () => $e(e.type),
|
|
405
406
|
title: `Add ${e.label} after the selected step`,
|
|
406
407
|
className: "flex min-w-[76px] flex-col items-center gap-1 rounded-lg border border-border-subtle bg-bg-surface px-2 py-2 text-[11px] font-medium text-text-primary transition-colors hover:border-border-strong hover:bg-bg-sunken",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ g("span", {
|
|
408
409
|
className: i("flex h-7 w-7 items-center justify-center rounded-md ring-1 ring-inset", u[e.tone]),
|
|
409
|
-
children: /* @__PURE__ */
|
|
410
|
-
}), /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ g(t, { className: "h-3.5 w-3.5" })
|
|
411
|
+
}), /* @__PURE__ */ g("span", {
|
|
411
412
|
className: "text-center leading-tight",
|
|
412
413
|
children: e.shortLabel
|
|
413
414
|
})]
|
|
414
415
|
}, e.type);
|
|
415
416
|
})
|
|
416
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ g("div", {
|
|
417
418
|
dir: "ltr",
|
|
418
|
-
onPointerDown:
|
|
419
|
-
onPointerMove:
|
|
420
|
-
onPointerUp:
|
|
421
|
-
onPointerCancel:
|
|
419
|
+
onPointerDown: tt,
|
|
420
|
+
onPointerMove: nt,
|
|
421
|
+
onPointerUp: rt,
|
|
422
|
+
onPointerCancel: rt,
|
|
422
423
|
"data-testid": "workflow-canvas",
|
|
423
424
|
className: "relative h-[520px] w-full cursor-grab overflow-hidden bg-bg-sunken active:cursor-grabbing sm:h-[600px]",
|
|
424
425
|
style: {
|
|
425
426
|
touchAction: "none",
|
|
426
427
|
backgroundImage: "radial-gradient(var(--color-border-subtle) 1px, transparent 1px)",
|
|
427
|
-
backgroundSize: `${20 *
|
|
428
|
-
backgroundPosition: `${
|
|
428
|
+
backgroundSize: `${20 * H}px ${20 * H}px`,
|
|
429
|
+
backgroundPosition: `${U.x}px ${U.y}px`
|
|
429
430
|
},
|
|
430
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ _("div", {
|
|
431
432
|
className: "absolute start-0 top-0 origin-top-left",
|
|
432
|
-
style: { transform: `translate(${
|
|
433
|
+
style: { transform: `translate(${U.x}px, ${U.y}px) scale(${H})` },
|
|
433
434
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
width:
|
|
436
|
-
height:
|
|
435
|
+
/* @__PURE__ */ _("svg", {
|
|
436
|
+
width: Ee,
|
|
437
|
+
height: De,
|
|
437
438
|
className: "pointer-events-none absolute start-0 top-0 overflow-visible",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ g("defs", { children: [
|
|
439
440
|
"accent",
|
|
440
441
|
"yes",
|
|
441
442
|
"no"
|
|
442
443
|
].map((e) => {
|
|
443
444
|
let t = e === "yes" ? "yes" : e === "no" ? "no" : null;
|
|
444
|
-
return /* @__PURE__ */
|
|
445
|
+
return /* @__PURE__ */ g("marker", {
|
|
445
446
|
id: `wf-arrow-${e}`,
|
|
446
447
|
viewBox: "0 0 10 10",
|
|
447
448
|
refX: "8",
|
|
@@ -449,30 +450,30 @@ var C = () => {
|
|
|
449
450
|
markerWidth: "7",
|
|
450
451
|
markerHeight: "7",
|
|
451
452
|
orient: "auto-start-reverse",
|
|
452
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ g("path", {
|
|
453
454
|
d: "M0,0 L10,5 L0,10 z",
|
|
454
|
-
style: { fill:
|
|
455
|
+
style: { fill: S(t) }
|
|
455
456
|
})
|
|
456
457
|
}, e);
|
|
457
|
-
}) }),
|
|
458
|
-
let t =
|
|
458
|
+
}) }), N.map((e) => {
|
|
459
|
+
let t = G.get(e.source), n = G.get(e.target);
|
|
459
460
|
if (!t || !n) return null;
|
|
460
|
-
let r =
|
|
461
|
-
return /* @__PURE__ */
|
|
461
|
+
let r = f(t, e.branch), i = re(n), a = (r.y + i.y) / 2, o = `M ${r.x} ${r.y} C ${r.x} ${a} ${i.x} ${a} ${i.x} ${i.y}`;
|
|
462
|
+
return /* @__PURE__ */ g("path", {
|
|
462
463
|
d: o,
|
|
463
464
|
fill: "none",
|
|
464
465
|
strokeWidth: 2,
|
|
465
466
|
strokeLinecap: "round",
|
|
466
|
-
style: { stroke:
|
|
467
|
-
markerEnd: `url(#${
|
|
467
|
+
style: { stroke: S(e.branch) },
|
|
468
|
+
markerEnd: `url(#${Oe(e.branch)})`
|
|
468
469
|
}, e.id);
|
|
469
470
|
})]
|
|
470
471
|
}),
|
|
471
|
-
|
|
472
|
-
let t =
|
|
472
|
+
N.filter((e) => e.branch).map((e) => {
|
|
473
|
+
let t = G.get(e.source), n = G.get(e.target);
|
|
473
474
|
if (!t || !n) return null;
|
|
474
|
-
let r =
|
|
475
|
-
return /* @__PURE__ */
|
|
475
|
+
let r = f(t, e.branch), a = re(n);
|
|
476
|
+
return /* @__PURE__ */ g("span", {
|
|
476
477
|
style: {
|
|
477
478
|
left: (r.x + a.x) / 2,
|
|
478
479
|
top: (r.y + a.y) / 2
|
|
@@ -481,76 +482,76 @@ var C = () => {
|
|
|
481
482
|
children: e.branch
|
|
482
483
|
}, `label-${e.id}`);
|
|
483
484
|
}),
|
|
484
|
-
|
|
485
|
+
j.map((e) => /* @__PURE__ */ g(ue, {
|
|
485
486
|
node: e,
|
|
486
|
-
selected:
|
|
487
|
-
invalid:
|
|
488
|
-
scale:
|
|
489
|
-
subtitle:
|
|
490
|
-
onSelect:
|
|
491
|
-
onConfigure:
|
|
492
|
-
onDelete:
|
|
493
|
-
onPositionChange:
|
|
487
|
+
selected: F === e.id,
|
|
488
|
+
invalid: Re === e.id,
|
|
489
|
+
scale: H,
|
|
490
|
+
subtitle: ie(e),
|
|
491
|
+
onSelect: I,
|
|
492
|
+
onConfigure: I,
|
|
493
|
+
onDelete: Qe,
|
|
494
|
+
onPositionChange: Je
|
|
494
495
|
}, e.id))
|
|
495
496
|
]
|
|
496
497
|
})
|
|
497
498
|
})]
|
|
498
499
|
})]
|
|
499
500
|
}),
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ _("div", {
|
|
501
502
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
503
|
-
ref:
|
|
504
|
-
children:
|
|
505
|
-
node:
|
|
506
|
-
onLabelChange: (e) =>
|
|
507
|
-
onConfigChange: (e) =>
|
|
508
|
-
onTriggerChange:
|
|
509
|
-
onClose: () =>
|
|
510
|
-
}) : /* @__PURE__ */
|
|
511
|
-
}), /* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ g("div", {
|
|
504
|
+
ref: qe,
|
|
505
|
+
children: K ? /* @__PURE__ */ g(fe, {
|
|
506
|
+
node: K,
|
|
507
|
+
onLabelChange: (e) => Ye(K.id, e),
|
|
508
|
+
onConfigChange: (e) => Xe(K.id, e),
|
|
509
|
+
onTriggerChange: Ze,
|
|
510
|
+
onClose: () => I(null)
|
|
511
|
+
}) : /* @__PURE__ */ g(de, {})
|
|
512
|
+
}), /* @__PURE__ */ _("div", {
|
|
512
513
|
className: "rounded-card border border-border-seam bg-gloss-card p-4 shadow-pop",
|
|
513
514
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ g("h4", {
|
|
515
516
|
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
516
517
|
children: "Trigger"
|
|
517
518
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ g("div", {
|
|
519
520
|
className: "grid grid-cols-1 gap-1.5 sm:grid-cols-2",
|
|
520
|
-
children: ee.map((e) => /* @__PURE__ */
|
|
521
|
+
children: ee.map((e) => /* @__PURE__ */ _("button", {
|
|
521
522
|
type: "button",
|
|
522
|
-
onClick: () =>
|
|
523
|
-
"aria-pressed":
|
|
524
|
-
className: i("rounded-md border px-3 py-2 text-start text-sm transition-colors",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
523
|
+
onClick: () => Ze(e.type),
|
|
524
|
+
"aria-pressed": $ === e.type,
|
|
525
|
+
className: i("rounded-md border px-3 py-2 text-start text-sm transition-colors", $ === e.type ? "border-[color-mix(in_oklab,var(--color-action-primary-bg)_40%,transparent)] bg-[var(--color-accent-soft)] text-text-primary" : "border-border-subtle text-text-primary hover:bg-bg-sunken"),
|
|
526
|
+
children: [/* @__PURE__ */ g("span", {
|
|
526
527
|
className: "block font-medium",
|
|
527
528
|
children: e.label
|
|
528
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ g("span", {
|
|
529
530
|
className: "block text-xs text-text-secondary",
|
|
530
531
|
children: e.description
|
|
531
532
|
})]
|
|
532
533
|
}, e.type))
|
|
533
534
|
}),
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ g("p", {
|
|
535
536
|
className: "mt-3 text-xs text-text-secondary",
|
|
536
537
|
children: "Steps are added after the selected node. A Condition continues on its Yes path; give its No path steps of its own, or leave it empty to stop there."
|
|
537
538
|
})
|
|
538
539
|
]
|
|
539
540
|
})]
|
|
540
541
|
}),
|
|
541
|
-
|
|
542
|
-
workflow:
|
|
543
|
-
open:
|
|
544
|
-
onClose: () =>
|
|
542
|
+
k && Ve && /* @__PURE__ */ g(pe, {
|
|
543
|
+
workflow: k,
|
|
544
|
+
open: Ve,
|
|
545
|
+
onClose: () => He(!1),
|
|
545
546
|
onChanged: () => void 0
|
|
546
547
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ g(s, { toasts: Ue.map((e) => ({
|
|
548
549
|
...e,
|
|
549
|
-
onDismiss:
|
|
550
|
+
onDismiss: J
|
|
550
551
|
})) })
|
|
551
552
|
]
|
|
552
553
|
});
|
|
553
554
|
};
|
|
554
|
-
export {
|
|
555
|
+
export { E as WorkflowBuilderPage, T as insertAction, w as removeNode };
|
|
555
556
|
|
|
556
557
|
//# sourceMappingURL=WorkflowBuilderPage.js.map
|