@oomol-lab/open-flow 0.1.0-beta.4 → 0.1.0-beta.5
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/{DesignerIcon-DdfuH2jW.js → DesignerIcon-XKBRy_0Q.js} +640 -640
- package/dist/browser/createResourceDialog-Cf7QpXp6.js +505 -0
- package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
- package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
- package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
- package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
- package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
- package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
- package/dist/browser/dist-DxahK_I8.js +2688 -0
- package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
- package/dist/browser/{esm-C9jQK70n.js → esm-xWDFFpGd.js} +5 -6
- package/dist/browser/flow-authoring-module.d.ts +2 -2
- package/dist/browser/flow-authoring-node.d.ts +2 -2
- package/dist/browser/flow-authoring.js +469 -209
- package/dist/browser/flow-change.d.ts +96 -8
- package/dist/browser/flow-change.js +319 -96
- package/dist/browser/{flowChanges-Bs-ZcJV8.js → flowChanges-CeMiiZIO.js} +1578 -1541
- package/dist/browser/{flowRunInputEditorStore-BYa8zFLC.js → flowRunInputEditorStore-DDidwd8h.js} +9 -1
- package/dist/browser/{flowWorkspace-BewofPeU.js → flowWorkspace-VnS8nLMT.js} +9354 -9349
- package/dist/browser/{getPseudoElementBounds-qDxSDwzN.js → getPseudoElementBounds-5LArT6Xc.js} +494 -474
- package/dist/browser/icons-CRxvozBE.js +726 -0
- package/dist/browser/{typeScriptSession-CwMPjseS.js → typeScriptSession-Bj2HDFRd.js} +255 -256
- package/dist/browser/{waitNotificationInputs-DtrPBwA1.js → waitNotificationInputs-ClCAEIAM.js} +2 -2
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +547 -611
- package/dist/browser/{workbenchSelect-CX8KtT7L.js → workbenchSelect-Cf1zlVm9.js} +398 -398
- package/dist/common/control-api-conformance.js +21 -19
- package/dist/common/control-api.d.ts +4 -11
- package/dist/common/control-api.js +6 -18
- package/package.json +1 -1
- package/dist/browser/createResourceDialog-4YQKl8lG.js +0 -505
- package/dist/browser/dist-BpopSHwP.js +0 -1543
- package/dist/browser/dist-CUSrALSX.js +0 -1620
- package/dist/browser/icons-DRoMXL5h.js +0 -521
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
|
|
2
2
|
import { a as r, i, s as a, t as o } from "./main-DmjVyuWr.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as u, d, f,
|
|
5
|
-
import { t as
|
|
6
|
-
import { $ as
|
|
7
|
-
import { a as
|
|
8
|
-
import { Suspense as
|
|
9
|
-
import { Fragment as
|
|
3
|
+
import { Un as s, Vn as c, jt as l } from "./getPseudoElementBounds-5LArT6Xc.js";
|
|
4
|
+
import { a as u, c as d, d as f, f as p, i as m, n as h, o as g, p as _, t as v, u as y } from "./icons-CRxvozBE.js";
|
|
5
|
+
import { t as b } from "./workbenchSelect-Cf1zlVm9.js";
|
|
6
|
+
import { $ as x, A as S, C as ee, D as C, E as w, F as T, G as E, H as D, I as O, J as k, M as A, N as j, O as M, P as N, Q as P, S as F, U as I, V as L, W as te, X as ne, Y as re, Z as ie, _ as ae, a as oe, at as se, b as ce, c as le, ct as ue, d as de, dt as fe, et as pe, f as me, ft as R, g as he, h as ge, i as _e, it as ve, j as z, l as ye, lt as be, m as xe, mt as B, n as V, nt as Se, o as Ce, ot as we, p as Te, pt as Ee, q as De, rt as Oe, s as ke, st as Ae, t as je, tt as H, u as Me, ut as U, v as Ne, w as Pe, x as Fe, y as Ie, z as Le } from "./flowChanges-CeMiiZIO.js";
|
|
7
|
+
import { a as Re, i as ze, n as Be, r as Ve } from "./languages-DgJehE1g.js";
|
|
8
|
+
import { Suspense as He, lazy as Ue, useEffect as W, useRef as We, useState as G } from "react";
|
|
9
|
+
import { Fragment as Ge, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
10
10
|
//#region src/workbench/browser/runtime/navigation.ts
|
|
11
|
-
var
|
|
11
|
+
var Ke = class {
|
|
12
12
|
#e;
|
|
13
13
|
#t;
|
|
14
14
|
#n;
|
|
@@ -67,7 +67,7 @@ var qe = class {
|
|
|
67
67
|
this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
|
|
68
68
|
}
|
|
69
69
|
async apply(e) {
|
|
70
|
-
if (
|
|
70
|
+
if (qe(e, this.#t)) return;
|
|
71
71
|
this.#t = e;
|
|
72
72
|
let t = ++this.#i;
|
|
73
73
|
this.#s = !0;
|
|
@@ -83,49 +83,49 @@ var qe = class {
|
|
|
83
83
|
flowId: this.#n.workspace.$.flowId.value,
|
|
84
84
|
view: e
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
qe(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function qe(e, t) {
|
|
90
90
|
return e.flowId == t.flowId && e.view == t.view;
|
|
91
91
|
}
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
94
|
-
var
|
|
95
|
-
label:
|
|
94
|
+
var Je = Ue(() => import("./createResourceDialog-Cf7QpXp6.js")), Ye = Re.map((e) => ({
|
|
95
|
+
label: ze[e],
|
|
96
96
|
value: e
|
|
97
97
|
}));
|
|
98
|
-
function
|
|
99
|
-
let n = r(), [i, a] =
|
|
100
|
-
return t == null ? null : /* @__PURE__ */
|
|
98
|
+
function Xe({ language: e, onLanguageChange: t }) {
|
|
99
|
+
let n = r(), [i, a] = G(null);
|
|
100
|
+
return t == null ? null : /* @__PURE__ */ q("div", {
|
|
101
101
|
className: "resource-language",
|
|
102
102
|
ref: a,
|
|
103
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ K("span", {
|
|
104
104
|
className: "sr-only",
|
|
105
105
|
children: n("language.label")
|
|
106
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ K(b, {
|
|
107
107
|
ariaLabel: n("language.label"),
|
|
108
108
|
onValueChange: (e) => t(e),
|
|
109
|
-
options:
|
|
109
|
+
options: Ye,
|
|
110
110
|
portalRoot: i,
|
|
111
111
|
value: e
|
|
112
112
|
})]
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
let
|
|
115
|
+
function Ze({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: d }) {
|
|
116
|
+
let f = i(), p = r(), [m, h] = G("idle"), [g, y] = G(n.name), b = u(g);
|
|
117
117
|
async function x(e) {
|
|
118
118
|
e.preventDefault();
|
|
119
|
-
let t =
|
|
120
|
-
|
|
119
|
+
let t = g.trim();
|
|
120
|
+
u(t) == null && await d.workspace.renameFlow(n.flowId, t) && h("idle");
|
|
121
121
|
}
|
|
122
122
|
async function S() {
|
|
123
|
-
await
|
|
123
|
+
await d.workspace.deleteFlow(n.flowId) && h("idle");
|
|
124
124
|
}
|
|
125
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ q("div", {
|
|
126
126
|
className: "resource-item-row",
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ q(c, {
|
|
129
129
|
"aria-disabled": n.status == "retiring",
|
|
130
130
|
className: "resource-list-row flow-columns",
|
|
131
131
|
nativeButton: !1,
|
|
@@ -136,188 +136,188 @@ function Qe({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: u }) {
|
|
|
136
136
|
}
|
|
137
137
|
pe(e, () => o(n));
|
|
138
138
|
},
|
|
139
|
-
render: /* @__PURE__ */
|
|
139
|
+
render: /* @__PURE__ */ K("a", { href: n.status == "retiring" ? void 0 : a }),
|
|
140
140
|
tabIndex: n.status == "retiring" ? -1 : void 0,
|
|
141
141
|
variant: "ghost",
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ q("span", {
|
|
144
144
|
className: "resource-primary-cell",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ K("span", {
|
|
146
146
|
className: "resource-icon",
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ K(v, { name: "flow" })
|
|
148
|
+
}), /* @__PURE__ */ q("span", { children: [/* @__PURE__ */ q("span", {
|
|
149
149
|
className: "flex min-w-0 items-center gap-2",
|
|
150
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ K("strong", {
|
|
151
151
|
className: "min-w-0 truncate",
|
|
152
152
|
children: n.name
|
|
153
|
-
}), e != null && /* @__PURE__ */
|
|
153
|
+
}), e != null && /* @__PURE__ */ K(fe, {
|
|
154
154
|
className: "min-w-0 shrink",
|
|
155
155
|
title: e,
|
|
156
156
|
variant: "secondary",
|
|
157
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ K("span", {
|
|
158
158
|
className: "truncate",
|
|
159
159
|
children: e
|
|
160
160
|
})
|
|
161
161
|
})]
|
|
162
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ K("code", {
|
|
163
163
|
translate: "no",
|
|
164
164
|
children: n.flowId
|
|
165
165
|
})] })]
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ K("time", {
|
|
168
168
|
dateTime: n.updatedAt,
|
|
169
|
-
children: new Date(n.updatedAt).toLocaleString(
|
|
169
|
+
children: new Date(n.updatedAt).toLocaleString(f)
|
|
170
170
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ q("span", {
|
|
172
172
|
className: `resource-status ${n.status == "active" ? "active" : "warning"}`,
|
|
173
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ K("span", {
|
|
174
174
|
"aria-hidden": "true",
|
|
175
175
|
className: `status-dot ${n.status == "active" ? "success" : "running"}`
|
|
176
|
-
}),
|
|
176
|
+
}), p(n.status == "active" ? "resource.active" : "resource.retiring")]
|
|
177
177
|
})
|
|
178
178
|
]
|
|
179
179
|
}),
|
|
180
|
-
n.status == "active" && /* @__PURE__ */
|
|
181
|
-
"aria-expanded":
|
|
182
|
-
"aria-label":
|
|
183
|
-
className:
|
|
180
|
+
n.status == "active" && /* @__PURE__ */ K(c, {
|
|
181
|
+
"aria-expanded": m != "idle",
|
|
182
|
+
"aria-label": p("sidebar.flowActions", { name: n.name }),
|
|
183
|
+
className: s("resource-row-more", m != "idle" && "active"),
|
|
184
184
|
disabled: t != null,
|
|
185
|
-
onClick: () =>
|
|
185
|
+
onClick: () => h(m == "idle" ? "actions" : "idle"),
|
|
186
186
|
size: "icon-sm",
|
|
187
187
|
variant: "ghost",
|
|
188
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ K(v, { name: "more" })
|
|
189
189
|
}),
|
|
190
|
-
|
|
190
|
+
m == "actions" && /* @__PURE__ */ q("div", {
|
|
191
191
|
className: "resource-row-actions",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ K(c, {
|
|
193
193
|
onClick: () => {
|
|
194
|
-
y(n.name),
|
|
194
|
+
y(n.name), h("rename");
|
|
195
195
|
},
|
|
196
196
|
size: "sm",
|
|
197
197
|
variant: "outline",
|
|
198
|
-
children:
|
|
199
|
-
}), /* @__PURE__ */
|
|
200
|
-
onClick: () =>
|
|
198
|
+
children: p("common.rename")
|
|
199
|
+
}), /* @__PURE__ */ K(c, {
|
|
200
|
+
onClick: () => h("delete"),
|
|
201
201
|
size: "sm",
|
|
202
202
|
variant: "destructive",
|
|
203
|
-
children:
|
|
203
|
+
children: p("common.delete")
|
|
204
204
|
})]
|
|
205
205
|
}),
|
|
206
|
-
|
|
206
|
+
m == "rename" && /* @__PURE__ */ q("form", {
|
|
207
207
|
className: "resource-row-form",
|
|
208
208
|
onSubmit: (e) => void x(e),
|
|
209
209
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ K(_, {
|
|
211
211
|
htmlFor: `rename-flow-${n.flowId}`,
|
|
212
|
-
children:
|
|
212
|
+
children: p("sidebar.renameFlow", { name: n.name })
|
|
213
213
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ q("span", {
|
|
215
215
|
className: "resource-row-field",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ K(l, {
|
|
217
217
|
autoComplete: "off",
|
|
218
|
-
"aria-invalid":
|
|
218
|
+
"aria-invalid": g.length > 0 && b != null,
|
|
219
219
|
autoFocus: !0,
|
|
220
220
|
id: `rename-flow-${n.flowId}`,
|
|
221
221
|
name: "flow-name",
|
|
222
222
|
onChange: (e) => y(e.target.value),
|
|
223
223
|
required: !0,
|
|
224
|
-
value:
|
|
225
|
-
}),
|
|
224
|
+
value: g
|
|
225
|
+
}), g.length > 0 && b != null && /* @__PURE__ */ K("small", {
|
|
226
226
|
className: "resource-name-message error",
|
|
227
|
-
children:
|
|
227
|
+
children: p(`resource.nameIssue.${b}`, { max: 80 })
|
|
228
228
|
})]
|
|
229
229
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
onClick: () =>
|
|
230
|
+
/* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(c, {
|
|
231
|
+
onClick: () => h("idle"),
|
|
232
232
|
size: "sm",
|
|
233
233
|
variant: "outline",
|
|
234
|
-
children:
|
|
235
|
-
}), /* @__PURE__ */
|
|
234
|
+
children: p("common.cancel")
|
|
235
|
+
}), /* @__PURE__ */ K(c, {
|
|
236
236
|
disabled: t != null || b != null,
|
|
237
237
|
size: "sm",
|
|
238
238
|
type: "submit",
|
|
239
|
-
children:
|
|
239
|
+
children: p("common.save")
|
|
240
240
|
})] })
|
|
241
241
|
]
|
|
242
242
|
}),
|
|
243
|
-
|
|
243
|
+
m == "delete" && /* @__PURE__ */ q("div", {
|
|
244
244
|
className: "resource-row-confirm",
|
|
245
245
|
role: "group",
|
|
246
|
-
"aria-label":
|
|
247
|
-
children: [/* @__PURE__ */
|
|
248
|
-
onClick: () =>
|
|
246
|
+
"aria-label": p("sidebar.deleteFlow", { name: n.name }),
|
|
247
|
+
children: [/* @__PURE__ */ K("span", { children: /* @__PURE__ */ K("strong", { children: p("sidebar.deleteFlowConfirm", { name: n.name }) }) }), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(c, {
|
|
248
|
+
onClick: () => h("idle"),
|
|
249
249
|
size: "sm",
|
|
250
250
|
variant: "outline",
|
|
251
|
-
children:
|
|
252
|
-
}), /* @__PURE__ */
|
|
251
|
+
children: p("common.cancel")
|
|
252
|
+
}), /* @__PURE__ */ K(c, {
|
|
253
253
|
disabled: t != null,
|
|
254
254
|
onClick: () => void S(),
|
|
255
255
|
size: "sm",
|
|
256
256
|
variant: "destructive",
|
|
257
|
-
children:
|
|
257
|
+
children: p(t == "flow" ? "common.deleting" : "common.delete")
|
|
258
258
|
})] })]
|
|
259
259
|
})
|
|
260
260
|
]
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return /* @__PURE__ */
|
|
263
|
+
function Qe() {
|
|
264
|
+
return /* @__PURE__ */ q("div", {
|
|
265
265
|
"aria-hidden": "true",
|
|
266
266
|
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
267
267
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ q("span", {
|
|
269
269
|
className: "resource-primary-cell",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ K(H, { className: "size-8 shrink-0" }), /* @__PURE__ */ q("span", {
|
|
271
271
|
className: "resource-skeleton-copy",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ K(H, { className: "h-3.5 w-36" }), /* @__PURE__ */ K(H, { className: "h-2.5 w-48 max-w-full" })]
|
|
273
273
|
})]
|
|
274
274
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ K(H, { className: "h-3 w-28" }),
|
|
276
|
+
/* @__PURE__ */ K(H, { className: "h-3 w-16" })
|
|
277
277
|
]
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
let y = r(),
|
|
280
|
+
function $e({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: l, hostTitle: d, language: f, onCreateFlow: p, onHostAction: m, onLanguageChange: h, onSelectFlow: g, store: _ }) {
|
|
281
|
+
let y = r(), b = a(_.workspace.$.busy), S = a(_.workspace.$.flowLoadFailed), ee = a(_.workspace.$.flowLoadMoreFailed), C = a(_.workspace.$.flowLoading), w = a(_.workspace.$.flowLoadingMore), T = a(_.workspace.$.flowNextCursor), E = a(_.workspace.$.flows), D = a(_.workspace.$.flowTotal), [O, k] = G(!1), [A, j] = G(""), [M, N] = G(""), P = A.trim().toLocaleLowerCase(), F = E.filter((e) => e.name.toLocaleLowerCase().includes(P));
|
|
282
282
|
async function I(e) {
|
|
283
283
|
e.preventDefault();
|
|
284
284
|
let t = M.trim();
|
|
285
|
-
|
|
285
|
+
u(t) != null || !await p(t) || (k(!1), N(""));
|
|
286
286
|
}
|
|
287
|
-
return /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ K("main", {
|
|
288
288
|
className: "resource-browser",
|
|
289
|
-
children: /* @__PURE__ */
|
|
290
|
-
className:
|
|
289
|
+
children: /* @__PURE__ */ q("div", {
|
|
290
|
+
className: s("resource-page", e != "default" && "resource-page-full"),
|
|
291
291
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ K("h1", {
|
|
293
293
|
className: "sr-only",
|
|
294
294
|
children: y("resource.flows")
|
|
295
295
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ q("section", {
|
|
297
297
|
"aria-labelledby": "flow-list-title",
|
|
298
298
|
className: "resource-list-section",
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ q("div", {
|
|
301
301
|
className: "resource-list-title",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ q("div", {
|
|
303
303
|
className: "resource-list-heading",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ K("h2", {
|
|
305
305
|
id: "flow-list-title",
|
|
306
306
|
children: y("resource.allFlows")
|
|
307
|
-
}), !
|
|
308
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), !C && /* @__PURE__ */ K("span", { children: y("resource.flowCount", { count: D ?? E.length }) })]
|
|
308
|
+
}), /* @__PURE__ */ q("div", {
|
|
309
309
|
className: "resource-list-actions",
|
|
310
310
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
language:
|
|
311
|
+
/* @__PURE__ */ K(Xe, {
|
|
312
|
+
language: f,
|
|
313
313
|
onLanguageChange: h
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ q(Se, {
|
|
316
316
|
className: "w-full sm:w-56",
|
|
317
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ K(Oe, { children: /* @__PURE__ */ K(v, {
|
|
318
318
|
name: "search",
|
|
319
319
|
size: 17
|
|
320
|
-
}) }), /* @__PURE__ */
|
|
320
|
+
}) }), /* @__PURE__ */ K(ve, {
|
|
321
321
|
autoComplete: "off",
|
|
322
322
|
"aria-label": y("resource.searchFlows"),
|
|
323
323
|
name: "flow-search",
|
|
@@ -326,114 +326,114 @@ function et({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
326
326
|
value: A
|
|
327
327
|
})]
|
|
328
328
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ K(c, {
|
|
330
330
|
"aria-label": y("common.refresh"),
|
|
331
|
-
disabled:
|
|
332
|
-
onClick: () => void
|
|
331
|
+
disabled: C || b != null,
|
|
332
|
+
onClick: () => void _.workspace.reloadFlows(),
|
|
333
333
|
size: "icon",
|
|
334
334
|
title: y("common.refresh"),
|
|
335
335
|
variant: "outline",
|
|
336
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ K(v, { name: "refresh" })
|
|
337
337
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ q(c, {
|
|
339
339
|
className: "resource-page-primary-action",
|
|
340
|
-
disabled:
|
|
340
|
+
disabled: b != null,
|
|
341
341
|
onClick: () => k(!0),
|
|
342
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ K(v, {
|
|
343
343
|
"data-icon": "inline-start",
|
|
344
344
|
name: "plus"
|
|
345
345
|
}), y("resource.newFlow")]
|
|
346
346
|
}),
|
|
347
|
-
|
|
348
|
-
action:
|
|
347
|
+
l != null && d != null && m != null && /* @__PURE__ */ K(x, {
|
|
348
|
+
action: l,
|
|
349
349
|
onAction: m,
|
|
350
|
-
title:
|
|
350
|
+
title: d
|
|
351
351
|
})
|
|
352
352
|
]
|
|
353
353
|
})]
|
|
354
354
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ q("div", {
|
|
356
356
|
"aria-hidden": "true",
|
|
357
357
|
className: "resource-list-columns flow-columns",
|
|
358
358
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ K("span", { children: y("resource.name") }),
|
|
360
|
+
/* @__PURE__ */ K("span", { children: y("resource.updated") }),
|
|
361
|
+
/* @__PURE__ */ K("span", { children: y("resource.status") })
|
|
362
362
|
]
|
|
363
363
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ K("div", {
|
|
365
365
|
className: "resource-list",
|
|
366
|
-
children:
|
|
366
|
+
children: C ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ K(Qe, {}, t)) : S ? /* @__PURE__ */ q(se, {
|
|
367
367
|
className: "min-h-64",
|
|
368
368
|
role: "alert",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ q(ue, { children: [
|
|
370
|
+
/* @__PURE__ */ K(be, {
|
|
371
371
|
variant: "icon",
|
|
372
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ K(v, {
|
|
373
373
|
name: "alert",
|
|
374
374
|
size: 20
|
|
375
375
|
})
|
|
376
376
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
] }), /* @__PURE__ */
|
|
380
|
-
onClick: () => void
|
|
377
|
+
/* @__PURE__ */ K(U, { children: y("resource.flowsLoadFailed") }),
|
|
378
|
+
/* @__PURE__ */ K(Ae, { children: y("resource.flowsLoadFailedDescription") })
|
|
379
|
+
] }), /* @__PURE__ */ K(we, { children: /* @__PURE__ */ K(c, {
|
|
380
|
+
onClick: () => void _.retryFlows(),
|
|
381
381
|
variant: "outline",
|
|
382
382
|
children: y("empty.retry")
|
|
383
383
|
}) })]
|
|
384
|
-
}) : F.length == 0 ? /* @__PURE__ */
|
|
384
|
+
}) : F.length == 0 ? /* @__PURE__ */ q(se, {
|
|
385
385
|
className: "min-h-64",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ q(ue, { children: [
|
|
387
|
+
/* @__PURE__ */ K(be, {
|
|
388
388
|
variant: "icon",
|
|
389
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ K(v, {
|
|
390
390
|
name: "flow",
|
|
391
391
|
size: 20
|
|
392
392
|
})
|
|
393
393
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
] }), P.length == 0 && /* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ K(U, { children: y(P.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
395
|
+
/* @__PURE__ */ K(Ae, { children: y(P.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
396
|
+
] }), P.length == 0 && /* @__PURE__ */ K(we, { children: /* @__PURE__ */ q(c, {
|
|
397
397
|
onClick: () => k(!0),
|
|
398
398
|
variant: "outline",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ K(v, {
|
|
400
400
|
"data-icon": "inline-start",
|
|
401
401
|
name: "plus"
|
|
402
402
|
}), y("resource.newFlow")]
|
|
403
403
|
}) })]
|
|
404
|
-
}) : F.map((e) => /* @__PURE__ */
|
|
404
|
+
}) : F.map((e) => /* @__PURE__ */ K(Ze, {
|
|
405
405
|
badge: i?.[e.flowId],
|
|
406
|
-
busy:
|
|
406
|
+
busy: b,
|
|
407
407
|
flow: e,
|
|
408
408
|
href: o(e),
|
|
409
409
|
onSelect: g,
|
|
410
|
-
store:
|
|
410
|
+
store: _
|
|
411
411
|
}, e.flowId))
|
|
412
412
|
}),
|
|
413
|
-
|
|
413
|
+
T != null && /* @__PURE__ */ K("div", {
|
|
414
414
|
className: "resource-list-footer",
|
|
415
|
-
children: /* @__PURE__ */
|
|
416
|
-
disabled:
|
|
417
|
-
onClick: () => void
|
|
415
|
+
children: /* @__PURE__ */ K(c, {
|
|
416
|
+
disabled: w,
|
|
417
|
+
onClick: () => void _.workspace.loadMoreFlows(),
|
|
418
418
|
variant: "outline",
|
|
419
|
-
children: y(
|
|
419
|
+
children: y(w ? "resource.loadingMore" : ee ? "resource.retryLoadMore" : "resource.loadMore")
|
|
420
420
|
})
|
|
421
421
|
})
|
|
422
422
|
]
|
|
423
423
|
}),
|
|
424
|
-
|
|
424
|
+
O && /* @__PURE__ */ K(He, {
|
|
425
425
|
fallback: null,
|
|
426
|
-
children: /* @__PURE__ */
|
|
426
|
+
children: /* @__PURE__ */ K(Je, {
|
|
427
427
|
disabled: t,
|
|
428
428
|
field: n,
|
|
429
429
|
id: "flow-name",
|
|
430
|
-
issue:
|
|
430
|
+
issue: u(M),
|
|
431
431
|
label: y("resource.flowName"),
|
|
432
432
|
name: M,
|
|
433
433
|
onNameChange: N,
|
|
434
434
|
onOpenChange: k,
|
|
435
435
|
onSubmit: (e) => void I(e),
|
|
436
|
-
pending:
|
|
436
|
+
pending: b == "flow",
|
|
437
437
|
title: y("resource.newFlow")
|
|
438
438
|
})
|
|
439
439
|
})
|
|
@@ -443,7 +443,7 @@ function et({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
|
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
446
|
-
var
|
|
446
|
+
var et = (e) => crypto.getRandomValues(new Uint8Array(e)), tt = (e, t, n) => {
|
|
447
447
|
let r = 256 - 256 % e.length;
|
|
448
448
|
if (r === 256) {
|
|
449
449
|
let r = e.length - 1;
|
|
@@ -465,41 +465,43 @@ var tt = (e) => crypto.getRandomValues(new Uint8Array(e)), nt = (e, t, n) => {
|
|
|
465
465
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
466
466
|
}
|
|
467
467
|
};
|
|
468
|
-
},
|
|
468
|
+
}, nt = (e, t = 21) => tt(e, t | 0, et);
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region src/flow/common/edgeChanges.ts
|
|
471
|
-
function
|
|
471
|
+
function rt(e, t, n) {
|
|
472
472
|
let r = {
|
|
473
473
|
source: n.source,
|
|
474
474
|
sourceHandle: n.sourceHandle,
|
|
475
475
|
target: n.target,
|
|
476
476
|
targetHandle: n.targetHandle
|
|
477
|
-
}, i =
|
|
477
|
+
}, i = at(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
478
478
|
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : De(e, [{
|
|
479
|
+
before: a,
|
|
479
480
|
edge: r,
|
|
480
481
|
kind: "graph.edge.connect",
|
|
481
482
|
target: t
|
|
482
483
|
}]);
|
|
483
484
|
}
|
|
484
|
-
function
|
|
485
|
+
function it(e, t, n) {
|
|
485
486
|
let r = {
|
|
486
487
|
source: n.source,
|
|
487
488
|
sourceHandle: n.sourceHandle,
|
|
488
489
|
target: n.target,
|
|
489
490
|
targetHandle: n.targetHandle
|
|
490
|
-
}, i =
|
|
491
|
+
}, i = at(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
491
492
|
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
493
|
+
before: a,
|
|
492
494
|
edge: r,
|
|
493
495
|
kind: "graph.edge.disconnect",
|
|
494
496
|
target: t
|
|
495
497
|
}];
|
|
496
498
|
}
|
|
497
|
-
function
|
|
499
|
+
function at(e, t) {
|
|
498
500
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
499
501
|
}
|
|
500
502
|
//#endregion
|
|
501
503
|
//#region src/flow/common/moduleChanges.ts
|
|
502
|
-
async function
|
|
504
|
+
async function ot(e) {
|
|
503
505
|
try {
|
|
504
506
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
505
507
|
errorRecovery: !0,
|
|
@@ -515,15 +517,17 @@ async function st(e) {
|
|
|
515
517
|
return [];
|
|
516
518
|
}
|
|
517
519
|
}
|
|
518
|
-
function
|
|
520
|
+
function st(e, t, n, r, i) {
|
|
519
521
|
return [{
|
|
520
|
-
|
|
522
|
+
beforeImports: n,
|
|
523
|
+
beforeSource: t,
|
|
524
|
+
imports: i,
|
|
521
525
|
kind: "module.source.replace",
|
|
522
526
|
moduleId: e,
|
|
523
|
-
source:
|
|
527
|
+
source: r
|
|
524
528
|
}];
|
|
525
529
|
}
|
|
526
|
-
var
|
|
530
|
+
var ct = nt("23456789abcdefghjkmnpqrstuvwxyz", 10), J = {
|
|
527
531
|
activities: [],
|
|
528
532
|
activitiesLoadFailed: !1,
|
|
529
533
|
activitiesLoading: !1,
|
|
@@ -536,24 +540,24 @@ var lt = rt("23456789abcdefghjkmnpqrstuvwxyz", 10), K = {
|
|
|
536
540
|
loadingMore: !1,
|
|
537
541
|
publications: [],
|
|
538
542
|
publishing: !1
|
|
539
|
-
},
|
|
540
|
-
function
|
|
543
|
+
}, lt = 20, ut = 50, dt = 750;
|
|
544
|
+
function Y(e, t) {
|
|
541
545
|
return e?.flowId == t.flowId;
|
|
542
546
|
}
|
|
543
|
-
var
|
|
547
|
+
var ft = class {
|
|
544
548
|
#e;
|
|
545
549
|
#t;
|
|
546
550
|
#n;
|
|
547
|
-
#r = new
|
|
548
|
-
#i = new
|
|
551
|
+
#r = new I();
|
|
552
|
+
#i = new I();
|
|
549
553
|
#a;
|
|
550
|
-
#o = new
|
|
551
|
-
#s = new
|
|
554
|
+
#o = new I();
|
|
555
|
+
#s = new I();
|
|
552
556
|
#c;
|
|
553
|
-
#l = t(
|
|
557
|
+
#l = t(J);
|
|
554
558
|
#u;
|
|
555
559
|
#d;
|
|
556
|
-
constructor(t, n, r, i, a = () => crypto.randomUUID(), o =
|
|
560
|
+
constructor(t, n, r, i, a = () => crypto.randomUUID(), o = R()) {
|
|
557
561
|
this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
|
|
558
562
|
activities: e(this.#l, (e) => e.activities),
|
|
559
563
|
activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
|
|
@@ -586,12 +590,12 @@ var pt = class {
|
|
|
586
590
|
this.#l.dispose();
|
|
587
591
|
}
|
|
588
592
|
reset() {
|
|
589
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#d = void 0, this.#l.set(
|
|
593
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#d = void 0, this.#l.set(J);
|
|
590
594
|
}
|
|
591
595
|
async load(e) {
|
|
592
596
|
let t = { flowId: e }, n = this.#r.begin();
|
|
593
|
-
|
|
594
|
-
...
|
|
597
|
+
Y(this.#l.value.target, t) || (this.#i.invalidate(), this.#d = void 0), this.#c(void 0), this.#l.set({
|
|
598
|
+
...J,
|
|
595
599
|
loading: !0,
|
|
596
600
|
target: t
|
|
597
601
|
});
|
|
@@ -630,7 +634,7 @@ var pt = class {
|
|
|
630
634
|
try {
|
|
631
635
|
let e = await this.#e.listPublications(n.flowId, {
|
|
632
636
|
cursor: t,
|
|
633
|
-
limit:
|
|
637
|
+
limit: ut
|
|
634
638
|
});
|
|
635
639
|
if (!r()) return;
|
|
636
640
|
let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
|
|
@@ -668,7 +672,7 @@ var pt = class {
|
|
|
668
672
|
publishing: i.status == "pending"
|
|
669
673
|
}), await this.#g(n, i, o, e.name)) : !1;
|
|
670
674
|
} catch (e) {
|
|
671
|
-
return o() ? (e instanceof
|
|
675
|
+
return o() ? (e instanceof B && e.code == "live.conflict" && await this.#p(n), this.#c(D(e, this.#n.t)), !1) : !1;
|
|
672
676
|
} finally {
|
|
673
677
|
o() && this.#y({ publishing: !1 });
|
|
674
678
|
}
|
|
@@ -692,7 +696,7 @@ var pt = class {
|
|
|
692
696
|
message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
|
|
693
697
|
}), !0);
|
|
694
698
|
} catch (e) {
|
|
695
|
-
return s() ? (e instanceof
|
|
699
|
+
return s() ? (e instanceof B && e.code == "live.conflict" && await this.#p(r), this.#c(D(e, this.#n.t)), !1) : !1;
|
|
696
700
|
} finally {
|
|
697
701
|
s() && this.#y({ rollingBackPublicationId: void 0 });
|
|
698
702
|
}
|
|
@@ -727,7 +731,7 @@ var pt = class {
|
|
|
727
731
|
testingTriggerId: void 0,
|
|
728
732
|
testResult: void 0
|
|
729
733
|
});
|
|
730
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
734
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: lt })]);
|
|
731
735
|
if (n()) {
|
|
732
736
|
if (r.status == "rejected") {
|
|
733
737
|
this.#y({
|
|
@@ -761,7 +765,7 @@ var pt = class {
|
|
|
761
765
|
try {
|
|
762
766
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
763
767
|
cursor: t,
|
|
764
|
-
limit:
|
|
768
|
+
limit: lt
|
|
765
769
|
});
|
|
766
770
|
if (!i() || this.#l.value.selectedTriggerId != n) return;
|
|
767
771
|
let a = new Set(this.#l.value.activities.map((e) => e.activityId));
|
|
@@ -816,7 +820,7 @@ var pt = class {
|
|
|
816
820
|
}
|
|
817
821
|
async #f(e) {
|
|
818
822
|
let [t, n, r] = await this.#m(e);
|
|
819
|
-
this.#u.updateLive(t), await this.#u.refreshFlows(),
|
|
823
|
+
this.#u.updateLive(t), await this.#u.refreshFlows(), Y(this.#l.value.target, e) && this.#y({
|
|
820
824
|
bindings: r,
|
|
821
825
|
live: t,
|
|
822
826
|
loadFailed: !1,
|
|
@@ -837,7 +841,7 @@ var pt = class {
|
|
|
837
841
|
this.#e.getLive(e.flowId),
|
|
838
842
|
this.#e.listPublications(e.flowId, {
|
|
839
843
|
includeTotal: !0,
|
|
840
|
-
limit:
|
|
844
|
+
limit: ut
|
|
841
845
|
}),
|
|
842
846
|
this.#e.listFlowTriggerBindings(e.flowId)
|
|
843
847
|
]);
|
|
@@ -847,7 +851,7 @@ var pt = class {
|
|
|
847
851
|
if (t != null && t != "") try {
|
|
848
852
|
return await this.#e.getPublishOperation(e.flowId, t);
|
|
849
853
|
} catch (t) {
|
|
850
|
-
if (t instanceof
|
|
854
|
+
if (t instanceof B && t.code == "publication.operation-not-found") {
|
|
851
855
|
this.#a.setItem(this.#_(e.flowId), "");
|
|
852
856
|
return;
|
|
853
857
|
}
|
|
@@ -857,12 +861,12 @@ var pt = class {
|
|
|
857
861
|
async #g(e, t, n, r) {
|
|
858
862
|
let i = t;
|
|
859
863
|
for (; i.status == "pending";) {
|
|
860
|
-
if (await new Promise((e) => setTimeout(e,
|
|
864
|
+
if (await new Promise((e) => setTimeout(e, dt)), !n()) return !1;
|
|
861
865
|
try {
|
|
862
866
|
i = await this.#e.getPublishOperation(e.flowId, i.operationId);
|
|
863
867
|
} catch (t) {
|
|
864
868
|
if (!n()) return !1;
|
|
865
|
-
if (t instanceof
|
|
869
|
+
if (t instanceof B && t.code == "publication.operation-not-found") return this.#a.setItem(this.#_(e.flowId), ""), this.#v(e, {
|
|
866
870
|
operation: void 0,
|
|
867
871
|
publishing: !1
|
|
868
872
|
}), this.#c(D(t, this.#n.t)), !1;
|
|
@@ -893,8 +897,8 @@ var pt = class {
|
|
|
893
897
|
return `publish-operation:${e}`;
|
|
894
898
|
}
|
|
895
899
|
#v(e, t) {
|
|
896
|
-
|
|
897
|
-
...
|
|
900
|
+
Y(this.#l.value.target, e) ? this.#y(t) : this.#l.set({
|
|
901
|
+
...J,
|
|
898
902
|
...t,
|
|
899
903
|
target: e
|
|
900
904
|
});
|
|
@@ -905,12 +909,12 @@ var pt = class {
|
|
|
905
909
|
...e
|
|
906
910
|
});
|
|
907
911
|
}
|
|
908
|
-
},
|
|
909
|
-
function
|
|
912
|
+
}, pt = { starting: !1 };
|
|
913
|
+
function mt(e) {
|
|
910
914
|
switch (e.kind) {
|
|
911
915
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
912
|
-
case "subflow": return
|
|
913
|
-
case "task": return
|
|
916
|
+
case "subflow": return m(e.definition?.inputs ?? []);
|
|
917
|
+
case "task": return m(e.definition?.inputs ?? []);
|
|
914
918
|
case "value": return {};
|
|
915
919
|
case "wait": return { value: {
|
|
916
920
|
jsonSchema: {},
|
|
@@ -919,15 +923,15 @@ function ht(e) {
|
|
|
919
923
|
} };
|
|
920
924
|
}
|
|
921
925
|
}
|
|
922
|
-
function
|
|
926
|
+
function ht(e) {
|
|
923
927
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
924
928
|
}
|
|
925
|
-
async function
|
|
926
|
-
let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-
|
|
929
|
+
async function gt(e, t) {
|
|
930
|
+
let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-DDidwd8h.js").then((e) => e.r), r = L(e), i = r.graph({ kind: "flow" });
|
|
927
931
|
return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
|
|
928
932
|
let a = r.resolveNode(e, i);
|
|
929
933
|
if (a.kind == "trigger") return [];
|
|
930
|
-
let o = Object.entries(
|
|
934
|
+
let o = Object.entries(mt(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
931
935
|
handle: e,
|
|
932
936
|
jsonSchema: t.jsonSchema,
|
|
933
937
|
nullable: t.nullable
|
|
@@ -935,21 +939,21 @@ async function _t(e, t) {
|
|
|
935
939
|
return o.length == 0 ? [] : [{
|
|
936
940
|
editor: new n(o, t),
|
|
937
941
|
nodeId: e,
|
|
938
|
-
title:
|
|
942
|
+
title: ht(a)
|
|
939
943
|
}];
|
|
940
944
|
});
|
|
941
945
|
}
|
|
942
|
-
var
|
|
946
|
+
var _t = class {
|
|
943
947
|
#e;
|
|
944
948
|
#t;
|
|
945
949
|
#n;
|
|
946
|
-
#r = new
|
|
947
|
-
#i = new
|
|
950
|
+
#r = new I();
|
|
951
|
+
#i = new I();
|
|
948
952
|
#a;
|
|
949
953
|
#o;
|
|
950
|
-
#s = t(
|
|
954
|
+
#s = t(pt);
|
|
951
955
|
#c;
|
|
952
|
-
constructor(t, n, r, i =
|
|
956
|
+
constructor(t, n, r, i = R(), a = () => crypto.randomUUID()) {
|
|
953
957
|
this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
|
|
954
958
|
inputRequest: e(this.#s, (e) => e.inputRequest),
|
|
955
959
|
starting: e(this.#s, (e) => e.starting),
|
|
@@ -964,7 +968,7 @@ var vt = class {
|
|
|
964
968
|
reset() {
|
|
965
969
|
this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
|
|
966
970
|
let e = this.#s.value.inputRequest;
|
|
967
|
-
this.#s.set(
|
|
971
|
+
this.#s.set(pt), this.#d(e);
|
|
968
972
|
}
|
|
969
973
|
async requestDraft(e, t) {
|
|
970
974
|
let n = this.#i.begin();
|
|
@@ -1007,7 +1011,7 @@ var vt = class {
|
|
|
1007
1011
|
}), this.#d(s);
|
|
1008
1012
|
let c;
|
|
1009
1013
|
try {
|
|
1010
|
-
c = await
|
|
1014
|
+
c = await gt(r, this.#n.lang$);
|
|
1011
1015
|
} catch (e) {
|
|
1012
1016
|
throw a() && this.#f({
|
|
1013
1017
|
starting: !1,
|
|
@@ -1083,18 +1087,18 @@ var vt = class {
|
|
|
1083
1087
|
...e
|
|
1084
1088
|
});
|
|
1085
1089
|
}
|
|
1086
|
-
},
|
|
1090
|
+
}, vt = {
|
|
1087
1091
|
actions: {},
|
|
1088
1092
|
catalogs: {}
|
|
1089
1093
|
};
|
|
1090
|
-
function
|
|
1094
|
+
function yt(e) {
|
|
1091
1095
|
return Object.entries(e).map(([e, t]) => ({
|
|
1092
1096
|
description: t.description,
|
|
1093
1097
|
handle: e,
|
|
1094
1098
|
jsonSchema: t.jsonSchema
|
|
1095
1099
|
}));
|
|
1096
1100
|
}
|
|
1097
|
-
function
|
|
1101
|
+
function X(e, t) {
|
|
1098
1102
|
return {
|
|
1099
1103
|
connector: e,
|
|
1100
1104
|
description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
|
|
@@ -1104,13 +1108,13 @@ function J(e, t) {
|
|
|
1104
1108
|
group: t("addNode.connectorActions"),
|
|
1105
1109
|
icon: T(e),
|
|
1106
1110
|
id: `connector:${e.actionId}`,
|
|
1107
|
-
inputs:
|
|
1111
|
+
inputs: yt(e.inputs),
|
|
1108
1112
|
kind: "connector",
|
|
1109
1113
|
label: e.name,
|
|
1110
|
-
outputs:
|
|
1114
|
+
outputs: yt(e.outputs)
|
|
1111
1115
|
};
|
|
1112
1116
|
}
|
|
1113
|
-
function
|
|
1117
|
+
function bt(e, t) {
|
|
1114
1118
|
let n = /* @__PURE__ */ new Map();
|
|
1115
1119
|
for (let t of e) {
|
|
1116
1120
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -1118,7 +1122,7 @@ function xt(e, t) {
|
|
|
1118
1122
|
}
|
|
1119
1123
|
return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
|
|
1120
1124
|
let n = e[0], r = e.map((e) => {
|
|
1121
|
-
let n =
|
|
1125
|
+
let n = X(e, t);
|
|
1122
1126
|
return {
|
|
1123
1127
|
description: n.description,
|
|
1124
1128
|
label: n.label,
|
|
@@ -1139,7 +1143,7 @@ function xt(e, t) {
|
|
|
1139
1143
|
};
|
|
1140
1144
|
});
|
|
1141
1145
|
}
|
|
1142
|
-
function
|
|
1146
|
+
function xt(e, t) {
|
|
1143
1147
|
return {
|
|
1144
1148
|
choices: [],
|
|
1145
1149
|
description: t("addNode.connectorBrowseActions"),
|
|
@@ -1153,7 +1157,7 @@ function St(e, t) {
|
|
|
1153
1157
|
serviceId: e.serviceId
|
|
1154
1158
|
};
|
|
1155
1159
|
}
|
|
1156
|
-
function
|
|
1160
|
+
function St(e, t) {
|
|
1157
1161
|
if (e == null) return;
|
|
1158
1162
|
let n = e.kind == "wait" ? e.node.notification?.taskId : e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
|
|
1159
1163
|
if (n == null) return;
|
|
@@ -1165,7 +1169,7 @@ function Ct(e, t) {
|
|
|
1165
1169
|
taskId: n
|
|
1166
1170
|
};
|
|
1167
1171
|
}
|
|
1168
|
-
function
|
|
1172
|
+
function Ct(e, t, n) {
|
|
1169
1173
|
if (e == null) return [];
|
|
1170
1174
|
let r = [];
|
|
1171
1175
|
for (let i of [...O(e.revision.content).tasks].toSorted()) {
|
|
@@ -1185,7 +1189,7 @@ function wt(e, t, n) {
|
|
|
1185
1189
|
}
|
|
1186
1190
|
return r;
|
|
1187
1191
|
}
|
|
1188
|
-
var
|
|
1192
|
+
var wt = class {
|
|
1189
1193
|
#e;
|
|
1190
1194
|
#t;
|
|
1191
1195
|
#n;
|
|
@@ -1202,13 +1206,13 @@ var Tt = class {
|
|
|
1202
1206
|
#p;
|
|
1203
1207
|
#m;
|
|
1204
1208
|
#h;
|
|
1205
|
-
constructor(r, i, a, o, s =
|
|
1206
|
-
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new
|
|
1209
|
+
constructor(r, i, a, o, s = R()) {
|
|
1210
|
+
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new I(), this.#o = new I(), this.#d = t(vt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
|
|
1207
1211
|
if (this.#h) return;
|
|
1208
1212
|
let t = this.#f.$.flowId.value;
|
|
1209
1213
|
if (t == null) return;
|
|
1210
1214
|
let n = this.#m ?? await this.#e.listConnectorProviders(e, t);
|
|
1211
|
-
if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) =>
|
|
1215
|
+
if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => xt(e, this.#t.t));
|
|
1212
1216
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
1213
1217
|
if (this.#h) return;
|
|
1214
1218
|
let n = this.#f.$.flowId.value, r = this.#m?.find((t) => `connector-provider:${t.serviceId}` == e);
|
|
@@ -1219,7 +1223,7 @@ var Tt = class {
|
|
|
1219
1223
|
return this.#r.set(r.serviceId, a), this.#b({ actions: {
|
|
1220
1224
|
...this.#d.value.actions,
|
|
1221
1225
|
...Object.fromEntries(a.map((e) => [e.actionId, e]))
|
|
1222
|
-
} }), a.map((e) =>
|
|
1226
|
+
} }), a.map((e) => X(e, this.#t.t));
|
|
1223
1227
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1224
1228
|
if (this.#h) return;
|
|
1225
1229
|
let n = this.#f.$.flowId.value;
|
|
@@ -1228,17 +1232,17 @@ var Tt = class {
|
|
|
1228
1232
|
if (t.aborted || this.#h || n != this.#f.$.flowId.value) return;
|
|
1229
1233
|
let a = { ...this.#d.value.actions };
|
|
1230
1234
|
for (let e of i) a[e.actionId] = e;
|
|
1231
|
-
if (this.#b({ actions: a }), r.length != 0) return i.map((e) =>
|
|
1235
|
+
if (this.#b({ actions: a }), r.length != 0) return i.map((e) => X(e, this.#t.t));
|
|
1232
1236
|
let o = new Map(i.map((e) => [e.actionId, e]));
|
|
1233
1237
|
for (let e of this.#f.$.revision.value?.connectorActionIds ?? []) {
|
|
1234
1238
|
let t = a[e];
|
|
1235
1239
|
t != null && o.set(e, t);
|
|
1236
1240
|
}
|
|
1237
|
-
return
|
|
1241
|
+
return bt([...o.values()], this.#t.t);
|
|
1238
1242
|
}, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t = s;
|
|
1239
1243
|
let c = e(this.#d, (e) => e.actions), l = e(this.#d, (e) => e.catalogs);
|
|
1240
1244
|
this.#l = n((e) => {
|
|
1241
|
-
let t =
|
|
1245
|
+
let t = St(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
|
|
1242
1246
|
if (t == null) return { authorizationPending: !1 };
|
|
1243
1247
|
let r = n.actions[t.actionId], a = r == null ? void 0 : n.catalogs[r.serviceId], o = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
|
|
1244
1248
|
return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
|
|
@@ -1254,7 +1258,7 @@ var Tt = class {
|
|
|
1254
1258
|
actions: c,
|
|
1255
1259
|
catalogs: l,
|
|
1256
1260
|
connectionLoading: e(this.#d, (e) => e.connectionLoading),
|
|
1257
|
-
diagnostics: n((e) =>
|
|
1261
|
+
diagnostics: n((e) => Ct(e(i.$.revision), e(c), e(l))),
|
|
1258
1262
|
selectedAction: e(this.#l, (e) => e.action),
|
|
1259
1263
|
selectedActionError: e(this.#l, (e) => e.actionError),
|
|
1260
1264
|
selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
|
|
@@ -1269,11 +1273,11 @@ var Tt = class {
|
|
|
1269
1273
|
this.#l.dispose(), this.#d.dispose();
|
|
1270
1274
|
}
|
|
1271
1275
|
reset() {
|
|
1272
|
-
this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(
|
|
1276
|
+
this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(vt));
|
|
1273
1277
|
}
|
|
1274
1278
|
async refresh(e = !1) {
|
|
1275
1279
|
if (this.#h) return;
|
|
1276
|
-
let t = this.#o.begin(), n = this.#f.$.flowId.value, r =
|
|
1280
|
+
let t = this.#o.begin(), n = this.#f.$.flowId.value, r = St(this.#f.$.selection.value, this.#f.$.revision.value);
|
|
1277
1281
|
if (n == null || r == null) {
|
|
1278
1282
|
(this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#b({
|
|
1279
1283
|
actionLoading: void 0,
|
|
@@ -1409,8 +1413,8 @@ var Tt = class {
|
|
|
1409
1413
|
}
|
|
1410
1414
|
await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
|
|
1411
1415
|
}
|
|
1412
|
-
},
|
|
1413
|
-
function
|
|
1416
|
+
}, Tt = { catalogs: {} }, Et = "trigger:";
|
|
1417
|
+
function Z(e, t) {
|
|
1414
1418
|
if (e?.kind != "trigger") return;
|
|
1415
1419
|
let n = e.trigger;
|
|
1416
1420
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -1421,7 +1425,7 @@ function Y(e, t) {
|
|
|
1421
1425
|
triggerId: e.id
|
|
1422
1426
|
};
|
|
1423
1427
|
}
|
|
1424
|
-
function
|
|
1428
|
+
function Dt(e, t) {
|
|
1425
1429
|
return {
|
|
1426
1430
|
description: t.t("addNode.triggerNeedsConnection", { provider: e.provider }),
|
|
1427
1431
|
group: t.t("addNode.triggers"),
|
|
@@ -1429,7 +1433,7 @@ function Ot(e, t) {
|
|
|
1429
1433
|
serviceId: e.provider,
|
|
1430
1434
|
serviceName: e.provider
|
|
1431
1435
|
}),
|
|
1432
|
-
id: `${
|
|
1436
|
+
id: `${Et}${e.key}`,
|
|
1433
1437
|
inputs: [],
|
|
1434
1438
|
kind: "trigger",
|
|
1435
1439
|
label: e.displayName,
|
|
@@ -1443,7 +1447,7 @@ function Ot(e, t) {
|
|
|
1443
1447
|
}
|
|
1444
1448
|
};
|
|
1445
1449
|
}
|
|
1446
|
-
var
|
|
1450
|
+
var Ot = class {
|
|
1447
1451
|
#e;
|
|
1448
1452
|
#t;
|
|
1449
1453
|
#n;
|
|
@@ -1455,12 +1459,12 @@ var kt = class {
|
|
|
1455
1459
|
#c;
|
|
1456
1460
|
#l;
|
|
1457
1461
|
#u;
|
|
1458
|
-
constructor(r, i, a, o, s =
|
|
1459
|
-
this.#t = new AbortController(), this.#a = new
|
|
1462
|
+
constructor(r, i, a, o, s = R()) {
|
|
1463
|
+
this.#t = new AbortController(), this.#a = new I(), this.#c = t(Tt), this.#u = !1, this.browseAddNodeOptions = async (e) => {
|
|
1460
1464
|
let t = this.#l.$.flowId.value;
|
|
1461
1465
|
if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
1462
1466
|
let n = await this.#d();
|
|
1463
|
-
if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) =>
|
|
1467
|
+
if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => Dt(e, this.#i));
|
|
1464
1468
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
1465
1469
|
let n = this.#l.$.flowId.value;
|
|
1466
1470
|
if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
@@ -1474,9 +1478,9 @@ var kt = class {
|
|
|
1474
1478
|
e.name,
|
|
1475
1479
|
e.provider,
|
|
1476
1480
|
e.type
|
|
1477
|
-
].some((e) => e.toLowerCase().includes(r))).map((e) =>
|
|
1481
|
+
].some((e) => e.toLowerCase().includes(r))).map((e) => Dt(e, this.#i));
|
|
1478
1482
|
}, this.#n = r, this.#r = o, this.#i = s, this.#s = a, this.#l = i, this.#o = n((e) => {
|
|
1479
|
-
let t = e(i.$.selection), n =
|
|
1483
|
+
let t = e(i.$.selection), n = Z(t, i), r = e(this.#c);
|
|
1480
1484
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
1481
1485
|
let a = t.trigger;
|
|
1482
1486
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
@@ -1503,10 +1507,10 @@ var kt = class {
|
|
|
1503
1507
|
this.#o.dispose(), this.#c.dispose();
|
|
1504
1508
|
}
|
|
1505
1509
|
reset() {
|
|
1506
|
-
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(
|
|
1510
|
+
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(Tt));
|
|
1507
1511
|
}
|
|
1508
1512
|
async refresh(e = !1) {
|
|
1509
|
-
let t = this.#a.begin(), n = this.#l.$.flowId.value, r =
|
|
1513
|
+
let t = this.#a.begin(), n = this.#l.$.flowId.value, r = Z(this.#l.$.selection.value, this.#l);
|
|
1510
1514
|
if (!this.#u) {
|
|
1511
1515
|
if (n == null || r == null) {
|
|
1512
1516
|
this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
|
|
@@ -1563,7 +1567,7 @@ var kt = class {
|
|
|
1563
1567
|
delete t[e], this.#f({
|
|
1564
1568
|
authorizationProvider: void 0,
|
|
1565
1569
|
catalogs: t
|
|
1566
|
-
}),
|
|
1570
|
+
}), Z(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
|
|
1567
1571
|
}
|
|
1568
1572
|
#d() {
|
|
1569
1573
|
if (this.#e != null) return this.#e;
|
|
@@ -1583,46 +1587,28 @@ var kt = class {
|
|
|
1583
1587
|
}
|
|
1584
1588
|
};
|
|
1585
1589
|
//#endregion
|
|
1586
|
-
//#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
|
|
1587
|
-
function At(e, t) {
|
|
1588
|
-
return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
|
|
1589
|
-
}
|
|
1590
|
-
function X(e, t, n, r) {
|
|
1591
|
-
for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
|
|
1592
|
-
}
|
|
1593
|
-
function jt(e, t, n, r) {
|
|
1594
|
-
let i = /* @__PURE__ */ new Set();
|
|
1595
|
-
for (let a of r) switch (a.kind) {
|
|
1596
|
-
case "graph.node.create":
|
|
1597
|
-
case "graph.node.replace":
|
|
1598
|
-
At(a.target, n) && i.add(a.nodeId);
|
|
1599
|
-
break;
|
|
1600
|
-
case "task.replace":
|
|
1601
|
-
X(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), X(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
|
|
1602
|
-
break;
|
|
1603
|
-
case "module.source.replace":
|
|
1604
|
-
X(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), X(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
|
|
1605
|
-
break;
|
|
1606
|
-
case "subflow.definition.replace": X(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), X(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
|
|
1607
|
-
}
|
|
1608
|
-
return new Set([...i].filter((e) => t.selection(n, e) != null));
|
|
1609
|
-
}
|
|
1610
|
-
//#endregion
|
|
1611
1590
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
1612
|
-
function
|
|
1613
|
-
if (e.length != 1) return;
|
|
1614
|
-
let
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1591
|
+
function kt(e, t) {
|
|
1592
|
+
if (e.length != 1 || t.length != 1) return;
|
|
1593
|
+
let n = e[0], r = t[0];
|
|
1594
|
+
if (n?.kind == "graph.node.field.set" && r?.kind == "graph.node.field.set") return n.nodeId != r.nodeId || n.field != r.field || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
|
|
1595
|
+
before: n.before,
|
|
1596
|
+
field: r.field,
|
|
1597
|
+
kind: r.kind,
|
|
1598
|
+
nodeId: r.nodeId,
|
|
1599
|
+
target: r.target,
|
|
1600
|
+
value: r.value
|
|
1601
|
+
}];
|
|
1602
|
+
if (n?.kind == "graph.node.input.set" && r?.kind == "graph.node.input.set") return n.nodeId != r.nodeId || n.handle != r.handle || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
|
|
1603
|
+
before: n.before,
|
|
1604
|
+
handle: r.handle,
|
|
1605
|
+
kind: r.kind,
|
|
1606
|
+
nodeId: r.nodeId,
|
|
1607
|
+
target: r.target,
|
|
1608
|
+
value: r.value
|
|
1609
|
+
}];
|
|
1624
1610
|
}
|
|
1625
|
-
var
|
|
1611
|
+
var At = class {
|
|
1626
1612
|
#e;
|
|
1627
1613
|
#t;
|
|
1628
1614
|
#n;
|
|
@@ -1648,54 +1634,70 @@ var Nt = class {
|
|
|
1648
1634
|
}
|
|
1649
1635
|
replaceCommitted(e) {
|
|
1650
1636
|
this.#a = e;
|
|
1637
|
+
let t = e, n = [];
|
|
1638
|
+
for (let e of this.#o) try {
|
|
1639
|
+
t = V(t, e.changes), n.push(e);
|
|
1640
|
+
} catch (t) {
|
|
1641
|
+
if (!(t instanceof h)) throw t;
|
|
1642
|
+
e.active = !1;
|
|
1643
|
+
}
|
|
1644
|
+
return this.#o = n, t;
|
|
1651
1645
|
}
|
|
1652
1646
|
project(e) {
|
|
1653
|
-
return this.#o.reduce((e, t) =>
|
|
1647
|
+
return this.#o.reduce((e, t) => V(e, t.changes), e);
|
|
1654
1648
|
}
|
|
1655
1649
|
enqueue(e) {
|
|
1656
1650
|
let t = this.#s.then(e);
|
|
1657
1651
|
return this.#s = t, t;
|
|
1658
1652
|
}
|
|
1659
1653
|
async change(e, t, n, r = !0) {
|
|
1660
|
-
this.#
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
let
|
|
1654
|
+
let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : kt(i.changes, n);
|
|
1655
|
+
if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
|
|
1656
|
+
this.#t.beforeChange(r);
|
|
1657
|
+
let o = {
|
|
1664
1658
|
...e,
|
|
1659
|
+
active: !0,
|
|
1660
|
+
changeId: crypto.randomUUID(),
|
|
1665
1661
|
changes: n,
|
|
1666
1662
|
started: !1
|
|
1667
1663
|
};
|
|
1668
|
-
this.#a ??= t, this.#o.push(
|
|
1669
|
-
let
|
|
1670
|
-
|
|
1664
|
+
this.#a ??= t, this.#o.push(o), this.#t.apply(this.project(this.#a)), this.#i += 1;
|
|
1665
|
+
let s = this.#s.then(() => (o.started = !0, this.#c(o)));
|
|
1666
|
+
o.result = s, this.#s = s.then(() => void 0);
|
|
1671
1667
|
try {
|
|
1672
|
-
return await
|
|
1668
|
+
return await s;
|
|
1673
1669
|
} finally {
|
|
1674
1670
|
--this.#i, this.#i == 0 && this.#t.finishChanges();
|
|
1675
1671
|
}
|
|
1676
1672
|
}
|
|
1677
1673
|
async #c(e) {
|
|
1678
1674
|
let t = !1;
|
|
1679
|
-
for (; this.#t.current(e);) {
|
|
1675
|
+
for (; e.active && this.#t.current(e);) {
|
|
1680
1676
|
let n = this.#a;
|
|
1681
1677
|
if (n == null) return;
|
|
1682
1678
|
try {
|
|
1683
|
-
let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes);
|
|
1679
|
+
let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes, e.changeId);
|
|
1684
1680
|
if (!this.#t.current(e)) return;
|
|
1685
1681
|
if (t.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft change response.");
|
|
1686
1682
|
let r = this.#l(e, n, t);
|
|
1687
1683
|
return this.#o.length == 0 && this.#t.check(), r;
|
|
1688
1684
|
} catch (n) {
|
|
1689
|
-
if (n instanceof
|
|
1685
|
+
if (n instanceof B && n.code == "flow.revision-conflict") {
|
|
1690
1686
|
if (!t && await this.#t.recover(e)) {
|
|
1691
|
-
t = !0;
|
|
1687
|
+
t = !0, e.changeId = crypto.randomUUID();
|
|
1692
1688
|
continue;
|
|
1693
1689
|
}
|
|
1694
|
-
t && await this.#t.recover(e), this.#u(e)
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1690
|
+
t && await this.#t.recover(e), this.#u(e);
|
|
1691
|
+
} else {
|
|
1692
|
+
if (!(n instanceof B) && !t) {
|
|
1693
|
+
let n = this.#a?.revisionId;
|
|
1694
|
+
if (await this.#t.recover(e)) {
|
|
1695
|
+
t = !0, e.active && this.#a?.revisionId != n && (e.changeId = crypto.randomUUID());
|
|
1696
|
+
continue;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
this.#u(e), this.#t.current(e) && this.#r(D(n, this.#n.t));
|
|
1700
|
+
}
|
|
1699
1701
|
return;
|
|
1700
1702
|
}
|
|
1701
1703
|
}
|
|
@@ -1703,28 +1705,28 @@ var Nt = class {
|
|
|
1703
1705
|
#l(e, t, n) {
|
|
1704
1706
|
let r = {
|
|
1705
1707
|
...n.revision,
|
|
1706
|
-
content:
|
|
1708
|
+
content: V(t, e.changes).content
|
|
1707
1709
|
};
|
|
1708
1710
|
this.#o = this.#o.filter((t) => t !== e), this.#a = r;
|
|
1709
1711
|
let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
|
|
1710
1712
|
return this.#t.apply(this.project(r), a), this.#t.headChanged(e.flowId, r.revisionId), r;
|
|
1711
1713
|
}
|
|
1712
1714
|
#u(e) {
|
|
1713
|
-
this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
|
|
1715
|
+
e.active = !1, this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
|
|
1714
1716
|
}
|
|
1715
|
-
},
|
|
1717
|
+
}, jt = 50, Mt = {
|
|
1716
1718
|
failed: !1,
|
|
1717
1719
|
loaded: !1,
|
|
1718
1720
|
loading: !0,
|
|
1719
1721
|
loadingMore: !1,
|
|
1720
1722
|
loadMoreFailed: !1,
|
|
1721
1723
|
flows: []
|
|
1722
|
-
},
|
|
1724
|
+
}, Nt = class {
|
|
1723
1725
|
#e;
|
|
1724
1726
|
#t;
|
|
1725
|
-
#n = new
|
|
1727
|
+
#n = new I();
|
|
1726
1728
|
#r;
|
|
1727
|
-
#i = t(
|
|
1729
|
+
#i = t(Mt);
|
|
1728
1730
|
#a = !1;
|
|
1729
1731
|
constructor(t, n, r) {
|
|
1730
1732
|
this.#e = t, this.#t = r, this.#r = n, this.$ = {
|
|
@@ -1766,7 +1768,7 @@ var Nt = class {
|
|
|
1766
1768
|
try {
|
|
1767
1769
|
let t = await this.#e.listFlows({
|
|
1768
1770
|
includeTotal: !0,
|
|
1769
|
-
limit:
|
|
1771
|
+
limit: jt
|
|
1770
1772
|
});
|
|
1771
1773
|
if (!e()) return;
|
|
1772
1774
|
this.#o({
|
|
@@ -1795,7 +1797,7 @@ var Nt = class {
|
|
|
1795
1797
|
try {
|
|
1796
1798
|
let e = await this.#e.listFlows({
|
|
1797
1799
|
cursor: t,
|
|
1798
|
-
limit:
|
|
1800
|
+
limit: jt
|
|
1799
1801
|
});
|
|
1800
1802
|
if (!n()) return;
|
|
1801
1803
|
let r = new Set(this.#i.value.flows.map((e) => e.flowId));
|
|
@@ -1851,7 +1853,7 @@ var Nt = class {
|
|
|
1851
1853
|
...e
|
|
1852
1854
|
});
|
|
1853
1855
|
}
|
|
1854
|
-
},
|
|
1856
|
+
}, Pt = class {
|
|
1855
1857
|
#e;
|
|
1856
1858
|
#t;
|
|
1857
1859
|
#n;
|
|
@@ -1894,7 +1896,7 @@ var Nt = class {
|
|
|
1894
1896
|
this.#c(a, r);
|
|
1895
1897
|
} catch (r) {
|
|
1896
1898
|
if (this.#o || !n()) return;
|
|
1897
|
-
if (r instanceof
|
|
1899
|
+
if (r instanceof B && r.code == "flow.presentation-conflict") try {
|
|
1898
1900
|
let t = await this.#e.getPresentation(e);
|
|
1899
1901
|
if (this.#o || !n()) return;
|
|
1900
1902
|
this.#c(a, t), this.#n({
|
|
@@ -1916,21 +1918,21 @@ var Nt = class {
|
|
|
1916
1918
|
value: n
|
|
1917
1919
|
});
|
|
1918
1920
|
}
|
|
1919
|
-
},
|
|
1921
|
+
}, Ft = {
|
|
1920
1922
|
checkLoading: !1,
|
|
1921
1923
|
selectedNodeIds: [],
|
|
1922
1924
|
workspaceLoadFailed: !1,
|
|
1923
1925
|
workspaceLoading: !1
|
|
1924
1926
|
};
|
|
1925
|
-
function
|
|
1927
|
+
function It(e) {
|
|
1926
1928
|
return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
|
|
1927
1929
|
}
|
|
1928
|
-
function
|
|
1930
|
+
function Q(e, t) {
|
|
1929
1931
|
if (t.phase != null) return t.phase;
|
|
1930
1932
|
let n = e?.content.modules[t.moduleId];
|
|
1931
1933
|
return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
|
|
1932
1934
|
}
|
|
1933
|
-
function
|
|
1935
|
+
function $(e, t, n) {
|
|
1934
1936
|
if (e == null || t == null || n.length != 1) return;
|
|
1935
1937
|
let r = e.node(t, n[0]);
|
|
1936
1938
|
if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
|
|
@@ -1938,9 +1940,9 @@ function Q(e, t, n) {
|
|
|
1938
1940
|
source: r.module.source
|
|
1939
1941
|
};
|
|
1940
1942
|
}
|
|
1941
|
-
var
|
|
1943
|
+
var Lt = class {
|
|
1942
1944
|
#e;
|
|
1943
|
-
#t = t(
|
|
1945
|
+
#t = t(Ft);
|
|
1944
1946
|
#n;
|
|
1945
1947
|
constructor(t, r) {
|
|
1946
1948
|
let i = e(this.#t, (e) => e.busy), a = e(this.#t, (e) => e.checkLoading), o = e(this.#t, (e) => e.diagnosticFocus), s = e(this.#t, (e) => e.diagnostics), c = e(this.#t, (e) => e.draft), l = e(this.#t, (e) => {
|
|
@@ -1948,25 +1950,25 @@ var Bt = class {
|
|
|
1948
1950
|
let { phase: t, ...n } = e.moduleEditor;
|
|
1949
1951
|
return {
|
|
1950
1952
|
...n,
|
|
1951
|
-
status:
|
|
1953
|
+
status: Q(e.draft, e.moduleEditor)
|
|
1952
1954
|
};
|
|
1953
|
-
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 :
|
|
1955
|
+
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : L(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
|
|
1954
1956
|
this.#e = e(this.#t, (e) => ({
|
|
1955
|
-
revision: e.draft == null ? void 0 :
|
|
1957
|
+
revision: e.draft == null ? void 0 : L(e.draft),
|
|
1956
1958
|
target: e.target
|
|
1957
1959
|
}), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
|
|
1958
1960
|
let y = e(this.#t, (e) => {
|
|
1959
|
-
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return
|
|
1961
|
+
if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return L(e.draft).selection(e.target, e.selectedNodeIds[0]);
|
|
1960
1962
|
});
|
|
1961
1963
|
this.$ = {
|
|
1962
1964
|
addNodeOptions: n((e) => {
|
|
1963
1965
|
let { revision: n, target: r } = e(this.#e);
|
|
1964
|
-
return
|
|
1966
|
+
return Pe(n?.revision, r, e(t.t$));
|
|
1965
1967
|
}),
|
|
1966
1968
|
busy: i,
|
|
1967
1969
|
checkLoading: a,
|
|
1968
1970
|
diagnosticFocus: o,
|
|
1969
|
-
diagnosticItems: e(this.#t, (e) => E(e.draft == null ? void 0 :
|
|
1971
|
+
diagnosticItems: e(this.#t, (e) => E(e.draft == null ? void 0 : L(e.draft), e.target, e.diagnostics)),
|
|
1970
1972
|
diagnostics: s,
|
|
1971
1973
|
draft: c,
|
|
1972
1974
|
flow: n((e) => {
|
|
@@ -1981,7 +1983,7 @@ var Bt = class {
|
|
|
1981
1983
|
flowNextCursor: r.$.nextCursor,
|
|
1982
1984
|
flowTotal: r.$.total,
|
|
1983
1985
|
flows: r.$.flows,
|
|
1984
|
-
inspectorDiagnostics: e(this.#t, (e) => te(e.draft == null ? void 0 :
|
|
1986
|
+
inspectorDiagnostics: e(this.#t, (e) => te(e.draft == null ? void 0 : L(e.draft), e.target, e.diagnostics, y.value)),
|
|
1985
1987
|
live: p,
|
|
1986
1988
|
moduleDiagnostics: e(this.#t, (e) => {
|
|
1987
1989
|
let t = e.moduleEditor?.moduleId;
|
|
@@ -1993,11 +1995,11 @@ var Bt = class {
|
|
|
1993
1995
|
revision: m,
|
|
1994
1996
|
selection: y,
|
|
1995
1997
|
selectedNodeIds: h,
|
|
1996
|
-
status: e(this.#t,
|
|
1998
|
+
status: e(this.#t, It),
|
|
1997
1999
|
target: g,
|
|
1998
2000
|
targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
1999
2001
|
targetName: e(this.#t, (e) => {
|
|
2000
|
-
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id :
|
|
2002
|
+
if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : L(e.draft).subflow(e.target.id)?.name ?? e.target.id;
|
|
2001
2003
|
}),
|
|
2002
2004
|
workspaceLoadFailed: _,
|
|
2003
2005
|
workspaceLoading: v
|
|
@@ -2016,17 +2018,16 @@ var Bt = class {
|
|
|
2016
2018
|
for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
|
|
2017
2019
|
this.#e.dispose(), this.#t.dispose();
|
|
2018
2020
|
}
|
|
2019
|
-
}
|
|
2020
|
-
|
|
2021
|
+
};
|
|
2022
|
+
//#endregion
|
|
2023
|
+
//#region src/workbench/browser/runtime/stores/workspaceStore.ts
|
|
2024
|
+
function Rt(e, t) {
|
|
2021
2025
|
if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
|
|
2022
2026
|
}
|
|
2023
|
-
|
|
2024
|
-
return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
|
|
2025
|
-
}
|
|
2026
|
-
var Ut = class {
|
|
2027
|
+
var zt = class {
|
|
2027
2028
|
#e;
|
|
2028
2029
|
#t;
|
|
2029
|
-
#n = new
|
|
2030
|
+
#n = new I();
|
|
2030
2031
|
#r;
|
|
2031
2032
|
#i;
|
|
2032
2033
|
#a;
|
|
@@ -2037,36 +2038,33 @@ var Ut = class {
|
|
|
2037
2038
|
#u;
|
|
2038
2039
|
#d = 0;
|
|
2039
2040
|
#f = 0;
|
|
2040
|
-
#p;
|
|
2041
|
-
#m =
|
|
2041
|
+
#p = !1;
|
|
2042
|
+
#m = !1;
|
|
2042
2043
|
#h = !1;
|
|
2043
|
-
#g =
|
|
2044
|
-
#_
|
|
2045
|
-
#v
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
constructor(e, t, n = lt, r = L(), i = () => {}) {
|
|
2050
|
-
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new It(e, t, r), this.#l = new Bt(r, this.#o), this.#t = new Nt(e, t, r, {
|
|
2051
|
-
apply: (e, t) => this.#w(e, t),
|
|
2044
|
+
#g = 0;
|
|
2045
|
+
#_;
|
|
2046
|
+
#v;
|
|
2047
|
+
constructor(e, t, n = ct, r = R(), i = () => {}) {
|
|
2048
|
+
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new Nt(e, t, r), this.#l = new Lt(r, this.#o), this.#t = new At(e, t, r, {
|
|
2049
|
+
apply: (e, t) => this.#x(e, t),
|
|
2052
2050
|
beforeChange: (e) => {
|
|
2053
|
-
|
|
2051
|
+
e && (this.#N({ busy: "designer" }), this.#c(void 0));
|
|
2054
2052
|
},
|
|
2055
|
-
check: () => void this.#
|
|
2056
|
-
current: (e) => this.#
|
|
2053
|
+
check: () => void this.#C(),
|
|
2054
|
+
current: (e) => this.#M(e),
|
|
2057
2055
|
diagnostics: () => this.#l.value.diagnostics,
|
|
2058
2056
|
finishChanges: () => {
|
|
2059
|
-
!this.#
|
|
2057
|
+
!this.#m && this.#l.value.busy == "designer" && this.#N({ busy: void 0 });
|
|
2060
2058
|
},
|
|
2061
|
-
headChanged: (e, t) => this.#
|
|
2062
|
-
recover: (e) => this.#
|
|
2063
|
-
}), this.#a = new
|
|
2059
|
+
headChanged: (e, t) => this.#E(e, t),
|
|
2060
|
+
recover: (e) => this.#T(e, !0)
|
|
2061
|
+
}), this.#a = new Pt(e, t, (e) => this.#N({ presentation: e }), r), this.$ = this.#l.$;
|
|
2064
2062
|
}
|
|
2065
2063
|
dispose() {
|
|
2066
|
-
this.#
|
|
2064
|
+
this.#m = !0, this.#n.invalidate(), this.#a.dispose(), this.#_?.(), this.#v?.(), this.#l.dispose(), this.#o.dispose();
|
|
2067
2065
|
}
|
|
2068
2066
|
async start(e) {
|
|
2069
|
-
this.#
|
|
2067
|
+
this.#_ ??= this.#e.watchFlowCatalog(() => void this.reloadFlows()), await this.reloadFlows(), await this.selectFlow(e);
|
|
2070
2068
|
}
|
|
2071
2069
|
async reloadFlows() {
|
|
2072
2070
|
await this.#o.reload();
|
|
@@ -2075,10 +2073,9 @@ var Ut = class {
|
|
|
2075
2073
|
await this.#o.loadMore();
|
|
2076
2074
|
}
|
|
2077
2075
|
async selectFlow(e) {
|
|
2078
|
-
if (!this.#
|
|
2079
|
-
this.#M();
|
|
2076
|
+
if (!this.#O()) return !1;
|
|
2080
2077
|
let t = this.#n.begin();
|
|
2081
|
-
if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#
|
|
2078
|
+
if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#p = !1, this.#h = !1, this.#v?.(), this.#v = void 0, this.#N({
|
|
2082
2079
|
checkLoading: !1,
|
|
2083
2080
|
diagnosticFocus: void 0,
|
|
2084
2081
|
diagnostics: void 0,
|
|
@@ -2101,18 +2098,18 @@ var Ut = class {
|
|
|
2101
2098
|
this.#e.getPresentation(e)
|
|
2102
2099
|
]);
|
|
2103
2100
|
if (!t()) return !1;
|
|
2104
|
-
this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#
|
|
2101
|
+
this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#N({
|
|
2105
2102
|
draft: i,
|
|
2106
2103
|
live: a,
|
|
2107
2104
|
presentation: o,
|
|
2108
2105
|
target: { kind: "flow" },
|
|
2109
2106
|
workspaceLoadFailed: !1,
|
|
2110
2107
|
workspaceLoading: !1
|
|
2111
|
-
}), this.#
|
|
2112
|
-
!this.#
|
|
2108
|
+
}), this.#C(), this.#v = this.#e.watchFlow(e, (e) => {
|
|
2109
|
+
!this.#m && e != this.#t.committed?.revisionId && this.#w(e);
|
|
2113
2110
|
}, this.#s);
|
|
2114
2111
|
} catch (e) {
|
|
2115
|
-
return t() ? (this.#
|
|
2112
|
+
return t() ? (this.#N({
|
|
2116
2113
|
workspaceLoadFailed: !0,
|
|
2117
2114
|
workspaceLoading: !1
|
|
2118
2115
|
}), this.#c(D(e, this.#r.t)), !1) : !1;
|
|
@@ -2120,59 +2117,59 @@ var Ut = class {
|
|
|
2120
2117
|
return !0;
|
|
2121
2118
|
}
|
|
2122
2119
|
selectTarget(e) {
|
|
2123
|
-
return this.#
|
|
2120
|
+
return this.#O() ? (this.#N({
|
|
2124
2121
|
diagnosticFocus: void 0,
|
|
2125
2122
|
diagnostics: void 0,
|
|
2126
2123
|
moduleEditor: void 0,
|
|
2127
2124
|
nodeFocus: void 0,
|
|
2128
2125
|
selectedNodeIds: [],
|
|
2129
2126
|
target: e
|
|
2130
|
-
}), this.#
|
|
2127
|
+
}), this.#C(), !0) : !1;
|
|
2131
2128
|
}
|
|
2132
2129
|
selectNodes(e) {
|
|
2133
|
-
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#
|
|
2130
|
+
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#O() ? (this.#N({
|
|
2134
2131
|
diagnosticFocus: void 0,
|
|
2135
|
-
moduleEditor:
|
|
2132
|
+
moduleEditor: $(this.#l.value.draft == null ? void 0 : L(this.#l.value.draft), this.#l.value.target, e),
|
|
2136
2133
|
nodeFocus: void 0,
|
|
2137
2134
|
selectedNodeIds: e
|
|
2138
2135
|
}), !0) : !1;
|
|
2139
2136
|
}
|
|
2140
2137
|
async createFlow(e, t) {
|
|
2141
|
-
if (this.#
|
|
2142
|
-
this.#
|
|
2138
|
+
if (this.#O()) {
|
|
2139
|
+
this.#N({ busy: "flow" }), this.#c(void 0);
|
|
2143
2140
|
try {
|
|
2144
2141
|
if (t == null) return await this.#o.create(e);
|
|
2145
2142
|
let n = await this.#e.getFlow(await t(e));
|
|
2146
2143
|
return this.#o.insert(n), n;
|
|
2147
2144
|
} catch (e) {
|
|
2148
|
-
this.#
|
|
2145
|
+
this.#m || this.#c(D(e, this.#r.t));
|
|
2149
2146
|
} finally {
|
|
2150
|
-
this.#
|
|
2147
|
+
this.#N({ busy: void 0 });
|
|
2151
2148
|
}
|
|
2152
2149
|
}
|
|
2153
2150
|
}
|
|
2154
2151
|
async deleteFlow(e) {
|
|
2155
|
-
if (!this.#
|
|
2152
|
+
if (!this.#O()) return !1;
|
|
2156
2153
|
let t = this.#o.flow(e);
|
|
2157
2154
|
if (t == null || t.status == "retiring") return !1;
|
|
2158
|
-
this.#
|
|
2155
|
+
this.#N({ busy: "flow" }), this.#c(void 0);
|
|
2159
2156
|
try {
|
|
2160
|
-
return await this.#e.deleteFlow(e), !this.#
|
|
2157
|
+
return await this.#e.deleteFlow(e), !this.#m && (this.#o.remove(e), this.#c({
|
|
2161
2158
|
kind: "success",
|
|
2162
2159
|
message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
|
|
2163
2160
|
}), !0);
|
|
2164
2161
|
} catch (e) {
|
|
2165
|
-
return this.#
|
|
2162
|
+
return this.#m || this.#c(D(e, this.#r.t)), !1;
|
|
2166
2163
|
} finally {
|
|
2167
|
-
this.#
|
|
2164
|
+
this.#N({ busy: void 0 });
|
|
2168
2165
|
}
|
|
2169
2166
|
}
|
|
2170
2167
|
async createResource(e) {
|
|
2171
|
-
if (!this.#
|
|
2168
|
+
if (!this.#O() || this.#l.value.draft == null) return !1;
|
|
2172
2169
|
let t = this.#i();
|
|
2173
|
-
this.#
|
|
2174
|
-
let n = await this.#
|
|
2175
|
-
return this.#
|
|
2170
|
+
this.#N({ busy: "resource" }), this.#c(void 0);
|
|
2171
|
+
let n = await this.#b(oe(t, e), !1);
|
|
2172
|
+
return this.#N({ busy: void 0 }), n != null && (this.selectTarget({
|
|
2176
2173
|
id: t,
|
|
2177
2174
|
kind: "subflow"
|
|
2178
2175
|
}), this.#c({
|
|
@@ -2184,53 +2181,53 @@ var Ut = class {
|
|
|
2184
2181
|
let n = this.#o.flow(e), r = t.trim();
|
|
2185
2182
|
if (n == null || r.length == 0) return !1;
|
|
2186
2183
|
if (n.name == r) return !0;
|
|
2187
|
-
this.#
|
|
2184
|
+
this.#N({ busy: "flow" }), this.#c(void 0);
|
|
2188
2185
|
let i;
|
|
2189
2186
|
try {
|
|
2190
2187
|
i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
|
|
2191
2188
|
} catch (e) {
|
|
2192
|
-
this.#
|
|
2189
|
+
this.#m || this.#c(D(e, this.#r.t));
|
|
2193
2190
|
}
|
|
2194
|
-
return this.#
|
|
2191
|
+
return this.#N({ busy: void 0 }), i != null && (this.#c({
|
|
2195
2192
|
kind: "success",
|
|
2196
2193
|
message: this.#r.t("notice.flowRenamed", { name: r })
|
|
2197
2194
|
}), !0);
|
|
2198
2195
|
}
|
|
2199
2196
|
async addNode(e, t, n) {
|
|
2200
|
-
if (!this.#
|
|
2197
|
+
if (!this.#O()) return;
|
|
2201
2198
|
let r = this.#l.value.draft, i = this.#l.value.target;
|
|
2202
2199
|
if (r == null || i == null) return;
|
|
2203
2200
|
let a = this.#i();
|
|
2204
|
-
if (e.kind == "comment") return await this.#
|
|
2205
|
-
let o =
|
|
2201
|
+
if (e.kind == "comment") return await this.#y(i, a, t);
|
|
2202
|
+
let o = L(r), s = ee(e, o, i, this.#r.t);
|
|
2206
2203
|
if (s == null) return;
|
|
2207
2204
|
let c = je(o, i, a, s, this.#i);
|
|
2208
2205
|
if (c == null) return;
|
|
2209
|
-
let l = n == null ? c : [...c, ...
|
|
2206
|
+
let l = n == null ? c : [...c, ...rt(V(r, c).content, i, n(a))], u = this.#b(l);
|
|
2210
2207
|
this.selectNodes([a]);
|
|
2211
2208
|
let d = this.moveNodes({ [a]: t });
|
|
2212
|
-
if (await u != null && (await d, !this.#
|
|
2209
|
+
if (await u != null && (await d, !this.#m)) return this.#N({ nodeFocus: {
|
|
2213
2210
|
nodeId: a,
|
|
2214
|
-
requestId: ++this.#
|
|
2211
|
+
requestId: ++this.#g
|
|
2215
2212
|
} }), a;
|
|
2216
2213
|
}
|
|
2217
2214
|
async connect(e) {
|
|
2218
2215
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2219
2216
|
if (t == null || n == null) return;
|
|
2220
|
-
let r =
|
|
2221
|
-
r.length > 0 && await this.#
|
|
2217
|
+
let r = rt(t.revision.content, n, e);
|
|
2218
|
+
r.length > 0 && await this.#b(r);
|
|
2222
2219
|
}
|
|
2223
2220
|
async disconnect(e) {
|
|
2224
2221
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2225
2222
|
if (t == null || n == null) return;
|
|
2226
|
-
let r =
|
|
2227
|
-
r.length > 0 && await this.#
|
|
2223
|
+
let r = it(t.revision.content, n, e);
|
|
2224
|
+
r.length > 0 && await this.#b(r);
|
|
2228
2225
|
}
|
|
2229
2226
|
async deleteSelectedNodes() {
|
|
2230
|
-
if (!this.#
|
|
2227
|
+
if (!this.#O()) return;
|
|
2231
2228
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
2232
2229
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2233
|
-
let n = w(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ce(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#
|
|
2230
|
+
let n = w(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ce(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#b(i), o = r.size == 0 ? void 0 : this.#S((e) => S(e, t, r));
|
|
2234
2231
|
this.selectNodes([]), (a == null || await a != null) && await o;
|
|
2235
2232
|
}
|
|
2236
2233
|
copySelectedNodes() {
|
|
@@ -2238,7 +2235,7 @@ var Ut = class {
|
|
|
2238
2235
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
2239
2236
|
let n = new Set(this.#l.value.selectedNodeIds);
|
|
2240
2237
|
this.#u = {
|
|
2241
|
-
comments: this.#
|
|
2238
|
+
comments: this.#D().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
|
|
2242
2239
|
content: e.content,
|
|
2243
2240
|
position: e.position,
|
|
2244
2241
|
sourceId: e.id,
|
|
@@ -2248,23 +2245,23 @@ var Ut = class {
|
|
|
2248
2245
|
};
|
|
2249
2246
|
}
|
|
2250
2247
|
async pasteNodes(e) {
|
|
2251
|
-
if (!this.#
|
|
2248
|
+
if (!this.#O()) return;
|
|
2252
2249
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2253
2250
|
if (t == null || n == null || this.#u == null) return;
|
|
2254
|
-
let r = ke(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#
|
|
2251
|
+
let r = ke(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#b(r.changes), a = this.#u.comments.map((e) => ({
|
|
2255
2252
|
...e,
|
|
2256
2253
|
nodeId: this.#i()
|
|
2257
2254
|
}));
|
|
2258
2255
|
if (r.nodeIds.length == 0 && a.length == 0) return;
|
|
2259
|
-
let o = new Map(this.#
|
|
2256
|
+
let o = new Map(this.#D().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
|
|
2260
2257
|
let i = e?.[t] ?? o.get(t)?.position;
|
|
2261
2258
|
return [r.nodeIds[n], {
|
|
2262
2259
|
x: (i?.x ?? 80) + 40,
|
|
2263
2260
|
y: (i?.y ?? 80) + 40
|
|
2264
2261
|
}];
|
|
2265
|
-
})), c = this.#
|
|
2266
|
-
let t =
|
|
2267
|
-
for (let e of a) t =
|
|
2262
|
+
})), c = this.#S((e) => {
|
|
2263
|
+
let t = j(e, n, s);
|
|
2264
|
+
for (let e of a) t = z(t, n, e.nodeId, {
|
|
2268
2265
|
content: e.content,
|
|
2269
2266
|
position: {
|
|
2270
2267
|
x: e.position.x + 40,
|
|
@@ -2283,65 +2280,65 @@ var Ut = class {
|
|
|
2283
2280
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2284
2281
|
if (n == null || r == null) return !1;
|
|
2285
2282
|
let i = he(n, r, e, t);
|
|
2286
|
-
return i != null && await this.#
|
|
2283
|
+
return i != null && await this.#b(i) != null;
|
|
2287
2284
|
}
|
|
2288
2285
|
async saveNodeDescription(e, t) {
|
|
2289
2286
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2290
2287
|
if (n == null || r == null) return !1;
|
|
2291
2288
|
let i = Te(n, r, e, t);
|
|
2292
|
-
return i != null && await this.#
|
|
2289
|
+
return i != null && await this.#b(i) != null;
|
|
2293
2290
|
}
|
|
2294
2291
|
async saveNodeIcon(e, t) {
|
|
2295
2292
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2296
2293
|
if (n == null || r == null) return !1;
|
|
2297
2294
|
let i = xe(n, r, e, t);
|
|
2298
|
-
return i != null && await this.#
|
|
2295
|
+
return i != null && await this.#b(i) != null;
|
|
2299
2296
|
}
|
|
2300
2297
|
async saveNodeTitle(e, t) {
|
|
2301
2298
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2302
2299
|
if (n == null || r == null) return !1;
|
|
2303
2300
|
let i = ge(n, r, e, t);
|
|
2304
|
-
return i != null && await this.#
|
|
2301
|
+
return i != null && await this.#b(i) != null;
|
|
2305
2302
|
}
|
|
2306
2303
|
async setInputValue(e, t, n) {
|
|
2307
2304
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2308
2305
|
if (r == null || i == null) return !1;
|
|
2309
2306
|
let a = le(r, i, e, t, n);
|
|
2310
|
-
return a != null && await this.#
|
|
2307
|
+
return a != null && await this.#b(a) != null;
|
|
2311
2308
|
}
|
|
2312
2309
|
async setInputVariable(e, t, n) {
|
|
2313
2310
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2314
2311
|
if (r == null || i == null) return !1;
|
|
2315
2312
|
let a = n == null ? le(r, i, e, t, void 0) : ye(r, i, e, t, n, this.#i());
|
|
2316
|
-
return a != null && await this.#
|
|
2313
|
+
return a != null && await this.#b(a) != null;
|
|
2317
2314
|
}
|
|
2318
2315
|
async saveCondition(e, t) {
|
|
2319
2316
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2320
2317
|
if (n == null || r == null) return !1;
|
|
2321
2318
|
let i = me(n, r, e, t);
|
|
2322
|
-
return i != null && await this.#
|
|
2319
|
+
return i != null && await this.#b(i) != null;
|
|
2323
2320
|
}
|
|
2324
2321
|
async saveValue(e, t) {
|
|
2325
2322
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2326
2323
|
if (n == null || r == null) return !1;
|
|
2327
2324
|
let i = ce(n, r, e, t);
|
|
2328
|
-
return i != null && await this.#
|
|
2325
|
+
return i != null && await this.#b(i) != null;
|
|
2329
2326
|
}
|
|
2330
2327
|
async saveWait(e, t) {
|
|
2331
2328
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2332
2329
|
if (n == null || r?.kind != "flow") return !1;
|
|
2333
|
-
let i =
|
|
2334
|
-
return i != null && await this.#
|
|
2330
|
+
let i = Fe(n, r, e, t);
|
|
2331
|
+
return i != null && await this.#b(i) != null;
|
|
2335
2332
|
}
|
|
2336
2333
|
async setWaitNotification(e, t) {
|
|
2337
2334
|
let n = this.$.revision.value, r = n == null ? void 0 : Me(n, e, t, this.#i());
|
|
2338
|
-
return r != null && await this.#
|
|
2335
|
+
return r != null && await this.#b(r) != null;
|
|
2339
2336
|
}
|
|
2340
2337
|
async saveComment(e, t) {
|
|
2341
2338
|
let n = this.#l.value.target;
|
|
2342
2339
|
if (n == null) return;
|
|
2343
|
-
let r = this.#
|
|
2344
|
-
r != null && await this.#
|
|
2340
|
+
let r = this.#D().nodes.find((t) => t.id == e)?.position;
|
|
2341
|
+
r != null && await this.#S((i) => z(i, n, e, {
|
|
2345
2342
|
...t,
|
|
2346
2343
|
position: r
|
|
2347
2344
|
}));
|
|
@@ -2349,66 +2346,66 @@ var Ut = class {
|
|
|
2349
2346
|
async saveTaskSettings(e, t) {
|
|
2350
2347
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2351
2348
|
if (n == null || r == null) return !1;
|
|
2352
|
-
let i =
|
|
2353
|
-
return i != null && await this.#
|
|
2349
|
+
let i = Ne(n, r, e, t);
|
|
2350
|
+
return i != null && await this.#b(i) != null;
|
|
2354
2351
|
}
|
|
2355
2352
|
async saveCodeTaskPorts(e, t) {
|
|
2356
2353
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2357
2354
|
if (n == null || r == null) return !1;
|
|
2358
2355
|
let i = de(n, r, e, t);
|
|
2359
|
-
return i != null && await this.#
|
|
2356
|
+
return i != null && await this.#b(i) != null;
|
|
2360
2357
|
}
|
|
2361
2358
|
async saveTaskAdditionalInputs(e, t) {
|
|
2362
2359
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2363
2360
|
if (n == null || r == null) return !1;
|
|
2364
|
-
let i =
|
|
2365
|
-
return i != null && await this.#
|
|
2361
|
+
let i = Ie(n, r, e, t);
|
|
2362
|
+
return i != null && await this.#b(i) != null;
|
|
2366
2363
|
}
|
|
2367
2364
|
async setConnectorConnection(e, t) {
|
|
2368
2365
|
let n = this.$.revision.value;
|
|
2369
2366
|
if (n == null) return !1;
|
|
2370
|
-
let r =
|
|
2371
|
-
return r != null && await this.#
|
|
2367
|
+
let r = k(n.revision.content, e, t);
|
|
2368
|
+
return r != null && await this.#b(r) != null;
|
|
2372
2369
|
}
|
|
2373
2370
|
async saveTriggerSettings(e, t) {
|
|
2374
2371
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2375
2372
|
if (n == null || r?.kind != "flow") return !1;
|
|
2376
2373
|
let i = ne(n.revision.content, r, e, t);
|
|
2377
|
-
return i != null && await this.#
|
|
2374
|
+
return i != null && await this.#b(i) != null;
|
|
2378
2375
|
}
|
|
2379
2376
|
async saveTriggerConfig(e, t, n) {
|
|
2380
2377
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
2381
2378
|
if (r == null || i?.kind != "flow") return !1;
|
|
2382
2379
|
let a = ie(r.revision.content, i, e, t, n);
|
|
2383
|
-
return a != null && await this.#
|
|
2380
|
+
return a != null && await this.#b(a) != null;
|
|
2384
2381
|
}
|
|
2385
2382
|
async saveTriggerSchedule(e, t) {
|
|
2386
2383
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2387
2384
|
if (n == null || r?.kind != "flow") return !1;
|
|
2388
|
-
let i =
|
|
2389
|
-
return i != null && await this.#
|
|
2385
|
+
let i = P(n.revision.content, r, e, t);
|
|
2386
|
+
return i != null && await this.#b(i) != null;
|
|
2390
2387
|
}
|
|
2391
2388
|
async saveWebhook(e, t) {
|
|
2392
2389
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2393
2390
|
if (n == null || r?.kind != "flow") return !1;
|
|
2394
|
-
let i =
|
|
2395
|
-
return i != null && await this.#
|
|
2391
|
+
let i = F(n, r, e, t);
|
|
2392
|
+
return i != null && await this.#b(i) != null;
|
|
2396
2393
|
}
|
|
2397
2394
|
async setTriggerConnection(e, t) {
|
|
2398
2395
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
2399
2396
|
if (n == null || r?.kind != "flow") return !1;
|
|
2400
2397
|
let i = re(n.revision.content, r, e, t);
|
|
2401
|
-
return i != null && await this.#
|
|
2398
|
+
return i != null && await this.#b(i) != null;
|
|
2402
2399
|
}
|
|
2403
2400
|
async saveSubflowSettings(e, t) {
|
|
2404
2401
|
let n = this.$.revision.value;
|
|
2405
2402
|
if (n == null) return !1;
|
|
2406
2403
|
let r = ae(n, e, t);
|
|
2407
|
-
return r != null && await this.#
|
|
2404
|
+
return r != null && await this.#b(r) != null;
|
|
2408
2405
|
}
|
|
2409
2406
|
updateModuleSource(e) {
|
|
2410
2407
|
let t = this.#l.value.moduleEditor;
|
|
2411
|
-
t != null && t.source != e && this.#
|
|
2408
|
+
t != null && t.source != e && this.#N({ moduleEditor: {
|
|
2412
2409
|
...t,
|
|
2413
2410
|
phase: void 0,
|
|
2414
2411
|
source: e
|
|
@@ -2419,10 +2416,10 @@ var Ut = class {
|
|
|
2419
2416
|
if (e == null) return;
|
|
2420
2417
|
let t = this.#l.value.draft?.content.modules[e.moduleId];
|
|
2421
2418
|
if (t == null) {
|
|
2422
|
-
this.#
|
|
2419
|
+
this.#N({ moduleEditor: void 0 });
|
|
2423
2420
|
return;
|
|
2424
2421
|
}
|
|
2425
|
-
this.#
|
|
2422
|
+
this.#N({ moduleEditor: {
|
|
2426
2423
|
moduleId: e.moduleId,
|
|
2427
2424
|
source: t.source
|
|
2428
2425
|
} });
|
|
@@ -2430,104 +2427,104 @@ var Ut = class {
|
|
|
2430
2427
|
async saveModuleEditor() {
|
|
2431
2428
|
let e = this.#l.value.moduleEditor;
|
|
2432
2429
|
if (e == null || e.phase == "saving") return !1;
|
|
2433
|
-
this.#
|
|
2430
|
+
this.#N({ moduleEditor: {
|
|
2434
2431
|
...e,
|
|
2435
2432
|
phase: "saving"
|
|
2436
2433
|
} });
|
|
2437
|
-
let t = await
|
|
2438
|
-
if (this.#
|
|
2439
|
-
let n =
|
|
2440
|
-
|
|
2434
|
+
let t = await ot(e.source);
|
|
2435
|
+
if (this.#m) return !1;
|
|
2436
|
+
let n = this.#l.value.draft?.content.modules[e.moduleId];
|
|
2437
|
+
if (n == null) return !1;
|
|
2438
|
+
let r = await this.#b(st(e.moduleId, n.source, n.imports, e.source, t));
|
|
2439
|
+
return !this.#m && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#N({ moduleEditor: {
|
|
2441
2440
|
...this.#l.value.moduleEditor,
|
|
2442
|
-
phase:
|
|
2443
|
-
} }),
|
|
2441
|
+
phase: r == null ? "failed" : void 0
|
|
2442
|
+
} }), r != null;
|
|
2444
2443
|
}
|
|
2445
2444
|
async moveNodes(e, t = "detail") {
|
|
2446
2445
|
let n = this.#l.value.target;
|
|
2447
|
-
n != null && await this.#
|
|
2446
|
+
n != null && await this.#S((r) => j(r, n, e, t));
|
|
2448
2447
|
}
|
|
2449
2448
|
async moveViewport(e, t = "detail") {
|
|
2450
2449
|
let n = this.#l.value.target;
|
|
2451
|
-
|
|
2452
|
-
let r = this.#P().viewport;
|
|
2453
|
-
(r.x != e.x || r.y != e.y || r.zoom != e.zoom) && this.#M(), await this.#T((r) => k(r, n, e, t));
|
|
2450
|
+
n != null && await this.#S((r) => A(r, n, e, t));
|
|
2454
2451
|
}
|
|
2455
2452
|
async check() {
|
|
2456
|
-
await this.#
|
|
2453
|
+
await this.#C();
|
|
2457
2454
|
}
|
|
2458
2455
|
async refreshFlows() {
|
|
2459
2456
|
await this.reloadFlows();
|
|
2460
2457
|
}
|
|
2461
2458
|
updateLive(e) {
|
|
2462
|
-
e.flowId == this.#l.value.flowId && this.#
|
|
2459
|
+
e.flowId == this.#l.value.flowId && this.#N({ live: e });
|
|
2463
2460
|
}
|
|
2464
2461
|
locateNode(e) {
|
|
2465
2462
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
2466
|
-
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#
|
|
2463
|
+
return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#N({ nodeFocus: {
|
|
2467
2464
|
nodeId: e,
|
|
2468
|
-
requestId: ++this.#
|
|
2465
|
+
requestId: ++this.#g
|
|
2469
2466
|
} }), !0);
|
|
2470
2467
|
}
|
|
2471
2468
|
locateDiagnostic(e) {
|
|
2472
|
-
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#
|
|
2469
|
+
return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#N({ diagnosticFocus: {
|
|
2473
2470
|
...e.location,
|
|
2474
2471
|
diagnostic: e.diagnostic,
|
|
2475
2472
|
requestId: ++this.#d
|
|
2476
2473
|
} }), !0);
|
|
2477
2474
|
}
|
|
2478
|
-
async #
|
|
2479
|
-
let r = Math.max(0, ...this.#
|
|
2475
|
+
async #y(e, t, n) {
|
|
2476
|
+
let r = Math.max(0, ...this.#D().nodes.flatMap((e) => {
|
|
2480
2477
|
if (e.kind != "comment") return [];
|
|
2481
2478
|
let t = /#(\d+)$/.exec(e.title);
|
|
2482
2479
|
return t == null ? [] : [Number(t[1])];
|
|
2483
|
-
})), i = this.#
|
|
2480
|
+
})), i = this.#S((i) => z(i, e, t, {
|
|
2484
2481
|
content: "",
|
|
2485
2482
|
position: n,
|
|
2486
2483
|
title: this.#r.t("addNode.commentName", { number: r + 1 })
|
|
2487
2484
|
}));
|
|
2488
|
-
if (this.selectNodes([t]), await i, !this.#
|
|
2485
|
+
if (this.selectNodes([t]), await i, !this.#m) return t;
|
|
2489
2486
|
}
|
|
2490
|
-
async #
|
|
2487
|
+
async #b(e, t = !0) {
|
|
2491
2488
|
let n = this.#l.value.flowId, r = this.#l.value.draft;
|
|
2492
|
-
if (n != null && r != null) return await this.#t.change({
|
|
2489
|
+
if (n != null && r != null) return e.length == 0 ? r : await this.#t.change({
|
|
2493
2490
|
current: this.#n.capture(),
|
|
2494
2491
|
flowId: n
|
|
2495
2492
|
}, r, e, t);
|
|
2496
2493
|
}
|
|
2497
|
-
#
|
|
2498
|
-
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#
|
|
2499
|
-
return this.#
|
|
2494
|
+
#x(e, t = !1) {
|
|
2495
|
+
let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#k(e), o = this.#l.value.moduleEditor;
|
|
2496
|
+
return this.#N({
|
|
2500
2497
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
2501
2498
|
draft: e,
|
|
2502
|
-
moduleEditor: o != null && n != null &&
|
|
2499
|
+
moduleEditor: o != null && n != null && Q(n, o) != "saved" ? o : $(r, a, i),
|
|
2503
2500
|
selectedNodeIds: i,
|
|
2504
2501
|
target: a
|
|
2505
2502
|
}), r;
|
|
2506
2503
|
}
|
|
2507
|
-
async #
|
|
2508
|
-
if (this.#
|
|
2504
|
+
async #S(e) {
|
|
2505
|
+
if (this.#m) return;
|
|
2509
2506
|
let t = this.#l.value.flowId, n = this.#l.value.presentation;
|
|
2510
2507
|
t != null && n != null && await this.#a.change(t, n, this.#o.capture(), e);
|
|
2511
2508
|
}
|
|
2512
|
-
async #
|
|
2513
|
-
if (this.#
|
|
2509
|
+
async #C() {
|
|
2510
|
+
if (this.#m) return;
|
|
2514
2511
|
let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
|
|
2515
2512
|
if (e == null || t == null || n == null) {
|
|
2516
|
-
n ?? this.#
|
|
2513
|
+
n ?? this.#N({
|
|
2517
2514
|
checkLoading: !1,
|
|
2518
2515
|
diagnostics: void 0
|
|
2519
2516
|
});
|
|
2520
2517
|
return;
|
|
2521
2518
|
}
|
|
2522
|
-
this.#
|
|
2519
|
+
this.#N({
|
|
2523
2520
|
checkLoading: !0,
|
|
2524
2521
|
diagnosticFocus: void 0
|
|
2525
2522
|
});
|
|
2526
2523
|
try {
|
|
2527
2524
|
let n = await this.#e.checkFlow(e, t.revisionId);
|
|
2528
|
-
if (!this.#
|
|
2525
|
+
if (!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
|
|
2529
2526
|
let e = this.#l.value.live;
|
|
2530
|
-
this.#
|
|
2527
|
+
this.#N({
|
|
2531
2528
|
diagnostics: n,
|
|
2532
2529
|
live: e == null ? void 0 : {
|
|
2533
2530
|
...e,
|
|
@@ -2536,16 +2533,16 @@ var Ut = class {
|
|
|
2536
2533
|
});
|
|
2537
2534
|
}
|
|
2538
2535
|
} catch (n) {
|
|
2539
|
-
!this.#
|
|
2536
|
+
!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(D(n, this.#r.t));
|
|
2540
2537
|
} finally {
|
|
2541
|
-
!this.#
|
|
2538
|
+
!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#N({ checkLoading: !1 });
|
|
2542
2539
|
}
|
|
2543
2540
|
}
|
|
2544
|
-
async #
|
|
2545
|
-
if (this.#
|
|
2541
|
+
async #w(e) {
|
|
2542
|
+
if (this.#m) return;
|
|
2546
2543
|
let t = this.#l.value.flowId;
|
|
2547
|
-
if (t == null || (this.#f += 1, e != null && (this.#
|
|
2548
|
-
this.#
|
|
2544
|
+
if (t == null || (this.#f += 1, e != null && (this.#p = !0), this.#h)) return;
|
|
2545
|
+
this.#h = !0;
|
|
2549
2546
|
let n = {
|
|
2550
2547
|
current: this.#n.capture(),
|
|
2551
2548
|
flowId: t
|
|
@@ -2554,144 +2551,83 @@ var Ut = class {
|
|
|
2554
2551
|
let e;
|
|
2555
2552
|
do {
|
|
2556
2553
|
e = this.#f;
|
|
2557
|
-
let t = this.#
|
|
2558
|
-
this.#
|
|
2559
|
-
} while (this.#
|
|
2560
|
-
}), this.#
|
|
2554
|
+
let t = this.#p;
|
|
2555
|
+
this.#p = !1, await this.#T(n, !1, t);
|
|
2556
|
+
} while (this.#M(n) && e != this.#f);
|
|
2557
|
+
}), this.#M(n) && (this.#h = !1);
|
|
2561
2558
|
}
|
|
2562
|
-
async #
|
|
2559
|
+
async #T(e, t, n = !1) {
|
|
2563
2560
|
try {
|
|
2564
|
-
let t =
|
|
2565
|
-
if (
|
|
2566
|
-
let
|
|
2567
|
-
if (!this.#
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
}
|
|
2576
|
-
if (s.revisionId == a.revisionId) return !0;
|
|
2577
|
-
let c = o.kind == "changes" && t != null ? jt(I(a), I(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
|
|
2578
|
-
o.kind == "snapshot" && this.#M();
|
|
2579
|
-
let l = this.#L(s, !1);
|
|
2580
|
-
return this.#N(e.flowId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#A(e, t, c, i), n && (this.#c({
|
|
2581
|
-
kind: l ? "error" : "success",
|
|
2582
|
-
message: this.#r.t(l ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
2583
|
-
}), this.#E()), !0;
|
|
2561
|
+
let t = this.#t.committed;
|
|
2562
|
+
if (t == null) return !1;
|
|
2563
|
+
let r = await this.#e.syncDraft(e.flowId);
|
|
2564
|
+
if (!this.#M(e)) return !1;
|
|
2565
|
+
let i = r.draft;
|
|
2566
|
+
if (i.revisionId == t.revisionId) return !0;
|
|
2567
|
+
let a = this.#A(i, !1);
|
|
2568
|
+
return this.#E(e.flowId, i.revisionId), n && (this.#c({
|
|
2569
|
+
kind: a ? "error" : "success",
|
|
2570
|
+
message: this.#r.t(a ? "notice.moduleUpdated" : "notice.draftUpdated")
|
|
2571
|
+
}), this.#C()), !0;
|
|
2584
2572
|
} catch (n) {
|
|
2585
|
-
return t && this.#
|
|
2586
|
-
}
|
|
2587
|
-
}
|
|
2588
|
-
#k(e, t) {
|
|
2589
|
-
if (t.kind == "snapshot") return t.draft;
|
|
2590
|
-
let n = e;
|
|
2591
|
-
for (let e of t.revisions) {
|
|
2592
|
-
if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
|
|
2593
|
-
n = {
|
|
2594
|
-
...e.revision,
|
|
2595
|
-
content: B(n, e.operations).content
|
|
2596
|
-
};
|
|
2573
|
+
return t && this.#M(e) && this.#c(D(n, this.#r.t)), !1;
|
|
2597
2574
|
}
|
|
2598
|
-
return n;
|
|
2599
|
-
}
|
|
2600
|
-
#A(e, t, n, r) {
|
|
2601
|
-
let i = this.#l.value;
|
|
2602
|
-
if (!this.#z(e) || r != this.#m || !$(i.target, t)) return;
|
|
2603
|
-
let a = this.#p;
|
|
2604
|
-
if (a != null) {
|
|
2605
|
-
if (a.flowId != e.flowId || !$(a.target, t)) {
|
|
2606
|
-
this.#M();
|
|
2607
|
-
return;
|
|
2608
|
-
}
|
|
2609
|
-
for (let e of n) a.targets.add(e);
|
|
2610
|
-
globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), Vt);
|
|
2611
|
-
return;
|
|
2612
|
-
}
|
|
2613
|
-
n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
|
|
2614
|
-
current: e.current,
|
|
2615
|
-
generation: r,
|
|
2616
|
-
flowId: e.flowId,
|
|
2617
|
-
target: t,
|
|
2618
|
-
targets: new Set(n),
|
|
2619
|
-
timer: globalThis.setTimeout(() => this.#j(), Vt),
|
|
2620
|
-
viewport: this.#P().viewport
|
|
2621
|
-
});
|
|
2622
|
-
}
|
|
2623
|
-
#j() {
|
|
2624
|
-
let e = this.#p;
|
|
2625
|
-
if (this.#p = void 0, e == null || !e.current() || e.generation != this.#m) return;
|
|
2626
|
-
let t = this.#l.value;
|
|
2627
|
-
if (t.flowId != e.flowId || !$(t.target, e.target) || t.selectedNodeIds.length > 0) return;
|
|
2628
|
-
let n = this.#P().viewport;
|
|
2629
|
-
if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
|
|
2630
|
-
let r = I(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
|
|
2631
|
-
i.length == 1 && this.#B({ nodeFocus: {
|
|
2632
|
-
nodeId: i[0],
|
|
2633
|
-
requestId: ++this.#y
|
|
2634
|
-
} });
|
|
2635
|
-
}
|
|
2636
|
-
#M() {
|
|
2637
|
-
this.#m += 1, this.#p != null && globalThis.clearTimeout(this.#p.timer), this.#p = void 0;
|
|
2638
2575
|
}
|
|
2639
|
-
#
|
|
2576
|
+
#E(e, t) {
|
|
2640
2577
|
this.#o.advanceHead(e, t);
|
|
2641
2578
|
}
|
|
2642
|
-
#
|
|
2579
|
+
#D() {
|
|
2643
2580
|
let e = this.#l.value;
|
|
2644
|
-
return
|
|
2581
|
+
return M(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
|
|
2645
2582
|
}
|
|
2646
|
-
#
|
|
2583
|
+
#O() {
|
|
2647
2584
|
let e = this.#l.value.moduleEditor;
|
|
2648
|
-
return e == null ||
|
|
2585
|
+
return e == null || Q(this.#l.value.draft, e) == "saved" || (this.#c({
|
|
2649
2586
|
kind: "error",
|
|
2650
2587
|
message: this.#r.t("notice.unsavedCode")
|
|
2651
2588
|
}), !1);
|
|
2652
2589
|
}
|
|
2653
|
-
#
|
|
2654
|
-
let t =
|
|
2590
|
+
#k(e) {
|
|
2591
|
+
let t = L(e), n = Rt(t, this.#l.value.target);
|
|
2655
2592
|
return {
|
|
2656
2593
|
revision: t,
|
|
2657
2594
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
2658
2595
|
target: n
|
|
2659
2596
|
};
|
|
2660
2597
|
}
|
|
2661
|
-
#
|
|
2662
|
-
this.#t.replaceCommitted(e);
|
|
2663
|
-
|
|
2664
|
-
return this.#B({
|
|
2598
|
+
#A(e, t) {
|
|
2599
|
+
let n = this.#t.replaceCommitted(e), r = this.#l.value.moduleEditor, i = r != null && Q(this.#l.value.draft, r) != "saved", a = this.#k(n), o = a.target;
|
|
2600
|
+
return this.#N({
|
|
2665
2601
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
2666
2602
|
draft: n,
|
|
2667
|
-
moduleEditor: this.#
|
|
2603
|
+
moduleEditor: this.#j(a.revision, o, a.selectedNodeIds),
|
|
2668
2604
|
selectedNodeIds: a.selectedNodeIds,
|
|
2669
2605
|
target: o
|
|
2670
2606
|
}), i;
|
|
2671
2607
|
}
|
|
2672
|
-
#
|
|
2608
|
+
#j(e, t, n) {
|
|
2673
2609
|
let r = this.#l.value.moduleEditor;
|
|
2674
|
-
return r == null ||
|
|
2610
|
+
return r == null || Q(this.#l.value.draft, r) == "saved" ? $(e, t, n) : {
|
|
2675
2611
|
...r,
|
|
2676
2612
|
phase: "failed"
|
|
2677
2613
|
};
|
|
2678
2614
|
}
|
|
2679
|
-
#
|
|
2680
|
-
return !this.#
|
|
2615
|
+
#M(e) {
|
|
2616
|
+
return !this.#m && e.flowId == this.#l.value.flowId && e.current();
|
|
2681
2617
|
}
|
|
2682
|
-
#
|
|
2683
|
-
this.#
|
|
2618
|
+
#N(e) {
|
|
2619
|
+
this.#m || this.#l.set(e);
|
|
2684
2620
|
}
|
|
2685
2621
|
};
|
|
2686
2622
|
//#endregion
|
|
2687
2623
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
2688
|
-
function
|
|
2624
|
+
function Bt(e) {
|
|
2689
2625
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
2690
2626
|
}
|
|
2691
|
-
function
|
|
2692
|
-
return e == null || t == null ? [] :
|
|
2627
|
+
function Vt(e, t) {
|
|
2628
|
+
return e == null || t == null ? [] : L(e).designerInputs(t);
|
|
2693
2629
|
}
|
|
2694
|
-
function
|
|
2630
|
+
function Ht(e, t, n, r, i) {
|
|
2695
2631
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
2696
2632
|
let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
|
|
2697
2633
|
return typeof a == "string" ? new Map(r.flatMap((t) => {
|
|
@@ -2699,7 +2635,7 @@ function Kt(e, t, n, r, i) {
|
|
|
2699
2635
|
return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
|
|
2700
2636
|
})) : /* @__PURE__ */ new Map();
|
|
2701
2637
|
}
|
|
2702
|
-
var
|
|
2638
|
+
var Ut = { openExternalPage: async () => !1 }, Wt = class {
|
|
2703
2639
|
#e;
|
|
2704
2640
|
#t;
|
|
2705
2641
|
#n;
|
|
@@ -2710,16 +2646,16 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
|
|
|
2710
2646
|
#s;
|
|
2711
2647
|
#c;
|
|
2712
2648
|
#l;
|
|
2713
|
-
constructor(r, i, a = () => crypto.randomUUID(), o =
|
|
2714
|
-
this.#t = new
|
|
2649
|
+
constructor(r, i, a = () => crypto.randomUUID(), o = R(), s = Ut, c = !0) {
|
|
2650
|
+
this.#t = new I(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = new I(), this.#l = !1, this.provideAddNodeOptions = async (e, t) => await this.#u([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#u([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => {
|
|
2715
2651
|
if (!e.startsWith("trigger:")) return await this.connectors.provideAddNodeOptionChoices(e, t);
|
|
2716
2652
|
}, this.#e = r, this.#n = o, this.#i = c;
|
|
2717
2653
|
let l = (e) => {
|
|
2718
2654
|
this.#l || this.#r.set(e);
|
|
2719
2655
|
};
|
|
2720
|
-
this.runs = new
|
|
2656
|
+
this.runs = new Le(r, l, o), this.workspace = new zt(r, l, ct, o, (e) => {
|
|
2721
2657
|
e.kind == "run.created" ? this.#d(r, e) : this.runs.changed(e.runId);
|
|
2722
|
-
}), this.connectors = new
|
|
2658
|
+
}), this.connectors = new wt(r, this.workspace, l, s, o), this.triggers = new Ot(r, this.workspace, l, s, o), this.publications = new ft(r, this.workspace, l, i, a, o), this.runRequests = new _t(r, this.runs, l, o, a);
|
|
2723
2659
|
let u = n((e) => {
|
|
2724
2660
|
let t = e(this.workspace.$.diagnostics);
|
|
2725
2661
|
if (t == null) return;
|
|
@@ -2733,8 +2669,8 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
|
|
|
2733
2669
|
let t = e(this.workspace.$.draft);
|
|
2734
2670
|
f != t?.flowId && (d.clear(), f = t?.flowId);
|
|
2735
2671
|
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), p = e(this.runs.$.events), m = e(this.#a), h = e(this.#o), g = e(this.#s), _ = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, v = [
|
|
2736
|
-
...
|
|
2737
|
-
r == null || n == null ? void 0 :
|
|
2672
|
+
...Vt(t, n),
|
|
2673
|
+
r == null || n == null ? void 0 : N(r, n),
|
|
2738
2674
|
i,
|
|
2739
2675
|
a,
|
|
2740
2676
|
s,
|
|
@@ -2747,12 +2683,12 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
|
|
|
2747
2683
|
...l == null ? [] : [t?.revisionId]
|
|
2748
2684
|
], y = d.get(_);
|
|
2749
2685
|
if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
|
|
2750
|
-
let b =
|
|
2686
|
+
let b = M(t, n, r, i, a, s, c, l, p, m, h, g, this.#i);
|
|
2751
2687
|
return d.set(_, {
|
|
2752
2688
|
graph: b,
|
|
2753
2689
|
inputs: v
|
|
2754
2690
|
}), b;
|
|
2755
|
-
}), m = e(p,
|
|
2691
|
+
}), m = e(p, Bt);
|
|
2756
2692
|
this.$ = {
|
|
2757
2693
|
busy: n((e) => {
|
|
2758
2694
|
let t = e(this.workspace.$.busy);
|
|
@@ -2768,7 +2704,7 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
|
|
|
2768
2704
|
designer: p,
|
|
2769
2705
|
designerNodeById: m,
|
|
2770
2706
|
notice: this.#r,
|
|
2771
|
-
runEventNodes: n((e) =>
|
|
2707
|
+
runEventNodes: n((e) => Ht(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(m))),
|
|
2772
2708
|
selectedDesignerNode: n((e) => {
|
|
2773
2709
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
2774
2710
|
return t.length == 1 ? e(m).get(t[0]) : void 0;
|
|
@@ -2869,13 +2805,13 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
|
|
|
2869
2805
|
return;
|
|
2870
2806
|
}
|
|
2871
2807
|
}
|
|
2872
|
-
},
|
|
2873
|
-
function
|
|
2874
|
-
let
|
|
2875
|
-
/* @__PURE__ */
|
|
2808
|
+
}, Gt = Ue(() => import("./flowWorkspace-VnS8nLMT.js").then((e) => e.t));
|
|
2809
|
+
function Kt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: u }) {
|
|
2810
|
+
let m = s != null && u != null && i != null, h = s ?? "", _ = /* @__PURE__ */ q(Ge, { children: [
|
|
2811
|
+
/* @__PURE__ */ K("div", {
|
|
2876
2812
|
"aria-hidden": "true",
|
|
2877
2813
|
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
2878
|
-
children: /* @__PURE__ */
|
|
2814
|
+
children: /* @__PURE__ */ q("svg", {
|
|
2879
2815
|
className: "size-5",
|
|
2880
2816
|
fill: "none",
|
|
2881
2817
|
stroke: "currentColor",
|
|
@@ -2883,40 +2819,40 @@ function Xt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
2883
2819
|
strokeLinejoin: "round",
|
|
2884
2820
|
strokeWidth: "1.8",
|
|
2885
2821
|
viewBox: "0 0 24 24",
|
|
2886
|
-
children: [/* @__PURE__ */
|
|
2822
|
+
children: [/* @__PURE__ */ K("rect", {
|
|
2887
2823
|
height: "9",
|
|
2888
2824
|
rx: "2",
|
|
2889
2825
|
width: "14",
|
|
2890
2826
|
x: "5",
|
|
2891
2827
|
y: "11"
|
|
2892
|
-
}), /* @__PURE__ */
|
|
2828
|
+
}), /* @__PURE__ */ K("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
2893
2829
|
})
|
|
2894
2830
|
}),
|
|
2895
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ q("header", {
|
|
2896
2832
|
className: "flex flex-col gap-2",
|
|
2897
|
-
children: [/* @__PURE__ */
|
|
2833
|
+
children: [/* @__PURE__ */ K("h1", {
|
|
2898
2834
|
className: "text-xl font-semibold tracking-tight text-balance",
|
|
2899
2835
|
children: o
|
|
2900
|
-
}), /* @__PURE__ */
|
|
2836
|
+
}), /* @__PURE__ */ K("p", {
|
|
2901
2837
|
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
2902
2838
|
children: t
|
|
2903
2839
|
})]
|
|
2904
2840
|
}),
|
|
2905
|
-
|
|
2841
|
+
m && /* @__PURE__ */ K(f, { children: /* @__PURE__ */ q(d, {
|
|
2906
2842
|
"data-invalid": n != null,
|
|
2907
2843
|
children: [
|
|
2908
|
-
/* @__PURE__ */
|
|
2844
|
+
/* @__PURE__ */ K(p, {
|
|
2909
2845
|
htmlFor: "session-token",
|
|
2910
|
-
children:
|
|
2846
|
+
children: u
|
|
2911
2847
|
}),
|
|
2912
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ K(l, {
|
|
2913
2849
|
autoComplete: "username",
|
|
2914
2850
|
name: "username",
|
|
2915
2851
|
type: "hidden",
|
|
2916
2852
|
value: "open-flow",
|
|
2917
2853
|
readOnly: !0
|
|
2918
2854
|
}),
|
|
2919
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ K(l, {
|
|
2920
2856
|
autoComplete: "current-password",
|
|
2921
2857
|
"aria-invalid": n != null,
|
|
2922
2858
|
autoFocus: !0,
|
|
@@ -2928,46 +2864,46 @@ function Xt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
2928
2864
|
type: "password",
|
|
2929
2865
|
value: h
|
|
2930
2866
|
}),
|
|
2931
|
-
n != null && /* @__PURE__ */
|
|
2867
|
+
n != null && /* @__PURE__ */ K(y, { children: n })
|
|
2932
2868
|
]
|
|
2933
2869
|
}) }),
|
|
2934
|
-
e != null && r != null && /* @__PURE__ */
|
|
2935
|
-
disabled: a ||
|
|
2870
|
+
e != null && r != null && /* @__PURE__ */ q(c, {
|
|
2871
|
+
disabled: a || m && h.length == 0,
|
|
2936
2872
|
size: "lg",
|
|
2937
2873
|
type: "submit",
|
|
2938
|
-
children: [a && /* @__PURE__ */
|
|
2874
|
+
children: [a && /* @__PURE__ */ K(g, {
|
|
2939
2875
|
"aria-label": e,
|
|
2940
2876
|
"data-icon": "inline-start"
|
|
2941
2877
|
}), e]
|
|
2942
2878
|
}),
|
|
2943
|
-
a && e == null && /* @__PURE__ */
|
|
2944
|
-
] }),
|
|
2945
|
-
return /* @__PURE__ */
|
|
2879
|
+
a && e == null && /* @__PURE__ */ K(g, { "aria-label": t })
|
|
2880
|
+
] }), v = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
2881
|
+
return /* @__PURE__ */ K("main", {
|
|
2946
2882
|
className: "open-flow-workbench",
|
|
2947
|
-
children: /* @__PURE__ */
|
|
2883
|
+
children: /* @__PURE__ */ K("div", {
|
|
2948
2884
|
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
2949
|
-
children: r == null ? /* @__PURE__ */
|
|
2885
|
+
children: r == null ? /* @__PURE__ */ K("section", {
|
|
2950
2886
|
"aria-busy": a,
|
|
2951
|
-
className:
|
|
2887
|
+
className: v,
|
|
2952
2888
|
children: _
|
|
2953
|
-
}) : /* @__PURE__ */
|
|
2889
|
+
}) : /* @__PURE__ */ K("form", {
|
|
2954
2890
|
"aria-busy": a,
|
|
2955
|
-
className:
|
|
2891
|
+
className: v,
|
|
2956
2892
|
onSubmit: r,
|
|
2957
2893
|
children: _
|
|
2958
2894
|
})
|
|
2959
2895
|
})
|
|
2960
2896
|
});
|
|
2961
2897
|
}
|
|
2962
|
-
function
|
|
2898
|
+
function qt({ host: e, store: t }) {
|
|
2963
2899
|
let n = a(t.$.notice);
|
|
2964
|
-
return
|
|
2900
|
+
return W(() => e.notify(n), [e, n]), W(() => () => e.notify(void 0), [e]), null;
|
|
2965
2901
|
}
|
|
2966
|
-
function
|
|
2902
|
+
function Jt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
|
|
2967
2903
|
let g = a(m.workspace.$.flowId);
|
|
2968
|
-
return /* @__PURE__ */
|
|
2904
|
+
return /* @__PURE__ */ K("div", {
|
|
2969
2905
|
className: "app-shell",
|
|
2970
|
-
children: g == null ? /* @__PURE__ */
|
|
2906
|
+
children: g == null ? /* @__PURE__ */ K($e, {
|
|
2971
2907
|
catalogWidth: e,
|
|
2972
2908
|
createFlowDisabled: n,
|
|
2973
2909
|
createFlowField: r,
|
|
@@ -2984,12 +2920,12 @@ function Qt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
2984
2920
|
onLanguageChange: p,
|
|
2985
2921
|
onSelectFlow: (e) => void u.selectFlow(e),
|
|
2986
2922
|
store: m
|
|
2987
|
-
}) : /* @__PURE__ */
|
|
2988
|
-
fallback: /* @__PURE__ */
|
|
2923
|
+
}) : /* @__PURE__ */ K(He, {
|
|
2924
|
+
fallback: /* @__PURE__ */ K("main", {
|
|
2989
2925
|
"aria-busy": "true",
|
|
2990
2926
|
className: "workspace"
|
|
2991
2927
|
}),
|
|
2992
|
-
children: /* @__PURE__ */
|
|
2928
|
+
children: /* @__PURE__ */ K(Gt, {
|
|
2993
2929
|
hostAction: s,
|
|
2994
2930
|
hostTitle: c,
|
|
2995
2931
|
hrefFor: o,
|
|
@@ -3002,18 +2938,18 @@ function Qt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3002
2938
|
})
|
|
3003
2939
|
});
|
|
3004
2940
|
}
|
|
3005
|
-
function
|
|
3006
|
-
let y =
|
|
2941
|
+
function Yt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onHostAction: p, onLanguageChange: m, onNavigate: h, preferences: g, theme: _, variables: v = !0 }) {
|
|
2942
|
+
let y = We(h);
|
|
3007
2943
|
y.current = h;
|
|
3008
|
-
let [{ i18n: b, navigation: x, store: S }] =
|
|
3009
|
-
let e =
|
|
2944
|
+
let [{ i18n: b, navigation: x, store: S }] = G(() => {
|
|
2945
|
+
let e = R(u), t = new Wt(new Ee((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, () => crypto.randomUUID(), e, a, v);
|
|
3010
2946
|
return {
|
|
3011
2947
|
i18n: e,
|
|
3012
|
-
navigation: new
|
|
2948
|
+
navigation: new Ke(t, d, (e, t) => y.current(e, t)),
|
|
3013
2949
|
store: t
|
|
3014
2950
|
};
|
|
3015
2951
|
});
|
|
3016
|
-
return
|
|
2952
|
+
return W(() => {
|
|
3017
2953
|
x.start();
|
|
3018
2954
|
let e = () => {
|
|
3019
2955
|
S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.refreshVariableNames();
|
|
@@ -3025,17 +2961,17 @@ function $t({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3025
2961
|
b,
|
|
3026
2962
|
x,
|
|
3027
2963
|
S
|
|
3028
|
-
]),
|
|
2964
|
+
]), W(() => void x.apply(d), [d, x]), W(() => {
|
|
3029
2965
|
b.lang != u && b.switchLang(u);
|
|
3030
|
-
}, [b, u]), /* @__PURE__ */
|
|
2966
|
+
}, [b, u]), /* @__PURE__ */ K(o, {
|
|
3031
2967
|
i18n: b,
|
|
3032
|
-
children: /* @__PURE__ */
|
|
2968
|
+
children: /* @__PURE__ */ q("div", {
|
|
3033
2969
|
className: "open-flow-theme open-flow-workbench",
|
|
3034
2970
|
"data-theme": _,
|
|
3035
|
-
children: [/* @__PURE__ */
|
|
2971
|
+
children: [/* @__PURE__ */ K(qt, {
|
|
3036
2972
|
host: a,
|
|
3037
2973
|
store: S
|
|
3038
|
-
}), /* @__PURE__ */
|
|
2974
|
+
}), /* @__PURE__ */ K(Jt, {
|
|
3039
2975
|
catalogWidth: e,
|
|
3040
2976
|
createFlow: t,
|
|
3041
2977
|
createFlowDisabled: n,
|
|
@@ -3055,8 +2991,8 @@ function $t({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
|
|
|
3055
2991
|
})
|
|
3056
2992
|
});
|
|
3057
2993
|
}
|
|
3058
|
-
function
|
|
3059
|
-
return /* @__PURE__ */
|
|
2994
|
+
function Xt({ sessionKey: e, ...t }) {
|
|
2995
|
+
return /* @__PURE__ */ K(Yt, { ...t }, e);
|
|
3060
2996
|
}
|
|
3061
2997
|
//#endregion
|
|
3062
|
-
export {
|
|
2998
|
+
export { Kt as OpenFlowSessionGate, Xt as OpenFlowWorkbench, Be as isWorkbenchLanguage, Ve as resolveWorkbenchLanguage, ze as workbenchLanguageNames, Re as workbenchLanguages };
|