@arbidocs/blocks 0.5.142 → 0.5.143
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/{ConnectedCallDock-ZNS5BS2R.cjs → ConnectedCallDock-JVLJEWLJ.cjs} +11 -11
- package/dist/{ConnectedCallDock-ZNS5BS2R.cjs.map → ConnectedCallDock-JVLJEWLJ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-ACNVSFH7.cjs → ConnectedCallRoom-7YQRDIS3.cjs} +11 -11
- package/dist/{ConnectedCallRoom-ACNVSFH7.cjs.map → ConnectedCallRoom-7YQRDIS3.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-KZIMMOOL.cjs → ConnectedNativeDocxComparison-FWUYOTSF.cjs} +10 -10
- package/dist/{ConnectedNativeDocxComparison-KZIMMOOL.cjs.map → ConnectedNativeDocxComparison-FWUYOTSF.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-3JXN6SRT.cjs → ConnectedPresentation-JJXQBIV2.cjs} +12 -12
- package/dist/{ConnectedPresentation-3JXN6SRT.cjs.map → ConnectedPresentation-JJXQBIV2.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-IECS2MJI.cjs → ConnectedSlidesTab-BLR762KY.cjs} +12 -12
- package/dist/{ConnectedSlidesTab-IECS2MJI.cjs.map → ConnectedSlidesTab-BLR762KY.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-2FUCYULO.cjs → ConnectedStreamedWordArtifact-LXXTFGIW.cjs} +10 -10
- package/dist/{ConnectedStreamedWordArtifact-2FUCYULO.cjs.map → ConnectedStreamedWordArtifact-LXXTFGIW.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-4CVIX3PD.cjs → FilesViewerDialog-VOCAK22P.cjs} +19 -19
- package/dist/{FilesViewerDialog-4CVIX3PD.cjs.map → FilesViewerDialog-VOCAK22P.cjs.map} +1 -1
- package/dist/agents/index.cjs +362 -362
- package/dist/agents/workflows/StepParts.js +3 -0
- package/dist/agents/workflows/StepParts.js.map +2 -2
- package/dist/agents/workflows/WorkflowStepAction.d.ts +3 -1
- package/dist/agents/workflows/WorkflowStepAction.js +24 -3
- package/dist/agents/workflows/WorkflowStepAction.js.map +2 -2
- package/dist/agents/workflows/planSteps.js +24 -0
- package/dist/agents/workflows/planSteps.js.map +2 -2
- package/dist/agents/workflows/run.d.ts +1 -1
- package/dist/agents/workflows/run.js +9 -1
- package/dist/agents/workflows/run.js.map +2 -2
- package/dist/agents/workflows/stepKinds.d.ts +2 -1
- package/dist/agents/workflows/stepKinds.js +7 -4
- package/dist/agents/workflows/stepKinds.js.map +2 -2
- package/dist/agents/workflows/types.d.ts +22 -1
- package/dist/agents/workflows/types.js.map +1 -1
- package/dist/agents/workflows/useWorkflowView.js +13 -2
- package/dist/agents/workflows/useWorkflowView.js.map +3 -3
- package/dist/{ai-QEXZ4SYR.cjs → ai-YX3OAC4F.cjs} +23 -23
- package/dist/ai-YX3OAC4F.cjs.map +1 -0
- package/dist/calls/index.cjs +2 -2
- package/dist/chat/index.cjs +58 -58
- package/dist/{chunk-DGAGSP5G.cjs → chunk-2V5HW6T5.cjs} +6 -6
- package/dist/{chunk-DGAGSP5G.cjs.map → chunk-2V5HW6T5.cjs.map} +1 -1
- package/dist/{chunk-TXBXIUTX.cjs → chunk-2VEQKLNN.cjs} +6 -6
- package/dist/{chunk-TXBXIUTX.cjs.map → chunk-2VEQKLNN.cjs.map} +1 -1
- package/dist/{chunk-TOYKBRAU.cjs → chunk-2XZ3HBAA.cjs} +27 -27
- package/dist/{chunk-TOYKBRAU.cjs.map → chunk-2XZ3HBAA.cjs.map} +1 -1
- package/dist/{chunk-NRRX3TYV.cjs → chunk-36YSDDHB.cjs} +8 -8
- package/dist/{chunk-NRRX3TYV.cjs.map → chunk-36YSDDHB.cjs.map} +1 -1
- package/dist/{chunk-R7VF2UFA.cjs → chunk-3RN64MXC.cjs} +4 -4
- package/dist/{chunk-R7VF2UFA.cjs.map → chunk-3RN64MXC.cjs.map} +1 -1
- package/dist/{chunk-F6CEPWIF.cjs → chunk-5RMVFFVW.cjs} +7 -7
- package/dist/{chunk-F6CEPWIF.cjs.map → chunk-5RMVFFVW.cjs.map} +1 -1
- package/dist/{chunk-VZUXTF3U.cjs → chunk-6NHOZTIY.cjs} +80 -75
- package/dist/chunk-6NHOZTIY.cjs.map +1 -0
- package/dist/{chunk-MSJGEZHL.cjs → chunk-6RJXO2NF.cjs} +6 -6
- package/dist/{chunk-MSJGEZHL.cjs.map → chunk-6RJXO2NF.cjs.map} +1 -1
- package/dist/{chunk-OOHBXCDV.cjs → chunk-6TU4YLFW.cjs} +18 -18
- package/dist/{chunk-OOHBXCDV.cjs.map → chunk-6TU4YLFW.cjs.map} +1 -1
- package/dist/{chunk-QFXOTJ6G.cjs → chunk-73ECBDG7.cjs} +38 -14
- package/dist/chunk-73ECBDG7.cjs.map +1 -0
- package/dist/{chunk-5A6T4W46.cjs → chunk-7D4WXUBS.cjs} +7 -7
- package/dist/{chunk-5A6T4W46.cjs.map → chunk-7D4WXUBS.cjs.map} +1 -1
- package/dist/{chunk-PIYYBPHH.cjs → chunk-BCRB42SP.cjs} +56 -5
- package/dist/chunk-BCRB42SP.cjs.map +1 -0
- package/dist/{chunk-OOW7H2YD.cjs → chunk-FK7MBD5H.cjs} +6 -6
- package/dist/{chunk-OOW7H2YD.cjs.map → chunk-FK7MBD5H.cjs.map} +1 -1
- package/dist/{chunk-X46QYO4S.cjs → chunk-FSGMWE5I.cjs} +9 -9
- package/dist/{chunk-X46QYO4S.cjs.map → chunk-FSGMWE5I.cjs.map} +1 -1
- package/dist/{chunk-ZTHYJP4G.cjs → chunk-GF3I3SA4.cjs} +10 -10
- package/dist/{chunk-ZTHYJP4G.cjs.map → chunk-GF3I3SA4.cjs.map} +1 -1
- package/dist/{chunk-EQTZQD66.cjs → chunk-I2LJ7RZ2.cjs} +17 -9
- package/dist/chunk-I2LJ7RZ2.cjs.map +1 -0
- package/dist/{chunk-LFMOQALU.cjs → chunk-JJDJLAC7.cjs} +9 -9
- package/dist/{chunk-LFMOQALU.cjs.map → chunk-JJDJLAC7.cjs.map} +1 -1
- package/dist/{chunk-VL7ZX4KQ.cjs → chunk-KMOIE2XH.cjs} +12 -9
- package/dist/chunk-KMOIE2XH.cjs.map +1 -0
- package/dist/{chunk-MEYQLQWS.cjs → chunk-MC34TXSS.cjs} +17 -17
- package/dist/{chunk-MEYQLQWS.cjs.map → chunk-MC34TXSS.cjs.map} +1 -1
- package/dist/{chunk-UWTCK5IN.cjs → chunk-NPRNR54M.cjs} +8 -8
- package/dist/{chunk-UWTCK5IN.cjs.map → chunk-NPRNR54M.cjs.map} +1 -1
- package/dist/{chunk-ORQXGMCC.cjs → chunk-OE36OY64.cjs} +17 -17
- package/dist/{chunk-ORQXGMCC.cjs.map → chunk-OE36OY64.cjs.map} +1 -1
- package/dist/{chunk-UVP5RJWA.cjs → chunk-P2AZ2HX7.cjs} +70 -70
- package/dist/{chunk-UVP5RJWA.cjs.map → chunk-P2AZ2HX7.cjs.map} +1 -1
- package/dist/{chunk-GG7QKDV5.cjs → chunk-PI4U4LEN.cjs} +7 -7
- package/dist/{chunk-GG7QKDV5.cjs.map → chunk-PI4U4LEN.cjs.map} +1 -1
- package/dist/{chunk-R5NTEW4L.cjs → chunk-UKAN76CS.cjs} +144 -109
- package/dist/chunk-UKAN76CS.cjs.map +1 -0
- package/dist/{chunk-JN5YMHGI.cjs → chunk-XPQR2PJX.cjs} +2 -2
- package/dist/chunk-XPQR2PJX.cjs.map +1 -0
- package/dist/{chunk-ACDMGTHX.cjs → chunk-YOSRBLLD.cjs} +5 -5
- package/dist/{chunk-ACDMGTHX.cjs.map → chunk-YOSRBLLD.cjs.map} +1 -1
- package/dist/{chunk-6CGMSJLB.cjs → chunk-YST6GVN5.cjs} +16 -16
- package/dist/{chunk-6CGMSJLB.cjs.map → chunk-YST6GVN5.cjs.map} +1 -1
- package/dist/{chunk-RSQGDXAF.cjs → chunk-YZ25NAR3.cjs} +11 -11
- package/dist/{chunk-RSQGDXAF.cjs.map → chunk-YZ25NAR3.cjs.map} +1 -1
- package/dist/{chunk-56Z6CQC6.cjs → chunk-Z6FJLJWX.cjs} +4 -4
- package/dist/{chunk-56Z6CQC6.cjs.map → chunk-Z6FJLJWX.cjs.map} +1 -1
- package/dist/connect/docx.cjs +13 -13
- package/dist/connect/index.cjs +429 -382
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +8 -8
- package/dist/connection/ConnectedWorkflowBuilder.js +8 -0
- package/dist/connection/ConnectedWorkflowBuilder.js.map +2 -2
- package/dist/connection/billing/StripeCheckoutModal.js +1 -1
- package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
- package/dist/connection/databases/ConnectedDatabasesPage.js +50 -8
- package/dist/connection/databases/ConnectedDatabasesPage.js.map +2 -2
- package/dist/connection/notification-center/useOpenNotificationTarget.d.ts +2 -0
- package/dist/connection/notification-center/useOpenNotificationTarget.js +11 -2
- package/dist/connection/notification-center/useOpenNotificationTarget.js.map +2 -2
- package/dist/connection/tasks/ConnectedThreadTaskBar.js +9 -2
- package/dist/connection/tasks/ConnectedThreadTaskBar.js.map +2 -2
- package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +2 -2
- package/dist/databases/DatabaseColumnDialog.d.ts +13 -0
- package/dist/databases/DatabaseColumnDialog.js +38 -1
- package/dist/databases/DatabaseColumnDialog.js.map +2 -2
- package/dist/databases/DatabaseRowDetail.d.ts +6 -1
- package/dist/databases/DatabaseRowDetail.js +15 -1
- package/dist/databases/DatabaseRowDetail.js.map +2 -2
- package/dist/databases/column-types.d.ts +14 -0
- package/dist/databases/column-types.js.map +2 -2
- package/dist/databases/databaseColumns.js +1 -1
- package/dist/databases/databaseColumns.js.map +2 -2
- package/dist/databases/index.cjs +48 -48
- package/dist/embed/index.cjs +20 -20
- package/dist/index.cjs +471 -471
- package/dist/office/index.cjs +5 -5
- package/dist/studio/index.cjs +14 -14
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/StepActionSettings.d.ts +25 -1
- package/dist/workflow-canvas/StepActionSettings.js +113 -1
- package/dist/workflow-canvas/StepActionSettings.js.map +2 -2
- package/dist/workflow-canvas/StepInspector.d.ts +5 -3
- package/dist/workflow-canvas/StepInspector.js +14 -1
- package/dist/workflow-canvas/StepInspector.js.map +2 -2
- package/dist/workflow-canvas/WorkflowBuilder.d.ts +4 -2
- package/dist/workflow-canvas/WorkflowBuilder.js +8 -2
- package/dist/workflow-canvas/WorkflowBuilder.js.map +2 -2
- package/dist/workflow-canvas/WorkflowCanvas.d.ts +4 -0
- package/dist/workflow-canvas/WorkflowCanvas.js +5 -1
- package/dist/workflow-canvas/WorkflowCanvas.js.map +2 -2
- package/dist/workflow-canvas/edit.js +19 -1
- package/dist/workflow-canvas/edit.js.map +2 -2
- package/dist/workflow-canvas/index.cjs +237 -81
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/blocks.css +3 -0
- package/dist/ai-QEXZ4SYR.cjs.map +0 -1
- package/dist/chunk-EQTZQD66.cjs.map +0 -1
- package/dist/chunk-JN5YMHGI.cjs.map +0 -1
- package/dist/chunk-PIYYBPHH.cjs.map +0 -1
- package/dist/chunk-QFXOTJ6G.cjs.map +0 -1
- package/dist/chunk-R5NTEW4L.cjs.map +0 -1
- package/dist/chunk-VL7ZX4KQ.cjs.map +0 -1
- package/dist/chunk-VZUXTF3U.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk6NHOZTIY_cjs = require('../chunk-6NHOZTIY.cjs');
|
|
5
5
|
require('../chunk-32W2S6DE.cjs');
|
|
6
6
|
require('../chunk-KWJW5TMH.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-OE36OY64.cjs');
|
|
8
8
|
require('../chunk-33GOYI3O.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkYST6GVN5_cjs = require('../chunk-YST6GVN5.cjs');
|
|
10
10
|
require('../chunk-AEQT2QQX.cjs');
|
|
11
11
|
var chunkUD56Y6UA_cjs = require('../chunk-UD56Y6UA.cjs');
|
|
12
12
|
require('../chunk-KP7BQIZL.cjs');
|
|
@@ -15,11 +15,11 @@ require('../chunk-HYUKPHCT.cjs');
|
|
|
15
15
|
require('../chunk-ZPIZINH2.cjs');
|
|
16
16
|
require('../chunk-223D4727.cjs');
|
|
17
17
|
require('../chunk-SNUBQMIS.cjs');
|
|
18
|
-
var
|
|
18
|
+
var chunkPI4U4LEN_cjs = require('../chunk-PI4U4LEN.cjs');
|
|
19
19
|
require('../chunk-4ONPEVTP.cjs');
|
|
20
20
|
require('../chunk-V3KLUWQQ.cjs');
|
|
21
21
|
var chunkOA3AN6WW_cjs = require('../chunk-OA3AN6WW.cjs');
|
|
22
|
-
require('../chunk-
|
|
22
|
+
require('../chunk-FK7MBD5H.cjs');
|
|
23
23
|
require('../chunk-OUYBYZ7Y.cjs');
|
|
24
24
|
require('../chunk-QQMMCXBP.cjs');
|
|
25
25
|
require('../chunk-DTMBAFIL.cjs');
|
|
@@ -32,12 +32,12 @@ require('../chunk-TG2GM7WJ.cjs');
|
|
|
32
32
|
require('../chunk-A53YMUOX.cjs');
|
|
33
33
|
var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
|
|
34
34
|
require('../chunk-OEJQFPWO.cjs');
|
|
35
|
-
var
|
|
36
|
-
var
|
|
35
|
+
var chunkFSGMWE5I_cjs = require('../chunk-FSGMWE5I.cjs');
|
|
36
|
+
var chunkUKAN76CS_cjs = require('../chunk-UKAN76CS.cjs');
|
|
37
37
|
require('../chunk-CYN66TBO.cjs');
|
|
38
|
-
var
|
|
38
|
+
var chunk73ECBDG7_cjs = require('../chunk-73ECBDG7.cjs');
|
|
39
39
|
var chunkI4IS6ST6_cjs = require('../chunk-I4IS6ST6.cjs');
|
|
40
|
-
var
|
|
40
|
+
var chunk7D4WXUBS_cjs = require('../chunk-7D4WXUBS.cjs');
|
|
41
41
|
require('../chunk-EVZH6Z5O.cjs');
|
|
42
42
|
require('../chunk-OYXWQTHF.cjs');
|
|
43
43
|
require('../chunk-S237ORM3.cjs');
|
|
@@ -45,11 +45,11 @@ require('../chunk-II2OEXHW.cjs');
|
|
|
45
45
|
require('../chunk-JJZOL5MG.cjs');
|
|
46
46
|
require('../chunk-3YEXZX4H.cjs');
|
|
47
47
|
require('../chunk-4PA6VCCR.cjs');
|
|
48
|
-
var
|
|
48
|
+
var chunkYZ25NAR3_cjs = require('../chunk-YZ25NAR3.cjs');
|
|
49
49
|
require('../chunk-AHDJXIUB.cjs');
|
|
50
|
+
require('../chunk-S5OGPQSB.cjs');
|
|
50
51
|
require('../chunk-RL2HI6NP.cjs');
|
|
51
52
|
require('../chunk-6UZC4XVV.cjs');
|
|
52
|
-
require('../chunk-S5OGPQSB.cjs');
|
|
53
53
|
require('../chunk-OUGRCQM7.cjs');
|
|
54
54
|
require('../chunk-ZVEW3JBT.cjs');
|
|
55
55
|
require('../chunk-M74FWYNL.cjs');
|
|
@@ -65,17 +65,17 @@ require('../chunk-SJSGSHIT.cjs');
|
|
|
65
65
|
require('../chunk-ZW6FPIFC.cjs');
|
|
66
66
|
require('../chunk-ZT5MIFLC.cjs');
|
|
67
67
|
require('../chunk-XZMYSDU4.cjs');
|
|
68
|
-
require('../chunk-
|
|
69
|
-
require('../chunk-
|
|
68
|
+
require('../chunk-6TU4YLFW.cjs');
|
|
69
|
+
require('../chunk-5RMVFFVW.cjs');
|
|
70
70
|
require('../chunk-5F4DCIHS.cjs');
|
|
71
71
|
require('../chunk-MCXS6X37.cjs');
|
|
72
72
|
require('../chunk-KQF7POTG.cjs');
|
|
73
73
|
require('../chunk-75BNMCUX.cjs');
|
|
74
74
|
require('../chunk-IN6ILI5A.cjs');
|
|
75
|
-
var
|
|
75
|
+
var chunkKMOIE2XH_cjs = require('../chunk-KMOIE2XH.cjs');
|
|
76
76
|
require('../chunk-FX3K6LNZ.cjs');
|
|
77
|
-
var
|
|
78
|
-
var
|
|
77
|
+
var chunkI2LJ7RZ2_cjs = require('../chunk-I2LJ7RZ2.cjs');
|
|
78
|
+
var chunkXPQR2PJX_cjs = require('../chunk-XPQR2PJX.cjs');
|
|
79
79
|
var chunkUDSHVNU3_cjs = require('../chunk-UDSHVNU3.cjs');
|
|
80
80
|
require('../chunk-IPSHAMO2.cjs');
|
|
81
81
|
require('../chunk-PPCATBOY.cjs');
|
|
@@ -107,11 +107,11 @@ function withSteps(workflow, steps, layout) {
|
|
|
107
107
|
const run = workflow.run.kind === "steps" ? workflow.run : { kind: "steps", steps: [] };
|
|
108
108
|
return {
|
|
109
109
|
...workflow,
|
|
110
|
-
run: { ...run, steps:
|
|
110
|
+
run: { ...run, steps: chunkI2LJ7RZ2_cjs.orderSteps(steps), layout: layout ?? run.layout }
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
var layoutOf = (workflow) => workflow.run.kind === "steps" && workflow.run.layout || {};
|
|
114
|
-
var explicit = (steps) => steps.map((s) => ({ ...s, after:
|
|
114
|
+
var explicit = (steps) => steps.map((s) => ({ ...s, after: chunkI2LJ7RZ2_cjs.stepDependencies(steps, s.id) }));
|
|
115
115
|
function stepIdFor(steps, title) {
|
|
116
116
|
const base = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "") || "step";
|
|
117
117
|
const taken = new Set(steps.map((s) => s.id));
|
|
@@ -127,7 +127,8 @@ var DEFAULT_TITLES = {
|
|
|
127
127
|
review: "Review",
|
|
128
128
|
sign: "Sign",
|
|
129
129
|
email_draft: "Email draft",
|
|
130
|
-
tabular_review: "Tabular review"
|
|
130
|
+
tabular_review: "Tabular review",
|
|
131
|
+
approval: "Request approval"
|
|
131
132
|
};
|
|
132
133
|
function blankStep(kind, id, title) {
|
|
133
134
|
switch (kind) {
|
|
@@ -155,10 +156,17 @@ function blankStep(kind, id, title) {
|
|
|
155
156
|
title,
|
|
156
157
|
action: { type: "tabular_review", tags: [], documents: "run_uploads" }
|
|
157
158
|
};
|
|
159
|
+
case "approval":
|
|
160
|
+
return {
|
|
161
|
+
id,
|
|
162
|
+
kind: "action",
|
|
163
|
+
title,
|
|
164
|
+
action: { type: "approval", database: "", decision: "", values: {} }
|
|
165
|
+
};
|
|
158
166
|
}
|
|
159
167
|
}
|
|
160
168
|
function addStep(workflow, kind, options = {}) {
|
|
161
|
-
const steps = explicit(
|
|
169
|
+
const steps = explicit(chunkI2LJ7RZ2_cjs.workflowSteps(workflow));
|
|
162
170
|
const title = options.title ?? DEFAULT_TITLES[kind];
|
|
163
171
|
const id = stepIdFor(steps, title);
|
|
164
172
|
const step = { ...blankStep(kind, id, title), after: options.after ? [options.after] : [] };
|
|
@@ -167,7 +175,7 @@ function addStep(workflow, kind, options = {}) {
|
|
|
167
175
|
return { workflow: withSteps(workflow, [...steps, step], layout), id };
|
|
168
176
|
}
|
|
169
177
|
function removeStep(workflow, id) {
|
|
170
|
-
const steps = explicit(
|
|
178
|
+
const steps = explicit(chunkI2LJ7RZ2_cjs.workflowSteps(workflow));
|
|
171
179
|
const removed = steps.find((s) => s.id === id);
|
|
172
180
|
if (!removed) return workflow;
|
|
173
181
|
const bridged = steps.filter((s) => s.id !== id).map(
|
|
@@ -180,8 +188,8 @@ function removeStep(workflow, id) {
|
|
|
180
188
|
return withSteps(workflow, bridged, layout);
|
|
181
189
|
}
|
|
182
190
|
function connectSteps(workflow, from, to) {
|
|
183
|
-
const steps = explicit(
|
|
184
|
-
if (from === to || !steps.some((s) => s.id === from) ||
|
|
191
|
+
const steps = explicit(chunkI2LJ7RZ2_cjs.workflowSteps(workflow));
|
|
192
|
+
if (from === to || !steps.some((s) => s.id === from) || chunkI2LJ7RZ2_cjs.dependsOn(steps, from, to)) {
|
|
185
193
|
return workflow;
|
|
186
194
|
}
|
|
187
195
|
return withSteps(
|
|
@@ -191,16 +199,16 @@ function connectSteps(workflow, from, to) {
|
|
|
191
199
|
)
|
|
192
200
|
);
|
|
193
201
|
}
|
|
194
|
-
var wouldCycle = (workflow, from, to) => from === to ||
|
|
202
|
+
var wouldCycle = (workflow, from, to) => from === to || chunkI2LJ7RZ2_cjs.dependsOn(chunkI2LJ7RZ2_cjs.workflowSteps(workflow), from, to);
|
|
195
203
|
function disconnectSteps(workflow, from, to) {
|
|
196
|
-
const steps = explicit(
|
|
204
|
+
const steps = explicit(chunkI2LJ7RZ2_cjs.workflowSteps(workflow));
|
|
197
205
|
return withSteps(
|
|
198
206
|
workflow,
|
|
199
207
|
steps.map((s) => s.id === to ? { ...s, after: (s.after ?? []).filter((d) => d !== from) } : s)
|
|
200
208
|
);
|
|
201
209
|
}
|
|
202
210
|
function updateStep(workflow, id, patch) {
|
|
203
|
-
const steps = explicit(
|
|
211
|
+
const steps = explicit(chunkI2LJ7RZ2_cjs.workflowSteps(workflow));
|
|
204
212
|
return withSteps(
|
|
205
213
|
workflow,
|
|
206
214
|
steps.map(
|
|
@@ -214,7 +222,7 @@ var renameIn = (text, from, to) => text.replace(
|
|
|
214
222
|
);
|
|
215
223
|
function renameInput(workflow, from, to) {
|
|
216
224
|
if (from === to) return workflow;
|
|
217
|
-
const steps =
|
|
225
|
+
const steps = chunkI2LJ7RZ2_cjs.workflowSteps(workflow).map((s) => {
|
|
218
226
|
if (s.kind === "agent")
|
|
219
227
|
return {
|
|
220
228
|
...s,
|
|
@@ -250,6 +258,16 @@ function renameInput(workflow, from, to) {
|
|
|
250
258
|
...a.attachments ? { attachments: a.attachments.map((r) => renameRef(r, from, to)) } : {}
|
|
251
259
|
}
|
|
252
260
|
};
|
|
261
|
+
if (a.type === "approval")
|
|
262
|
+
return {
|
|
263
|
+
...base,
|
|
264
|
+
action: {
|
|
265
|
+
...a,
|
|
266
|
+
values: Object.fromEntries(
|
|
267
|
+
Object.entries(a.values ?? {}).map(([k, v]) => [k, renameIn(v, from, to)])
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
};
|
|
253
271
|
if (Array.isArray(a.documents))
|
|
254
272
|
return {
|
|
255
273
|
...base,
|
|
@@ -263,13 +281,13 @@ function renameInput(workflow, from, to) {
|
|
|
263
281
|
var renamePerson = (a, from, to) => "input" in a && a.input === from ? { input: to } : a;
|
|
264
282
|
var renameRef = (r, from, to) => "input" in r && r.input === from ? { input: to } : r;
|
|
265
283
|
function moveStep(workflow, id, position) {
|
|
266
|
-
return withSteps(workflow,
|
|
284
|
+
return withSteps(workflow, chunkI2LJ7RZ2_cjs.workflowSteps(workflow), { ...layoutOf(workflow), [id]: position });
|
|
267
285
|
}
|
|
268
286
|
var COLUMN = 300;
|
|
269
287
|
var ROW = 140;
|
|
270
288
|
function autoLayout(steps) {
|
|
271
289
|
const layout = {};
|
|
272
|
-
|
|
290
|
+
chunkI2LJ7RZ2_cjs.stepLevels(steps).forEach(
|
|
273
291
|
(level, x) => level.forEach((s, y) => {
|
|
274
292
|
layout[s.id] = { x: x * COLUMN, y: (y - (level.length - 1) / 2) * ROW };
|
|
275
293
|
})
|
|
@@ -277,7 +295,7 @@ function autoLayout(steps) {
|
|
|
277
295
|
return layout;
|
|
278
296
|
}
|
|
279
297
|
function layoutWithDefaults(workflow) {
|
|
280
|
-
const auto = autoLayout(
|
|
298
|
+
const auto = autoLayout(chunkI2LJ7RZ2_cjs.workflowSteps(workflow));
|
|
281
299
|
return { ...auto, ...layoutOf(workflow) };
|
|
282
300
|
}
|
|
283
301
|
var DEFAULT_SIGNALS_EDITOR_LABELS = {
|
|
@@ -374,9 +392,9 @@ function SignalsEditor({
|
|
|
374
392
|
{
|
|
375
393
|
className: ui.cn(
|
|
376
394
|
"space-y-1.5 rounded-md border p-2",
|
|
377
|
-
|
|
395
|
+
chunk73ECBDG7_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
|
|
378
396
|
),
|
|
379
|
-
"data-incomplete":
|
|
397
|
+
"data-incomplete": chunk73ECBDG7_cjs.isIncompleteSignal(signal) || void 0,
|
|
380
398
|
"data-testid": `${testId}-${i}`,
|
|
381
399
|
children: [
|
|
382
400
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -538,7 +556,16 @@ var DEFAULT_STEP_ACTION_SETTINGS_LABELS = {
|
|
|
538
556
|
addDocument: "Add document",
|
|
539
557
|
overwrite: "Fill cells that already have a value again",
|
|
540
558
|
editDocument: "Edit this document (tracked changes)",
|
|
541
|
-
editDocumentHint: "The instruction says what to change; the edited copy is saved as its next version, to accept or reject change by change."
|
|
559
|
+
editDocumentHint: "The instruction says what to change; the edited copy is saved as its next version, to accept or reject change by change.",
|
|
560
|
+
approvalDatabase: "Requests database",
|
|
561
|
+
chooseDatabase: "Choose a database\u2026",
|
|
562
|
+
approvalDecision: "Decision column",
|
|
563
|
+
approvalDecisionHint: "Its approvers are the people its edit rule lists; one of them decides on the request row.",
|
|
564
|
+
chooseColumn: "Choose a column\u2026",
|
|
565
|
+
approvalValues: "Request fields",
|
|
566
|
+
approvalValuesHint: "Each column is filled from the run, e.g. {{client}}. Blank: left empty.",
|
|
567
|
+
approvalWords: "Decision words",
|
|
568
|
+
approvalWordsHint: "Approve \xB7 Send back \xB7 Reject (matched on the decision cell)."
|
|
542
569
|
};
|
|
543
570
|
var selectClass2 = "flex h-9 w-full rounded-md border border-input bg-background px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring";
|
|
544
571
|
function Field({
|
|
@@ -993,6 +1020,108 @@ function TabularReviewSettings({
|
|
|
993
1020
|
] })
|
|
994
1021
|
] });
|
|
995
1022
|
}
|
|
1023
|
+
function ApprovalSettings({
|
|
1024
|
+
action,
|
|
1025
|
+
onChange,
|
|
1026
|
+
ctx,
|
|
1027
|
+
l,
|
|
1028
|
+
testId
|
|
1029
|
+
}) {
|
|
1030
|
+
const set = (p) => onChange({ ...action, ...p });
|
|
1031
|
+
const databases = ctx.databases ?? [];
|
|
1032
|
+
const chosen = databases.find((d) => d.value === action.database);
|
|
1033
|
+
const values = action.values ?? {};
|
|
1034
|
+
const setValue = (column, template) => {
|
|
1035
|
+
const next = { ...values };
|
|
1036
|
+
if (template.trim()) next[column] = template;
|
|
1037
|
+
else delete next[column];
|
|
1038
|
+
set({ values: next });
|
|
1039
|
+
};
|
|
1040
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1041
|
+
/* @__PURE__ */ jsxRuntime.jsx(Field, { label: l.approvalDatabase, children: databases.length ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1042
|
+
"select",
|
|
1043
|
+
{
|
|
1044
|
+
className: selectClass2,
|
|
1045
|
+
value: action.database,
|
|
1046
|
+
onChange: (e) => set({ database: e.target.value, decision: "", values: {} }),
|
|
1047
|
+
"data-testid": `${testId}-database`,
|
|
1048
|
+
children: [
|
|
1049
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: l.chooseDatabase }),
|
|
1050
|
+
databases.map((d) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: d.value, children: d.label }, d.value))
|
|
1051
|
+
]
|
|
1052
|
+
}
|
|
1053
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1054
|
+
ui.Input,
|
|
1055
|
+
{
|
|
1056
|
+
value: action.database,
|
|
1057
|
+
placeholder: "dbs-\u2026",
|
|
1058
|
+
onChange: (e) => set({ database: e.target.value.trim() }),
|
|
1059
|
+
"data-testid": `${testId}-database`
|
|
1060
|
+
}
|
|
1061
|
+
) }),
|
|
1062
|
+
/* @__PURE__ */ jsxRuntime.jsx(Field, { label: l.approvalDecision, hint: l.approvalDecisionHint, children: chosen ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1063
|
+
"select",
|
|
1064
|
+
{
|
|
1065
|
+
className: selectClass2,
|
|
1066
|
+
value: action.decision,
|
|
1067
|
+
onChange: (e) => set({ decision: e.target.value }),
|
|
1068
|
+
"data-testid": `${testId}-decision`,
|
|
1069
|
+
children: [
|
|
1070
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: l.chooseColumn }),
|
|
1071
|
+
chosen.columns.filter((c) => c.decides).map((c) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c.value, children: c.label }, c.value))
|
|
1072
|
+
]
|
|
1073
|
+
}
|
|
1074
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1075
|
+
ui.Input,
|
|
1076
|
+
{
|
|
1077
|
+
value: action.decision,
|
|
1078
|
+
onChange: (e) => set({ decision: e.target.value }),
|
|
1079
|
+
"data-testid": `${testId}-decision`
|
|
1080
|
+
}
|
|
1081
|
+
) }),
|
|
1082
|
+
chosen && /* @__PURE__ */ jsxRuntime.jsx(Field, { label: l.approvalValues, hint: l.approvalValuesHint, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", "data-testid": `${testId}-values`, children: chosen.columns.filter((c) => !c.decides).map((c) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[8rem_1fr] items-center gap-2", children: [
|
|
1083
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: c.label }),
|
|
1084
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1085
|
+
ui.Input,
|
|
1086
|
+
{
|
|
1087
|
+
value: values[c.value] ?? "",
|
|
1088
|
+
placeholder: `{{${c.label.toLowerCase().replace(/[^a-z0-9]+/g, "_")}}}`,
|
|
1089
|
+
onChange: (e) => setValue(c.value, e.target.value),
|
|
1090
|
+
"data-testid": `${testId}-value-${c.value}`
|
|
1091
|
+
}
|
|
1092
|
+
)
|
|
1093
|
+
] }, c.value)) }) }),
|
|
1094
|
+
/* @__PURE__ */ jsxRuntime.jsx(Field, { label: l.approvalWords, hint: l.approvalWordsHint, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-2", children: [
|
|
1095
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1096
|
+
ui.Input,
|
|
1097
|
+
{
|
|
1098
|
+
value: action.approve ?? "",
|
|
1099
|
+
placeholder: "Approved",
|
|
1100
|
+
onChange: (e) => set({ approve: e.target.value || void 0 }),
|
|
1101
|
+
"data-testid": `${testId}-approve`
|
|
1102
|
+
}
|
|
1103
|
+
),
|
|
1104
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1105
|
+
ui.Input,
|
|
1106
|
+
{
|
|
1107
|
+
value: action.sendBack ?? "",
|
|
1108
|
+
placeholder: "Sent back",
|
|
1109
|
+
onChange: (e) => set({ sendBack: e.target.value || void 0 }),
|
|
1110
|
+
"data-testid": `${testId}-send-back`
|
|
1111
|
+
}
|
|
1112
|
+
),
|
|
1113
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1114
|
+
ui.Input,
|
|
1115
|
+
{
|
|
1116
|
+
value: action.reject ?? "",
|
|
1117
|
+
placeholder: "Rejected",
|
|
1118
|
+
onChange: (e) => set({ reject: e.target.value || void 0 }),
|
|
1119
|
+
"data-testid": `${testId}-reject`
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
] }) })
|
|
1123
|
+
] });
|
|
1124
|
+
}
|
|
996
1125
|
function EditDocumentSettings({
|
|
997
1126
|
step,
|
|
998
1127
|
patch,
|
|
@@ -1199,6 +1328,7 @@ function StepInspector({
|
|
|
1199
1328
|
people = [],
|
|
1200
1329
|
tags = [],
|
|
1201
1330
|
documents = [],
|
|
1331
|
+
databases = [],
|
|
1202
1332
|
labels,
|
|
1203
1333
|
actionLabels,
|
|
1204
1334
|
signalLabels,
|
|
@@ -1207,7 +1337,7 @@ function StepInspector({
|
|
|
1207
1337
|
}) {
|
|
1208
1338
|
const l = { ...DEFAULT_STEP_INSPECTOR_LABELS, ...labels };
|
|
1209
1339
|
const ol = { ...DEFAULT_FIELD_OPTIONS_EDITOR_LABELS, ...optionLabels };
|
|
1210
|
-
const steps =
|
|
1340
|
+
const steps = chunkI2LJ7RZ2_cjs.workflowSteps(workflow);
|
|
1211
1341
|
const step = steps.find((s) => s.id === stepId);
|
|
1212
1342
|
const run = workflow.run.kind === "steps" ? workflow.run : void 0;
|
|
1213
1343
|
if (!step || !run) {
|
|
@@ -1234,11 +1364,12 @@ function StepInspector({
|
|
|
1234
1364
|
const patch = (p) => onChange(updateStep(workflow, step.id, p));
|
|
1235
1365
|
const al = { ...DEFAULT_STEP_ACTION_SETTINGS_LABELS, ...actionLabels };
|
|
1236
1366
|
const ctx = {
|
|
1237
|
-
earlier:
|
|
1238
|
-
fields:
|
|
1367
|
+
earlier: chunkI2LJ7RZ2_cjs.upstreamSteps(steps, step.id),
|
|
1368
|
+
fields: chunkI2LJ7RZ2_cjs.runFields(workflow),
|
|
1239
1369
|
people,
|
|
1240
1370
|
tags,
|
|
1241
|
-
documents
|
|
1371
|
+
documents,
|
|
1372
|
+
databases
|
|
1242
1373
|
};
|
|
1243
1374
|
const takenBy = (id) => steps.flatMap(
|
|
1244
1375
|
(s) => s.id === id ? [] : s.kind === "form" ? s.inputs : s.kind === "review" ? s.fields ?? [] : []
|
|
@@ -1256,7 +1387,7 @@ function StepInspector({
|
|
|
1256
1387
|
)
|
|
1257
1388
|
);
|
|
1258
1389
|
};
|
|
1259
|
-
const deps =
|
|
1390
|
+
const deps = chunkI2LJ7RZ2_cjs.stepDependencies(steps, step.id);
|
|
1260
1391
|
const titleOf = (id) => steps.find((s) => s.id === id)?.title ?? id;
|
|
1261
1392
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": `${testId}-step`, children: [
|
|
1262
1393
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
@@ -1337,7 +1468,7 @@ function StepInspector({
|
|
|
1337
1468
|
{
|
|
1338
1469
|
step,
|
|
1339
1470
|
workflows,
|
|
1340
|
-
fields:
|
|
1471
|
+
fields: chunkI2LJ7RZ2_cjs.runFields(workflow).map((f) => f.name),
|
|
1341
1472
|
patch,
|
|
1342
1473
|
l,
|
|
1343
1474
|
testId
|
|
@@ -1398,7 +1529,17 @@ function StepInspector({
|
|
|
1398
1529
|
testId: `${testId}-review-grid`
|
|
1399
1530
|
}
|
|
1400
1531
|
),
|
|
1401
|
-
|
|
1532
|
+
step.kind === "action" && step.action.type === "approval" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
+
ApprovalSettings,
|
|
1534
|
+
{
|
|
1535
|
+
action: step.action,
|
|
1536
|
+
onChange: (action) => patch({ action }),
|
|
1537
|
+
ctx,
|
|
1538
|
+
l: al,
|
|
1539
|
+
testId: `${testId}-approval`
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
chunkI2LJ7RZ2_cjs.canAssign(step) && /* @__PURE__ */ jsxRuntime.jsx(AssigneeSettings, { step, patch, ctx, l: al, testId }),
|
|
1402
1543
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1403
1544
|
SignalsEditor,
|
|
1404
1545
|
{
|
|
@@ -1664,7 +1805,7 @@ function triggerFields(trigger, clearOthers) {
|
|
|
1664
1805
|
return {
|
|
1665
1806
|
timezone: trigger.timezone,
|
|
1666
1807
|
rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
|
|
1667
|
-
run_at: trigger.start === "once" ?
|
|
1808
|
+
run_at: trigger.start === "once" ? chunk7D4WXUBS_cjs.localInputToIso(trigger.runAt) : none,
|
|
1668
1809
|
event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
|
|
1669
1810
|
// A step signal is `workflow_signal` narrowed to one signal name.
|
|
1670
1811
|
event_filter: filter ?? none,
|
|
@@ -1680,7 +1821,7 @@ function plan(value, options) {
|
|
|
1680
1821
|
criteria: [],
|
|
1681
1822
|
max_passes: 3,
|
|
1682
1823
|
documents: [],
|
|
1683
|
-
steps:
|
|
1824
|
+
steps: chunk73ECBDG7_cjs.toPlanSteps(value.workflow, options)
|
|
1684
1825
|
};
|
|
1685
1826
|
}
|
|
1686
1827
|
function builderToWorkflowRequest(value, workspaceId, options = {}) {
|
|
@@ -1715,7 +1856,7 @@ function builderToWorkflowUpdate(value, options = {}) {
|
|
|
1715
1856
|
}
|
|
1716
1857
|
function workflowRecordToBuilder(record) {
|
|
1717
1858
|
const planned = record.plan?.steps ?? [];
|
|
1718
|
-
const steps = planned.length ?
|
|
1859
|
+
const steps = planned.length ? chunk73ECBDG7_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
|
|
1719
1860
|
{
|
|
1720
1861
|
id: "work",
|
|
1721
1862
|
kind: "agent",
|
|
@@ -1723,7 +1864,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1723
1864
|
...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
|
|
1724
1865
|
}
|
|
1725
1866
|
] : [];
|
|
1726
|
-
const when =
|
|
1867
|
+
const when = chunk7D4WXUBS_cjs.workflowWhen(record);
|
|
1727
1868
|
return {
|
|
1728
1869
|
workflow: {
|
|
1729
1870
|
id: record.external_id,
|
|
@@ -1732,12 +1873,12 @@ function workflowRecordToBuilder(record) {
|
|
|
1732
1873
|
inputs: [],
|
|
1733
1874
|
landing: "chat",
|
|
1734
1875
|
schedulable: false,
|
|
1735
|
-
run: { kind: "steps", steps, layout:
|
|
1876
|
+
run: { kind: "steps", steps, layout: chunk73ECBDG7_cjs.layoutFromPlanSteps(planned ?? []) }
|
|
1736
1877
|
},
|
|
1737
1878
|
trigger: {
|
|
1738
1879
|
...DEFAULT_WORKFLOW_TRIGGER,
|
|
1739
1880
|
start: when === "now" ? "manual" : when,
|
|
1740
|
-
runAt:
|
|
1881
|
+
runAt: chunk7D4WXUBS_cjs.isoToLocalInput(record.run_at),
|
|
1741
1882
|
rrule: record.rrule ?? "",
|
|
1742
1883
|
timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
|
|
1743
1884
|
eventKind: record.event_kind ?? "",
|
|
@@ -1803,7 +1944,7 @@ function triggerSummary(trigger, options = {}) {
|
|
|
1803
1944
|
case "once":
|
|
1804
1945
|
return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
|
|
1805
1946
|
case "repeat":
|
|
1806
|
-
return trigger.rrule ?
|
|
1947
|
+
return trigger.rrule ? chunk73ECBDG7_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
|
|
1807
1948
|
case "event":
|
|
1808
1949
|
if (isSignalTrigger(trigger))
|
|
1809
1950
|
return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
|
|
@@ -1862,7 +2003,7 @@ function TriggerInspector({
|
|
|
1862
2003
|
}
|
|
1863
2004
|
)
|
|
1864
2005
|
] }),
|
|
1865
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2006
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkUKAN76CS_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1866
2007
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1867
2008
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1868
2009
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1960,7 +2101,7 @@ function TriggerInspector({
|
|
|
1960
2101
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1961
2102
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
|
|
1962
2103
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1963
|
-
|
|
2104
|
+
chunkYZ25NAR3_cjs.AgentSelect,
|
|
1964
2105
|
{
|
|
1965
2106
|
agents,
|
|
1966
2107
|
value: trigger.agentId,
|
|
@@ -2028,7 +2169,7 @@ function revealCenter(node, view, frame, reserveRight = 0) {
|
|
|
2028
2169
|
};
|
|
2029
2170
|
}
|
|
2030
2171
|
var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
2031
|
-
...
|
|
2172
|
+
...chunkKMOIE2XH_cjs.DEFAULT_STEP_KIND_LABELS,
|
|
2032
2173
|
redline: "Tracked changes",
|
|
2033
2174
|
branch: "Branch",
|
|
2034
2175
|
kindHints: {
|
|
@@ -2038,7 +2179,8 @@ var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
|
2038
2179
|
review: "A person approves",
|
|
2039
2180
|
sign: "People e-sign a document",
|
|
2040
2181
|
email_draft: "Prepare an email to send",
|
|
2041
|
-
tabular_review: "Review documents in a grid"
|
|
2182
|
+
tabular_review: "Review documents in a grid",
|
|
2183
|
+
approval: "Submit a request for a decision"
|
|
2042
2184
|
},
|
|
2043
2185
|
addNext: "Add the next step",
|
|
2044
2186
|
runs: "Runs \u201C{name}\u201D",
|
|
@@ -2052,6 +2194,8 @@ var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
|
2052
2194
|
noRecipients: "Add a recipient",
|
|
2053
2195
|
reviewColumns: "{count} columns",
|
|
2054
2196
|
noColumns: "Choose the columns",
|
|
2197
|
+
approvalSummary: "Request: decided on its row",
|
|
2198
|
+
chooseDatabase: "Choose the requests database",
|
|
2055
2199
|
assignee: "{name}",
|
|
2056
2200
|
remind: "Reminds after {hours}h",
|
|
2057
2201
|
emptyTitle: "Start your workflow",
|
|
@@ -2059,7 +2203,7 @@ var DEFAULT_WORKFLOW_CANVAS_LABELS = {
|
|
|
2059
2203
|
fitView: "Fit view"
|
|
2060
2204
|
};
|
|
2061
2205
|
var TRIGGER_NODE = "__trigger";
|
|
2062
|
-
var KINDS =
|
|
2206
|
+
var KINDS = chunkKMOIE2XH_cjs.WORKFLOW_STEP_KINDS;
|
|
2063
2207
|
function AddNext({
|
|
2064
2208
|
from,
|
|
2065
2209
|
onAdd,
|
|
@@ -2081,7 +2225,7 @@ function AddNext({
|
|
|
2081
2225
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.PopoverContent, { side: "right", align: "start", className: "w-60 p-1.5", children: [
|
|
2082
2226
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 pb-1 pt-0.5 text-xs font-medium text-muted-foreground", children: l.addNext }),
|
|
2083
2227
|
KINDS.map((kind) => {
|
|
2084
|
-
const Icon =
|
|
2228
|
+
const Icon = chunkKMOIE2XH_cjs.STEP_KIND_ICONS[kind];
|
|
2085
2229
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2086
2230
|
"button",
|
|
2087
2231
|
{
|
|
@@ -2120,8 +2264,8 @@ function PhaseMark({ phase }) {
|
|
|
2120
2264
|
}
|
|
2121
2265
|
function StepNode({ data }) {
|
|
2122
2266
|
const { step, phase, summary, assignee, icon, l, onAdd, testId } = data;
|
|
2123
|
-
const kind =
|
|
2124
|
-
const KindIcon =
|
|
2267
|
+
const kind = chunkKMOIE2XH_cjs.stepKindOf(step);
|
|
2268
|
+
const KindIcon = chunkKMOIE2XH_cjs.STEP_KIND_ICONS[kind];
|
|
2125
2269
|
const redline = step.kind === "agent" && !!step.editDocument;
|
|
2126
2270
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2127
2271
|
"div",
|
|
@@ -2235,6 +2379,7 @@ function summaryOf(step, l, workflowTitle) {
|
|
|
2235
2379
|
const to = a.to.find((t) => t.trim());
|
|
2236
2380
|
return to ? l.emailTo.replace("{to}", to) : l.noRecipients;
|
|
2237
2381
|
}
|
|
2382
|
+
if (a.type === "approval") return a.database ? l.approvalSummary : l.chooseDatabase;
|
|
2238
2383
|
return a.tags.length ? l.reviewColumns.replace("{count}", String(a.tags.length)) : l.noColumns;
|
|
2239
2384
|
}
|
|
2240
2385
|
}
|
|
@@ -2257,12 +2402,12 @@ function WorkflowCanvas({
|
|
|
2257
2402
|
testId = "workflow-canvas"
|
|
2258
2403
|
}) {
|
|
2259
2404
|
const l = react.useMemo(() => ({ ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...labels }), [labels]);
|
|
2260
|
-
const steps =
|
|
2405
|
+
const steps = chunkI2LJ7RZ2_cjs.workflowSteps(workflow);
|
|
2261
2406
|
const editable = !!onChange;
|
|
2262
2407
|
const built = react.useMemo(() => {
|
|
2263
2408
|
const layout = layoutWithDefaults(workflow);
|
|
2264
|
-
const all =
|
|
2265
|
-
const roots = all.filter((s) =>
|
|
2409
|
+
const all = chunkI2LJ7RZ2_cjs.workflowSteps(workflow);
|
|
2410
|
+
const roots = all.filter((s) => chunkI2LJ7RZ2_cjs.stepDependencies(all, s.id).length === 0);
|
|
2266
2411
|
const triggerNode = trigger ? [
|
|
2267
2412
|
{
|
|
2268
2413
|
id: TRIGGER_NODE,
|
|
@@ -2311,7 +2456,7 @@ function WorkflowCanvas({
|
|
|
2311
2456
|
react.useEffect(() => setNodes(built), [built]);
|
|
2312
2457
|
const edges = react.useMemo(
|
|
2313
2458
|
() => steps.flatMap((s) => {
|
|
2314
|
-
const deps =
|
|
2459
|
+
const deps = chunkI2LJ7RZ2_cjs.stepDependencies(steps, s.id);
|
|
2315
2460
|
const from = deps.length ? deps : trigger ? [TRIGGER_NODE] : [];
|
|
2316
2461
|
return from.map((d) => ({
|
|
2317
2462
|
id: `${d}->${s.id}`,
|
|
@@ -2481,7 +2626,7 @@ function WorkflowCanvas({
|
|
|
2481
2626
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold", children: l.emptyTitle }),
|
|
2482
2627
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: l.emptyHint }),
|
|
2483
2628
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 grid grid-cols-2 gap-2", children: KINDS.map((kind) => {
|
|
2484
|
-
const Icon =
|
|
2629
|
+
const Icon = chunkKMOIE2XH_cjs.STEP_KIND_ICONS[kind];
|
|
2485
2630
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2486
2631
|
"button",
|
|
2487
2632
|
{
|
|
@@ -2527,11 +2672,13 @@ var DEFAULT_WORKFLOW_BUILDER_LABELS = {
|
|
|
2527
2672
|
signers: "\u201C{step}\u201D needs at least one signer.",
|
|
2528
2673
|
recipients: "\u201C{step}\u201D needs a recipient.",
|
|
2529
2674
|
tags: "\u201C{step}\u201D needs at least one column.",
|
|
2530
|
-
documents: "\u201C{step}\u201D needs documents to review."
|
|
2675
|
+
documents: "\u201C{step}\u201D needs documents to review.",
|
|
2676
|
+
database: "\u201C{step}\u201D needs the database its requests go to.",
|
|
2677
|
+
decision: "\u201C{step}\u201D needs the column its approvers decide in."
|
|
2531
2678
|
}
|
|
2532
2679
|
};
|
|
2533
2680
|
var PANEL_WIDTH = 344;
|
|
2534
|
-
var KINDS2 =
|
|
2681
|
+
var KINDS2 = chunkKMOIE2XH_cjs.WORKFLOW_STEP_KINDS;
|
|
2535
2682
|
function WorkflowBuilder({
|
|
2536
2683
|
value,
|
|
2537
2684
|
onChange,
|
|
@@ -2543,6 +2690,7 @@ function WorkflowBuilder({
|
|
|
2543
2690
|
people = [],
|
|
2544
2691
|
tags = [],
|
|
2545
2692
|
documents = [],
|
|
2693
|
+
databases = [],
|
|
2546
2694
|
compose,
|
|
2547
2695
|
renderIcon,
|
|
2548
2696
|
actions,
|
|
@@ -2563,12 +2711,12 @@ function WorkflowBuilder({
|
|
|
2563
2711
|
const [mode, setMode] = react.useState("design");
|
|
2564
2712
|
const [adding, setAdding] = react.useState(false);
|
|
2565
2713
|
const { workflow, trigger } = value;
|
|
2566
|
-
const steps =
|
|
2567
|
-
const problems =
|
|
2568
|
-
const missing =
|
|
2714
|
+
const steps = chunkI2LJ7RZ2_cjs.workflowSteps(workflow);
|
|
2715
|
+
const problems = chunkI2LJ7RZ2_cjs.validateWorkflowGraph(steps);
|
|
2716
|
+
const missing = chunkI2LJ7RZ2_cjs.stepConfigProblems(steps);
|
|
2569
2717
|
const nameOf = (id) => people.find((p) => p.value === id)?.label;
|
|
2570
|
-
const fields =
|
|
2571
|
-
const assigneeOf = (step) =>
|
|
2718
|
+
const fields = chunkI2LJ7RZ2_cjs.runFields(workflow);
|
|
2719
|
+
const assigneeOf = (step) => chunkI2LJ7RZ2_cjs.canAssign(step) ? chunkI2LJ7RZ2_cjs.assigneeName(step.assignee, { nameOf, fields }) : void 0;
|
|
2572
2720
|
const titles = react.useMemo(() => new Map(workflows.map((w) => [w.id, w.title])), [workflows]);
|
|
2573
2721
|
const setWorkflow = (next) => onChange({ ...value, workflow: next });
|
|
2574
2722
|
const addAfter = (from, kind) => {
|
|
@@ -2637,7 +2785,7 @@ function WorkflowBuilder({
|
|
|
2637
2785
|
l.addStep
|
|
2638
2786
|
] }) }),
|
|
2639
2787
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { align: "start", className: "w-64 p-1.5", children: KINDS2.map((kind) => {
|
|
2640
|
-
const Icon =
|
|
2788
|
+
const Icon = chunkKMOIE2XH_cjs.STEP_KIND_ICONS[kind];
|
|
2641
2789
|
const cls = { ...DEFAULT_WORKFLOW_CANVAS_LABELS, ...canvasLabels };
|
|
2642
2790
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2643
2791
|
"button",
|
|
@@ -2756,6 +2904,7 @@ function WorkflowBuilder({
|
|
|
2756
2904
|
people,
|
|
2757
2905
|
tags,
|
|
2758
2906
|
documents,
|
|
2907
|
+
databases,
|
|
2759
2908
|
labels: inspectorLabels,
|
|
2760
2909
|
testId: `${testId}-inspector`
|
|
2761
2910
|
}
|
|
@@ -2799,13 +2948,13 @@ function WorkflowPreview({
|
|
|
2799
2948
|
renderIcon,
|
|
2800
2949
|
testId
|
|
2801
2950
|
}) {
|
|
2802
|
-
const run =
|
|
2951
|
+
const run = chunkFSGMWE5I_cjs.useWorkflowPreview(workflow, {
|
|
2803
2952
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2804
2953
|
compose,
|
|
2805
2954
|
answer
|
|
2806
2955
|
});
|
|
2807
2956
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2808
|
-
|
|
2957
|
+
chunkUKAN76CS_cjs.WorkflowRunner,
|
|
2809
2958
|
{
|
|
2810
2959
|
workflow,
|
|
2811
2960
|
run,
|
|
@@ -2876,7 +3025,7 @@ function scheduledTaskBuilderValue() {
|
|
|
2876
3025
|
]
|
|
2877
3026
|
}
|
|
2878
3027
|
},
|
|
2879
|
-
trigger: { ...value.trigger, start: "repeat", rrule:
|
|
3028
|
+
trigger: { ...value.trigger, start: "repeat", rrule: chunk73ECBDG7_cjs.buildRRule(chunk73ECBDG7_cjs.DEFAULT_RECURRENCE) }
|
|
2880
3029
|
};
|
|
2881
3030
|
}
|
|
2882
3031
|
var TITLE_WORDS = 6;
|
|
@@ -2932,6 +3081,12 @@ function ConnectedWorkflowBuilder({
|
|
|
2932
3081
|
label: [m.user.given_name, m.user.family_name].filter(Boolean).join(" ") || m.user.email
|
|
2933
3082
|
}));
|
|
2934
3083
|
const tagOptions = tagList.map((t) => ({ value: t.external_id, label: t.name }));
|
|
3084
|
+
const { data: databaseList } = react$2.useDatabases();
|
|
3085
|
+
const databaseOptions = (databaseList ?? []).filter((d) => d.editable).map((d) => ({
|
|
3086
|
+
value: d.id,
|
|
3087
|
+
label: d.name,
|
|
3088
|
+
columns: (d.columns ?? []).filter((c) => c.type !== "lookup" && c.type !== "rollup").map((c) => ({ value: c.id, label: c.name, decides: c.edit_by?.kind === "listed" }))
|
|
3089
|
+
}));
|
|
2935
3090
|
const documentOptions = docList.map((d) => ({
|
|
2936
3091
|
value: d.external_id,
|
|
2937
3092
|
label: d.file_name ?? d.external_id
|
|
@@ -2956,7 +3111,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2956
3111
|
}
|
|
2957
3112
|
}, [record, loaded]);
|
|
2958
3113
|
const workflows = react.useMemo(() => {
|
|
2959
|
-
const merged =
|
|
3114
|
+
const merged = chunkXPQR2PJX_cjs.mergeSkillWorkflows(hostWorkflows, skills.data ?? []);
|
|
2960
3115
|
return [...merged.host, ...merged.skills];
|
|
2961
3116
|
}, [hostWorkflows, skills.data]);
|
|
2962
3117
|
const agents = (agentsQuery.data ?? []).map((a) => ({
|
|
@@ -2965,7 +3120,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2965
3120
|
}));
|
|
2966
3121
|
const tasks = conversations.filter((c) => c.status && c.status !== "done").map((c) => ({ value: c.external_id, label: c.title || l.untitledTask }));
|
|
2967
3122
|
const options = { resolveWorkflow: (wid) => workflows.find((w) => w.id === wid), compose };
|
|
2968
|
-
const problem = triggerProblem(value.trigger) ?? (
|
|
3123
|
+
const problem = triggerProblem(value.trigger) ?? (chunkI2LJ7RZ2_cjs.validateWorkflowGraph(chunkI2LJ7RZ2_cjs.workflowSteps(value.workflow)).length || chunkI2LJ7RZ2_cjs.stepConfigProblems(chunkI2LJ7RZ2_cjs.workflowSteps(value.workflow)).length ? "graph" : null);
|
|
2969
3124
|
const busy = !!pending || create.isPending || update.isPending || run.isPending;
|
|
2970
3125
|
const save = async () => {
|
|
2971
3126
|
if (!workspaceId) return void 0;
|
|
@@ -3023,6 +3178,7 @@ function ConnectedWorkflowBuilder({
|
|
|
3023
3178
|
people,
|
|
3024
3179
|
tags: tagOptions,
|
|
3025
3180
|
documents: documentOptions,
|
|
3181
|
+
databases: databaseOptions,
|
|
3026
3182
|
signals: declaredSignals(saved.data ?? []),
|
|
3027
3183
|
compose,
|
|
3028
3184
|
testId,
|
|
@@ -3100,13 +3256,13 @@ function ConnectedWorkflowsPage({
|
|
|
3100
3256
|
historyLabels,
|
|
3101
3257
|
testId = "workflows-page"
|
|
3102
3258
|
}) {
|
|
3103
|
-
const webWorkflows =
|
|
3259
|
+
const webWorkflows = chunkYST6GVN5_cjs.useNamedWorkflows(chunk7D4WXUBS_cjs.WEB_WORKFLOWS);
|
|
3104
3260
|
const l = { ...DEFAULT_CONNECTED_WORKFLOWS_PAGE_LABELS, ...labels };
|
|
3105
3261
|
const host = chunk3YZKDCWY_cjs.useHost();
|
|
3106
3262
|
const config = host.workflows;
|
|
3107
3263
|
const { openConversation, openFiles } = chunkLIKDQBNJ_cjs.useBlocksEnvironment();
|
|
3108
3264
|
const openWorkflow = chunkOA3AN6WW_cjs.useOpenWorkflow();
|
|
3109
|
-
const renderPerson =
|
|
3265
|
+
const renderPerson = chunk6NHOZTIY_cjs.useRenderTaskPerson();
|
|
3110
3266
|
const refreshDocuments = react$2.useRefreshDocuments();
|
|
3111
3267
|
const invalidateTags = react$2.useInvalidateTagData();
|
|
3112
3268
|
const { data: tags = [] } = react$2.useTags();
|
|
@@ -3137,7 +3293,7 @@ function ConnectedWorkflowsPage({
|
|
|
3137
3293
|
openHistory,
|
|
3138
3294
|
closeHistoryTab,
|
|
3139
3295
|
selectHistoryTab
|
|
3140
|
-
} =
|
|
3296
|
+
} = chunk6NHOZTIY_cjs.useWorkflowsPageState({
|
|
3141
3297
|
historyWorkflowId: requestedHistoryId ?? historyWorkflowId,
|
|
3142
3298
|
onHistoryWorkflowConsumed: consumeHistory
|
|
3143
3299
|
});
|
|
@@ -3205,7 +3361,7 @@ function ConnectedWorkflowsPage({
|
|
|
3205
3361
|
return (
|
|
3206
3362
|
// The page in the Workflows page's frame: padded, scrolling.
|
|
3207
3363
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full min-h-0 w-full overflow-auto p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3208
|
-
|
|
3364
|
+
chunk6NHOZTIY_cjs.ConnectedWorkflowRunPage,
|
|
3209
3365
|
{
|
|
3210
3366
|
workflow: running.workflow,
|
|
3211
3367
|
projectFrom: running.projectFrom,
|
|
@@ -3293,7 +3449,7 @@ function ConnectedWorkflowsPage({
|
|
|
3293
3449
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col", "data-testid": testId, children: [
|
|
3294
3450
|
pageHeader && /* @__PURE__ */ jsxRuntime.jsx(chunkNSD37OF5_cjs.PageHeader, { ...pageHeader }),
|
|
3295
3451
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3296
|
-
|
|
3452
|
+
chunkPI4U4LEN_cjs.ConnectedWorkflowsTable,
|
|
3297
3453
|
{
|
|
3298
3454
|
onOpenTemplate: (id) => openBuilder({ kind: "template", id }),
|
|
3299
3455
|
tabs: [
|
|
@@ -3323,7 +3479,7 @@ function ConnectedWorkflowsPage({
|
|
|
3323
3479
|
}
|
|
3324
3480
|
},
|
|
3325
3481
|
content: hostTab ? hostTab.content : runsFor ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3326
|
-
|
|
3482
|
+
chunk6NHOZTIY_cjs.ConnectedWorkflowHistory,
|
|
3327
3483
|
{
|
|
3328
3484
|
inline: true,
|
|
3329
3485
|
hideHeader: true,
|
|
@@ -3348,7 +3504,7 @@ function ConnectedWorkflowsPage({
|
|
|
3348
3504
|
) : void 0,
|
|
3349
3505
|
automationsOnly: true,
|
|
3350
3506
|
gridId: "automations-grid-v1",
|
|
3351
|
-
describeTrigger: (workflow) => workflow.on_demand ? l.manualTrigger :
|
|
3507
|
+
describeTrigger: (workflow) => workflow.on_demand ? l.manualTrigger : chunk73ECBDG7_cjs.describeTrigger(workflow),
|
|
3352
3508
|
formatDate: ui.formatFriendlyDate,
|
|
3353
3509
|
renderPerson,
|
|
3354
3510
|
onViewRuns: showHistory,
|
|
@@ -3387,7 +3543,7 @@ function ConnectedWorkflowsPage({
|
|
|
3387
3543
|
}
|
|
3388
3544
|
),
|
|
3389
3545
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3390
|
-
|
|
3546
|
+
chunk6NHOZTIY_cjs.ConnectedTaskComposer,
|
|
3391
3547
|
{
|
|
3392
3548
|
kind: "workflow",
|
|
3393
3549
|
saveOnly: true,
|