@livechat/platform-workflows 0.0.88 → 0.0.90
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +855 -638
- package/dist/index.mjs +796 -694
- package/package.json +11 -6
package/dist/index.mjs
CHANGED
|
@@ -1,78 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
38
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
39
|
-
};
|
|
40
|
-
var __copyProps = (to, from2, except, desc) => {
|
|
41
|
-
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
42
|
-
for (let key of __getOwnPropNames(from2))
|
|
43
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
-
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
45
|
-
}
|
|
46
|
-
return to;
|
|
47
|
-
};
|
|
48
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
49
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
50
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
51
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
52
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
53
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
54
|
-
mod
|
|
55
|
-
));
|
|
56
|
-
var __async = (__this, __arguments, generator) => {
|
|
57
|
-
return new Promise((resolve, reject) => {
|
|
58
|
-
var fulfilled = (value) => {
|
|
59
|
-
try {
|
|
60
|
-
step(generator.next(value));
|
|
61
|
-
} catch (e) {
|
|
62
|
-
reject(e);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var rejected = (value) => {
|
|
66
|
-
try {
|
|
67
|
-
step(generator.throw(value));
|
|
68
|
-
} catch (e) {
|
|
69
|
-
reject(e);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
73
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
74
|
-
});
|
|
75
|
-
};
|
|
2
|
+
import {
|
|
3
|
+
WORKFLOWS_TEST_SELECTORS,
|
|
4
|
+
__async,
|
|
5
|
+
__commonJS,
|
|
6
|
+
__objRest,
|
|
7
|
+
__spreadProps,
|
|
8
|
+
__spreadValues,
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./chunk-Q53XLSIX.mjs";
|
|
76
11
|
|
|
77
12
|
// ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
|
|
78
13
|
var require_react_is_production_min = __commonJS({
|
|
@@ -2063,7 +1998,7 @@ var useDeleteWorkflow = () => {
|
|
|
2063
1998
|
);
|
|
2064
1999
|
}),
|
|
2065
2000
|
{
|
|
2066
|
-
onSuccess: (
|
|
2001
|
+
onSuccess: (_2, workflow) => {
|
|
2067
2002
|
queryClient.removeQueries(queryKeys.workflow.get(workflow.id));
|
|
2068
2003
|
if (workflow.related_workflow_id) {
|
|
2069
2004
|
queryClient.setQueryData(
|
|
@@ -2092,7 +2027,7 @@ var usePublishWorkflowDraft = () => {
|
|
|
2092
2027
|
return { id: data.id };
|
|
2093
2028
|
}),
|
|
2094
2029
|
{
|
|
2095
|
-
onSuccess: (
|
|
2030
|
+
onSuccess: (_2, draft) => __async(void 0, null, function* () {
|
|
2096
2031
|
if (draft.related_workflow_id) {
|
|
2097
2032
|
const workflow = yield api2.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
2098
2033
|
draft.related_workflow_id
|
|
@@ -2129,7 +2064,7 @@ var useActivateWorkflow = () => {
|
|
|
2129
2064
|
);
|
|
2130
2065
|
}),
|
|
2131
2066
|
{
|
|
2132
|
-
onSuccess: (
|
|
2067
|
+
onSuccess: (_2, { id }) => {
|
|
2133
2068
|
queryClient.setQueryData(
|
|
2134
2069
|
queryKeys.workflow.get(id),
|
|
2135
2070
|
(workflow) => workflow ? __spreadProps(__spreadValues({}, workflow), { active: true }) : workflow
|
|
@@ -2300,17 +2235,17 @@ function Waitlist({ image }) {
|
|
|
2300
2235
|
var Waitlist_default = Waitlist;
|
|
2301
2236
|
|
|
2302
2237
|
// src/views/Workflows/index.tsx
|
|
2303
|
-
import { useEffect as
|
|
2304
|
-
import { Navigate as Navigate2, Route as Route6, Routes as Routes6, useNavigate as
|
|
2238
|
+
import { useEffect as useEffect21 } from "react";
|
|
2239
|
+
import { Navigate as Navigate2, Route as Route6, Routes as Routes6, useNavigate as useNavigate22 } from "react-router-dom";
|
|
2305
2240
|
import { Loader as Loader6 } from "@livechat/developer-studio-ui-react";
|
|
2306
2241
|
|
|
2307
2242
|
// src/views/Workflows/Creator/index.tsx
|
|
2308
2243
|
import {
|
|
2309
2244
|
Route as Route3,
|
|
2310
2245
|
Routes as Routes3,
|
|
2311
|
-
useLocation as
|
|
2312
|
-
useNavigate as
|
|
2313
|
-
useParams as
|
|
2246
|
+
useLocation as useLocation6,
|
|
2247
|
+
useNavigate as useNavigate14,
|
|
2248
|
+
useParams as useParams5
|
|
2314
2249
|
} from "react-router-dom";
|
|
2315
2250
|
import {
|
|
2316
2251
|
Loader as Loader3,
|
|
@@ -2348,7 +2283,7 @@ var WORKFLOW_TRIGGER_OUTPUT_SCHEMA = (body) => ({
|
|
|
2348
2283
|
}
|
|
2349
2284
|
});
|
|
2350
2285
|
var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
2351
|
-
var _a, _b;
|
|
2286
|
+
var _a, _b, _c;
|
|
2352
2287
|
return {
|
|
2353
2288
|
required: ["type", "name", "inputParameters"],
|
|
2354
2289
|
properties: {
|
|
@@ -2367,7 +2302,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2367
2302
|
(overrides == null ? void 0 : overrides.body) ? "body" : void 0
|
|
2368
2303
|
].filter(Boolean),
|
|
2369
2304
|
properties: {
|
|
2370
|
-
uri: {
|
|
2305
|
+
uri: (_a = overrides == null ? void 0 : overrides.uri) != null ? _a : {
|
|
2371
2306
|
type: "string",
|
|
2372
2307
|
title: "URI"
|
|
2373
2308
|
},
|
|
@@ -2376,7 +2311,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2376
2311
|
title: "Method",
|
|
2377
2312
|
enum: ["GET", "POST", "PATCH", "PUT", "DELETE"]
|
|
2378
2313
|
},
|
|
2379
|
-
headers: (
|
|
2314
|
+
headers: (_b = overrides == null ? void 0 : overrides.headers) != null ? _b : {
|
|
2380
2315
|
type: "object",
|
|
2381
2316
|
title: "Headers",
|
|
2382
2317
|
properties: {},
|
|
@@ -2384,7 +2319,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2384
2319
|
type: "string"
|
|
2385
2320
|
}
|
|
2386
2321
|
},
|
|
2387
|
-
body: (
|
|
2322
|
+
body: (_c = overrides == null ? void 0 : overrides.body) != null ? _c : {
|
|
2388
2323
|
type: "object",
|
|
2389
2324
|
title: "Body",
|
|
2390
2325
|
properties: {},
|
|
@@ -2409,10 +2344,19 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2409
2344
|
};
|
|
2410
2345
|
var WORKFLOW_HTTP_TASK_INPUT_SCHEMA = (body, query) => ({
|
|
2411
2346
|
type: "object",
|
|
2412
|
-
required: [
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2347
|
+
required: [
|
|
2348
|
+
"uri",
|
|
2349
|
+
body ? "body" : void 0,
|
|
2350
|
+
query ? "query" : void 0
|
|
2351
|
+
].filter(Boolean),
|
|
2352
|
+
properties: __spreadValues(__spreadValues({
|
|
2353
|
+
uri: query ? {
|
|
2354
|
+
type: "string",
|
|
2355
|
+
queryParams: query
|
|
2356
|
+
} : {
|
|
2357
|
+
type: "string"
|
|
2358
|
+
}
|
|
2359
|
+
}, query ? {
|
|
2416
2360
|
query
|
|
2417
2361
|
} : {}), body ? {
|
|
2418
2362
|
body
|
|
@@ -4107,9 +4051,9 @@ var helpdeskTaskConfigs = () => ({
|
|
|
4107
4051
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA(
|
|
4108
4052
|
{
|
|
4109
4053
|
type: "object",
|
|
4110
|
-
required: ["
|
|
4054
|
+
required: ["tagIDs"],
|
|
4111
4055
|
properties: {
|
|
4112
|
-
|
|
4056
|
+
tagIDs: {
|
|
4113
4057
|
type: "array",
|
|
4114
4058
|
title: "Tag IDs",
|
|
4115
4059
|
items: {
|
|
@@ -4370,7 +4314,7 @@ var helpdeskTaskTemplates = () => ({
|
|
|
4370
4314
|
)}/functions/add-tags-to-helpdesk-ticket?id=#{ticket_id}`,
|
|
4371
4315
|
method: "POST",
|
|
4372
4316
|
body: {
|
|
4373
|
-
|
|
4317
|
+
tagIDs: ["#{tag_id}"]
|
|
4374
4318
|
},
|
|
4375
4319
|
headers: {
|
|
4376
4320
|
Accept: "application/json",
|
|
@@ -4972,7 +4916,7 @@ var webhookSpecs2 = {
|
|
|
4972
4916
|
required: [],
|
|
4973
4917
|
properties: {
|
|
4974
4918
|
targetAgentId: {
|
|
4975
|
-
|
|
4919
|
+
$ref: "#/$defs/livechat_agent",
|
|
4976
4920
|
title: "Target Agent email"
|
|
4977
4921
|
}
|
|
4978
4922
|
}
|
|
@@ -6335,12 +6279,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6335
6279
|
specification: {
|
|
6336
6280
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6337
6281
|
type: "object",
|
|
6338
|
-
required: ["list_id", "
|
|
6282
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6339
6283
|
properties: {
|
|
6340
6284
|
list_id: {
|
|
6341
|
-
type: "string",
|
|
6342
|
-
title: "Mailchimp audience ID",
|
|
6343
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6344
6285
|
$ref: "#/$defs/mailchimp_audience"
|
|
6345
6286
|
},
|
|
6346
6287
|
email: {
|
|
@@ -6392,9 +6333,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6392
6333
|
required: ["list_id"],
|
|
6393
6334
|
properties: {
|
|
6394
6335
|
list_id: {
|
|
6395
|
-
type: "string",
|
|
6396
|
-
title: "Mailchimp audience ID",
|
|
6397
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6398
6336
|
$ref: "#/$defs/mailchimp_audience"
|
|
6399
6337
|
}
|
|
6400
6338
|
}
|
|
@@ -6428,10 +6366,7 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6428
6366
|
required: ["campaign_id"],
|
|
6429
6367
|
properties: {
|
|
6430
6368
|
campaign_id: {
|
|
6431
|
-
|
|
6432
|
-
title: "Campaign ID",
|
|
6433
|
-
description: `The unique ID for the campaign. You'll find it by going to the Campaigns page in Mailchimp and selecting View Email from the drop-down list for the campaign. The URL indicates the campaign ID by the prefix "id=".`
|
|
6434
|
-
// $ref: '#/$defs/mailchimp_campaign',
|
|
6369
|
+
$ref: "#/$defs/mailchimp_campaign"
|
|
6435
6370
|
}
|
|
6436
6371
|
}
|
|
6437
6372
|
}),
|
|
@@ -6457,12 +6392,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6457
6392
|
specification: {
|
|
6458
6393
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6459
6394
|
type: "object",
|
|
6460
|
-
required: ["list_id", "
|
|
6395
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6461
6396
|
properties: {
|
|
6462
6397
|
list_id: {
|
|
6463
|
-
type: "string",
|
|
6464
|
-
title: "Mailchimp audience ID",
|
|
6465
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6466
6398
|
$ref: "#/$defs/mailchimp_audience"
|
|
6467
6399
|
},
|
|
6468
6400
|
email: {
|
|
@@ -6506,12 +6438,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6506
6438
|
specification: {
|
|
6507
6439
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6508
6440
|
type: "object",
|
|
6509
|
-
required: ["list_id", "
|
|
6441
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6510
6442
|
properties: {
|
|
6511
6443
|
list_id: {
|
|
6512
|
-
type: "string",
|
|
6513
|
-
title: "Mailchimp audience ID",
|
|
6514
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6515
6444
|
$ref: "#/$defs/mailchimp_audience"
|
|
6516
6445
|
},
|
|
6517
6446
|
email: {
|
|
@@ -6558,9 +6487,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6558
6487
|
required: ["list_id", "email"],
|
|
6559
6488
|
properties: {
|
|
6560
6489
|
list_id: {
|
|
6561
|
-
type: "string",
|
|
6562
|
-
title: "Mailchimp audience ID",
|
|
6563
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6564
6490
|
$ref: "#/$defs/mailchimp_audience"
|
|
6565
6491
|
},
|
|
6566
6492
|
email: {
|
|
@@ -6594,9 +6520,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6594
6520
|
required: ["list_id", "email"],
|
|
6595
6521
|
properties: {
|
|
6596
6522
|
list_id: {
|
|
6597
|
-
type: "string",
|
|
6598
|
-
title: "Mailchimp audience ID",
|
|
6599
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6600
6523
|
$ref: "#/$defs/mailchimp_audience"
|
|
6601
6524
|
},
|
|
6602
6525
|
email: {
|
|
@@ -6630,9 +6553,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6630
6553
|
required: ["list_id", "email", "tag"],
|
|
6631
6554
|
properties: {
|
|
6632
6555
|
list_id: {
|
|
6633
|
-
type: "string",
|
|
6634
|
-
title: "Mailchimp audience ID",
|
|
6635
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6636
6556
|
$ref: "#/$defs/mailchimp_audience"
|
|
6637
6557
|
},
|
|
6638
6558
|
email: {
|
|
@@ -6671,9 +6591,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6671
6591
|
required: ["list_id", "email", "name"],
|
|
6672
6592
|
properties: {
|
|
6673
6593
|
list_id: {
|
|
6674
|
-
type: "string",
|
|
6675
|
-
title: "Mailchimp audience ID",
|
|
6676
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6677
6594
|
$ref: "#/$defs/mailchimp_audience"
|
|
6678
6595
|
},
|
|
6679
6596
|
email: {
|
|
@@ -6728,9 +6645,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6728
6645
|
required: ["list_id", "email", "note"],
|
|
6729
6646
|
properties: {
|
|
6730
6647
|
list_id: {
|
|
6731
|
-
type: "string",
|
|
6732
|
-
title: "Mailchimp audience ID",
|
|
6733
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6734
6648
|
$ref: "#/$defs/mailchimp_audience"
|
|
6735
6649
|
},
|
|
6736
6650
|
email: {
|
|
@@ -6769,9 +6683,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6769
6683
|
required: ["list_id", "email", "tag"],
|
|
6770
6684
|
properties: {
|
|
6771
6685
|
list_id: {
|
|
6772
|
-
type: "string",
|
|
6773
|
-
title: "Mailchimp audience ID",
|
|
6774
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6775
6686
|
$ref: "#/$defs/mailchimp_audience"
|
|
6776
6687
|
},
|
|
6777
6688
|
email: {
|
|
@@ -6809,9 +6720,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6809
6720
|
required: ["list_id", "email"],
|
|
6810
6721
|
properties: {
|
|
6811
6722
|
list_id: {
|
|
6812
|
-
type: "string",
|
|
6813
|
-
title: "Mailchimp audience ID",
|
|
6814
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6815
6723
|
$ref: "#/$defs/mailchimp_audience"
|
|
6816
6724
|
},
|
|
6817
6725
|
email: {
|
|
@@ -6875,9 +6783,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6875
6783
|
required: ["list_id", "email"],
|
|
6876
6784
|
properties: {
|
|
6877
6785
|
list_id: {
|
|
6878
|
-
type: "string",
|
|
6879
|
-
title: "Mailchimp audience ID",
|
|
6880
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
6881
6786
|
$ref: "#/$defs/mailchimp_audience"
|
|
6882
6787
|
},
|
|
6883
6788
|
email: {
|
|
@@ -7051,10 +6956,8 @@ var mailchimpTaskConfigs = () => ({
|
|
|
7051
6956
|
required: ["list_id", "query"],
|
|
7052
6957
|
properties: {
|
|
7053
6958
|
list_id: {
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
7057
|
-
$ref: "#/$defs/mailchimp_audience"
|
|
6959
|
+
$ref: "#/$defs/mailchimp_audience",
|
|
6960
|
+
minLength: 1
|
|
7058
6961
|
},
|
|
7059
6962
|
query: {
|
|
7060
6963
|
type: "string",
|
|
@@ -7228,10 +7131,7 @@ var mailchimpTaskConfigs = () => ({
|
|
|
7228
7131
|
required: ["campaign_id"],
|
|
7229
7132
|
properties: {
|
|
7230
7133
|
campaign_id: {
|
|
7231
|
-
|
|
7232
|
-
title: "Campaign ID",
|
|
7233
|
-
description: `The unique ID for the campaign. You'll find it by going to the Campaigns page in Mailchimp and selecting View Email from the drop-down list for the campaign. The URL indicates the campaign ID by the prefix "id=".`
|
|
7234
|
-
//$ref: '#/$defs/mailchimp_campaign'
|
|
7134
|
+
$ref: "#/$defs/mailchimp_campaign"
|
|
7235
7135
|
}
|
|
7236
7136
|
}
|
|
7237
7137
|
}),
|
|
@@ -9463,7 +9363,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9463
9363
|
},
|
|
9464
9364
|
...Object.values(WorkflowSpecification.config.tasks).map(
|
|
9465
9365
|
(config2) => {
|
|
9466
|
-
var _a, _b;
|
|
9366
|
+
var _a, _b, _c, _d;
|
|
9467
9367
|
return {
|
|
9468
9368
|
if: {
|
|
9469
9369
|
properties: {
|
|
@@ -9472,7 +9372,8 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9472
9372
|
}
|
|
9473
9373
|
},
|
|
9474
9374
|
then: WORKFLOW_HTTP_TASK_SCHEMA(config2.key, {
|
|
9475
|
-
|
|
9375
|
+
uri: (_b = (_a = config2.specification.input) == null ? void 0 : _a.properties) == null ? void 0 : _b.uri,
|
|
9376
|
+
body: (_d = (_c = config2.specification.input) == null ? void 0 : _c.properties) == null ? void 0 : _d.body
|
|
9476
9377
|
})
|
|
9477
9378
|
};
|
|
9478
9379
|
}
|
|
@@ -9499,6 +9400,9 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9499
9400
|
}),
|
|
9500
9401
|
$defs: {
|
|
9501
9402
|
mailchimp_audience: {
|
|
9403
|
+
type: "string",
|
|
9404
|
+
title: "Mailchimp audience ID",
|
|
9405
|
+
description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
|
|
9502
9406
|
"x-ref": {
|
|
9503
9407
|
provider: "mailchimp",
|
|
9504
9408
|
product: "mailchimp",
|
|
@@ -9508,13 +9412,17 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9508
9412
|
}
|
|
9509
9413
|
},
|
|
9510
9414
|
mailchimp_campaign: {
|
|
9511
|
-
"
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9415
|
+
type: "string",
|
|
9416
|
+
title: "Campaign ID",
|
|
9417
|
+
description: `The unique ID for the campaign. You'll find it by going to the Campaigns page in Mailchimp and selecting View Email from the drop-down list for the campaign. The URL indicates the campaign ID by the prefix "id=".`
|
|
9418
|
+
// TODO WD: it not ready yet, but WIP on BE side
|
|
9419
|
+
// 'x-ref': {
|
|
9420
|
+
// provider: 'mailchimp',
|
|
9421
|
+
// product: 'mailchimp',
|
|
9422
|
+
// name: 'campaign',
|
|
9423
|
+
// displayField: 'name',
|
|
9424
|
+
// valueField: 'id'
|
|
9425
|
+
// }
|
|
9518
9426
|
},
|
|
9519
9427
|
helpdesk_ticket: {
|
|
9520
9428
|
title: "Ticket ID",
|
|
@@ -9546,7 +9454,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9546
9454
|
product: "helpdesk",
|
|
9547
9455
|
name: "agent",
|
|
9548
9456
|
displayField: "email",
|
|
9549
|
-
valueField: "
|
|
9457
|
+
valueField: "ID"
|
|
9550
9458
|
}
|
|
9551
9459
|
},
|
|
9552
9460
|
livechat_chat_id: {
|
|
@@ -12657,8 +12565,8 @@ var getWorkflowTemplates = () => [
|
|
|
12657
12565
|
];
|
|
12658
12566
|
|
|
12659
12567
|
// src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
|
|
12660
|
-
import { useEffect as
|
|
12661
|
-
import { NavLink, useLocation, useNavigate as
|
|
12568
|
+
import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
12569
|
+
import { NavLink, useLocation as useLocation2, useNavigate as useNavigate4, useParams as useParams2 } from "react-router-dom";
|
|
12662
12570
|
import {
|
|
12663
12571
|
Button as Button2,
|
|
12664
12572
|
DesignToken as DesignToken4,
|
|
@@ -13138,13 +13046,13 @@ var ProductIcon_default = ProductIcon;
|
|
|
13138
13046
|
// src/views/Workflows/Creator/Provider/index.tsx
|
|
13139
13047
|
import {
|
|
13140
13048
|
createContext as createContext4,
|
|
13141
|
-
useCallback as
|
|
13049
|
+
useCallback as useCallback4,
|
|
13142
13050
|
useContext as useContext6,
|
|
13143
|
-
useEffect as
|
|
13144
|
-
useRef as
|
|
13051
|
+
useEffect as useEffect4,
|
|
13052
|
+
useRef as useRef3,
|
|
13145
13053
|
useState as useState4
|
|
13146
13054
|
} from "react";
|
|
13147
|
-
import { useNavigate as
|
|
13055
|
+
import { useNavigate as useNavigate3 } from "react-router-dom";
|
|
13148
13056
|
import { ReactFlowProvider, useReactFlow } from "reactflow";
|
|
13149
13057
|
import debounce from "lodash.debounce";
|
|
13150
13058
|
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType12 } from "@livechat/developer-studio-api";
|
|
@@ -13384,15 +13292,36 @@ var DEFAULT_NODE_HEIGHT = {
|
|
|
13384
13292
|
default: 65
|
|
13385
13293
|
};
|
|
13386
13294
|
|
|
13295
|
+
// src/views/Workflows/Creator/Provider/navigation/hooks.ts
|
|
13296
|
+
import { useCallback, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
13297
|
+
import { useLocation, useNavigate as useNavigate2, useParams } from "react-router-dom";
|
|
13298
|
+
function useReplaceWorkflowIdInUrl() {
|
|
13299
|
+
const navigate = useNavigate2();
|
|
13300
|
+
const location = useLocation();
|
|
13301
|
+
const { id } = useParams();
|
|
13302
|
+
const latestPathRef = useRef2(location.pathname);
|
|
13303
|
+
useEffect2(() => {
|
|
13304
|
+
latestPathRef.current = location.pathname;
|
|
13305
|
+
}, [location.pathname]);
|
|
13306
|
+
return useCallback(
|
|
13307
|
+
(newId) => {
|
|
13308
|
+
if (!id) return;
|
|
13309
|
+
const latestPath = latestPathRef.current.replace(`/${id}`, `/${newId}`);
|
|
13310
|
+
navigate(latestPath, { replace: true });
|
|
13311
|
+
},
|
|
13312
|
+
[navigate, id]
|
|
13313
|
+
);
|
|
13314
|
+
}
|
|
13315
|
+
|
|
13387
13316
|
// src/views/Workflows/Creator/Provider/state/data/hooks.ts
|
|
13388
|
-
import { useCallback, useEffect as
|
|
13317
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
|
|
13389
13318
|
function useWorkflowData(workflow) {
|
|
13390
13319
|
const [actions, setActions] = useState3({});
|
|
13391
13320
|
const [selection, setSelection] = useState3();
|
|
13392
13321
|
const [pendingWorkflow, setPendingWorkflow] = useState3(
|
|
13393
13322
|
() => JSON.parse(JSON.stringify(workflow))
|
|
13394
13323
|
);
|
|
13395
|
-
const setAction =
|
|
13324
|
+
const setAction = useCallback2(
|
|
13396
13325
|
(action, value) => {
|
|
13397
13326
|
setActions((prevState) => __spreadProps(__spreadValues({}, prevState), {
|
|
13398
13327
|
[action]: value
|
|
@@ -13400,10 +13329,10 @@ function useWorkflowData(workflow) {
|
|
|
13400
13329
|
},
|
|
13401
13330
|
[]
|
|
13402
13331
|
);
|
|
13403
|
-
|
|
13332
|
+
useEffect3(() => {
|
|
13404
13333
|
setPendingWorkflow(JSON.parse(JSON.stringify(workflow)));
|
|
13405
13334
|
setSelection((prevState) => {
|
|
13406
|
-
if ((prevState == null ? void 0 : prevState.kind) === "trigger") {
|
|
13335
|
+
if ((prevState == null ? void 0 : prevState.kind) === "trigger" && !workflow.trigger.type) {
|
|
13407
13336
|
return void 0;
|
|
13408
13337
|
}
|
|
13409
13338
|
if ((prevState == null ? void 0 : prevState.kind) === "task") {
|
|
@@ -13690,51 +13619,9 @@ var getWorkflowContexts = (workflow, external) => {
|
|
|
13690
13619
|
};
|
|
13691
13620
|
|
|
13692
13621
|
// src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
|
|
13693
|
-
import { useMemo as
|
|
13622
|
+
import { useMemo as useMemo3 } from "react";
|
|
13694
13623
|
import { useFetchIntegrationCredentialsQuery } from "@livechat/platform-integrations";
|
|
13695
13624
|
|
|
13696
|
-
// src/hooks/user.ts
|
|
13697
|
-
import { useMutation as useMutation2, useQuery as useQuery3, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
13698
|
-
import { api as api3 } from "@livechat/developer-studio-api";
|
|
13699
|
-
var userQueryKeys = {
|
|
13700
|
-
accounts: {
|
|
13701
|
-
account: {
|
|
13702
|
-
getInfo: ["accounts.account.getInfo"]
|
|
13703
|
-
},
|
|
13704
|
-
products: {
|
|
13705
|
-
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
13706
|
-
}
|
|
13707
|
-
},
|
|
13708
|
-
dps: {
|
|
13709
|
-
getUser: ["dps.getUser"],
|
|
13710
|
-
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
13711
|
-
}
|
|
13712
|
-
};
|
|
13713
|
-
var useFetchOrganizationProducts = () => {
|
|
13714
|
-
var _b;
|
|
13715
|
-
const _a = useQuery3(
|
|
13716
|
-
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
13717
|
-
() => api3.platform.accounts.products.getOrganizationProducts()
|
|
13718
|
-
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
13719
|
-
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
13720
|
-
};
|
|
13721
|
-
var useUpdateOrganizationProducts = () => {
|
|
13722
|
-
const queryClient = useQueryClient2();
|
|
13723
|
-
const { mutateAsync: updateOrganizationProducts, isLoading } = useMutation2(
|
|
13724
|
-
({ productName }) => api3.platform.accounts.products.updateOrganizationProducts({
|
|
13725
|
-
product: productName
|
|
13726
|
-
}),
|
|
13727
|
-
{
|
|
13728
|
-
onSuccess: (_) => {
|
|
13729
|
-
void queryClient.refetchQueries({
|
|
13730
|
-
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
13731
|
-
});
|
|
13732
|
-
}
|
|
13733
|
-
}
|
|
13734
|
-
);
|
|
13735
|
-
return { updateOrganizationProducts, isLoading };
|
|
13736
|
-
};
|
|
13737
|
-
|
|
13738
13625
|
// src/views/Workflows/Creator/Provider/state/metadata/utils.ts
|
|
13739
13626
|
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType11 } from "@livechat/developer-studio-api";
|
|
13740
13627
|
var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
|
|
@@ -13751,17 +13638,61 @@ var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(task
|
|
|
13751
13638
|
});
|
|
13752
13639
|
|
|
13753
13640
|
// src/views/Workflows/Creator/Provider/state/metadata/validation/utils.ts
|
|
13754
|
-
import Ajv from "ajv";
|
|
13641
|
+
import Ajv, { _ } from "ajv";
|
|
13755
13642
|
import AjvWithErrors from "ajv-errors";
|
|
13756
13643
|
import { IntegrationNames as IntegrationNames12 } from "@livechat/developer-studio-api";
|
|
13757
|
-
var
|
|
13644
|
+
var keywords = {
|
|
13645
|
+
urlWithQueryParams: {
|
|
13646
|
+
keyword: "queryParams",
|
|
13647
|
+
type: "string",
|
|
13648
|
+
schemaType: "object",
|
|
13649
|
+
metaSchema: {
|
|
13650
|
+
type: "object",
|
|
13651
|
+
properties: {
|
|
13652
|
+
queryParams: {
|
|
13653
|
+
type: "object"
|
|
13654
|
+
}
|
|
13655
|
+
}
|
|
13656
|
+
},
|
|
13657
|
+
error: {
|
|
13658
|
+
message: () => `This field cannot be empty`,
|
|
13659
|
+
params: (cxt) => _`{ param: ${cxt.params.param} }`
|
|
13660
|
+
},
|
|
13661
|
+
code(cxt) {
|
|
13662
|
+
const { data, schema } = cxt;
|
|
13663
|
+
cxt.gen.if(
|
|
13664
|
+
_`typeof ${data} === "string" && ${data}.includes("?")`,
|
|
13665
|
+
() => {
|
|
13666
|
+
const params = _`Object.fromEntries(new URL(${data}).searchParams.entries())`;
|
|
13667
|
+
for (const param of Object.keys(schema.properties || {})) {
|
|
13668
|
+
cxt.gen.if(
|
|
13669
|
+
_`!(${param} in ${params}) || ${params}[${param}].length <= 0`,
|
|
13670
|
+
() => {
|
|
13671
|
+
cxt.error(
|
|
13672
|
+
true,
|
|
13673
|
+
{ param },
|
|
13674
|
+
{
|
|
13675
|
+
instancePath: param
|
|
13676
|
+
}
|
|
13677
|
+
);
|
|
13678
|
+
}
|
|
13679
|
+
);
|
|
13680
|
+
}
|
|
13681
|
+
},
|
|
13682
|
+
() => {
|
|
13683
|
+
cxt.error(true, { param: "URL" });
|
|
13684
|
+
}
|
|
13685
|
+
);
|
|
13686
|
+
}
|
|
13687
|
+
}
|
|
13688
|
+
};
|
|
13689
|
+
var getValidator = () => AjvWithErrors(
|
|
13758
13690
|
new Ajv({
|
|
13759
13691
|
strict: false,
|
|
13760
13692
|
allErrors: true
|
|
13761
|
-
})
|
|
13762
|
-
);
|
|
13763
|
-
var validateSchema = (workflow, frames) => {
|
|
13764
|
-
const validate = ajv.compile(WORKFLOW_SCHEMA());
|
|
13693
|
+
}).addKeyword(keywords.urlWithQueryParams)
|
|
13694
|
+
).compile(WORKFLOW_SCHEMA());
|
|
13695
|
+
var validateSchema = (workflow, frames, validateFunction) => {
|
|
13765
13696
|
const resolved = __spreadProps(__spreadValues({}, workflow), {
|
|
13766
13697
|
definition: __spreadProps(__spreadValues({}, workflow.definition), {
|
|
13767
13698
|
tasks: workflow.definition.tasks.map(
|
|
@@ -13782,8 +13713,8 @@ var validateSchema = (workflow, frames) => {
|
|
|
13782
13713
|
}
|
|
13783
13714
|
)
|
|
13784
13715
|
});
|
|
13785
|
-
|
|
13786
|
-
return
|
|
13716
|
+
validateFunction(resolved);
|
|
13717
|
+
return validateFunction.errors || [];
|
|
13787
13718
|
};
|
|
13788
13719
|
var validateTasks = (workflow, frames, products) => {
|
|
13789
13720
|
function taskCompiler(task2, baseInstancePath) {
|
|
@@ -14093,11 +14024,11 @@ function flattenErrorSchema(workflow, schema) {
|
|
|
14093
14024
|
}).filter(([, value]) => Boolean(value))
|
|
14094
14025
|
);
|
|
14095
14026
|
}
|
|
14096
|
-
var getWorkflowValidation = (workflow, internal, external) => {
|
|
14027
|
+
var getWorkflowValidation = (workflow, internal, external, validator3) => {
|
|
14097
14028
|
const rawErrors = [
|
|
14098
14029
|
...validateTrigger(workflow, internal.frames, external.products),
|
|
14099
14030
|
...validateTasks(workflow, internal.frames, external.products),
|
|
14100
|
-
...validateSchema(workflow, internal.frames)
|
|
14031
|
+
...validateSchema(workflow, internal.frames, validator3)
|
|
14101
14032
|
].filter(
|
|
14102
14033
|
(rawError) => Boolean(rawError)
|
|
14103
14034
|
).map((rawError) => {
|
|
@@ -14151,11 +14082,74 @@ var getWorkflowValidation = (workflow, internal, external) => {
|
|
|
14151
14082
|
};
|
|
14152
14083
|
};
|
|
14153
14084
|
|
|
14085
|
+
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
14086
|
+
import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
14087
|
+
|
|
14088
|
+
// src/hooks/user.ts
|
|
14089
|
+
import { useMutation as useMutation2, useQuery as useQuery3, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
14090
|
+
import { api as api3 } from "@livechat/developer-studio-api";
|
|
14091
|
+
var userQueryKeys = {
|
|
14092
|
+
accounts: {
|
|
14093
|
+
account: {
|
|
14094
|
+
getInfo: ["accounts.account.getInfo"]
|
|
14095
|
+
},
|
|
14096
|
+
products: {
|
|
14097
|
+
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
14098
|
+
}
|
|
14099
|
+
},
|
|
14100
|
+
dps: {
|
|
14101
|
+
getUser: ["dps.getUser"],
|
|
14102
|
+
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
14103
|
+
}
|
|
14104
|
+
};
|
|
14105
|
+
var useFetchOrganizationProducts = () => {
|
|
14106
|
+
var _b;
|
|
14107
|
+
const _a = useQuery3(
|
|
14108
|
+
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
14109
|
+
() => api3.platform.accounts.products.getOrganizationProducts()
|
|
14110
|
+
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
14111
|
+
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
14112
|
+
};
|
|
14113
|
+
var useUpdateOrganizationProducts = () => {
|
|
14114
|
+
const queryClient = useQueryClient2();
|
|
14115
|
+
const { mutateAsync: updateOrganizationProducts, isLoading } = useMutation2(
|
|
14116
|
+
({ productName }) => api3.platform.accounts.products.updateOrganizationProducts({
|
|
14117
|
+
product: productName
|
|
14118
|
+
}),
|
|
14119
|
+
{
|
|
14120
|
+
onSuccess: (_2) => {
|
|
14121
|
+
void queryClient.refetchQueries({
|
|
14122
|
+
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
14123
|
+
});
|
|
14124
|
+
}
|
|
14125
|
+
}
|
|
14126
|
+
);
|
|
14127
|
+
return { updateOrganizationProducts, isLoading };
|
|
14128
|
+
};
|
|
14129
|
+
|
|
14130
|
+
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
14131
|
+
function useWorkflowValidator() {
|
|
14132
|
+
const organizationProducts = useFetchOrganizationProducts();
|
|
14133
|
+
const validator3 = useMemo2(getValidator, []);
|
|
14134
|
+
const validate = useCallback3(
|
|
14135
|
+
(workflow, internal) => getWorkflowValidation(
|
|
14136
|
+
workflow,
|
|
14137
|
+
internal,
|
|
14138
|
+
{
|
|
14139
|
+
products: organizationProducts.data
|
|
14140
|
+
},
|
|
14141
|
+
validator3
|
|
14142
|
+
),
|
|
14143
|
+
[validator3, organizationProducts.data]
|
|
14144
|
+
);
|
|
14145
|
+
return validate;
|
|
14146
|
+
}
|
|
14147
|
+
|
|
14154
14148
|
// src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
|
|
14155
14149
|
function useWorkflowMetadata(workflow) {
|
|
14156
14150
|
const credentialsQuery = useFetchIntegrationCredentialsQuery();
|
|
14157
|
-
const
|
|
14158
|
-
const metadata =
|
|
14151
|
+
const validator3 = useWorkflowValidator();
|
|
14152
|
+
const metadata = useMemo3(() => {
|
|
14159
14153
|
var _a;
|
|
14160
14154
|
const elements = {
|
|
14161
14155
|
trigger: workflow.trigger,
|
|
@@ -14169,19 +14163,13 @@ function useWorkflowMetadata(workflow) {
|
|
|
14169
14163
|
const frames = getWorkflowContexts(workflow, {
|
|
14170
14164
|
credentials: (_a = credentialsQuery.data) != null ? _a : []
|
|
14171
14165
|
});
|
|
14172
|
-
const validation =
|
|
14173
|
-
workflow,
|
|
14174
|
-
{ frames },
|
|
14175
|
-
{
|
|
14176
|
-
products: organizationProducts.data
|
|
14177
|
-
}
|
|
14178
|
-
);
|
|
14166
|
+
const validation = validator3(workflow, { frames });
|
|
14179
14167
|
return {
|
|
14180
14168
|
elements,
|
|
14181
14169
|
frames,
|
|
14182
14170
|
validation
|
|
14183
14171
|
};
|
|
14184
|
-
}, [workflow, credentialsQuery.data
|
|
14172
|
+
}, [validator3, workflow, credentialsQuery.data]);
|
|
14185
14173
|
return {
|
|
14186
14174
|
metadata
|
|
14187
14175
|
};
|
|
@@ -14278,8 +14266,9 @@ function WorkflowCreatorProviderBase({
|
|
|
14278
14266
|
}) {
|
|
14279
14267
|
var _a, _b;
|
|
14280
14268
|
const { fitView } = useReactFlow();
|
|
14281
|
-
const navigate =
|
|
14269
|
+
const navigate = useNavigate3();
|
|
14282
14270
|
const notifications = useNotificationContext2();
|
|
14271
|
+
const replaceWorkflowId = useReplaceWorkflowIdInUrl();
|
|
14283
14272
|
const createWorkflowAction = useCreateWorkflow();
|
|
14284
14273
|
const createWorkflowDraftAction = useCreateWorkflowDraft();
|
|
14285
14274
|
const updateWorkflowAction = useUpdateWorkflow();
|
|
@@ -14290,22 +14279,22 @@ function WorkflowCreatorProviderBase({
|
|
|
14290
14279
|
state,
|
|
14291
14280
|
updaters: { setWorkflow, setAction, setSelection }
|
|
14292
14281
|
} = useWorkflowState(workflow, options);
|
|
14293
|
-
const autosaveStateRef =
|
|
14294
|
-
const autosaveWorkflowRef =
|
|
14282
|
+
const autosaveStateRef = useRef3(state);
|
|
14283
|
+
const autosaveWorkflowRef = useRef3(
|
|
14295
14284
|
debounce(() => __async(this, null, function* () {
|
|
14296
14285
|
yield save(true);
|
|
14297
14286
|
}), 500)
|
|
14298
14287
|
);
|
|
14299
14288
|
const autosaveWorkflow = autosaveWorkflowRef.current;
|
|
14300
|
-
|
|
14289
|
+
useEffect4(() => {
|
|
14301
14290
|
return () => {
|
|
14302
14291
|
autosaveWorkflow.cancel();
|
|
14303
14292
|
};
|
|
14304
14293
|
}, [autosaveWorkflow]);
|
|
14305
|
-
|
|
14294
|
+
useEffect4(() => {
|
|
14306
14295
|
autosaveStateRef.current = state;
|
|
14307
14296
|
}, [state]);
|
|
14308
|
-
const focus =
|
|
14297
|
+
const focus = useCallback4(
|
|
14309
14298
|
(identifier2) => {
|
|
14310
14299
|
setTimeout(
|
|
14311
14300
|
() => fitView(
|
|
@@ -14326,7 +14315,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14326
14315
|
},
|
|
14327
14316
|
[fitView]
|
|
14328
14317
|
);
|
|
14329
|
-
const toggle =
|
|
14318
|
+
const toggle = useCallback4(
|
|
14330
14319
|
(params) => {
|
|
14331
14320
|
setTimeout(() => {
|
|
14332
14321
|
setSelection(() => {
|
|
@@ -14350,7 +14339,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14350
14339
|
},
|
|
14351
14340
|
[focus, setSelection]
|
|
14352
14341
|
);
|
|
14353
|
-
const validate =
|
|
14342
|
+
const validate = useCallback4(() => {
|
|
14354
14343
|
var _a2;
|
|
14355
14344
|
const state2 = autosaveStateRef.current;
|
|
14356
14345
|
if (((_a2 = options == null ? void 0 : options.validation) == null ? void 0 : _a2.strategy) !== "non-blocking" && !state2.metadata.validation.isValid) {
|
|
@@ -14381,21 +14370,21 @@ function WorkflowCreatorProviderBase({
|
|
|
14381
14370
|
}
|
|
14382
14371
|
return true;
|
|
14383
14372
|
}, [(_a = options == null ? void 0 : options.validation) == null ? void 0 : _a.strategy, toggle]);
|
|
14384
|
-
const replaceWorkflow =
|
|
14373
|
+
const replaceWorkflow = useCallback4(
|
|
14385
14374
|
(workflow2) => {
|
|
14386
14375
|
setWorkflow(workflow2);
|
|
14387
14376
|
void autosaveWorkflowRef.current();
|
|
14388
14377
|
},
|
|
14389
14378
|
[autosaveWorkflowRef, setWorkflow]
|
|
14390
14379
|
);
|
|
14391
|
-
const changeWorkflow =
|
|
14380
|
+
const changeWorkflow = useCallback4(
|
|
14392
14381
|
(change) => {
|
|
14393
14382
|
setWorkflow((prevState) => applyChange(prevState, change(prevState)));
|
|
14394
14383
|
void autosaveWorkflowRef.current();
|
|
14395
14384
|
},
|
|
14396
14385
|
[autosaveWorkflowRef, setWorkflow]
|
|
14397
14386
|
);
|
|
14398
|
-
const goToAddTrigger =
|
|
14387
|
+
const goToAddTrigger = useCallback4(() => {
|
|
14399
14388
|
navigate(
|
|
14400
14389
|
`${basePath}/trigger/${OTHER_TYPES.SYSTEM}/${"manual" /* Manual */}`,
|
|
14401
14390
|
{
|
|
@@ -14405,7 +14394,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14405
14394
|
}
|
|
14406
14395
|
);
|
|
14407
14396
|
}, [basePath, navigate]);
|
|
14408
|
-
const addTrigger =
|
|
14397
|
+
const addTrigger = useCallback4(
|
|
14409
14398
|
(trigger) => {
|
|
14410
14399
|
changeWorkflow(() => ({
|
|
14411
14400
|
trigger
|
|
@@ -14419,7 +14408,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14419
14408
|
},
|
|
14420
14409
|
[changeWorkflow, toggle]
|
|
14421
14410
|
);
|
|
14422
|
-
const updateTrigger =
|
|
14411
|
+
const updateTrigger = useCallback4(
|
|
14423
14412
|
(trigger) => {
|
|
14424
14413
|
changeWorkflow(() => ({
|
|
14425
14414
|
trigger
|
|
@@ -14427,7 +14416,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14427
14416
|
},
|
|
14428
14417
|
[changeWorkflow]
|
|
14429
14418
|
);
|
|
14430
|
-
const removeTrigger =
|
|
14419
|
+
const removeTrigger = useCallback4(() => {
|
|
14431
14420
|
var _a2;
|
|
14432
14421
|
const state2 = autosaveStateRef.current;
|
|
14433
14422
|
replaceWorkflow(__spreadProps(__spreadValues({}, state2.workflow), {
|
|
@@ -14437,7 +14426,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14437
14426
|
toggle();
|
|
14438
14427
|
}
|
|
14439
14428
|
}, [replaceWorkflow, toggle]);
|
|
14440
|
-
const goToAddTask =
|
|
14429
|
+
const goToAddTask = useCallback4(
|
|
14441
14430
|
(taskReference, parentTaskReference) => {
|
|
14442
14431
|
navigate(`${basePath}/add`, {
|
|
14443
14432
|
state: {
|
|
@@ -14449,7 +14438,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14449
14438
|
},
|
|
14450
14439
|
[state.metadata.frames, navigate, basePath]
|
|
14451
14440
|
);
|
|
14452
|
-
const addTask =
|
|
14441
|
+
const addTask = useCallback4(
|
|
14453
14442
|
(task2, targetTaskReference, parentTaskReference) => {
|
|
14454
14443
|
var _a2;
|
|
14455
14444
|
const existingTasks = Object.values(state.metadata.elements.tasks).filter((x) => x.taskReferenceName.includes(task2.taskReferenceName)).sort((a, b) => {
|
|
@@ -14558,7 +14547,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14558
14547
|
},
|
|
14559
14548
|
[state.workflow.definition.tasks, changeWorkflow, toggle]
|
|
14560
14549
|
);
|
|
14561
|
-
const updateTask =
|
|
14550
|
+
const updateTask = useCallback4(
|
|
14562
14551
|
(targetTaskReferenceName, targetTask) => {
|
|
14563
14552
|
changeWorkflow((workflow2) => ({
|
|
14564
14553
|
definition: {
|
|
@@ -14575,7 +14564,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14575
14564
|
},
|
|
14576
14565
|
[changeWorkflow]
|
|
14577
14566
|
);
|
|
14578
|
-
const removeTask =
|
|
14567
|
+
const removeTask = useCallback4(
|
|
14579
14568
|
(targetTaskReferenceName) => {
|
|
14580
14569
|
var _a2;
|
|
14581
14570
|
changeWorkflow((workflow2) => ({
|
|
@@ -14596,7 +14585,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14596
14585
|
},
|
|
14597
14586
|
[(_b = state.selection) == null ? void 0 : _b.id, changeWorkflow, toggle]
|
|
14598
14587
|
);
|
|
14599
|
-
const save =
|
|
14588
|
+
const save = useCallback4(
|
|
14600
14589
|
(silent) => __async(this, null, function* () {
|
|
14601
14590
|
const state2 = autosaveStateRef.current;
|
|
14602
14591
|
if (!state2.workflow.draft && !validate()) {
|
|
@@ -14625,7 +14614,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14625
14614
|
"Workflow has been created successfully"
|
|
14626
14615
|
);
|
|
14627
14616
|
}
|
|
14628
|
-
|
|
14617
|
+
replaceWorkflowId(workflowId);
|
|
14629
14618
|
}
|
|
14630
14619
|
} finally {
|
|
14631
14620
|
setAction("isSaving", false);
|
|
@@ -14635,13 +14624,13 @@ function WorkflowCreatorProviderBase({
|
|
|
14635
14624
|
createWorkflowAction,
|
|
14636
14625
|
updateWorkflowAction,
|
|
14637
14626
|
notifications,
|
|
14627
|
+
replaceWorkflowId,
|
|
14638
14628
|
validate,
|
|
14639
|
-
navigate,
|
|
14640
14629
|
setWorkflow,
|
|
14641
14630
|
setAction
|
|
14642
14631
|
]
|
|
14643
14632
|
);
|
|
14644
|
-
const activate =
|
|
14633
|
+
const activate = useCallback4(() => __async(this, null, function* () {
|
|
14645
14634
|
const state2 = autosaveStateRef.current;
|
|
14646
14635
|
if (state2.workflow.draft) {
|
|
14647
14636
|
return;
|
|
@@ -14665,7 +14654,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14665
14654
|
setAction("isActivating", false);
|
|
14666
14655
|
}
|
|
14667
14656
|
}), [activateWorkflowAction, notifications, validate, setWorkflow, setAction]);
|
|
14668
|
-
const remove =
|
|
14657
|
+
const remove = useCallback4(() => __async(this, null, function* () {
|
|
14669
14658
|
const state2 = autosaveStateRef.current;
|
|
14670
14659
|
setAction("isRemoving", true);
|
|
14671
14660
|
try {
|
|
@@ -14684,7 +14673,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14684
14673
|
setAction("isRemoving", false);
|
|
14685
14674
|
}
|
|
14686
14675
|
}), [setAction, navigate, notifications, deleteWorkflowAction]);
|
|
14687
|
-
const createDraft =
|
|
14676
|
+
const createDraft = useCallback4(
|
|
14688
14677
|
(options2) => __async(this, null, function* () {
|
|
14689
14678
|
const state2 = autosaveStateRef.current;
|
|
14690
14679
|
if (state2.workflow.draft) {
|
|
@@ -14722,7 +14711,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14722
14711
|
setAction
|
|
14723
14712
|
]
|
|
14724
14713
|
);
|
|
14725
|
-
const publishDraft =
|
|
14714
|
+
const publishDraft = useCallback4(
|
|
14726
14715
|
(options2) => __async(this, null, function* () {
|
|
14727
14716
|
var _a2;
|
|
14728
14717
|
const state2 = autosaveStateRef.current;
|
|
@@ -14767,7 +14756,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14767
14756
|
createWorkflowAction
|
|
14768
14757
|
]
|
|
14769
14758
|
);
|
|
14770
|
-
const discardDraft =
|
|
14759
|
+
const discardDraft = useCallback4(() => __async(this, null, function* () {
|
|
14771
14760
|
const state2 = autosaveStateRef.current;
|
|
14772
14761
|
setAction("isDiscarding", true);
|
|
14773
14762
|
try {
|
|
@@ -14874,7 +14863,16 @@ var itemOptionCss = (active) => css`
|
|
|
14874
14863
|
`;
|
|
14875
14864
|
function ItemOption({ option, onClick, active }) {
|
|
14876
14865
|
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss(active), onClick, children: /* @__PURE__ */ jsxs2(Column2, { setColumnPadding: "0", width: 6, children: [
|
|
14877
|
-
/* @__PURE__ */ jsx4(
|
|
14866
|
+
/* @__PURE__ */ jsx4(
|
|
14867
|
+
Text2,
|
|
14868
|
+
{
|
|
14869
|
+
noMargin: true,
|
|
14870
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCard(
|
|
14871
|
+
option.key
|
|
14872
|
+
),
|
|
14873
|
+
children: option.name
|
|
14874
|
+
}
|
|
14875
|
+
),
|
|
14878
14876
|
/* @__PURE__ */ jsx4(
|
|
14879
14877
|
Text2,
|
|
14880
14878
|
{
|
|
@@ -14937,11 +14935,11 @@ var Options_default = AddWorkflowTaskOptions;
|
|
|
14937
14935
|
function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
14938
14936
|
var _a;
|
|
14939
14937
|
const [search, setSearch] = useState5("");
|
|
14940
|
-
const location =
|
|
14941
|
-
const navigate =
|
|
14942
|
-
const params =
|
|
14938
|
+
const location = useLocation2();
|
|
14939
|
+
const navigate = useNavigate4();
|
|
14940
|
+
const params = useParams2();
|
|
14943
14941
|
const [state, setState] = useState5();
|
|
14944
|
-
const config2 =
|
|
14942
|
+
const config2 = useMemo4(
|
|
14945
14943
|
() => [
|
|
14946
14944
|
// {
|
|
14947
14945
|
// name: "system",
|
|
@@ -15101,7 +15099,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15101
15099
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15102
15100
|
user == null ? void 0 : user.meta.email
|
|
15103
15101
|
);
|
|
15104
|
-
|
|
15102
|
+
useEffect5(() => {
|
|
15105
15103
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
15106
15104
|
if (!params.task) {
|
|
15107
15105
|
const service = (_a2 = params.service) != null ? _a2 : "livechat";
|
|
@@ -15181,12 +15179,14 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15181
15179
|
handleAddTask(state == null ? void 0 : state.task);
|
|
15182
15180
|
},
|
|
15183
15181
|
size: "medium",
|
|
15182
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.saveButton,
|
|
15184
15183
|
children: "Add task"
|
|
15185
15184
|
}
|
|
15186
15185
|
)
|
|
15187
15186
|
] }),
|
|
15188
15187
|
heading: /* @__PURE__ */ jsx4(ModalHeader, { title: "Add task" }),
|
|
15189
15188
|
onClose,
|
|
15189
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.wrapper,
|
|
15190
15190
|
children: /* @__PURE__ */ jsxs2(Row2, { notPadded: true, children: [
|
|
15191
15191
|
/* @__PURE__ */ jsxs2(
|
|
15192
15192
|
Column3,
|
|
@@ -15275,7 +15275,16 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15275
15275
|
end: false,
|
|
15276
15276
|
state: location.state,
|
|
15277
15277
|
to: `${basePath}/${name}`,
|
|
15278
|
-
children: /* @__PURE__ */ jsx4(
|
|
15278
|
+
children: /* @__PURE__ */ jsx4(
|
|
15279
|
+
Text3,
|
|
15280
|
+
{
|
|
15281
|
+
size: "md",
|
|
15282
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCategoryButton(
|
|
15283
|
+
name
|
|
15284
|
+
),
|
|
15285
|
+
children: displayName
|
|
15286
|
+
}
|
|
15287
|
+
)
|
|
15279
15288
|
}
|
|
15280
15289
|
)
|
|
15281
15290
|
]
|
|
@@ -15328,8 +15337,8 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15328
15337
|
var Modal_default = AddWorkflowTaskModal;
|
|
15329
15338
|
|
|
15330
15339
|
// src/views/Workflows/Creator/Modals/AddTrigger/Modal.tsx
|
|
15331
|
-
import { useEffect as
|
|
15332
|
-
import { NavLink as NavLink2, useLocation as
|
|
15340
|
+
import { useEffect as useEffect6, useMemo as useMemo5, useState as useState6 } from "react";
|
|
15341
|
+
import { NavLink as NavLink2, useLocation as useLocation3, useNavigate as useNavigate5, useParams as useParams3 } from "react-router-dom";
|
|
15333
15342
|
import {
|
|
15334
15343
|
Button as Button3,
|
|
15335
15344
|
DesignToken as DesignToken6,
|
|
@@ -15380,7 +15389,17 @@ var itemOptionCss2 = (active) => css`
|
|
|
15380
15389
|
`;
|
|
15381
15390
|
function ItemOption2({ option, onClick, active }) {
|
|
15382
15391
|
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss2(active), onClick, children: /* @__PURE__ */ jsxs2(Column4, { setColumnPadding: "0", width: 6, children: [
|
|
15383
|
-
/* @__PURE__ */ jsx4(
|
|
15392
|
+
/* @__PURE__ */ jsx4(
|
|
15393
|
+
Text4,
|
|
15394
|
+
{
|
|
15395
|
+
bold: true,
|
|
15396
|
+
noMargin: true,
|
|
15397
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCard(
|
|
15398
|
+
option.key
|
|
15399
|
+
),
|
|
15400
|
+
children: option.name
|
|
15401
|
+
}
|
|
15402
|
+
),
|
|
15384
15403
|
/* @__PURE__ */ jsx4(
|
|
15385
15404
|
Text4,
|
|
15386
15405
|
{
|
|
@@ -15445,7 +15464,7 @@ function AddWorkflowTriggerModal({
|
|
|
15445
15464
|
onClose
|
|
15446
15465
|
}) {
|
|
15447
15466
|
const [search, setSearch] = useState6("");
|
|
15448
|
-
const config2 =
|
|
15467
|
+
const config2 = useMemo5(
|
|
15449
15468
|
() => [
|
|
15450
15469
|
{
|
|
15451
15470
|
name: OTHER_TYPES.SYSTEM,
|
|
@@ -15571,16 +15590,16 @@ function AddWorkflowTriggerModal({
|
|
|
15571
15590
|
],
|
|
15572
15591
|
[]
|
|
15573
15592
|
);
|
|
15574
|
-
const location =
|
|
15575
|
-
const navigate =
|
|
15576
|
-
const params =
|
|
15593
|
+
const location = useLocation3();
|
|
15594
|
+
const navigate = useNavigate5();
|
|
15595
|
+
const params = useParams3();
|
|
15577
15596
|
const [state, setState] = useState6();
|
|
15578
15597
|
const { addTrigger } = useWorkflowCreator();
|
|
15579
15598
|
const { user } = useUserContext4();
|
|
15580
15599
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15581
15600
|
user == null ? void 0 : user.meta.email
|
|
15582
15601
|
);
|
|
15583
|
-
|
|
15602
|
+
useEffect6(() => {
|
|
15584
15603
|
var _a, _b;
|
|
15585
15604
|
if (!params.trigger) {
|
|
15586
15605
|
const firstTrigger = (_b = (_a = config2.find((el) => el.name === params.service)) == null ? void 0 : _a.values.sort((a, b) => a.name.localeCompare(b.name))[0]) == null ? void 0 : _b.key;
|
|
@@ -15619,12 +15638,14 @@ function AddWorkflowTriggerModal({
|
|
|
15619
15638
|
handleAddTrigger(state == null ? void 0 : state.trigger);
|
|
15620
15639
|
},
|
|
15621
15640
|
size: "medium",
|
|
15641
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.saveButton,
|
|
15622
15642
|
children: "Add trigger"
|
|
15623
15643
|
}
|
|
15624
15644
|
)
|
|
15625
15645
|
] }),
|
|
15626
15646
|
heading: /* @__PURE__ */ jsx4(ModalHeader2, { title: "Add trigger" }),
|
|
15627
15647
|
onClose,
|
|
15648
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.wrapper,
|
|
15628
15649
|
children: /* @__PURE__ */ jsxs2(Row3, { notPadded: true, children: [
|
|
15629
15650
|
/* @__PURE__ */ jsxs2(
|
|
15630
15651
|
Column5,
|
|
@@ -15713,7 +15734,16 @@ function AddWorkflowTriggerModal({
|
|
|
15713
15734
|
end: false,
|
|
15714
15735
|
state: location.state,
|
|
15715
15736
|
to: `${basePath}/${name}`,
|
|
15716
|
-
children: /* @__PURE__ */ jsx4(
|
|
15737
|
+
children: /* @__PURE__ */ jsx4(
|
|
15738
|
+
Text5,
|
|
15739
|
+
{
|
|
15740
|
+
size: "md",
|
|
15741
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCategoryButton(
|
|
15742
|
+
name
|
|
15743
|
+
),
|
|
15744
|
+
children: displayName
|
|
15745
|
+
}
|
|
15746
|
+
)
|
|
15717
15747
|
}
|
|
15718
15748
|
)
|
|
15719
15749
|
]
|
|
@@ -15840,7 +15870,7 @@ function DeleteWorkflowModal({
|
|
|
15840
15870
|
}
|
|
15841
15871
|
|
|
15842
15872
|
// src/views/Workflows/Creator/Modals/Edit/Modal.tsx
|
|
15843
|
-
import { useNavigate as
|
|
15873
|
+
import { useNavigate as useNavigate6 } from "react-router-dom";
|
|
15844
15874
|
import { Error as Error3 } from "@livechat/design-system-icons";
|
|
15845
15875
|
import {
|
|
15846
15876
|
Button as Button5,
|
|
@@ -15854,7 +15884,7 @@ import {
|
|
|
15854
15884
|
} from "@livechat/developer-studio-ui-react";
|
|
15855
15885
|
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
15856
15886
|
function EditWorkflowModal({ onClose }) {
|
|
15857
|
-
const navigate =
|
|
15887
|
+
const navigate = useNavigate6();
|
|
15858
15888
|
const {
|
|
15859
15889
|
state: {
|
|
15860
15890
|
workflow,
|
|
@@ -15911,7 +15941,7 @@ function EditWorkflowModal({ onClose }) {
|
|
|
15911
15941
|
}
|
|
15912
15942
|
|
|
15913
15943
|
// src/views/Workflows/Creator/Modals/Execute/Modal.tsx
|
|
15914
|
-
import { useCallback as
|
|
15944
|
+
import { useCallback as useCallback5 } from "react";
|
|
15915
15945
|
import { Field, Form } from "react-final-form";
|
|
15916
15946
|
import validator from "validator";
|
|
15917
15947
|
import {
|
|
@@ -15929,7 +15959,7 @@ function ExecuteWorkflowModal({
|
|
|
15929
15959
|
onClose
|
|
15930
15960
|
}) {
|
|
15931
15961
|
const executeMutation = useExecuteWorkflow();
|
|
15932
|
-
const onSubmit =
|
|
15962
|
+
const onSubmit = useCallback5(
|
|
15933
15963
|
(data) => __async(this, null, function* () {
|
|
15934
15964
|
yield executeMutation.mutateAsync({
|
|
15935
15965
|
workflow,
|
|
@@ -16011,8 +16041,8 @@ function ExecuteWorkflowModal({
|
|
|
16011
16041
|
var Modal_default3 = ExecuteWorkflowModal;
|
|
16012
16042
|
|
|
16013
16043
|
// src/views/Workflows/Creator/Modals/Preview/Modal.tsx
|
|
16014
|
-
import { useCallback as
|
|
16015
|
-
import { useNavigate as
|
|
16044
|
+
import { useCallback as useCallback16 } from "react";
|
|
16045
|
+
import { useNavigate as useNavigate10 } from "react-router-dom";
|
|
16016
16046
|
|
|
16017
16047
|
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1__@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
|
|
16018
16048
|
import * as React4 from "react";
|
|
@@ -16313,7 +16343,7 @@ tags.forEach(function(tagName) {
|
|
|
16313
16343
|
// src/views/Workflows/Creator/Modals/Preview/Modal.tsx
|
|
16314
16344
|
import {
|
|
16315
16345
|
Button as Button23,
|
|
16316
|
-
DesignToken as
|
|
16346
|
+
DesignToken as DesignToken32,
|
|
16317
16347
|
Modal as Modal6,
|
|
16318
16348
|
ModalHeader as ModalHeader4,
|
|
16319
16349
|
RadiusToken as RadiusToken15,
|
|
@@ -16322,7 +16352,7 @@ import {
|
|
|
16322
16352
|
import { Row as Row11 } from "@livechat/developer-studio-ui-react";
|
|
16323
16353
|
|
|
16324
16354
|
// src/views/Workflows/Creator/Builder/Diagram.tsx
|
|
16325
|
-
import { useCallback as
|
|
16355
|
+
import { useCallback as useCallback15, useEffect as useEffect18 } from "react";
|
|
16326
16356
|
import ReactFlow, {
|
|
16327
16357
|
addEdge,
|
|
16328
16358
|
Background,
|
|
@@ -16330,7 +16360,7 @@ import ReactFlow, {
|
|
|
16330
16360
|
useEdgesState,
|
|
16331
16361
|
useNodesState
|
|
16332
16362
|
} from "reactflow";
|
|
16333
|
-
import { DesignToken as
|
|
16363
|
+
import { DesignToken as DesignToken31 } from "@livechat/design-system-react-components";
|
|
16334
16364
|
|
|
16335
16365
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/Add/Task/Task.tsx
|
|
16336
16366
|
import { memo } from "react";
|
|
@@ -16362,6 +16392,7 @@ function AddTaskNode(node2) {
|
|
|
16362
16392
|
node2.data.parentTaskReference
|
|
16363
16393
|
);
|
|
16364
16394
|
},
|
|
16395
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.task.button,
|
|
16365
16396
|
children: workflow.definition.tasks.length > 0 ? "" : "Add task"
|
|
16366
16397
|
}
|
|
16367
16398
|
),
|
|
@@ -16388,6 +16419,7 @@ function AddTriggerNode(node2) {
|
|
|
16388
16419
|
onClick: () => {
|
|
16389
16420
|
goToAddTrigger();
|
|
16390
16421
|
},
|
|
16422
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.trigger.button,
|
|
16391
16423
|
children: "Add trigger"
|
|
16392
16424
|
}
|
|
16393
16425
|
),
|
|
@@ -16495,7 +16527,7 @@ import SchemaForm from "@rjsf/core";
|
|
|
16495
16527
|
import validator2 from "@rjsf/validator-ajv8";
|
|
16496
16528
|
|
|
16497
16529
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Field.tsx
|
|
16498
|
-
import { useEffect as
|
|
16530
|
+
import { useCallback as useCallback9, useEffect as useEffect10, useMemo as useMemo7, useState as useState12 } from "react";
|
|
16499
16531
|
import { getDefaultRegistry } from "@rjsf/core";
|
|
16500
16532
|
import { MoreHoriz } from "@livechat/design-system-icons";
|
|
16501
16533
|
import {
|
|
@@ -16509,7 +16541,7 @@ import { Intro as Intro2, Row as Row7 } from "@livechat/developer-studio-ui-reac
|
|
|
16509
16541
|
import { useFetchIntegrationResourceQuery } from "@livechat/platform-integrations";
|
|
16510
16542
|
|
|
16511
16543
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/Field.tsx
|
|
16512
|
-
import { useRef as
|
|
16544
|
+
import { useRef as useRef6, useState as useState10 } from "react";
|
|
16513
16545
|
import { useOnClickOutside } from "@livechat/developer-studio-ui-react";
|
|
16514
16546
|
|
|
16515
16547
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Picker.tsx
|
|
@@ -16952,7 +16984,7 @@ function CustomTagsPicker({
|
|
|
16952
16984
|
}
|
|
16953
16985
|
|
|
16954
16986
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Input.tsx
|
|
16955
|
-
import { useCallback as
|
|
16987
|
+
import { useCallback as useCallback8, useEffect as useEffect8, useRef as useRef5 } from "react";
|
|
16956
16988
|
import debounce3 from "lodash.debounce";
|
|
16957
16989
|
import { Tooltip as Tooltip3 } from "@livechat/design-system-react-components";
|
|
16958
16990
|
|
|
@@ -17003,7 +17035,7 @@ function CustomTagTemplate(tagData, { settings: _s }) {
|
|
|
17003
17035
|
}
|
|
17004
17036
|
|
|
17005
17037
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tag/Tooltip.tsx
|
|
17006
|
-
import { useCallback as
|
|
17038
|
+
import { useCallback as useCallback6, useState as useState9 } from "react";
|
|
17007
17039
|
import debounce2 from "lodash.debounce";
|
|
17008
17040
|
import {
|
|
17009
17041
|
DesignToken as DesignToken10,
|
|
@@ -17022,8 +17054,8 @@ var useCustomTagsInputTagTooltipData = () => {
|
|
|
17022
17054
|
visible: false
|
|
17023
17055
|
}
|
|
17024
17056
|
);
|
|
17025
|
-
const setTooltipDataDebounced =
|
|
17026
|
-
const showTagTooltip =
|
|
17057
|
+
const setTooltipDataDebounced = useCallback6(debounce2(setTooltipData, 50), []);
|
|
17058
|
+
const showTagTooltip = useCallback6(
|
|
17027
17059
|
(tag, tagElement) => {
|
|
17028
17060
|
const rect = tagElement.getBoundingClientRect();
|
|
17029
17061
|
const tooltipPosition = {
|
|
@@ -17038,7 +17070,7 @@ var useCustomTagsInputTagTooltipData = () => {
|
|
|
17038
17070
|
},
|
|
17039
17071
|
[setTooltipDataDebounced]
|
|
17040
17072
|
);
|
|
17041
|
-
const hideTagTooltip =
|
|
17073
|
+
const hideTagTooltip = useCallback6(() => {
|
|
17042
17074
|
setTooltipDataDebounced({
|
|
17043
17075
|
visible: false
|
|
17044
17076
|
});
|
|
@@ -17107,10 +17139,10 @@ function CustomTagsInputTagTooltip({
|
|
|
17107
17139
|
}
|
|
17108
17140
|
|
|
17109
17141
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tags.tsx
|
|
17110
|
-
import { memo as memo3, useCallback as
|
|
17142
|
+
import { memo as memo3, useCallback as useCallback7, useEffect as useEffect7, useMemo as useMemo6, useRef as useRef4 } from "react";
|
|
17111
17143
|
import Tagify from "@yaireo/tagify";
|
|
17112
17144
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
17113
|
-
var noop = (
|
|
17145
|
+
var noop = (_2) => _2;
|
|
17114
17146
|
var isSameDeep = (a, b) => {
|
|
17115
17147
|
const trans = (x) => typeof x === "string" ? x : JSON.stringify(x);
|
|
17116
17148
|
return trans(a) === trans(b);
|
|
@@ -17191,12 +17223,12 @@ function TagifyWrapper({
|
|
|
17191
17223
|
defaultValue,
|
|
17192
17224
|
showDropdown
|
|
17193
17225
|
}) {
|
|
17194
|
-
const mountedRef =
|
|
17195
|
-
const inputElmRef =
|
|
17196
|
-
const tagify =
|
|
17197
|
-
const lastClassNameRef =
|
|
17226
|
+
const mountedRef = useRef4();
|
|
17227
|
+
const inputElmRef = useRef4(null);
|
|
17228
|
+
const tagify = useRef4();
|
|
17229
|
+
const lastClassNameRef = useRef4();
|
|
17198
17230
|
const _value = defaultValue || value;
|
|
17199
|
-
const inputAttrs =
|
|
17231
|
+
const inputAttrs = useMemo6(
|
|
17200
17232
|
() => ({
|
|
17201
17233
|
ref: inputElmRef,
|
|
17202
17234
|
name,
|
|
@@ -17209,10 +17241,10 @@ function TagifyWrapper({
|
|
|
17209
17241
|
}),
|
|
17210
17242
|
[]
|
|
17211
17243
|
);
|
|
17212
|
-
const setFocus =
|
|
17244
|
+
const setFocus = useCallback7(() => {
|
|
17213
17245
|
autoFocus && tagify.current.DOM.input.focus();
|
|
17214
17246
|
}, [tagify]);
|
|
17215
|
-
|
|
17247
|
+
useEffect7(() => {
|
|
17216
17248
|
templatesToString(settings2.templates);
|
|
17217
17249
|
settings2.userInput = userInput;
|
|
17218
17250
|
if (InputMode === "textarea") settings2.mode = "mix";
|
|
@@ -17230,70 +17262,70 @@ function TagifyWrapper({
|
|
|
17230
17262
|
t.destroy();
|
|
17231
17263
|
};
|
|
17232
17264
|
}, []);
|
|
17233
|
-
|
|
17265
|
+
useEffect7(() => {
|
|
17234
17266
|
tagify.current.off("change").on("change", onChange);
|
|
17235
17267
|
}, [onChange]);
|
|
17236
|
-
|
|
17268
|
+
useEffect7(() => {
|
|
17237
17269
|
tagify.current.off("input").on("input", onInput);
|
|
17238
17270
|
}, [onInput]);
|
|
17239
|
-
|
|
17271
|
+
useEffect7(() => {
|
|
17240
17272
|
tagify.current.off("add").on("add", onAdd);
|
|
17241
17273
|
}, [onAdd]);
|
|
17242
|
-
|
|
17274
|
+
useEffect7(() => {
|
|
17243
17275
|
tagify.current.off("remove").on("remove", onRemove);
|
|
17244
17276
|
}, [onRemove]);
|
|
17245
|
-
|
|
17277
|
+
useEffect7(() => {
|
|
17246
17278
|
tagify.current.off("invalid").on("invalid", onInvalid);
|
|
17247
17279
|
}, [onInvalid]);
|
|
17248
|
-
|
|
17280
|
+
useEffect7(() => {
|
|
17249
17281
|
tagify.current.off("keydown").on("keydown", onKeydown);
|
|
17250
17282
|
}, [onKeydown]);
|
|
17251
|
-
|
|
17283
|
+
useEffect7(() => {
|
|
17252
17284
|
tagify.current.off("focus").on("focus", onFocus);
|
|
17253
17285
|
}, [onFocus]);
|
|
17254
|
-
|
|
17286
|
+
useEffect7(() => {
|
|
17255
17287
|
tagify.current.off("blur").on("blur", onBlur);
|
|
17256
17288
|
}, [onBlur]);
|
|
17257
|
-
|
|
17289
|
+
useEffect7(() => {
|
|
17258
17290
|
tagify.current.off("click").on("click", onClick);
|
|
17259
17291
|
}, [onClick]);
|
|
17260
|
-
|
|
17292
|
+
useEffect7(() => {
|
|
17261
17293
|
tagify.current.off("edit:input").on("edit:input", onEditInput);
|
|
17262
17294
|
}, [onEditInput]);
|
|
17263
|
-
|
|
17295
|
+
useEffect7(() => {
|
|
17264
17296
|
tagify.current.off("edit:beforeUpdate").on("edit:beforeUpdate", onEditBeforeUpdate);
|
|
17265
17297
|
}, [onEditBeforeUpdate]);
|
|
17266
|
-
|
|
17298
|
+
useEffect7(() => {
|
|
17267
17299
|
tagify.current.off("edit:updated").on("edit:updated", onEditUpdated);
|
|
17268
17300
|
}, [onEditUpdated]);
|
|
17269
|
-
|
|
17301
|
+
useEffect7(() => {
|
|
17270
17302
|
tagify.current.off("edit:start").on("edit:start", onEditStart);
|
|
17271
17303
|
}, [onEditStart]);
|
|
17272
|
-
|
|
17304
|
+
useEffect7(() => {
|
|
17273
17305
|
tagify.current.off("edit:keydown").on("edit:keydown", onEditKeydown);
|
|
17274
17306
|
}, [onEditKeydown]);
|
|
17275
|
-
|
|
17307
|
+
useEffect7(() => {
|
|
17276
17308
|
tagify.current.off("dropdown:show").on("dropdown:show", onDropdownShow);
|
|
17277
17309
|
}, [onDropdownShow]);
|
|
17278
|
-
|
|
17310
|
+
useEffect7(() => {
|
|
17279
17311
|
tagify.current.off("dropdown:hide").on("dropdown:hide", onDropdownHide);
|
|
17280
17312
|
}, [onDropdownHide]);
|
|
17281
|
-
|
|
17313
|
+
useEffect7(() => {
|
|
17282
17314
|
tagify.current.off("dropdown:select").on("dropdown:select", onDropdownSelect);
|
|
17283
17315
|
}, [onDropdownSelect]);
|
|
17284
|
-
|
|
17316
|
+
useEffect7(() => {
|
|
17285
17317
|
tagify.current.off("dropdown:scroll").on("dropdown:scroll", onDropdownScroll);
|
|
17286
17318
|
}, [onDropdownScroll]);
|
|
17287
|
-
|
|
17319
|
+
useEffect7(() => {
|
|
17288
17320
|
tagify.current.off("dropdown:noMatch").on("dropdown:noMatch", onDropdownNoMatch);
|
|
17289
17321
|
}, [onDropdownNoMatch]);
|
|
17290
|
-
|
|
17322
|
+
useEffect7(() => {
|
|
17291
17323
|
tagify.current.off("dropdown:updated").on("dropdown:updated", onDropdownUpdated);
|
|
17292
17324
|
}, [onDropdownUpdated]);
|
|
17293
|
-
|
|
17325
|
+
useEffect7(() => {
|
|
17294
17326
|
setFocus();
|
|
17295
17327
|
}, [autoFocus]);
|
|
17296
|
-
|
|
17328
|
+
useEffect7(() => {
|
|
17297
17329
|
if (mountedRef.current) {
|
|
17298
17330
|
tagify.current.settings.whitelist.length = 0;
|
|
17299
17331
|
(whitelist == null ? void 0 : whitelist.length) && tagify.current.settings.whitelist.push(
|
|
@@ -17301,13 +17333,13 @@ function TagifyWrapper({
|
|
|
17301
17333
|
);
|
|
17302
17334
|
}
|
|
17303
17335
|
}, [whitelist]);
|
|
17304
|
-
|
|
17336
|
+
useEffect7(() => {
|
|
17305
17337
|
const currentValue = tagify.current.getInputValue();
|
|
17306
17338
|
if (mountedRef.current && !isSameDeep(value, currentValue)) {
|
|
17307
17339
|
tagify.current.loadOriginalValues(value);
|
|
17308
17340
|
}
|
|
17309
17341
|
}, [value]);
|
|
17310
|
-
|
|
17342
|
+
useEffect7(() => {
|
|
17311
17343
|
if (mountedRef.current) {
|
|
17312
17344
|
const { added, removed } = compareStrings(
|
|
17313
17345
|
lastClassNameRef.current,
|
|
@@ -17322,33 +17354,33 @@ function TagifyWrapper({
|
|
|
17322
17354
|
}
|
|
17323
17355
|
lastClassNameRef.current = className;
|
|
17324
17356
|
}, [className]);
|
|
17325
|
-
|
|
17357
|
+
useEffect7(() => {
|
|
17326
17358
|
if (mountedRef.current) {
|
|
17327
17359
|
tagify.current.loading(loading);
|
|
17328
17360
|
}
|
|
17329
17361
|
}, [loading]);
|
|
17330
|
-
|
|
17362
|
+
useEffect7(() => {
|
|
17331
17363
|
if (mountedRef.current) {
|
|
17332
17364
|
tagify.current.setReadonly(readOnly != null ? readOnly : false);
|
|
17333
17365
|
}
|
|
17334
17366
|
}, [readOnly]);
|
|
17335
|
-
|
|
17367
|
+
useEffect7(() => {
|
|
17336
17368
|
if (mountedRef.current) {
|
|
17337
17369
|
tagify.current.setDisabled(disabled != null ? disabled : false);
|
|
17338
17370
|
}
|
|
17339
17371
|
}, [disabled]);
|
|
17340
|
-
|
|
17372
|
+
useEffect7(() => {
|
|
17341
17373
|
if (mountedRef.current) {
|
|
17342
17374
|
const current = tagify.current;
|
|
17343
17375
|
current.userInput = userInput;
|
|
17344
17376
|
}
|
|
17345
17377
|
}, [userInput]);
|
|
17346
|
-
|
|
17378
|
+
useEffect7(() => {
|
|
17347
17379
|
if (mountedRef.current) {
|
|
17348
17380
|
tagify.current.setPlaceholder(placeholder2);
|
|
17349
17381
|
}
|
|
17350
17382
|
}, [placeholder2]);
|
|
17351
|
-
|
|
17383
|
+
useEffect7(() => {
|
|
17352
17384
|
const t = tagify.current;
|
|
17353
17385
|
if (mountedRef.current) {
|
|
17354
17386
|
if (showDropdown) {
|
|
@@ -17359,7 +17391,7 @@ function TagifyWrapper({
|
|
|
17359
17391
|
}
|
|
17360
17392
|
}
|
|
17361
17393
|
}, [showDropdown]);
|
|
17362
|
-
|
|
17394
|
+
useEffect7(() => {
|
|
17363
17395
|
mountedRef.current = true;
|
|
17364
17396
|
}, []);
|
|
17365
17397
|
return (
|
|
@@ -17471,23 +17503,23 @@ function CustomTagsInput({
|
|
|
17471
17503
|
renderPicker,
|
|
17472
17504
|
renderPickerTrigger
|
|
17473
17505
|
}) {
|
|
17474
|
-
const tagifyRef =
|
|
17506
|
+
const tagifyRef = useRef5();
|
|
17475
17507
|
const [tooltipData, { showTagTooltip, hideTagTooltip }] = useCustomTagsInputTagTooltipData();
|
|
17476
|
-
const updateAllIcons =
|
|
17508
|
+
const updateAllIcons = useCallback8(() => {
|
|
17477
17509
|
const tagify = tagifyRef.current;
|
|
17478
17510
|
if (!tagify) {
|
|
17479
17511
|
return;
|
|
17480
17512
|
}
|
|
17481
17513
|
tagify.value.forEach(updateCustomTagsInputTagIcon);
|
|
17482
17514
|
}, []);
|
|
17483
|
-
const getCurrentValue =
|
|
17515
|
+
const getCurrentValue = useCallback8(() => {
|
|
17484
17516
|
const tagify = tagifyRef.current;
|
|
17485
17517
|
if (!tagify) {
|
|
17486
17518
|
return "";
|
|
17487
17519
|
}
|
|
17488
17520
|
return tagify.getMixedTagsAsString().replace(trim2 ? /\s+/g : /\r\n$/, "").replaceAll("[[", "${").replaceAll("]]", "}").replaceAll("\u200B", "").replaceAll("\xA0", "");
|
|
17489
17521
|
}, [trim2]);
|
|
17490
|
-
const setCurrentValue =
|
|
17522
|
+
const setCurrentValue = useCallback8(
|
|
17491
17523
|
(value2, frame) => {
|
|
17492
17524
|
const tagify = tagifyRef.current;
|
|
17493
17525
|
if (!tagify) {
|
|
@@ -17498,14 +17530,14 @@ function CustomTagsInput({
|
|
|
17498
17530
|
},
|
|
17499
17531
|
[updateAllIcons]
|
|
17500
17532
|
);
|
|
17501
|
-
const handleChange =
|
|
17533
|
+
const handleChange = useCallback8(
|
|
17502
17534
|
debounce3(() => {
|
|
17503
17535
|
onChange(getCurrentValue());
|
|
17504
17536
|
updateAllIcons();
|
|
17505
17537
|
}, 300),
|
|
17506
17538
|
[onChange, getCurrentValue, updateAllIcons]
|
|
17507
17539
|
);
|
|
17508
|
-
const handleKeyDown =
|
|
17540
|
+
const handleKeyDown = useCallback8(
|
|
17509
17541
|
(e) => {
|
|
17510
17542
|
if (e.detail.event.key !== "Backspace") {
|
|
17511
17543
|
return;
|
|
@@ -17516,7 +17548,7 @@ function CustomTagsInput({
|
|
|
17516
17548
|
},
|
|
17517
17549
|
[handleChange]
|
|
17518
17550
|
);
|
|
17519
|
-
const addTag =
|
|
17551
|
+
const addTag = useCallback8(
|
|
17520
17552
|
(tag) => {
|
|
17521
17553
|
const tagify = tagifyRef.current;
|
|
17522
17554
|
if (!tagify) {
|
|
@@ -17532,7 +17564,7 @@ function CustomTagsInput({
|
|
|
17532
17564
|
},
|
|
17533
17565
|
[trim2, onPickerToggle]
|
|
17534
17566
|
);
|
|
17535
|
-
|
|
17567
|
+
useEffect8(() => {
|
|
17536
17568
|
const tagify = tagifyRef.current;
|
|
17537
17569
|
if (!tagify) {
|
|
17538
17570
|
return;
|
|
@@ -17558,7 +17590,7 @@ function CustomTagsInput({
|
|
|
17558
17590
|
showTagTooltip,
|
|
17559
17591
|
hideTagTooltip
|
|
17560
17592
|
]);
|
|
17561
|
-
|
|
17593
|
+
useEffect8(() => {
|
|
17562
17594
|
const tagify = tagifyRef.current;
|
|
17563
17595
|
if (!tagify) {
|
|
17564
17596
|
return;
|
|
@@ -17609,9 +17641,7 @@ function CustomTagsInput({
|
|
|
17609
17641
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Trigger.tsx
|
|
17610
17642
|
import { Add as Add4 } from "@livechat/design-system-icons";
|
|
17611
17643
|
import { Button as Button10, Icon as Icon8 } from "@livechat/design-system-react-components";
|
|
17612
|
-
function CustomTagsPickerTrigger({
|
|
17613
|
-
onClick
|
|
17614
|
-
}) {
|
|
17644
|
+
function CustomTagsPickerTrigger({ onClick }) {
|
|
17615
17645
|
return /* @__PURE__ */ jsx4(
|
|
17616
17646
|
Button10,
|
|
17617
17647
|
{
|
|
@@ -17624,7 +17654,6 @@ function CustomTagsPickerTrigger({
|
|
|
17624
17654
|
min-height: 28px;
|
|
17625
17655
|
width: 28px;
|
|
17626
17656
|
min-width: 28px;
|
|
17627
|
-
z-index: 1000;
|
|
17628
17657
|
`,
|
|
17629
17658
|
icon: /* @__PURE__ */ jsx4(Icon8, { source: Add4 }),
|
|
17630
17659
|
kind: "plain",
|
|
@@ -17646,7 +17675,7 @@ function CustomTagsField({
|
|
|
17646
17675
|
wrapperCss: wrapperCss3,
|
|
17647
17676
|
onChange
|
|
17648
17677
|
}) {
|
|
17649
|
-
const wrapperRef =
|
|
17678
|
+
const wrapperRef = useRef6(null);
|
|
17650
17679
|
const [isPickerVisible, setIsPickerVisible] = useState10(false);
|
|
17651
17680
|
useOnClickOutside(wrapperRef, () => {
|
|
17652
17681
|
setIsPickerVisible(false);
|
|
@@ -17714,12 +17743,14 @@ function DynamicCustomStringField(props) {
|
|
|
17714
17743
|
}
|
|
17715
17744
|
|
|
17716
17745
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Modes/Predefined.tsx
|
|
17717
|
-
import { useEffect as
|
|
17718
|
-
import { Picker } from "@livechat/design-system-react-components";
|
|
17719
|
-
var pickerCustomStyles = css`
|
|
17746
|
+
import { useEffect as useEffect9, useState as useState11 } from "react";
|
|
17747
|
+
import { DesignToken as DesignToken11, Picker } from "@livechat/design-system-react-components";
|
|
17748
|
+
var pickerCustomStyles = (readonly) => css`
|
|
17720
17749
|
flex: 1;
|
|
17721
17750
|
button {
|
|
17722
|
-
color: var(
|
|
17751
|
+
color: var(
|
|
17752
|
+
${readonly ? DesignToken11.ContentBasicDisabled : DesignToken11.ContentBasicPrimary}
|
|
17753
|
+
);
|
|
17723
17754
|
}
|
|
17724
17755
|
`;
|
|
17725
17756
|
function PredefinedCustomStringField(props) {
|
|
@@ -17727,11 +17758,11 @@ function PredefinedCustomStringField(props) {
|
|
|
17727
17758
|
const { resourceQuery, onChange, schema } = props;
|
|
17728
17759
|
const resourceConfig = schema["x-ref"];
|
|
17729
17760
|
const [pickerOptions, setPickerOptions] = useState11([]);
|
|
17730
|
-
|
|
17761
|
+
useEffect9(() => {
|
|
17731
17762
|
var _a2, _b;
|
|
17732
17763
|
if (!resourceConfig) {
|
|
17733
17764
|
if (resourceQuery.data) {
|
|
17734
|
-
onChange(
|
|
17765
|
+
onChange("");
|
|
17735
17766
|
}
|
|
17736
17767
|
return;
|
|
17737
17768
|
}
|
|
@@ -17740,7 +17771,7 @@ function PredefinedCustomStringField(props) {
|
|
|
17740
17771
|
return /* @__PURE__ */ jsx4(
|
|
17741
17772
|
Picker,
|
|
17742
17773
|
{
|
|
17743
|
-
css: pickerCustomStyles,
|
|
17774
|
+
css: pickerCustomStyles(props.readonly),
|
|
17744
17775
|
disabled: props.readonly,
|
|
17745
17776
|
error: Boolean((_a = props.rawErrors) == null ? void 0 : _a.length),
|
|
17746
17777
|
hideClearButton: true,
|
|
@@ -17763,17 +17794,29 @@ var {
|
|
|
17763
17794
|
fields: { StringField }
|
|
17764
17795
|
} = getDefaultRegistry();
|
|
17765
17796
|
function CustomStringField(props) {
|
|
17766
|
-
var _a;
|
|
17797
|
+
var _a, _b, _c;
|
|
17767
17798
|
const onChange = props.onChange;
|
|
17768
17799
|
const resourceConfig = props.schema["x-ref"];
|
|
17769
17800
|
const resourceQuery = useFetchIntegrationResourceQuery(resourceConfig);
|
|
17801
|
+
const [pristine, setPristine] = useState12(true);
|
|
17770
17802
|
const [isPredefinedMode, setIsPredefinedMode] = useState12(
|
|
17771
17803
|
() => {
|
|
17772
|
-
var _a2,
|
|
17773
|
-
return ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some((item) => item.key === props.formData)) || !props.formData && ((
|
|
17804
|
+
var _a2, _b2, _c2;
|
|
17805
|
+
return ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some((item) => item.key === props.formData)) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0 || void 0;
|
|
17774
17806
|
}
|
|
17775
17807
|
);
|
|
17776
|
-
const
|
|
17808
|
+
const handleChange = useCallback9(
|
|
17809
|
+
(value) => {
|
|
17810
|
+
setPristine(false);
|
|
17811
|
+
if (value !== "") {
|
|
17812
|
+
onChange(value);
|
|
17813
|
+
return;
|
|
17814
|
+
}
|
|
17815
|
+
onChange(props.schema.required ? null : void 0);
|
|
17816
|
+
},
|
|
17817
|
+
[onChange, props.schema.required]
|
|
17818
|
+
);
|
|
17819
|
+
const modeSelectorOptions = useMemo7(
|
|
17777
17820
|
() => [
|
|
17778
17821
|
resourceConfig ? {
|
|
17779
17822
|
key: "predefined",
|
|
@@ -17789,8 +17832,10 @@ function CustomStringField(props) {
|
|
|
17789
17832
|
}
|
|
17790
17833
|
) }),
|
|
17791
17834
|
onClick: () => {
|
|
17792
|
-
|
|
17793
|
-
|
|
17835
|
+
handleChange("");
|
|
17836
|
+
setTimeout(() => {
|
|
17837
|
+
setIsPredefinedMode(true);
|
|
17838
|
+
}, 50);
|
|
17794
17839
|
}
|
|
17795
17840
|
} : void 0,
|
|
17796
17841
|
{
|
|
@@ -17807,34 +17852,60 @@ function CustomStringField(props) {
|
|
|
17807
17852
|
}
|
|
17808
17853
|
) }),
|
|
17809
17854
|
onClick: () => {
|
|
17810
|
-
|
|
17855
|
+
handleChange("");
|
|
17811
17856
|
setTimeout(() => {
|
|
17812
17857
|
setIsPredefinedMode(false);
|
|
17813
|
-
},
|
|
17858
|
+
}, 50);
|
|
17814
17859
|
}
|
|
17815
17860
|
}
|
|
17816
17861
|
].filter(Boolean),
|
|
17817
|
-
[resourceConfig,
|
|
17862
|
+
[resourceConfig, handleChange, setIsPredefinedMode]
|
|
17818
17863
|
);
|
|
17819
|
-
|
|
17820
|
-
var _a2,
|
|
17864
|
+
useEffect10(() => {
|
|
17865
|
+
var _a2, _b2, _c2;
|
|
17866
|
+
if (!pristine && !props.formData) {
|
|
17867
|
+
return;
|
|
17868
|
+
}
|
|
17821
17869
|
setIsPredefinedMode(
|
|
17822
17870
|
((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some(
|
|
17823
17871
|
(option) => option.key === props.formData
|
|
17824
|
-
)) || !props.formData && ((
|
|
17872
|
+
)) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0
|
|
17825
17873
|
);
|
|
17826
|
-
}, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData]);
|
|
17874
|
+
}, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData, pristine]);
|
|
17875
|
+
useEffect10(() => {
|
|
17876
|
+
setPristine(true);
|
|
17877
|
+
}, [(_c = (_b = props.formContext) == null ? void 0 : _b.frame.__meta) == null ? void 0 : _c.index]);
|
|
17827
17878
|
if (props.schema.enum || props.schema.oneOf) {
|
|
17828
17879
|
return /* @__PURE__ */ jsx4(StringField, __spreadValues({}, props));
|
|
17829
17880
|
}
|
|
17830
17881
|
return /* @__PURE__ */ jsxs2(Row7, { gap: `var(${SpacingToken11.Spacing1})`, notPadded: true, children: [
|
|
17831
|
-
|
|
17882
|
+
/* @__PURE__ */ jsx4("br", {}),
|
|
17883
|
+
isPredefinedMode ? /* @__PURE__ */ jsx4(
|
|
17884
|
+
PredefinedCustomStringField,
|
|
17885
|
+
__spreadProps(__spreadValues({}, props), {
|
|
17886
|
+
onChange: handleChange,
|
|
17887
|
+
resourceQuery
|
|
17888
|
+
})
|
|
17889
|
+
) : /* @__PURE__ */ jsx4(
|
|
17890
|
+
DynamicCustomStringField,
|
|
17891
|
+
__spreadProps(__spreadValues({}, props), {
|
|
17892
|
+
onChange: handleChange,
|
|
17893
|
+
resourceQuery
|
|
17894
|
+
})
|
|
17895
|
+
),
|
|
17832
17896
|
modeSelectorOptions.length > 1 && /* @__PURE__ */ jsx4(
|
|
17833
17897
|
ActionMenu,
|
|
17834
17898
|
{
|
|
17835
17899
|
options: modeSelectorOptions,
|
|
17836
17900
|
selectedOptions: [isPredefinedMode ? "predefined" : "custom"],
|
|
17837
|
-
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
17901
|
+
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
17902
|
+
Button11,
|
|
17903
|
+
{
|
|
17904
|
+
disabled: props.readonly,
|
|
17905
|
+
icon: /* @__PURE__ */ jsx4(Icon9, { source: MoreHoriz }),
|
|
17906
|
+
kind: "secondary"
|
|
17907
|
+
}
|
|
17908
|
+
)
|
|
17838
17909
|
}
|
|
17839
17910
|
)
|
|
17840
17911
|
] });
|
|
@@ -17862,6 +17933,7 @@ function CustomAddButton(props) {
|
|
|
17862
17933
|
onClick: (e) => {
|
|
17863
17934
|
onClick && onClick(e);
|
|
17864
17935
|
},
|
|
17936
|
+
disabled: props.disabled,
|
|
17865
17937
|
size: "medium",
|
|
17866
17938
|
children: "Add property"
|
|
17867
17939
|
}
|
|
@@ -17880,6 +17952,7 @@ function CustomRemoveButton(props) {
|
|
|
17880
17952
|
`,
|
|
17881
17953
|
icon: /* @__PURE__ */ jsx4(Icon10, { source: Delete }),
|
|
17882
17954
|
kind: "text",
|
|
17955
|
+
disabled: props.disabled,
|
|
17883
17956
|
onClick: (e) => {
|
|
17884
17957
|
onClick && onClick(e);
|
|
17885
17958
|
}
|
|
@@ -17899,6 +17972,7 @@ function CustomMoveUpButton(props) {
|
|
|
17899
17972
|
`,
|
|
17900
17973
|
icon: /* @__PURE__ */ jsx4(Icon10, { source: ArrowUpward }),
|
|
17901
17974
|
kind: "text",
|
|
17975
|
+
disabled: props.disabled,
|
|
17902
17976
|
onClick: (e) => {
|
|
17903
17977
|
onClick && onClick(e);
|
|
17904
17978
|
}
|
|
@@ -17918,6 +17992,7 @@ function CustomMoveDownButton(props) {
|
|
|
17918
17992
|
`,
|
|
17919
17993
|
icon: /* @__PURE__ */ jsx4(Icon10, { source: ArrowDownward }),
|
|
17920
17994
|
kind: "text",
|
|
17995
|
+
disabled: props.disabled,
|
|
17921
17996
|
onClick: (e) => {
|
|
17922
17997
|
onClick && onClick(e);
|
|
17923
17998
|
}
|
|
@@ -17931,7 +18006,7 @@ import { getTemplate as getTemplate2, getUiOptions as getUiOptions2 } from "@rjs
|
|
|
17931
18006
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomArrayFieldHeader.tsx
|
|
17932
18007
|
import { getTemplate, getUiOptions } from "@rjsf/utils";
|
|
17933
18008
|
import {
|
|
17934
|
-
DesignToken as
|
|
18009
|
+
DesignToken as DesignToken12,
|
|
17935
18010
|
SpacingToken as SpacingToken13
|
|
17936
18011
|
} from "@livechat/design-system-react-components";
|
|
17937
18012
|
import { Row as Row8 } from "@livechat/developer-studio-ui-react";
|
|
@@ -17984,7 +18059,7 @@ function CustomArrayFieldHeader(props) {
|
|
|
17984
18059
|
font-size: 13px;
|
|
17985
18060
|
font-weight: 400;
|
|
17986
18061
|
line-height: 16px;
|
|
17987
|
-
color: var(${
|
|
18062
|
+
color: var(${DesignToken12.ContentBasicSecondary});
|
|
17988
18063
|
`,
|
|
17989
18064
|
children: "optional"
|
|
17990
18065
|
}
|
|
@@ -18102,7 +18177,7 @@ import {
|
|
|
18102
18177
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomFieldHeader.tsx
|
|
18103
18178
|
import { descriptionId as descriptionId2, getTemplate as getTemplate3, getUiOptions as getUiOptions3, titleId as titleId2 } from "@rjsf/utils";
|
|
18104
18179
|
import {
|
|
18105
|
-
DesignToken as
|
|
18180
|
+
DesignToken as DesignToken13,
|
|
18106
18181
|
SpacingToken as SpacingToken14
|
|
18107
18182
|
} from "@livechat/design-system-react-components";
|
|
18108
18183
|
import { Row as Row9 } from "@livechat/developer-studio-ui-react";
|
|
@@ -18110,7 +18185,7 @@ var OptionalWrapper = newStyled.div`
|
|
|
18110
18185
|
font-size: 13px;
|
|
18111
18186
|
font-weight: 400;
|
|
18112
18187
|
line-height: 16px;
|
|
18113
|
-
color: var(${
|
|
18188
|
+
color: var(${DesignToken13.ContentBasicSecondary});
|
|
18114
18189
|
`;
|
|
18115
18190
|
function CustomFieldHeader(props) {
|
|
18116
18191
|
const {
|
|
@@ -18306,7 +18381,7 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18306
18381
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomObjectField.tsx
|
|
18307
18382
|
import { useState as useState13 } from "react";
|
|
18308
18383
|
import { ADDITIONAL_PROPERTY_FLAG as ADDITIONAL_PROPERTY_FLAG3, canExpand } from "@rjsf/utils";
|
|
18309
|
-
import { Button as Button13, DesignToken as
|
|
18384
|
+
import { Button as Button13, DesignToken as DesignToken14 } from "@livechat/design-system-react-components";
|
|
18310
18385
|
function CustomObjectFieldTemplate(props) {
|
|
18311
18386
|
const {
|
|
18312
18387
|
description,
|
|
@@ -18371,7 +18446,7 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18371
18446
|
Button13,
|
|
18372
18447
|
{
|
|
18373
18448
|
css: css`
|
|
18374
|
-
color: var(${
|
|
18449
|
+
color: var(${DesignToken14.ContentBasicPrimary});
|
|
18375
18450
|
`,
|
|
18376
18451
|
kind: "link-light",
|
|
18377
18452
|
onClick: () => {
|
|
@@ -18692,7 +18767,7 @@ var CustomToolbar_default = Toolbar_default;
|
|
|
18692
18767
|
|
|
18693
18768
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/Custom.tsx
|
|
18694
18769
|
import {
|
|
18695
|
-
DesignToken as
|
|
18770
|
+
DesignToken as DesignToken15,
|
|
18696
18771
|
RadiusToken as RadiusToken6
|
|
18697
18772
|
} from "@livechat/design-system-react-components";
|
|
18698
18773
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -18702,8 +18777,8 @@ var Wrapper2 = newStyled.div`
|
|
|
18702
18777
|
|
|
18703
18778
|
.react-flow__handle {
|
|
18704
18779
|
transition: background-color 0.15s ease-in-out 0s;
|
|
18705
|
-
background: var(${
|
|
18706
|
-
border: 1px solid var(${
|
|
18780
|
+
background: var(${DesignToken15.SurfacePrimaryDefault}) !important;
|
|
18781
|
+
border: 1px solid var(${DesignToken15.BorderBasicPrimary}) !important;
|
|
18707
18782
|
pointer-events: all;
|
|
18708
18783
|
cursor: pointer;
|
|
18709
18784
|
border-radius: var(${RadiusToken6[1]}) !important;
|
|
@@ -18796,7 +18871,7 @@ var Node_default = memo4(ForkJoinNode);
|
|
|
18796
18871
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Base.tsx
|
|
18797
18872
|
import { Automation } from "@livechat/design-system-icons";
|
|
18798
18873
|
import {
|
|
18799
|
-
DesignToken as
|
|
18874
|
+
DesignToken as DesignToken16,
|
|
18800
18875
|
Icon as Icon14,
|
|
18801
18876
|
RadiusToken as RadiusToken7,
|
|
18802
18877
|
ShadowToken as ShadowToken2,
|
|
@@ -18805,10 +18880,10 @@ import {
|
|
|
18805
18880
|
import { IntegrationNames as IntegrationNames15 } from "@livechat/developer-studio-api";
|
|
18806
18881
|
import { Column as Column7 } from "@livechat/developer-studio-ui-react";
|
|
18807
18882
|
var Node2 = newStyled.div`
|
|
18808
|
-
color: var(${
|
|
18809
|
-
background-color: ${({ editing }) => editing ? `var(${
|
|
18883
|
+
color: var(${DesignToken16.ContentBasicPrimary});
|
|
18884
|
+
background-color: ${({ editing }) => editing ? `var(${DesignToken16.SurfacePrimaryActive})` : `var(${DesignToken16.SurfacePrimaryDefault})`};
|
|
18810
18885
|
border: 1px solid
|
|
18811
|
-
${({ editing, hasErrors }) => hasErrors ? `var(${
|
|
18886
|
+
${({ editing, hasErrors }) => hasErrors ? `var(${DesignToken16.BorderBasicNegative})` : editing ? `var(${DesignToken16.ActionPrimaryDefault})` : `var(${DesignToken16.BorderBasicSecondary})`};
|
|
18812
18887
|
border-radius: var(${RadiusToken7[3]});
|
|
18813
18888
|
width: ${DEFAULT_NODE_WIDTH.HTTP}px;
|
|
18814
18889
|
|
|
@@ -18820,7 +18895,7 @@ var Node2 = newStyled.div`
|
|
|
18820
18895
|
transition: 0.15s ease-in-out 0s;
|
|
18821
18896
|
|
|
18822
18897
|
&:hover {
|
|
18823
|
-
background: var(${
|
|
18898
|
+
background: var(${DesignToken16.SurfacePrimaryHover});
|
|
18824
18899
|
box-shadow: var(${ShadowToken2.Float});
|
|
18825
18900
|
}
|
|
18826
18901
|
`;
|
|
@@ -18927,7 +19002,7 @@ function HttpNodeBase({
|
|
|
18927
19002
|
var Base_default2 = HttpNodeBase;
|
|
18928
19003
|
|
|
18929
19004
|
// src/views/Workflows/Creator/Builder/Forms/Schema/Wrapper.tsx
|
|
18930
|
-
import { useMemo as
|
|
19005
|
+
import { useMemo as useMemo8, useState as useState15 } from "react";
|
|
18931
19006
|
import { Error as Error4 } from "@livechat/design-system-icons";
|
|
18932
19007
|
import {
|
|
18933
19008
|
Icon as Icon15,
|
|
@@ -18946,8 +19021,8 @@ import {
|
|
|
18946
19021
|
} from "@livechat/platform-integrations";
|
|
18947
19022
|
|
|
18948
19023
|
// src/views/Workflows/Creator/Builder/Forms/Schema/integrations/Text/index.tsx
|
|
18949
|
-
import { useCallback as
|
|
18950
|
-
import { useLocation as
|
|
19024
|
+
import { useCallback as useCallback10 } from "react";
|
|
19025
|
+
import { useLocation as useLocation4 } from "react-router-dom";
|
|
18951
19026
|
import { Button as Button15, SpacingToken as SpacingToken17 } from "@livechat/design-system-react-components";
|
|
18952
19027
|
import {
|
|
18953
19028
|
Card,
|
|
@@ -18961,7 +19036,7 @@ import {
|
|
|
18961
19036
|
triggerAccountsAction
|
|
18962
19037
|
} from "@livechat/platform-integrations";
|
|
18963
19038
|
function GlobalAccounts(props) {
|
|
18964
|
-
const { pathname } =
|
|
19039
|
+
const { pathname } = useLocation4();
|
|
18965
19040
|
const notifications = useNotificationContext3();
|
|
18966
19041
|
const { user } = useUserContext7();
|
|
18967
19042
|
const organizationProductsQuery = useFetchOrganizationProducts();
|
|
@@ -18972,7 +19047,7 @@ function GlobalAccounts(props) {
|
|
|
18972
19047
|
const needToBeActivated = organizationProductsQuery.data ? !organizationProductsQuery.data.find(
|
|
18973
19048
|
(product) => product.product === props.product
|
|
18974
19049
|
) : void 0;
|
|
18975
|
-
const refetch =
|
|
19050
|
+
const refetch = useCallback10(() => {
|
|
18976
19051
|
void organizationProductsQuery.refetch();
|
|
18977
19052
|
}, [organizationProductsQuery]);
|
|
18978
19053
|
return /* @__PURE__ */ jsxs2(Column8, { gap: `var(${SpacingToken17.Spacing3})`, notPadded: true, children: [
|
|
@@ -19048,11 +19123,11 @@ function CustomSchemaFormWrapper({
|
|
|
19048
19123
|
preselectedTab,
|
|
19049
19124
|
tabsMetadata
|
|
19050
19125
|
}) {
|
|
19051
|
-
const spec =
|
|
19126
|
+
const spec = useMemo8(() => WorkflowSpecification.getItemConfig(data), [data]);
|
|
19052
19127
|
const [selectedTab, setSelectedTab] = useState15(
|
|
19053
19128
|
preselectedTab != null ? preselectedTab : !spec || spec.specification.input ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
|
|
19054
19129
|
);
|
|
19055
|
-
const tabItems =
|
|
19130
|
+
const tabItems = useMemo8(
|
|
19056
19131
|
() => [
|
|
19057
19132
|
!spec || spec.specification.input ? { id: "parameters", title: "Parameters" } : void 0,
|
|
19058
19133
|
spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? {
|
|
@@ -19122,7 +19197,7 @@ function HttpNodeForm({
|
|
|
19122
19197
|
onChange,
|
|
19123
19198
|
readonly
|
|
19124
19199
|
}) {
|
|
19125
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
19200
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
19126
19201
|
const spec = (_a = metadata.frame.__meta) == null ? void 0 : _a.config;
|
|
19127
19202
|
if (data.name === "http") {
|
|
19128
19203
|
return /* @__PURE__ */ jsx4(
|
|
@@ -19171,15 +19246,7 @@ function HttpNodeForm({
|
|
|
19171
19246
|
data
|
|
19172
19247
|
}),
|
|
19173
19248
|
formData: queryParams,
|
|
19174
|
-
formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ?
|
|
19175
|
-
Object.entries(queryParams).map((entry) => {
|
|
19176
|
-
var _a2, _b2, _c2;
|
|
19177
|
-
return [
|
|
19178
|
-
entry[0],
|
|
19179
|
-
(_c2 = (_b2 = (_a2 = metadata.errors) == null ? void 0 : _a2.inputParameters) == null ? void 0 : _b2.http_request) == null ? void 0 : _c2.uri
|
|
19180
|
-
];
|
|
19181
|
-
})
|
|
19182
|
-
) : void 0,
|
|
19249
|
+
formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ? (_o = (_n = (_m = metadata.errors) == null ? void 0 : _m.inputParameters) == null ? void 0 : _n.http_request) == null ? void 0 : _o.uri : void 0,
|
|
19183
19250
|
onChange: (formData) => {
|
|
19184
19251
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
19185
19252
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -19193,14 +19260,14 @@ function HttpNodeForm({
|
|
|
19193
19260
|
schema: spec.specification.input.properties.query
|
|
19194
19261
|
}
|
|
19195
19262
|
) : void 0,
|
|
19196
|
-
((
|
|
19263
|
+
((_q = (_p = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _p.properties) == null ? void 0 : _q.body) ? /* @__PURE__ */ jsx4(
|
|
19197
19264
|
Form_default,
|
|
19198
19265
|
{
|
|
19199
19266
|
formContext: __spreadProps(__spreadValues({}, metadata), {
|
|
19200
19267
|
data
|
|
19201
19268
|
}),
|
|
19202
19269
|
formData: data.inputParameters.http_request.body,
|
|
19203
|
-
formErrors: (
|
|
19270
|
+
formErrors: (_t = (_s = (_r = metadata.errors) == null ? void 0 : _r.inputParameters) == null ? void 0 : _s.http_request) == null ? void 0 : _t.body,
|
|
19204
19271
|
onChange: (formData) => {
|
|
19205
19272
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
19206
19273
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -19298,17 +19365,17 @@ var Node_default2 = memo5(HttpNode);
|
|
|
19298
19365
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Base.tsx
|
|
19299
19366
|
import { DirectionsSignOff } from "@livechat/design-system-icons";
|
|
19300
19367
|
import {
|
|
19301
|
-
DesignToken as
|
|
19368
|
+
DesignToken as DesignToken17,
|
|
19302
19369
|
Icon as Icon16,
|
|
19303
19370
|
RadiusToken as RadiusToken8,
|
|
19304
19371
|
ShadowToken as ShadowToken3,
|
|
19305
19372
|
SpacingToken as SpacingToken19
|
|
19306
19373
|
} from "@livechat/design-system-react-components";
|
|
19307
19374
|
var Node3 = newStyled.div`
|
|
19308
|
-
color: var(${
|
|
19309
|
-
background-color: ${({ editing }) => editing ? `var(${
|
|
19375
|
+
color: var(${DesignToken17.ContentBasicPrimary});
|
|
19376
|
+
background-color: ${({ editing }) => editing ? `var(${DesignToken17.SurfacePrimaryActive})` : `var(${DesignToken17.Background01})`};
|
|
19310
19377
|
border: 1px solid
|
|
19311
|
-
${({ editing, hasErrors }) => hasErrors ? `var(${
|
|
19378
|
+
${({ editing, hasErrors }) => hasErrors ? `var(${DesignToken17.BorderBasicNegative})` : editing ? `var(${DesignToken17.ActionPrimaryDefault})` : `var(${DesignToken17.BorderBasicSecondary})`};
|
|
19312
19379
|
border-radius: var(${RadiusToken8[3]});
|
|
19313
19380
|
width: ${DEFAULT_NODE_WIDTH.JOIN}px;
|
|
19314
19381
|
|
|
@@ -19320,7 +19387,7 @@ var Node3 = newStyled.div`
|
|
|
19320
19387
|
transition: 0.15s ease-in-out 0s;
|
|
19321
19388
|
|
|
19322
19389
|
&:hover {
|
|
19323
|
-
background: var(${
|
|
19390
|
+
background: var(${DesignToken17.SurfacePrimaryHover});
|
|
19324
19391
|
box-shadow: var(${ShadowToken3.Float});
|
|
19325
19392
|
}
|
|
19326
19393
|
`;
|
|
@@ -19458,17 +19525,17 @@ var Node_default3 = memo6(JoinNode);
|
|
|
19458
19525
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Base.tsx
|
|
19459
19526
|
import { Channels } from "@livechat/design-system-icons";
|
|
19460
19527
|
import {
|
|
19461
|
-
DesignToken as
|
|
19528
|
+
DesignToken as DesignToken18,
|
|
19462
19529
|
Icon as Icon17,
|
|
19463
19530
|
RadiusToken as RadiusToken9,
|
|
19464
19531
|
ShadowToken as ShadowToken4,
|
|
19465
19532
|
SpacingToken as SpacingToken20
|
|
19466
19533
|
} from "@livechat/design-system-react-components";
|
|
19467
19534
|
var Node4 = newStyled.div`
|
|
19468
|
-
color: var(${
|
|
19469
|
-
background-color: ${({ editing }) => editing ? `var(${
|
|
19535
|
+
color: var(${DesignToken18.ContentBasicPrimary});
|
|
19536
|
+
background-color: ${({ editing }) => editing ? `var(${DesignToken18.SurfacePrimaryActive})` : `var(${DesignToken18.SurfacePrimaryDefault})`};
|
|
19470
19537
|
border: 1px solid
|
|
19471
|
-
${({ editing, hasErrors }) => hasErrors ? `var(${
|
|
19538
|
+
${({ editing, hasErrors }) => hasErrors ? `var(${DesignToken18.BorderBasicNegative})` : editing ? `var(${DesignToken18.ActionPrimaryDefault})` : `var(${DesignToken18.BorderBasicSecondary})`};
|
|
19472
19539
|
border-radius: var(${RadiusToken9[3]});
|
|
19473
19540
|
width: ${({ source }) => source ? `${DEFAULT_NODE_WIDTH.default}px` : `${DEFAULT_NODE_WIDTH.SWITCH}px`};
|
|
19474
19541
|
height: ${DEFAULT_NODE_HEIGHT.SWITCH}px;
|
|
@@ -19480,7 +19547,7 @@ var Node4 = newStyled.div`
|
|
|
19480
19547
|
transition: 0.15s ease-in-out 0s;
|
|
19481
19548
|
|
|
19482
19549
|
&:hover {
|
|
19483
|
-
background: var(${
|
|
19550
|
+
background: var(${DesignToken18.SurfacePrimaryHover});
|
|
19484
19551
|
box-shadow: var(${ShadowToken4.Float});
|
|
19485
19552
|
}
|
|
19486
19553
|
`;
|
|
@@ -19599,7 +19666,7 @@ var Form_default5 = SwitchNodeForm;
|
|
|
19599
19666
|
import { memo as memo7, useState as useState17 } from "react";
|
|
19600
19667
|
import { Handle as Handle5, Position as Position7 } from "reactflow";
|
|
19601
19668
|
import {
|
|
19602
|
-
DesignToken as
|
|
19669
|
+
DesignToken as DesignToken19,
|
|
19603
19670
|
ShadowToken as ShadowToken5
|
|
19604
19671
|
} from "@livechat/design-system-react-components";
|
|
19605
19672
|
var handlerWrapperCss = css`
|
|
@@ -19609,7 +19676,7 @@ var handlerWrapperCss = css`
|
|
|
19609
19676
|
|
|
19610
19677
|
&:hover {
|
|
19611
19678
|
> div:nth-of-type(3) {
|
|
19612
|
-
background: var(${
|
|
19679
|
+
background: var(${DesignToken19.SurfacePrimaryHover});
|
|
19613
19680
|
box-shadow: var(${ShadowToken5.Float});
|
|
19614
19681
|
}
|
|
19615
19682
|
}
|
|
@@ -19711,7 +19778,7 @@ var Node_default4 = memo7(SwitchNode);
|
|
|
19711
19778
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Base.tsx
|
|
19712
19779
|
import { ArrowBarToRight } from "@livechat/design-system-icons";
|
|
19713
19780
|
import {
|
|
19714
|
-
DesignToken as
|
|
19781
|
+
DesignToken as DesignToken20,
|
|
19715
19782
|
Icon as Icon18,
|
|
19716
19783
|
ShadowToken as ShadowToken6,
|
|
19717
19784
|
SpacingToken as SpacingToken21
|
|
@@ -19719,10 +19786,10 @@ import {
|
|
|
19719
19786
|
import { Column as Column10 } from "@livechat/developer-studio-ui-react";
|
|
19720
19787
|
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
19721
19788
|
var Node5 = newStyled.div`
|
|
19722
|
-
color: var(${
|
|
19723
|
-
background-color: ${({ editing }) => editing ? `var(${
|
|
19789
|
+
color: var(${DesignToken20.ContentBasicPrimary});
|
|
19790
|
+
background-color: ${({ editing }) => editing ? `var(${DesignToken20.SurfacePrimaryActive})` : `var(${DesignToken20.SurfacePrimaryDefault})`};
|
|
19724
19791
|
border: 1px solid
|
|
19725
|
-
${({ hasErrors }) => !hasErrors ? `var(${
|
|
19792
|
+
${({ hasErrors }) => !hasErrors ? `var(${DesignToken20.BorderBasicSecondary})` : `var(${DesignToken20.BorderBasicNegative})`};
|
|
19726
19793
|
border-radius: 50%;
|
|
19727
19794
|
width: ${DEFAULT_NODE_WIDTH.TERMINATE}px;
|
|
19728
19795
|
height: ${DEFAULT_NODE_HEIGHT.TERMINATE}px;
|
|
@@ -19733,7 +19800,7 @@ var Node5 = newStyled.div`
|
|
|
19733
19800
|
position: relative;
|
|
19734
19801
|
transition: 0.15s ease-in-out 0s;
|
|
19735
19802
|
&:hover {
|
|
19736
|
-
background: var(${
|
|
19803
|
+
background: var(${DesignToken20.SurfacePrimaryHover});
|
|
19737
19804
|
box-shadow: var(${ShadowToken6.Float});
|
|
19738
19805
|
}
|
|
19739
19806
|
`;
|
|
@@ -19872,17 +19939,17 @@ var Node_default5 = memo8(TerminateNode);
|
|
|
19872
19939
|
|
|
19873
19940
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Base.tsx
|
|
19874
19941
|
import {
|
|
19875
|
-
DesignToken as
|
|
19942
|
+
DesignToken as DesignToken21,
|
|
19876
19943
|
ShadowToken as ShadowToken7,
|
|
19877
19944
|
SpacingToken as SpacingToken22
|
|
19878
19945
|
} from "@livechat/design-system-react-components";
|
|
19879
19946
|
import { IntegrationNames as IntegrationNames17 } from "@livechat/developer-studio-api";
|
|
19880
19947
|
import { Column as Column11 } from "@livechat/developer-studio-ui-react";
|
|
19881
19948
|
var Node6 = newStyled.div`
|
|
19882
|
-
color: var(${
|
|
19883
|
-
background-color: ${({ editing }) => editing ? `var(${
|
|
19949
|
+
color: var(${DesignToken21.ContentBasicPrimary});
|
|
19950
|
+
background-color: ${({ editing }) => editing ? `var(${DesignToken21.SurfacePrimaryActive})` : `var(${DesignToken21.SurfacePrimaryDefault})`};
|
|
19884
19951
|
border: 1px solid
|
|
19885
|
-
${({ editing, hasErrors }) => hasErrors ? `var(${
|
|
19952
|
+
${({ editing, hasErrors }) => hasErrors ? `var(${DesignToken21.BorderBasicNegative})` : editing ? `var(${DesignToken21.ActionPrimaryDefault})` : `var(${DesignToken21.BorderBasicSecondary})`};
|
|
19886
19953
|
border-radius: 50px;
|
|
19887
19954
|
width: ${DEFAULT_NODE_WIDTH.HTTP}px;
|
|
19888
19955
|
|
|
@@ -19895,7 +19962,7 @@ var Node6 = newStyled.div`
|
|
|
19895
19962
|
padding: 0 var(${SpacingToken22.Spacing3});
|
|
19896
19963
|
|
|
19897
19964
|
&:hover {
|
|
19898
|
-
background: var(${
|
|
19965
|
+
background: var(${DesignToken21.SurfacePrimaryHover});
|
|
19899
19966
|
box-shadow: var(${ShadowToken7.Float});
|
|
19900
19967
|
}
|
|
19901
19968
|
`;
|
|
@@ -19988,34 +20055,34 @@ var Base_default6 = TriggerNodeBase;
|
|
|
19988
20055
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Form.tsx
|
|
19989
20056
|
import { useState as useState19 } from "react";
|
|
19990
20057
|
import { Cron } from "react-js-cron";
|
|
19991
|
-
import { DesignToken as
|
|
20058
|
+
import { DesignToken as DesignToken22 } from "@livechat/design-system-react-components";
|
|
19992
20059
|
var cronCss = css`
|
|
19993
20060
|
width: 100%;
|
|
19994
20061
|
|
|
19995
20062
|
.ant-select {
|
|
19996
|
-
color: var(${
|
|
20063
|
+
color: var(${DesignToken22.ContentBasicPrimary}) !important;
|
|
19997
20064
|
}
|
|
19998
20065
|
|
|
19999
20066
|
.ant-select-open .ant-select-selection-item {
|
|
20000
|
-
color: var(${
|
|
20067
|
+
color: var(${DesignToken22.ContentBasicPrimary}) !important;
|
|
20001
20068
|
}
|
|
20002
20069
|
|
|
20003
20070
|
.ant-select-selector {
|
|
20004
|
-
color: var(${
|
|
20005
|
-
border: 1px solid var(${
|
|
20006
|
-
background: var(${
|
|
20071
|
+
color: var(${DesignToken22.ContentBasicPrimary}) !important;
|
|
20072
|
+
border: 1px solid var(${DesignToken22.BorderBasicPrimary}) !important;
|
|
20073
|
+
background: var(${DesignToken22.SurfacePrimaryDefault}) !important;
|
|
20007
20074
|
|
|
20008
20075
|
&:hover {
|
|
20009
|
-
border-color: var(${
|
|
20076
|
+
border-color: var(${DesignToken22.BorderBasicHover}) !important;
|
|
20010
20077
|
}
|
|
20011
20078
|
}
|
|
20012
20079
|
|
|
20013
20080
|
svg {
|
|
20014
|
-
fill: var(${
|
|
20081
|
+
fill: var(${DesignToken22.ContentBasicPrimary}) !important;
|
|
20015
20082
|
}
|
|
20016
20083
|
|
|
20017
20084
|
.ant-select-item {
|
|
20018
|
-
color: var(${
|
|
20085
|
+
color: var(${DesignToken22.ContentBasicPrimary}) !important;
|
|
20019
20086
|
}
|
|
20020
20087
|
|
|
20021
20088
|
.react-js-cron-clear-button {
|
|
@@ -20157,8 +20224,8 @@ function TriggerNode(node2) {
|
|
|
20157
20224
|
var Node_default6 = memo9(TriggerNode);
|
|
20158
20225
|
|
|
20159
20226
|
// src/views/Workflows/Creator/Builder/Controls/CustomControls.tsx
|
|
20160
|
-
import { useEffect as
|
|
20161
|
-
import { useLocation as
|
|
20227
|
+
import { useEffect as useEffect17 } from "react";
|
|
20228
|
+
import { useLocation as useLocation5, useNavigate as useNavigate8 } from "react-router-dom";
|
|
20162
20229
|
import { ControlButton, Controls, useReactFlow as useReactFlow2 } from "reactflow";
|
|
20163
20230
|
import {
|
|
20164
20231
|
ArrowAutofitWidth,
|
|
@@ -20167,7 +20234,7 @@ import {
|
|
|
20167
20234
|
ZoomOut
|
|
20168
20235
|
} from "@livechat/design-system-icons";
|
|
20169
20236
|
import {
|
|
20170
|
-
DesignToken as
|
|
20237
|
+
DesignToken as DesignToken28,
|
|
20171
20238
|
Icon as Icon25,
|
|
20172
20239
|
Popover,
|
|
20173
20240
|
RadiusToken as RadiusToken13
|
|
@@ -20180,12 +20247,12 @@ import { Button as Button16, Icon as Icon19 } from "@livechat/design-system-reac
|
|
|
20180
20247
|
|
|
20181
20248
|
// src/views/Workflows/Common/One/widget/message-box/styles.ts
|
|
20182
20249
|
import {
|
|
20183
|
-
DesignToken as
|
|
20250
|
+
DesignToken as DesignToken23,
|
|
20184
20251
|
RadiusToken as RadiusToken10,
|
|
20185
20252
|
SpacingToken as SpacingToken23
|
|
20186
20253
|
} from "@livechat/design-system-react-components";
|
|
20187
20254
|
var popoverMessageBox = css`
|
|
20188
|
-
border-top: 1px solid var(${
|
|
20255
|
+
border-top: 1px solid var(${DesignToken23.BorderBasicSecondary});
|
|
20189
20256
|
`;
|
|
20190
20257
|
var contentEditable = css`
|
|
20191
20258
|
max-height: calc(100% - 32px);
|
|
@@ -20195,7 +20262,7 @@ var contentEditable = css`
|
|
|
20195
20262
|
line-height: 21px;
|
|
20196
20263
|
font-size: 16px;
|
|
20197
20264
|
outline: none;
|
|
20198
|
-
color: var(${
|
|
20265
|
+
color: var(${DesignToken23.ContentBasicPrimary});
|
|
20199
20266
|
margin-right: var(${SpacingToken23.Spacing1});
|
|
20200
20267
|
white-space: pre !important;
|
|
20201
20268
|
-ms-overflow-style: none;
|
|
@@ -20203,7 +20270,7 @@ var contentEditable = css`
|
|
|
20203
20270
|
-webkit-scrollbar: none;
|
|
20204
20271
|
|
|
20205
20272
|
&:focus-visible {
|
|
20206
|
-
border-color: var(${
|
|
20273
|
+
border-color: var(${DesignToken23.BorderDefault});
|
|
20207
20274
|
}
|
|
20208
20275
|
|
|
20209
20276
|
p {
|
|
@@ -20224,7 +20291,7 @@ var messageBoxWrapper = css`
|
|
|
20224
20291
|
}
|
|
20225
20292
|
`;
|
|
20226
20293
|
var placeholder = css`
|
|
20227
|
-
color: var(${
|
|
20294
|
+
color: var(${DesignToken23.ContentBasicDisabled});
|
|
20228
20295
|
overflow: hidden;
|
|
20229
20296
|
position: absolute;
|
|
20230
20297
|
text-overflow: ellipsis;
|
|
@@ -20269,16 +20336,16 @@ var messageBoxTip = css`
|
|
|
20269
20336
|
font-size: 14px;
|
|
20270
20337
|
line-height: 24px;
|
|
20271
20338
|
gap: var(${SpacingToken23.Spacing2});
|
|
20272
|
-
color: var(${
|
|
20339
|
+
color: var(${DesignToken23.ContentBasicDisabled});
|
|
20273
20340
|
|
|
20274
20341
|
strong {
|
|
20275
20342
|
width: 24px;
|
|
20276
20343
|
display: flex;
|
|
20277
20344
|
justify-content: center;
|
|
20278
20345
|
align-items: center;
|
|
20279
|
-
color: var(${
|
|
20346
|
+
color: var(${DesignToken23.ContentBasicPrimary});
|
|
20280
20347
|
border-radius: var(${RadiusToken10[3]});
|
|
20281
|
-
background-color: var(${
|
|
20348
|
+
background-color: var(${DesignToken23.SurfaceSecondaryDefault});
|
|
20282
20349
|
}
|
|
20283
20350
|
`;
|
|
20284
20351
|
|
|
@@ -20304,7 +20371,7 @@ function StopGenerateButton() {
|
|
|
20304
20371
|
}
|
|
20305
20372
|
|
|
20306
20373
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20307
|
-
import { useEffect as
|
|
20374
|
+
import { useEffect as useEffect12, useState as useState22 } from "react";
|
|
20308
20375
|
import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
|
|
20309
20376
|
import {
|
|
20310
20377
|
Button as Button17,
|
|
@@ -20313,7 +20380,7 @@ import {
|
|
|
20313
20380
|
} from "@livechat/design-system-react-components";
|
|
20314
20381
|
|
|
20315
20382
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20316
|
-
import { useEffect as
|
|
20383
|
+
import { useEffect as useEffect11, useState as useState21 } from "react";
|
|
20317
20384
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
20318
20385
|
|
|
20319
20386
|
// src/views/Workflows/Common/One/widget/message-box/constants.ts
|
|
@@ -20323,7 +20390,7 @@ var ONE_CHARACTER_LIMIT = 1e4;
|
|
|
20323
20390
|
var useAboveCharacterLimit = () => {
|
|
20324
20391
|
const [editor] = useLexicalComposerContext();
|
|
20325
20392
|
const [aboveLimit, setAboveLimit] = useState21(0);
|
|
20326
|
-
|
|
20393
|
+
useEffect11(() => {
|
|
20327
20394
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20328
20395
|
(textContent) => {
|
|
20329
20396
|
setAboveLimit(textContent.length - ONE_CHARACTER_LIMIT);
|
|
@@ -20340,13 +20407,13 @@ var useAboveCharacterLimit = () => {
|
|
|
20340
20407
|
};
|
|
20341
20408
|
|
|
20342
20409
|
// src/views/Workflows/Common/One/hooks/useSendOneMessage.ts
|
|
20343
|
-
import { useCallback as
|
|
20410
|
+
import { useCallback as useCallback11, useContext as useContext8 } from "react";
|
|
20344
20411
|
import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
|
|
20345
20412
|
import { CLEAR_EDITOR_COMMAND } from "lexical";
|
|
20346
20413
|
var useSendOneMessage = () => {
|
|
20347
20414
|
const [editor] = useLexicalComposerContext2();
|
|
20348
20415
|
const { sendMessage: sendMessage2 } = useContext8(OneMessagesContext);
|
|
20349
|
-
const onSend =
|
|
20416
|
+
const onSend = useCallback11(() => {
|
|
20350
20417
|
var _a;
|
|
20351
20418
|
const messageToSend = (_a = editor.getRootElement()) == null ? void 0 : _a.innerText.trim();
|
|
20352
20419
|
if (!messageToSend) {
|
|
@@ -20365,7 +20432,7 @@ function AskButton() {
|
|
|
20365
20432
|
const isLoading = false;
|
|
20366
20433
|
const { isAboveLimit } = useAboveCharacterLimit();
|
|
20367
20434
|
const handleSend = useSendOneMessage();
|
|
20368
|
-
|
|
20435
|
+
useEffect12(() => {
|
|
20369
20436
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20370
20437
|
(textContent) => {
|
|
20371
20438
|
setIsDisabled(!textContent);
|
|
@@ -20439,34 +20506,34 @@ import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
|
20439
20506
|
import { PlainTextPlugin } from "@lexical/react/LexicalPlainTextPlugin";
|
|
20440
20507
|
|
|
20441
20508
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/AutoFocusPlugin.tsx
|
|
20442
|
-
import { useCallback as
|
|
20509
|
+
import { useCallback as useCallback12, useEffect as useEffect13 } from "react";
|
|
20443
20510
|
import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
|
|
20444
20511
|
function AutoFocusPlugin() {
|
|
20445
20512
|
const [editor] = useLexicalComposerContext4();
|
|
20446
|
-
const handleFocus =
|
|
20513
|
+
const handleFocus = useCallback12(() => {
|
|
20447
20514
|
editor.focus();
|
|
20448
20515
|
}, [editor]);
|
|
20449
|
-
|
|
20516
|
+
useEffect13(() => {
|
|
20450
20517
|
handleFocus();
|
|
20451
20518
|
}, []);
|
|
20452
20519
|
return null;
|
|
20453
20520
|
}
|
|
20454
20521
|
|
|
20455
20522
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/EnterDownPlugin.tsx
|
|
20456
|
-
import { useCallback as
|
|
20523
|
+
import { useCallback as useCallback13, useEffect as useEffect14 } from "react";
|
|
20457
20524
|
import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
|
|
20458
20525
|
import { COMMAND_PRIORITY_LOW, KEY_ENTER_COMMAND } from "lexical";
|
|
20459
20526
|
function EnterDownPlugin({ isCommandMenuVisibleRef }) {
|
|
20460
20527
|
const [editor] = useLexicalComposerContext5();
|
|
20461
20528
|
const isLoading = false;
|
|
20462
20529
|
const handleSendMessage = useSendOneMessage();
|
|
20463
|
-
const onEnterDown =
|
|
20530
|
+
const onEnterDown = useCallback13(() => {
|
|
20464
20531
|
if (isLoading || (isCommandMenuVisibleRef == null ? void 0 : isCommandMenuVisibleRef.current)) {
|
|
20465
20532
|
return;
|
|
20466
20533
|
}
|
|
20467
20534
|
handleSendMessage({ enter: true, messageBox: true });
|
|
20468
20535
|
}, [handleSendMessage, isLoading, isCommandMenuVisibleRef]);
|
|
20469
|
-
|
|
20536
|
+
useEffect14(
|
|
20470
20537
|
() => editor.registerCommand(
|
|
20471
20538
|
KEY_ENTER_COMMAND,
|
|
20472
20539
|
(event) => {
|
|
@@ -20529,10 +20596,10 @@ function OneMessageBox() {
|
|
|
20529
20596
|
}
|
|
20530
20597
|
|
|
20531
20598
|
// src/views/Workflows/Common/One/widget/OneChatFeedContent.tsx
|
|
20532
|
-
import { useRef as
|
|
20599
|
+
import { useRef as useRef8 } from "react";
|
|
20533
20600
|
|
|
20534
20601
|
// src/views/Workflows/Common/One/hooks/useScroll.ts
|
|
20535
|
-
import { useCallback as
|
|
20602
|
+
import { useCallback as useCallback14, useEffect as useEffect15, useRef as useRef7 } from "react";
|
|
20536
20603
|
import debounce4 from "lodash.debounce";
|
|
20537
20604
|
var useScroll = ({
|
|
20538
20605
|
oneChatFeedRef,
|
|
@@ -20540,10 +20607,10 @@ var useScroll = ({
|
|
|
20540
20607
|
additionalEvents
|
|
20541
20608
|
}) => {
|
|
20542
20609
|
const oneScrollPosition = 0;
|
|
20543
|
-
const currentScrollPosition =
|
|
20544
|
-
const isScrolledToBottom =
|
|
20545
|
-
const timeoutRef =
|
|
20546
|
-
const scrollToBottom =
|
|
20610
|
+
const currentScrollPosition = useRef7(null);
|
|
20611
|
+
const isScrolledToBottom = useRef7(true);
|
|
20612
|
+
const timeoutRef = useRef7(null);
|
|
20613
|
+
const scrollToBottom = useCallback14(() => {
|
|
20547
20614
|
if (timeoutRef.current) {
|
|
20548
20615
|
clearTimeout(timeoutRef.current);
|
|
20549
20616
|
}
|
|
@@ -20559,7 +20626,7 @@ var useScroll = ({
|
|
|
20559
20626
|
}
|
|
20560
20627
|
};
|
|
20561
20628
|
}, []);
|
|
20562
|
-
|
|
20629
|
+
useEffect15(() => {
|
|
20563
20630
|
var _a;
|
|
20564
20631
|
if (!oneScrollPosition) {
|
|
20565
20632
|
scrollToBottom();
|
|
@@ -20568,12 +20635,12 @@ var useScroll = ({
|
|
|
20568
20635
|
(_a = oneChatFeedRef.current) == null ? void 0 : _a.scrollTo({ top: oneScrollPosition });
|
|
20569
20636
|
currentScrollPosition.current = oneScrollPosition;
|
|
20570
20637
|
}, []);
|
|
20571
|
-
|
|
20638
|
+
useEffect15(() => {
|
|
20572
20639
|
if (additionalEvents && isScrolledToBottom.current) {
|
|
20573
20640
|
scrollToBottom();
|
|
20574
20641
|
}
|
|
20575
20642
|
}, [scrollToBottom, additionalEvents]);
|
|
20576
|
-
|
|
20643
|
+
useEffect15(() => {
|
|
20577
20644
|
const [lastGroupEvent] = groupedEvents.slice(-1)[0];
|
|
20578
20645
|
const isLastMessageFromAgent = lastGroupEvent.authorType === "agent" /* Agent */;
|
|
20579
20646
|
if (isLastMessageFromAgent || isScrolledToBottom.current) {
|
|
@@ -20602,14 +20669,14 @@ import { Button as Button18, Icon as Icon20, Text as Text10 } from "@livechat/de
|
|
|
20602
20669
|
|
|
20603
20670
|
// src/views/Workflows/Common/One/widget/events/styles.ts
|
|
20604
20671
|
import {
|
|
20605
|
-
DesignToken as
|
|
20672
|
+
DesignToken as DesignToken25,
|
|
20606
20673
|
RadiusToken as RadiusToken12,
|
|
20607
20674
|
SpacingToken as SpacingToken25
|
|
20608
20675
|
} from "@livechat/design-system-react-components";
|
|
20609
20676
|
|
|
20610
20677
|
// src/views/Workflows/Common/One/widget/styles.ts
|
|
20611
20678
|
import {
|
|
20612
|
-
DesignToken as
|
|
20679
|
+
DesignToken as DesignToken24,
|
|
20613
20680
|
RadiusToken as RadiusToken11,
|
|
20614
20681
|
ShadowToken as ShadowToken8,
|
|
20615
20682
|
SpacingToken as SpacingToken24
|
|
@@ -20633,7 +20700,7 @@ var loaderText = css`
|
|
|
20633
20700
|
font-size: 14px;
|
|
20634
20701
|
font-weight: 400;
|
|
20635
20702
|
line-height: 20px;
|
|
20636
|
-
color: var(${
|
|
20703
|
+
color: var(${DesignToken24.ContentBasicDisabled});
|
|
20637
20704
|
`;
|
|
20638
20705
|
var relativeContainer = css`
|
|
20639
20706
|
position: relative;
|
|
@@ -20650,11 +20717,11 @@ var typingIndicator = css`
|
|
|
20650
20717
|
span {
|
|
20651
20718
|
width: 4px;
|
|
20652
20719
|
height: 4px;
|
|
20653
|
-
background-color: var(${
|
|
20720
|
+
background-color: var(${DesignToken24.ContentBasicDisabled});
|
|
20654
20721
|
}
|
|
20655
20722
|
`;
|
|
20656
20723
|
var selected = css`
|
|
20657
|
-
background-color: var(${
|
|
20724
|
+
background-color: var(${DesignToken24.SurfacePrimaryActive});
|
|
20658
20725
|
`;
|
|
20659
20726
|
var wrapper = css`
|
|
20660
20727
|
${resetLegacyLcBorderBox};
|
|
@@ -20675,13 +20742,13 @@ var wrapper = css`
|
|
|
20675
20742
|
}
|
|
20676
20743
|
|
|
20677
20744
|
&:hover {
|
|
20678
|
-
background-color: var(${
|
|
20745
|
+
background-color: var(${DesignToken24.SurfacePrimaryHover});
|
|
20679
20746
|
cursor: pointer;
|
|
20680
20747
|
}
|
|
20681
20748
|
`;
|
|
20682
20749
|
var textWrapper = css`
|
|
20683
20750
|
width: calc(100% - 2 * ${SIDE_PADDING}px - 2 * ${SIDE_MARGIN}px);
|
|
20684
|
-
color: var(${
|
|
20751
|
+
color: var(${DesignToken24.ContentBasicPrimary});
|
|
20685
20752
|
`;
|
|
20686
20753
|
var lastEventWrapper = css`
|
|
20687
20754
|
display: flex;
|
|
@@ -20695,7 +20762,7 @@ var text = css`
|
|
|
20695
20762
|
text-overflow: ellipsis;
|
|
20696
20763
|
white-space: nowrap;
|
|
20697
20764
|
word-wrap: normal;
|
|
20698
|
-
color: var(${
|
|
20765
|
+
color: var(${DesignToken24.ContentBasicSecondary});
|
|
20699
20766
|
`;
|
|
20700
20767
|
var chatFeed = css`
|
|
20701
20768
|
display: flex;
|
|
@@ -20710,14 +20777,14 @@ var undreadMessageCount = css`
|
|
|
20710
20777
|
min-width: 18px;
|
|
20711
20778
|
font-size: 12px;
|
|
20712
20779
|
border-radius: 50%;
|
|
20713
|
-
color: var(${
|
|
20714
|
-
background-color: var(${
|
|
20780
|
+
color: var(${DesignToken24.ContentLockedWhite});
|
|
20781
|
+
background-color: var(${DesignToken24.SurfaceAccentEmphasisHighNegative});
|
|
20715
20782
|
margin: 0 6px;
|
|
20716
20783
|
text-align: center;
|
|
20717
20784
|
font-weight: bold;
|
|
20718
20785
|
`;
|
|
20719
20786
|
var unreadMessageText = css`
|
|
20720
|
-
color: var(${
|
|
20787
|
+
color: var(${DesignToken24.ContentBasicSecondary});
|
|
20721
20788
|
flex-grow: 1;
|
|
20722
20789
|
font-size: 13px;
|
|
20723
20790
|
`;
|
|
@@ -20725,7 +20792,7 @@ var loaderContainer = css`
|
|
|
20725
20792
|
height: 100%;
|
|
20726
20793
|
`;
|
|
20727
20794
|
var loaderChatItem = css`
|
|
20728
|
-
background-color: var(${
|
|
20795
|
+
background-color: var(${DesignToken24.SurfaceSecondaryDisabled});
|
|
20729
20796
|
width: 325px;
|
|
20730
20797
|
padding: 15px;
|
|
20731
20798
|
display: flex;
|
|
@@ -20744,7 +20811,7 @@ var container = () => css`
|
|
|
20744
20811
|
width: 360px;
|
|
20745
20812
|
height: auto;
|
|
20746
20813
|
max-height: 75%;
|
|
20747
|
-
color: var(${
|
|
20814
|
+
color: var(${DesignToken24.ContentBasicPrimary});
|
|
20748
20815
|
`;
|
|
20749
20816
|
var headerWrapper = css`
|
|
20750
20817
|
display: flex;
|
|
@@ -20774,7 +20841,7 @@ var headerWrapperExpanded = css`
|
|
|
20774
20841
|
${headerWrapper};
|
|
20775
20842
|
box-sizing: border-box;
|
|
20776
20843
|
height: 64px;
|
|
20777
|
-
border-bottom: 1px solid var(${
|
|
20844
|
+
border-bottom: 1px solid var(${DesignToken24.BorderBasicTertiary});
|
|
20778
20845
|
|
|
20779
20846
|
> div:first-of-type {
|
|
20780
20847
|
padding: 0 4px;
|
|
@@ -20785,7 +20852,7 @@ var oneLogo = css`
|
|
|
20785
20852
|
display: inline-flex;
|
|
20786
20853
|
`;
|
|
20787
20854
|
var activeDetailsButton = css`
|
|
20788
|
-
background-color: var(${
|
|
20855
|
+
background-color: var(${DesignToken24.SurfaceOpacityBasicActive});
|
|
20789
20856
|
`;
|
|
20790
20857
|
var icon = css`
|
|
20791
20858
|
color: white;
|
|
@@ -20801,13 +20868,13 @@ var scrollbar = `
|
|
|
20801
20868
|
}
|
|
20802
20869
|
|
|
20803
20870
|
::-webkit-scrollbar-track {
|
|
20804
|
-
background: var(${
|
|
20871
|
+
background: var(${DesignToken24.SurfacePrimaryDefault});
|
|
20805
20872
|
}
|
|
20806
20873
|
|
|
20807
20874
|
::-webkit-scrollbar-thumb {
|
|
20808
|
-
background: var(${
|
|
20875
|
+
background: var(${DesignToken24.SurfaceModerateDefault});
|
|
20809
20876
|
border-radius: 8px;
|
|
20810
|
-
box-shadow: inset 0 0 0 3px var(${
|
|
20877
|
+
box-shadow: inset 0 0 0 3px var(${DesignToken24.SurfacePrimaryDefault});
|
|
20811
20878
|
}
|
|
20812
20879
|
`;
|
|
20813
20880
|
var scroller = css`
|
|
@@ -20903,7 +20970,7 @@ var loaderBubble = css`
|
|
|
20903
20970
|
width: 41px;
|
|
20904
20971
|
height: 46px;
|
|
20905
20972
|
padding: var(${SpacingToken25.Spacing3});
|
|
20906
|
-
color: var(${
|
|
20973
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
20907
20974
|
border-radius: var(${RadiusToken12[4]});
|
|
20908
20975
|
background: linear-gradient(
|
|
20909
20976
|
254.49deg,
|
|
@@ -20918,7 +20985,7 @@ var bubble = css`
|
|
|
20918
20985
|
font-size: 14px;
|
|
20919
20986
|
line-height: 1.5em;
|
|
20920
20987
|
word-break: break-word;
|
|
20921
|
-
color: var(${
|
|
20988
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
20922
20989
|
background: linear-gradient(
|
|
20923
20990
|
254.49deg,
|
|
20924
20991
|
rgb(187 154 255 / 18%) -0.38%,
|
|
@@ -20932,7 +20999,7 @@ var eventWrapper = (isAgentMessage) => css`
|
|
|
20932
20999
|
align-items: ${isAgentMessage ? "center" : "flex-start"};
|
|
20933
21000
|
justify-content: ${isAgentMessage ? "flex-end" : "flex-start"};
|
|
20934
21001
|
margin: 2px;
|
|
20935
|
-
color: ${isAgentMessage ? `var(${
|
|
21002
|
+
color: ${isAgentMessage ? `var(${DesignToken25.ContentLockedWhite})` : `var(${DesignToken25.ContentBasicPrimary})`};
|
|
20936
21003
|
`;
|
|
20937
21004
|
var eventText = css`
|
|
20938
21005
|
padding: var(${SpacingToken25.Spacing3}) var(${SpacingToken25.Spacing5});
|
|
@@ -21016,7 +21083,7 @@ var agentMessage = css`
|
|
|
21016
21083
|
font-style: normal;
|
|
21017
21084
|
font-weight: 600;
|
|
21018
21085
|
line-height: 24px;
|
|
21019
|
-
color: var(${
|
|
21086
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
21020
21087
|
width: 100%;
|
|
21021
21088
|
`;
|
|
21022
21089
|
var taskList = css`
|
|
@@ -21041,8 +21108,8 @@ var linkContainer = (type = "api_call") => css`
|
|
|
21041
21108
|
margin-bottom: var(${SpacingToken25.Spacing2});
|
|
21042
21109
|
|
|
21043
21110
|
span {
|
|
21044
|
-
color: var(${
|
|
21045
|
-
background-color: ${type === "url" ? `var(${
|
|
21111
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
21112
|
+
background-color: ${type === "url" ? `var(${DesignToken25.SurfacePrimaryActiveColored})` : `var(${DesignToken25.SurfaceTertiaryDefault})`};
|
|
21046
21113
|
width: 24px;
|
|
21047
21114
|
height: 24px;
|
|
21048
21115
|
padding: var(${SpacingToken25.Spacing1});
|
|
@@ -21058,10 +21125,10 @@ var sourcesContainer = css`
|
|
|
21058
21125
|
align-items: center;
|
|
21059
21126
|
`;
|
|
21060
21127
|
var sourcesBadgeActive = css`
|
|
21061
|
-
color: var(${
|
|
21128
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
21062
21129
|
`;
|
|
21063
21130
|
var sourcesButtonActive = css`
|
|
21064
|
-
color: var(${
|
|
21131
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
21065
21132
|
`;
|
|
21066
21133
|
var sourcesList = css`
|
|
21067
21134
|
margin: var(${SpacingToken25.Spacing3}) 0 0 var(${SpacingToken25.Spacing7});
|
|
@@ -21076,7 +21143,7 @@ var sourcesButton = css`
|
|
|
21076
21143
|
border-radius: var(${RadiusToken12[3]});
|
|
21077
21144
|
padding: var(${SpacingToken25.Spacing05}) var(${SpacingToken25.Spacing2})
|
|
21078
21145
|
var(${SpacingToken25.Spacing05}) 6px;
|
|
21079
|
-
color: var(${
|
|
21146
|
+
color: var(${DesignToken25.ContentBasicSecondary});
|
|
21080
21147
|
margin-top: var(${SpacingToken25.Spacing05});
|
|
21081
21148
|
|
|
21082
21149
|
&:hover {
|
|
@@ -21090,13 +21157,13 @@ var button = css`
|
|
|
21090
21157
|
margin: 0;
|
|
21091
21158
|
|
|
21092
21159
|
svg {
|
|
21093
|
-
color: var(${
|
|
21160
|
+
color: var(${DesignToken25.ContentBasicSecondary});
|
|
21094
21161
|
}
|
|
21095
21162
|
|
|
21096
21163
|
&:hover {
|
|
21097
21164
|
cursor: pointer;
|
|
21098
21165
|
svg {
|
|
21099
|
-
color: var(${
|
|
21166
|
+
color: var(${DesignToken25.ContentBasicPrimary});
|
|
21100
21167
|
}
|
|
21101
21168
|
}
|
|
21102
21169
|
`;
|
|
@@ -21142,10 +21209,10 @@ function OneErrorEvent({ eventId }) {
|
|
|
21142
21209
|
}
|
|
21143
21210
|
|
|
21144
21211
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
21145
|
-
import { useEffect as
|
|
21212
|
+
import { useEffect as useEffect16, useState as useState23 } from "react";
|
|
21146
21213
|
|
|
21147
21214
|
// src/views/Workflows/Common/One/components/SkeletonLine.tsx
|
|
21148
|
-
import { DesignToken as
|
|
21215
|
+
import { DesignToken as DesignToken26 } from "@livechat/design-system-react-components";
|
|
21149
21216
|
var shine = keyframes`
|
|
21150
21217
|
0% {
|
|
21151
21218
|
background-position: 100% 50%;
|
|
@@ -21156,7 +21223,7 @@ var shine = keyframes`
|
|
|
21156
21223
|
}
|
|
21157
21224
|
`;
|
|
21158
21225
|
var skeletonLine = css`
|
|
21159
|
-
background: var(${
|
|
21226
|
+
background: var(${DesignToken26.SurfaceSecondaryDisabled});
|
|
21160
21227
|
width: 35%;
|
|
21161
21228
|
height: 12px;
|
|
21162
21229
|
border-radius: 6px;
|
|
@@ -21206,7 +21273,7 @@ function SkeletonLine({
|
|
|
21206
21273
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
21207
21274
|
function OneImageEvent({ imageUrl }) {
|
|
21208
21275
|
const [isLoaded, setIsLoaded] = useState23(false);
|
|
21209
|
-
|
|
21276
|
+
useEffect16(() => {
|
|
21210
21277
|
const image = new Image();
|
|
21211
21278
|
image.src = imageUrl;
|
|
21212
21279
|
image.onload = () => {
|
|
@@ -21229,7 +21296,7 @@ function OneImageEvent({ imageUrl }) {
|
|
|
21229
21296
|
|
|
21230
21297
|
// src/views/Workflows/Common/One/components/TypingIndicator.tsx
|
|
21231
21298
|
import { memo as memo10 } from "react";
|
|
21232
|
-
import { DesignToken as
|
|
21299
|
+
import { DesignToken as DesignToken27 } from "@livechat/design-system-react-components";
|
|
21233
21300
|
var typingAnimation = keyframes`
|
|
21234
21301
|
0% {
|
|
21235
21302
|
opacity: 0.2;
|
|
@@ -21253,7 +21320,7 @@ var typingIndicator2 = css`
|
|
|
21253
21320
|
animation-duration: 1.4s;
|
|
21254
21321
|
animation-iteration-count: infinite;
|
|
21255
21322
|
animation-fill-mode: both;
|
|
21256
|
-
background-color: var(${
|
|
21323
|
+
background-color: var(${DesignToken27.ContentBasicPrimary});
|
|
21257
21324
|
border-radius: 50%;
|
|
21258
21325
|
display: block;
|
|
21259
21326
|
height: 3px;
|
|
@@ -21357,7 +21424,7 @@ var MarkdownEventRenderer = ({ children }) => /* @__PURE__ */ jsx4(
|
|
|
21357
21424
|
);
|
|
21358
21425
|
|
|
21359
21426
|
// src/views/Workflows/Common/One/components/NavigateButton.tsx
|
|
21360
|
-
import { useNavigate as
|
|
21427
|
+
import { useNavigate as useNavigate7 } from "react-router-dom";
|
|
21361
21428
|
import { Add as Add7, ArrowForward, OpenInNew } from "@livechat/design-system-icons";
|
|
21362
21429
|
import {
|
|
21363
21430
|
Button as Button19,
|
|
@@ -21379,7 +21446,7 @@ function NavigateButton({
|
|
|
21379
21446
|
kind,
|
|
21380
21447
|
iconPosition
|
|
21381
21448
|
}) {
|
|
21382
|
-
const navigate =
|
|
21449
|
+
const navigate = useNavigate7();
|
|
21383
21450
|
const handleButtonClick = () => {
|
|
21384
21451
|
if (isExternal) {
|
|
21385
21452
|
window.open(url, "_blank");
|
|
@@ -21811,7 +21878,7 @@ function OneChatFeedContent({
|
|
|
21811
21878
|
updateWorkflow,
|
|
21812
21879
|
previewWorkflow
|
|
21813
21880
|
}) {
|
|
21814
|
-
const oneChatFeedRef =
|
|
21881
|
+
const oneChatFeedRef = useRef8(null);
|
|
21815
21882
|
const { groupedEvents, hasAdditionalEvents } = useOneMessagesContext();
|
|
21816
21883
|
const { handleScroll } = useScroll({
|
|
21817
21884
|
oneChatFeedRef,
|
|
@@ -21906,15 +21973,15 @@ function CustomControls({
|
|
|
21906
21973
|
previewWorkflow
|
|
21907
21974
|
}) {
|
|
21908
21975
|
var _a;
|
|
21909
|
-
const navigate =
|
|
21976
|
+
const navigate = useNavigate8();
|
|
21910
21977
|
const { fitView, zoomIn, zoomOut } = useReactFlow2();
|
|
21911
21978
|
const { toggleOneWidget, isOpen } = useOneWidgetContext();
|
|
21912
21979
|
const {
|
|
21913
21980
|
state: { visibility },
|
|
21914
21981
|
focus
|
|
21915
21982
|
} = useWorkflowCreator();
|
|
21916
|
-
const location =
|
|
21917
|
-
|
|
21983
|
+
const location = useLocation5();
|
|
21984
|
+
useEffect17(() => {
|
|
21918
21985
|
var _a2;
|
|
21919
21986
|
if ((_a2 = location.state) == null ? void 0 : _a2.openOne) {
|
|
21920
21987
|
if (!isOpen) {
|
|
@@ -21930,7 +21997,7 @@ function CustomControls({
|
|
|
21930
21997
|
css: css`
|
|
21931
21998
|
max-width: 360px;
|
|
21932
21999
|
border-radius: var(${RadiusToken13[4]});
|
|
21933
|
-
background-color: var(${
|
|
22000
|
+
background-color: var(${DesignToken28.SurfacePrimaryDefault});
|
|
21934
22001
|
`,
|
|
21935
22002
|
floatingStrategy: "fixed",
|
|
21936
22003
|
isVisible: isOpen,
|
|
@@ -22020,7 +22087,7 @@ var CustomControls_default = CustomControls;
|
|
|
22020
22087
|
|
|
22021
22088
|
// src/views/Workflows/Creator/Builder/Controls/SwitcherControls.tsx
|
|
22022
22089
|
import { useState as useState26 } from "react";
|
|
22023
|
-
import { useNavigate as
|
|
22090
|
+
import { useNavigate as useNavigate9 } from "react-router-dom";
|
|
22024
22091
|
import { Controls as Controls2 } from "reactflow";
|
|
22025
22092
|
import { SegmentedControl } from "@livechat/design-system-react-components";
|
|
22026
22093
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
@@ -22032,7 +22099,7 @@ function SwitcherControls({
|
|
|
22032
22099
|
const [currentView, setCurrentView] = useState26(
|
|
22033
22100
|
isDraft ? "draft" : "published"
|
|
22034
22101
|
);
|
|
22035
|
-
const navigate =
|
|
22102
|
+
const navigate = useNavigate9();
|
|
22036
22103
|
const {
|
|
22037
22104
|
focus,
|
|
22038
22105
|
state: { visibility }
|
|
@@ -22116,7 +22183,7 @@ import {
|
|
|
22116
22183
|
getSmoothStepPath
|
|
22117
22184
|
} from "reactflow";
|
|
22118
22185
|
import {
|
|
22119
|
-
DesignToken as
|
|
22186
|
+
DesignToken as DesignToken29,
|
|
22120
22187
|
RadiusToken as RadiusToken14
|
|
22121
22188
|
} from "@livechat/design-system-react-components";
|
|
22122
22189
|
var CustomEdge = ({
|
|
@@ -22151,7 +22218,7 @@ var CustomEdge = ({
|
|
|
22151
22218
|
position: absolute;
|
|
22152
22219
|
transform: translate(-50%, -100%)
|
|
22153
22220
|
translate(${targetX}px, ${targetY - 10}px);
|
|
22154
|
-
background: ${typeof data.label === "object" ? "transparent" : `var(${
|
|
22221
|
+
background: ${typeof data.label === "object" ? "transparent" : `var(${DesignToken29.SurfaceTertiaryDefault})`};
|
|
22155
22222
|
padding: 0 8px;
|
|
22156
22223
|
border-radius: var(${RadiusToken14[3]});
|
|
22157
22224
|
font-size: 13px;
|
|
@@ -22170,7 +22237,7 @@ var Edges_default = CustomEdge_default;
|
|
|
22170
22237
|
// src/views/Workflows/Creator/Builder/utils.ts
|
|
22171
22238
|
import { MarkerType } from "reactflow";
|
|
22172
22239
|
import ElkConstructor from "elkjs";
|
|
22173
|
-
import { DesignToken as
|
|
22240
|
+
import { DesignToken as DesignToken30 } from "@livechat/design-system-react-components";
|
|
22174
22241
|
import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType13 } from "@livechat/developer-studio-api";
|
|
22175
22242
|
var elk = new ElkConstructor({
|
|
22176
22243
|
defaultLayoutOptions: {
|
|
@@ -22203,11 +22270,11 @@ var buildEdge = ({
|
|
|
22203
22270
|
type: MarkerType.ArrowClosed,
|
|
22204
22271
|
width: 10,
|
|
22205
22272
|
height: 10,
|
|
22206
|
-
color: `var(${
|
|
22273
|
+
color: `var(${DesignToken30.ContentBasicDisabled})`
|
|
22207
22274
|
},
|
|
22208
22275
|
style: {
|
|
22209
22276
|
strokeWidth: 2,
|
|
22210
|
-
stroke: `var(${
|
|
22277
|
+
stroke: `var(${DesignToken30.ContentBasicDisabled})`,
|
|
22211
22278
|
zIndex: 9999
|
|
22212
22279
|
}
|
|
22213
22280
|
};
|
|
@@ -22561,13 +22628,13 @@ function WorkflowBuilder() {
|
|
|
22561
22628
|
[]
|
|
22562
22629
|
);
|
|
22563
22630
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
22564
|
-
const onConnect =
|
|
22631
|
+
const onConnect = useCallback15(
|
|
22565
22632
|
(params) => {
|
|
22566
22633
|
setEdges((eds) => addEdge(params, eds));
|
|
22567
22634
|
},
|
|
22568
22635
|
[setEdges]
|
|
22569
22636
|
);
|
|
22570
|
-
|
|
22637
|
+
useEffect18(() => {
|
|
22571
22638
|
void (() => __async(this, null, function* () {
|
|
22572
22639
|
const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(
|
|
22573
22640
|
workflow
|
|
@@ -22636,7 +22703,7 @@ function WorkflowBuilder() {
|
|
|
22636
22703
|
/* @__PURE__ */ jsx14(
|
|
22637
22704
|
Background,
|
|
22638
22705
|
{
|
|
22639
|
-
color: `var(${
|
|
22706
|
+
color: `var(${DesignToken31.SurfaceSecondaryActive})`,
|
|
22640
22707
|
size: 2,
|
|
22641
22708
|
variant: BackgroundVariant.Dots
|
|
22642
22709
|
}
|
|
@@ -22671,7 +22738,7 @@ var WorkflowBuilderWrapper = newStyled.div`
|
|
|
22671
22738
|
min-height: 400px;
|
|
22672
22739
|
max-height: 100%;
|
|
22673
22740
|
border-radius: var(${RadiusToken15.Radius3});
|
|
22674
|
-
background-color: var(${
|
|
22741
|
+
background-color: var(${DesignToken32.SurfaceSecondaryDefault});
|
|
22675
22742
|
|
|
22676
22743
|
> div {
|
|
22677
22744
|
height: 400px !important;
|
|
@@ -22699,8 +22766,8 @@ function PreviewWorkflowModal({
|
|
|
22699
22766
|
onApply,
|
|
22700
22767
|
onClose
|
|
22701
22768
|
}) {
|
|
22702
|
-
const navigate =
|
|
22703
|
-
const handleClose =
|
|
22769
|
+
const navigate = useNavigate10();
|
|
22770
|
+
const handleClose = useCallback16(
|
|
22704
22771
|
(target) => {
|
|
22705
22772
|
if (onClose) {
|
|
22706
22773
|
onClose();
|
|
@@ -22714,7 +22781,7 @@ function PreviewWorkflowModal({
|
|
|
22714
22781
|
},
|
|
22715
22782
|
[onClose, navigate]
|
|
22716
22783
|
);
|
|
22717
|
-
const handleApply =
|
|
22784
|
+
const handleApply = useCallback16(() => {
|
|
22718
22785
|
if (onApply) {
|
|
22719
22786
|
onApply();
|
|
22720
22787
|
}
|
|
@@ -22790,7 +22857,7 @@ var Modal_default4 = PreviewWorkflowModalWrapper;
|
|
|
22790
22857
|
import { Error as Error5 } from "@livechat/design-system-icons";
|
|
22791
22858
|
import {
|
|
22792
22859
|
Button as Button24,
|
|
22793
|
-
DesignToken as
|
|
22860
|
+
DesignToken as DesignToken33,
|
|
22794
22861
|
Icon as Icon26,
|
|
22795
22862
|
Modal as Modal7
|
|
22796
22863
|
} from "@livechat/design-system-react-components";
|
|
@@ -22805,43 +22872,60 @@ function PublishWorkflowModal({
|
|
|
22805
22872
|
},
|
|
22806
22873
|
publishDraft
|
|
22807
22874
|
} = useWorkflowCreator();
|
|
22808
|
-
return /* @__PURE__ */ jsx15(
|
|
22809
|
-
|
|
22875
|
+
return /* @__PURE__ */ jsx15(
|
|
22876
|
+
Modal7,
|
|
22810
22877
|
{
|
|
22811
|
-
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
kind: "primary",
|
|
22817
|
-
loading: isPublishing,
|
|
22818
|
-
onClick: () => void publishDraft({
|
|
22819
|
-
confirmed: true
|
|
22820
|
-
}),
|
|
22821
|
-
children: "Publish workflow"
|
|
22822
|
-
}
|
|
22823
|
-
)
|
|
22824
|
-
] }),
|
|
22825
|
-
heading: "You are publishing a workflow",
|
|
22826
|
-
icon: /* @__PURE__ */ jsx15(
|
|
22827
|
-
Icon26,
|
|
22878
|
+
heading: true,
|
|
22879
|
+
onClose,
|
|
22880
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.wrapper,
|
|
22881
|
+
children: /* @__PURE__ */ jsx15(
|
|
22882
|
+
ActionModalContent3,
|
|
22828
22883
|
{
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22884
|
+
actions: /* @__PURE__ */ jsxs8(Fragment9, { children: [
|
|
22885
|
+
/* @__PURE__ */ jsx15(
|
|
22886
|
+
Button24,
|
|
22887
|
+
{
|
|
22888
|
+
kind: "secondary",
|
|
22889
|
+
onClick: onClose,
|
|
22890
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.cancelButton,
|
|
22891
|
+
children: "Cancel"
|
|
22892
|
+
}
|
|
22893
|
+
),
|
|
22894
|
+
/* @__PURE__ */ jsx15(
|
|
22895
|
+
Button24,
|
|
22896
|
+
{
|
|
22897
|
+
kind: "primary",
|
|
22898
|
+
loading: isPublishing,
|
|
22899
|
+
onClick: () => void publishDraft({
|
|
22900
|
+
confirmed: true
|
|
22901
|
+
}),
|
|
22902
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.saveButton,
|
|
22903
|
+
children: "Publish workflow"
|
|
22904
|
+
}
|
|
22905
|
+
)
|
|
22906
|
+
] }),
|
|
22907
|
+
heading: "You are publishing a workflow",
|
|
22908
|
+
icon: /* @__PURE__ */ jsx15(
|
|
22909
|
+
Icon26,
|
|
22910
|
+
{
|
|
22911
|
+
customColor: `var(${DesignToken33.ContentBasicDisabled})`,
|
|
22912
|
+
size: "xxlarge",
|
|
22913
|
+
source: Error5
|
|
22914
|
+
}
|
|
22915
|
+
),
|
|
22916
|
+
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22832
22917
|
}
|
|
22833
|
-
)
|
|
22834
|
-
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22918
|
+
)
|
|
22835
22919
|
}
|
|
22836
|
-
)
|
|
22920
|
+
);
|
|
22837
22921
|
}
|
|
22838
22922
|
|
|
22839
22923
|
// src/views/Workflows/Creator/View.tsx
|
|
22840
|
-
import { useEffect as
|
|
22924
|
+
import { useEffect as useEffect20 } from "react";
|
|
22841
22925
|
import { Route as Route2, Routes as Routes2 } from "react-router-dom";
|
|
22842
22926
|
import { useReactFlow as useReactFlow3 } from "reactflow";
|
|
22843
22927
|
import {
|
|
22844
|
-
DesignToken as
|
|
22928
|
+
DesignToken as DesignToken39,
|
|
22845
22929
|
RadiusToken as RadiusToken18,
|
|
22846
22930
|
SpacingToken as SpacingToken35
|
|
22847
22931
|
} from "@livechat/design-system-react-components";
|
|
@@ -22855,11 +22939,11 @@ var sendMessage = (type) => {
|
|
|
22855
22939
|
import { Navigate, Route, Routes } from "react-router-dom";
|
|
22856
22940
|
|
|
22857
22941
|
// src/views/Workflows/Creator/Panels/Details/Panel.tsx
|
|
22858
|
-
import { useNavigate as
|
|
22942
|
+
import { useNavigate as useNavigate11, useParams as useParams4 } from "react-router-dom";
|
|
22859
22943
|
import { Close as Close3 } from "@livechat/design-system-icons";
|
|
22860
22944
|
import {
|
|
22861
22945
|
Button as Button25,
|
|
22862
|
-
DesignToken as
|
|
22946
|
+
DesignToken as DesignToken36,
|
|
22863
22947
|
Heading as Heading3,
|
|
22864
22948
|
Icon as Icon28,
|
|
22865
22949
|
Loader as Loader2,
|
|
@@ -22876,11 +22960,14 @@ import { Row as Row14 } from "@livechat/developer-studio-ui-react";
|
|
|
22876
22960
|
// src/views/Workflows/Creator/Panels/Details/Executions/List.tsx
|
|
22877
22961
|
import { CheckCircle as CheckCircle2, CloseCircle as CloseCircle2 } from "@livechat/design-system-icons";
|
|
22878
22962
|
import {
|
|
22879
|
-
|
|
22880
|
-
DesignToken as DesignToken33,
|
|
22963
|
+
DesignToken as DesignToken34,
|
|
22881
22964
|
Icon as Icon27,
|
|
22882
|
-
SpacingToken as SpacingToken29
|
|
22965
|
+
SpacingToken as SpacingToken29,
|
|
22966
|
+
Tag as Tag2
|
|
22883
22967
|
} from "@livechat/design-system-react-components";
|
|
22968
|
+
import {
|
|
22969
|
+
WorkflowExecutionStatus
|
|
22970
|
+
} from "@livechat/developer-studio-api";
|
|
22884
22971
|
import { formatUSADate, Row as Row12 } from "@livechat/developer-studio-ui-react";
|
|
22885
22972
|
var tableCss = css`
|
|
22886
22973
|
font-size: 13px;
|
|
@@ -22889,7 +22976,7 @@ var tableCss = css`
|
|
|
22889
22976
|
|
|
22890
22977
|
width: 100%;
|
|
22891
22978
|
border-spacing: 0;
|
|
22892
|
-
color: var(${
|
|
22979
|
+
color: var(${DesignToken34.ContentBasicSecondary});
|
|
22893
22980
|
|
|
22894
22981
|
th {
|
|
22895
22982
|
text-transform: uppercase;
|
|
@@ -22914,22 +23001,18 @@ function WorkflowExecutionList({
|
|
|
22914
23001
|
/* @__PURE__ */ jsx4("td", { children: formatUSADate(execution.started_at) }),
|
|
22915
23002
|
/* @__PURE__ */ jsx4("td", { children: formatUSADate(execution.ended_at) }),
|
|
22916
23003
|
/* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
|
|
22917
|
-
|
|
23004
|
+
Tag2,
|
|
22918
23005
|
{
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
}
|
|
22930
|
-
),
|
|
22931
|
-
execution.status
|
|
22932
|
-
] })
|
|
23006
|
+
size: "small",
|
|
23007
|
+
kind: execution.status === WorkflowExecutionStatus.Completed ? "success" : "error",
|
|
23008
|
+
leftNode: /* @__PURE__ */ jsx4(
|
|
23009
|
+
Icon27,
|
|
23010
|
+
{
|
|
23011
|
+
size: "small",
|
|
23012
|
+
source: execution.status === WorkflowExecutionStatus.Completed ? CheckCircle2 : CloseCircle2
|
|
23013
|
+
}
|
|
23014
|
+
),
|
|
23015
|
+
children: execution.status
|
|
22933
23016
|
}
|
|
22934
23017
|
) })
|
|
22935
23018
|
] }, execution.id)) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
|
|
@@ -22939,7 +23022,7 @@ var List_default = WorkflowExecutionList;
|
|
|
22939
23022
|
|
|
22940
23023
|
// src/views/Workflows/Creator/Panels/Details/Info/Info.tsx
|
|
22941
23024
|
import {
|
|
22942
|
-
DesignToken as
|
|
23025
|
+
DesignToken as DesignToken35,
|
|
22943
23026
|
SpacingToken as SpacingToken30,
|
|
22944
23027
|
Text as Text15
|
|
22945
23028
|
} from "@livechat/design-system-react-components";
|
|
@@ -22949,13 +23032,13 @@ import {
|
|
|
22949
23032
|
Row as Row13
|
|
22950
23033
|
} from "@livechat/developer-studio-ui-react";
|
|
22951
23034
|
var Label = newStyled.div`
|
|
22952
|
-
color: var(${
|
|
23035
|
+
color: var(${DesignToken35.ContentBasicSecondary});
|
|
22953
23036
|
`;
|
|
22954
23037
|
var IconWrapper = newStyled.div`
|
|
22955
23038
|
display: flex;
|
|
22956
23039
|
align-items: center;
|
|
22957
23040
|
justify-content: center;
|
|
22958
|
-
background-color: var(${
|
|
23041
|
+
background-color: var(${DesignToken35.SurfaceSecondaryDefault});
|
|
22959
23042
|
border-radius: 50%;
|
|
22960
23043
|
width: var(${SpacingToken30.Spacing6});
|
|
22961
23044
|
height: var(${SpacingToken30.Spacing6});
|
|
@@ -23017,7 +23100,7 @@ var WorkflowSidebar = newStyled.div`
|
|
|
23017
23100
|
top: 0;
|
|
23018
23101
|
display: flex;
|
|
23019
23102
|
flex-direction: column;
|
|
23020
|
-
background-color: var(${
|
|
23103
|
+
background-color: var(${DesignToken36.SurfacePrimaryDefault});
|
|
23021
23104
|
width: ${({ width }) => width != null ? width : "524px"};
|
|
23022
23105
|
flex-shrink: 0;
|
|
23023
23106
|
height: 100%;
|
|
@@ -23035,8 +23118,8 @@ function WorkflowDetailsPanel({
|
|
|
23035
23118
|
onClose
|
|
23036
23119
|
}) {
|
|
23037
23120
|
var _a, _b, _c, _d, _e;
|
|
23038
|
-
const navigate =
|
|
23039
|
-
const { id, tab } =
|
|
23121
|
+
const navigate = useNavigate11();
|
|
23122
|
+
const { id, tab } = useParams4();
|
|
23040
23123
|
const workflowQuery = useFetchWorkflow(id);
|
|
23041
23124
|
const workflowExecutionsQuery = useFetchWorkflowExecutionList(id);
|
|
23042
23125
|
const relatedWorkflowQuery = useFetchWorkflow(
|
|
@@ -23150,8 +23233,8 @@ function WorkflowDetails({
|
|
|
23150
23233
|
}
|
|
23151
23234
|
|
|
23152
23235
|
// src/views/Workflows/Creator/Panels/Editor/Panel.tsx
|
|
23153
|
-
import { useRef as
|
|
23154
|
-
import { useNavigate as
|
|
23236
|
+
import { useRef as useRef9, useState as useState27 } from "react";
|
|
23237
|
+
import { useNavigate as useNavigate12 } from "react-router-dom";
|
|
23155
23238
|
import { Editor } from "@monaco-editor/react";
|
|
23156
23239
|
import { Close as Close4 } from "@livechat/design-system-icons";
|
|
23157
23240
|
import {
|
|
@@ -23182,13 +23265,13 @@ function configureMonaco(monaco) {
|
|
|
23182
23265
|
});
|
|
23183
23266
|
}
|
|
23184
23267
|
function WorkflowEditorPanel({ onClose }) {
|
|
23185
|
-
const navigate =
|
|
23268
|
+
const navigate = useNavigate12();
|
|
23186
23269
|
const {
|
|
23187
23270
|
state: { workflow },
|
|
23188
23271
|
replaceWorkflow,
|
|
23189
23272
|
focus
|
|
23190
23273
|
} = useWorkflowCreator();
|
|
23191
|
-
const editorRef =
|
|
23274
|
+
const editorRef = useRef9();
|
|
23192
23275
|
const [, setIsModified] = useState27(false);
|
|
23193
23276
|
const [, setJsonErrors] = useState27([]);
|
|
23194
23277
|
const filteredWorkflow = {
|
|
@@ -23259,7 +23342,7 @@ var Panel_default2 = WorkflowEditorPanel;
|
|
|
23259
23342
|
import { Automation as Automation2, Close as Close5 } from "@livechat/design-system-icons";
|
|
23260
23343
|
import {
|
|
23261
23344
|
Button as Button27,
|
|
23262
|
-
DesignToken as
|
|
23345
|
+
DesignToken as DesignToken37,
|
|
23263
23346
|
Icon as Icon30,
|
|
23264
23347
|
RadiusToken as RadiusToken17,
|
|
23265
23348
|
ShadowToken as ShadowToken10,
|
|
@@ -23276,7 +23359,7 @@ var formCss = () => css`
|
|
|
23276
23359
|
var Wrapper4 = newStyled.div`
|
|
23277
23360
|
height: 100%;
|
|
23278
23361
|
overflow: auto;
|
|
23279
|
-
background-color: var(${
|
|
23362
|
+
background-color: var(${DesignToken37.SurfacePrimaryDefault});
|
|
23280
23363
|
border-radius: 0 var(${RadiusToken17[4]}) var(${RadiusToken17[4]}) 0;
|
|
23281
23364
|
width: 524px;
|
|
23282
23365
|
flex-shrink: 0;
|
|
@@ -23424,69 +23507,76 @@ function WorkflowElementPanel() {
|
|
|
23424
23507
|
}
|
|
23425
23508
|
};
|
|
23426
23509
|
const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.provider) === IntegrationNames18.OpenAI || (config2 == null ? void 0 : config2.customization.provider) === IntegrationNames18.BigCommerce);
|
|
23427
|
-
return /* @__PURE__ */ jsxs2(
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
23510
|
+
return /* @__PURE__ */ jsxs2(
|
|
23511
|
+
Wrapper4,
|
|
23512
|
+
{
|
|
23513
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.element.wrapper,
|
|
23514
|
+
children: [
|
|
23515
|
+
" ",
|
|
23516
|
+
/* @__PURE__ */ jsxs2(Row16, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
|
|
23517
|
+
/* @__PURE__ */ jsx4(
|
|
23518
|
+
Header7,
|
|
23519
|
+
{
|
|
23520
|
+
css: css`
|
|
23433
23521
|
max-width: 85%;
|
|
23434
23522
|
`,
|
|
23435
|
-
|
|
23436
|
-
|
|
23437
|
-
|
|
23438
|
-
|
|
23439
|
-
|
|
23440
|
-
|
|
23441
|
-
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
|
|
23446
|
-
|
|
23447
|
-
|
|
23448
|
-
|
|
23449
|
-
|
|
23523
|
+
children: /* @__PURE__ */ jsxs2(Title7, { children: [
|
|
23524
|
+
(config2 == null ? void 0 : config2.customization.product) ? /* @__PURE__ */ jsx4(
|
|
23525
|
+
ProductIcon_default,
|
|
23526
|
+
{
|
|
23527
|
+
center: true,
|
|
23528
|
+
disabled: false,
|
|
23529
|
+
height: 10,
|
|
23530
|
+
product: config2.customization.provider,
|
|
23531
|
+
revertColors: revertIconColor,
|
|
23532
|
+
width: 10
|
|
23533
|
+
}
|
|
23534
|
+
) : /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
|
|
23535
|
+
Icon30,
|
|
23536
|
+
{
|
|
23537
|
+
css: css`
|
|
23450
23538
|
width: var(${SpacingToken33.Spacing6});
|
|
23451
23539
|
`,
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
23458
|
-
|
|
23459
|
-
|
|
23460
|
-
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
|
|
23467
|
-
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23471
|
-
|
|
23472
|
-
|
|
23473
|
-
|
|
23474
|
-
|
|
23475
|
-
|
|
23476
|
-
|
|
23477
|
-
|
|
23478
|
-
|
|
23540
|
+
size: "xlarge",
|
|
23541
|
+
source: Automation2
|
|
23542
|
+
}
|
|
23543
|
+
) }),
|
|
23544
|
+
/* @__PURE__ */ jsxs2(Column13, { noFlexBasis: true, notPadded: true, children: [
|
|
23545
|
+
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
23546
|
+
((_d = frame == null ? void 0 : frame.__meta) == null ? void 0 : _d.index) !== void 0 ? `${frame.__meta.index}. ` : "",
|
|
23547
|
+
(_e = config2 == null ? void 0 : config2.customization.displayName) != null ? _e : data.type === NodeNames.switch ? "Condition" : data.type === NodeNames.http ? "Custom HTTP" : data.type === NodeNames.terminate ? "End workflow" : ""
|
|
23548
|
+
] }),
|
|
23549
|
+
(_f = config2 == null ? void 0 : config2.customization.description) != null ? _f : data.type === NodeNames.switch ? "Conditional execution" : data.type === NodeNames.http ? "Make an HTTP request" : data.type === NodeNames.terminate ? "End the workflow" : ""
|
|
23550
|
+
] })
|
|
23551
|
+
] })
|
|
23552
|
+
}
|
|
23553
|
+
),
|
|
23554
|
+
/* @__PURE__ */ jsx4(
|
|
23555
|
+
Button27,
|
|
23556
|
+
{
|
|
23557
|
+
kind: "plain",
|
|
23558
|
+
onClick: () => {
|
|
23559
|
+
toggle();
|
|
23560
|
+
},
|
|
23561
|
+
children: /* @__PURE__ */ jsx4(Icon30, { source: Close5 })
|
|
23562
|
+
}
|
|
23563
|
+
)
|
|
23564
|
+
] }),
|
|
23565
|
+
/* @__PURE__ */ jsx4(Row16, { css: formCss, children: contentHandler() })
|
|
23566
|
+
]
|
|
23567
|
+
}
|
|
23568
|
+
);
|
|
23479
23569
|
}
|
|
23480
23570
|
var Panel_default3 = WorkflowElementPanel;
|
|
23481
23571
|
|
|
23482
23572
|
// src/views/Workflows/Creator/Navbar.tsx
|
|
23483
|
-
import { useEffect as
|
|
23484
|
-
import { useNavigate as
|
|
23573
|
+
import { useEffect as useEffect19, useRef as useRef10, useState as useState28 } from "react";
|
|
23574
|
+
import { useNavigate as useNavigate13 } from "react-router-dom";
|
|
23485
23575
|
import { ChevronDown as ChevronDown3, Close as Close6 } from "@livechat/design-system-icons";
|
|
23486
23576
|
import {
|
|
23487
23577
|
ActionMenu as ActionMenu2,
|
|
23488
23578
|
Button as Button28,
|
|
23489
|
-
DesignToken as
|
|
23579
|
+
DesignToken as DesignToken38,
|
|
23490
23580
|
FormField as FormField3,
|
|
23491
23581
|
Icon as Icon31,
|
|
23492
23582
|
Input as Input5,
|
|
@@ -23502,7 +23592,7 @@ import {
|
|
|
23502
23592
|
} from "@livechat/developer-studio-ui-react";
|
|
23503
23593
|
function WorkflowCreatorNavbar() {
|
|
23504
23594
|
var _a, _b, _c, _d, _e;
|
|
23505
|
-
const navigate =
|
|
23595
|
+
const navigate = useNavigate13();
|
|
23506
23596
|
const {
|
|
23507
23597
|
state: {
|
|
23508
23598
|
workflow,
|
|
@@ -23515,14 +23605,14 @@ function WorkflowCreatorNavbar() {
|
|
|
23515
23605
|
publishDraft,
|
|
23516
23606
|
toggle
|
|
23517
23607
|
} = useWorkflowCreator();
|
|
23518
|
-
const inputRef =
|
|
23608
|
+
const inputRef = useRef10(null);
|
|
23519
23609
|
const [isNameChanging, setIsNameChanging] = useState28(false);
|
|
23520
23610
|
const [workflowName, setWorkflowName] = useState28(workflow.name);
|
|
23521
23611
|
const { user } = useUserContext8();
|
|
23522
23612
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23523
23613
|
user == null ? void 0 : user.meta.email
|
|
23524
23614
|
);
|
|
23525
|
-
|
|
23615
|
+
useEffect19(() => {
|
|
23526
23616
|
setWorkflowName(workflow.name);
|
|
23527
23617
|
}, [workflow.name]);
|
|
23528
23618
|
useOnClickOutside2(inputRef, () => {
|
|
@@ -23615,7 +23705,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23615
23705
|
css: css`
|
|
23616
23706
|
background: transparent;
|
|
23617
23707
|
border: none;
|
|
23618
|
-
color: var(${
|
|
23708
|
+
color: var(${DesignToken38.ContentBasicPrimary});
|
|
23619
23709
|
border-radius: 0;
|
|
23620
23710
|
padding: 0;
|
|
23621
23711
|
|
|
@@ -23624,18 +23714,18 @@ function WorkflowCreatorNavbar() {
|
|
|
23624
23714
|
font-size: 18px;
|
|
23625
23715
|
font-weight: 600;
|
|
23626
23716
|
line-height: 24px;
|
|
23627
|
-
color: var(${
|
|
23717
|
+
color: var(${DesignToken38.ContentBasicPrimary});
|
|
23628
23718
|
margin-bottom: 1px;
|
|
23629
23719
|
width: ${((_c = inputRef.current) == null ? void 0 : _c.value.length) || 5}ch;
|
|
23630
23720
|
max-width: 30ch;
|
|
23631
23721
|
|
|
23632
23722
|
&:disabled {
|
|
23633
|
-
color: var(${
|
|
23723
|
+
color: var(${DesignToken38.ContentBasicPrimary});
|
|
23634
23724
|
}
|
|
23635
23725
|
|
|
23636
23726
|
${isNameChanging && css`
|
|
23637
23727
|
border-bottom: 1px solid
|
|
23638
|
-
var(${
|
|
23728
|
+
var(${DesignToken38.ContentBasicPrimary});
|
|
23639
23729
|
margin-bottom: 0;
|
|
23640
23730
|
`}
|
|
23641
23731
|
}
|
|
@@ -23697,7 +23787,8 @@ function WorkflowCreatorNavbar() {
|
|
|
23697
23787
|
on: workflow.active,
|
|
23698
23788
|
onChange: () => void activate(),
|
|
23699
23789
|
size: "medium",
|
|
23700
|
-
state: isActivating ? "loading" : workflow.draft ? "locked" : "regular"
|
|
23790
|
+
state: isActivating ? "loading" : workflow.draft ? "locked" : "regular",
|
|
23791
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.activateSwitch
|
|
23701
23792
|
}
|
|
23702
23793
|
),
|
|
23703
23794
|
children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
|
|
@@ -23708,7 +23799,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23708
23799
|
{
|
|
23709
23800
|
css: css`
|
|
23710
23801
|
width: 1px;
|
|
23711
|
-
background-color: var(${
|
|
23802
|
+
background-color: var(${DesignToken38.BorderBasicSecondary});
|
|
23712
23803
|
height: 36px;
|
|
23713
23804
|
`
|
|
23714
23805
|
}
|
|
@@ -23716,7 +23807,15 @@ function WorkflowCreatorNavbar() {
|
|
|
23716
23807
|
workflow.draft ? !workflow.trigger.type || !workflow.definition.tasks.length ? /* @__PURE__ */ jsxs2(
|
|
23717
23808
|
Tooltip8,
|
|
23718
23809
|
{
|
|
23719
|
-
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23810
|
+
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23811
|
+
Button28,
|
|
23812
|
+
{
|
|
23813
|
+
disabled: true,
|
|
23814
|
+
kind: "primary",
|
|
23815
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23816
|
+
children: "Publish"
|
|
23817
|
+
}
|
|
23818
|
+
),
|
|
23720
23819
|
children: [
|
|
23721
23820
|
!workflow.trigger.type && "To publish a workflow, add a trigger.",
|
|
23722
23821
|
!workflow.definition.tasks.length && "To publish a workflow, add at least one task."
|
|
@@ -23734,6 +23833,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23734
23833
|
);
|
|
23735
23834
|
void publishDraft();
|
|
23736
23835
|
},
|
|
23836
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23737
23837
|
children: "Publish"
|
|
23738
23838
|
}
|
|
23739
23839
|
) : /* @__PURE__ */ jsx4(
|
|
@@ -23749,6 +23849,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23749
23849
|
}
|
|
23750
23850
|
void createDraft();
|
|
23751
23851
|
},
|
|
23852
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.editButton,
|
|
23752
23853
|
children: "Edit"
|
|
23753
23854
|
}
|
|
23754
23855
|
)
|
|
@@ -23771,7 +23872,7 @@ var WorkflowCreatorContent = newStyled.div`
|
|
|
23771
23872
|
display: flex;
|
|
23772
23873
|
flex-flow: row nowrap;
|
|
23773
23874
|
border-radius: var(${RadiusToken18.Radius4});
|
|
23774
|
-
${({ grayBackground }) => grayBackground ? `background-color: var(${
|
|
23875
|
+
${({ grayBackground }) => grayBackground ? `background-color: var(${DesignToken39.SurfaceSecondaryDefault})` : `background-color: var(${DesignToken39.SurfacePrimaryDefault})`};
|
|
23775
23876
|
margin: var(${SpacingToken35.Spacing4});
|
|
23776
23877
|
width: calc(100% - var(${SpacingToken35.Spacing8}));
|
|
23777
23878
|
height: calc(100% - var(${SpacingToken35.Spacing8}) - 70px);
|
|
@@ -23782,7 +23883,7 @@ function WorkflowCreatorView() {
|
|
|
23782
23883
|
focus
|
|
23783
23884
|
} = useWorkflowCreator();
|
|
23784
23885
|
const { fitView } = useReactFlow3();
|
|
23785
|
-
|
|
23886
|
+
useEffect20(() => {
|
|
23786
23887
|
if (getWorkflowsEnv("isLiveChatMode")) {
|
|
23787
23888
|
sendMessage("closeSideNav" /* CloseSideNav */);
|
|
23788
23889
|
const timeoutId = setTimeout(() => {
|
|
@@ -23826,9 +23927,9 @@ var View_default = WorkflowCreatorView;
|
|
|
23826
23927
|
// src/views/Workflows/Creator/index.tsx
|
|
23827
23928
|
function WorkflowCreator() {
|
|
23828
23929
|
var _a, _b, _c;
|
|
23829
|
-
const location =
|
|
23830
|
-
const { id } =
|
|
23831
|
-
const navigate =
|
|
23930
|
+
const location = useLocation6();
|
|
23931
|
+
const { id } = useParams5();
|
|
23932
|
+
const navigate = useNavigate14();
|
|
23832
23933
|
const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
|
|
23833
23934
|
const credentialsQuery = useFetchIntegrationCredentialsQuery2();
|
|
23834
23935
|
const organizationProducts = useFetchOrganizationProducts2();
|
|
@@ -23967,23 +24068,23 @@ import { Row as Row27 } from "@livechat/developer-studio-ui-react";
|
|
|
23967
24068
|
import { Route as Route4, Routes as Routes4 } from "react-router-dom";
|
|
23968
24069
|
|
|
23969
24070
|
// src/views/Workflows/List/Modals/PreviewTemplate/index.tsx
|
|
23970
|
-
import { useMemo as
|
|
23971
|
-
import { useParams as
|
|
24071
|
+
import { useMemo as useMemo9 } from "react";
|
|
24072
|
+
import { useParams as useParams6 } from "react-router-dom";
|
|
23972
24073
|
|
|
23973
24074
|
// src/views/Workflows/List/Modals/PreviewTemplate/Modal.tsx
|
|
23974
|
-
import { useCallback as
|
|
23975
|
-
import { useNavigate as
|
|
24075
|
+
import { useCallback as useCallback17 } from "react";
|
|
24076
|
+
import { useNavigate as useNavigate15 } from "react-router-dom";
|
|
23976
24077
|
import { ArrowBackFilled } from "@livechat/design-system-icons";
|
|
23977
24078
|
import {
|
|
23978
24079
|
Button as Button29,
|
|
23979
|
-
DesignToken as
|
|
24080
|
+
DesignToken as DesignToken41,
|
|
23980
24081
|
Heading as Heading5,
|
|
23981
24082
|
Icon as Icon33,
|
|
23982
24083
|
Modal as Modal8,
|
|
23983
24084
|
ModalHeader as ModalHeader5,
|
|
23984
24085
|
RadiusToken as RadiusToken19,
|
|
23985
24086
|
SpacingToken as SpacingToken37,
|
|
23986
|
-
Tag as
|
|
24087
|
+
Tag as Tag3,
|
|
23987
24088
|
Text as Text19
|
|
23988
24089
|
} from "@livechat/design-system-react-components";
|
|
23989
24090
|
import {
|
|
@@ -24001,7 +24102,7 @@ import {
|
|
|
24001
24102
|
TargetArrow
|
|
24002
24103
|
} from "@livechat/design-system-icons";
|
|
24003
24104
|
import {
|
|
24004
|
-
DesignToken as
|
|
24105
|
+
DesignToken as DesignToken40,
|
|
24005
24106
|
Icon as Icon32,
|
|
24006
24107
|
SpacingToken as SpacingToken36,
|
|
24007
24108
|
Text as Text18
|
|
@@ -24020,7 +24121,7 @@ function WorkflowTemplateCategoryIcon(props) {
|
|
|
24020
24121
|
/* @__PURE__ */ jsx4(
|
|
24021
24122
|
Icon32,
|
|
24022
24123
|
{
|
|
24023
|
-
customColor: `var(${
|
|
24124
|
+
customColor: `var(${DesignToken40.ContentBasicSecondary})`,
|
|
24024
24125
|
size: "small",
|
|
24025
24126
|
source: icons[props.category]
|
|
24026
24127
|
}
|
|
@@ -24028,7 +24129,7 @@ function WorkflowTemplateCategoryIcon(props) {
|
|
|
24028
24129
|
/* @__PURE__ */ jsx4(
|
|
24029
24130
|
Text18,
|
|
24030
24131
|
{
|
|
24031
|
-
customColor: `var(${
|
|
24132
|
+
customColor: `var(${DesignToken40.ContentBasicSecondary})`,
|
|
24032
24133
|
noMargin: true,
|
|
24033
24134
|
size: "xs",
|
|
24034
24135
|
children: props.category
|
|
@@ -24047,7 +24148,7 @@ var WorkflowBuilderWrapper2 = newStyled.div`
|
|
|
24047
24148
|
min-height: 400px;
|
|
24048
24149
|
max-height: 100%;
|
|
24049
24150
|
border-radius: var(${RadiusToken19.Radius3});
|
|
24050
|
-
background-color: var(${
|
|
24151
|
+
background-color: var(${DesignToken41.SurfaceSecondaryDefault});
|
|
24051
24152
|
|
|
24052
24153
|
> div {
|
|
24053
24154
|
height: 400px !important;
|
|
@@ -24079,7 +24180,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
24079
24180
|
template,
|
|
24080
24181
|
onClose
|
|
24081
24182
|
}) {
|
|
24082
|
-
const navigate =
|
|
24183
|
+
const navigate = useNavigate15();
|
|
24083
24184
|
const {
|
|
24084
24185
|
save,
|
|
24085
24186
|
state: {
|
|
@@ -24090,7 +24191,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
24090
24191
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24091
24192
|
user == null ? void 0 : user.meta.email
|
|
24092
24193
|
);
|
|
24093
|
-
const handleClose =
|
|
24194
|
+
const handleClose = useCallback17(
|
|
24094
24195
|
(target) => {
|
|
24095
24196
|
if (onClose) {
|
|
24096
24197
|
onClose();
|
|
@@ -24109,7 +24210,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
24109
24210
|
return products.map((product, i) => {
|
|
24110
24211
|
const icon2 = templateIcons[i];
|
|
24111
24212
|
return /* @__PURE__ */ jsx4(
|
|
24112
|
-
|
|
24213
|
+
Tag3,
|
|
24113
24214
|
{
|
|
24114
24215
|
leftNode: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 4, product: icon2, width: 4 }),
|
|
24115
24216
|
size: "small",
|
|
@@ -24213,7 +24314,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
24213
24314
|
css: css`
|
|
24214
24315
|
margin-block-end: var(${SpacingToken37.Spacing1});
|
|
24215
24316
|
`,
|
|
24216
|
-
customColor: `var(${
|
|
24317
|
+
customColor: `var(${DesignToken41.ContentBasicSecondary})`,
|
|
24217
24318
|
noMargin: true,
|
|
24218
24319
|
size: "xs",
|
|
24219
24320
|
children: "Products used:"
|
|
@@ -24236,8 +24337,8 @@ function WorkflowTemplatePreview({
|
|
|
24236
24337
|
workflow,
|
|
24237
24338
|
onClose
|
|
24238
24339
|
}) {
|
|
24239
|
-
const flowTemplates =
|
|
24240
|
-
const params =
|
|
24340
|
+
const flowTemplates = useMemo9(() => getWorkflowTemplates(), []);
|
|
24341
|
+
const params = useParams6();
|
|
24241
24342
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
24242
24343
|
const targetWorkflow = workflow || (template == null ? void 0 : template.workflow);
|
|
24243
24344
|
if (!template) {
|
|
@@ -24268,22 +24369,22 @@ function WorkflowTemplatePreview({
|
|
|
24268
24369
|
var PreviewTemplate_default = WorkflowTemplatePreview;
|
|
24269
24370
|
|
|
24270
24371
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24271
|
-
import { useCallback as
|
|
24272
|
-
import { useNavigate as
|
|
24372
|
+
import { useCallback as useCallback20 } from "react";
|
|
24373
|
+
import { useNavigate as useNavigate18 } from "react-router-dom";
|
|
24273
24374
|
import { Modal as Modal9, ModalHeader as ModalHeader6 } from "@livechat/design-system-react-components";
|
|
24274
24375
|
|
|
24275
24376
|
// src/views/Workflows/List/Home/Home.tsx
|
|
24276
|
-
import { useMemo as
|
|
24377
|
+
import { useMemo as useMemo10, useState as useState31 } from "react";
|
|
24277
24378
|
import { FiletypeOther, OneColored } from "@livechat/design-system-icons";
|
|
24278
24379
|
import {
|
|
24279
|
-
DesignToken as
|
|
24380
|
+
DesignToken as DesignToken43,
|
|
24280
24381
|
SpacingToken as SpacingToken42,
|
|
24281
24382
|
Text as Text20
|
|
24282
24383
|
} from "@livechat/design-system-react-components";
|
|
24283
24384
|
import { Column as Column17, Intro as Intro3, Row as Row24 } from "@livechat/developer-studio-ui-react";
|
|
24284
24385
|
|
|
24285
24386
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Category.tsx
|
|
24286
|
-
import { useCallback as
|
|
24387
|
+
import { useCallback as useCallback18, useState as useState29 } from "react";
|
|
24287
24388
|
import {
|
|
24288
24389
|
ChatDots as ChatDots2,
|
|
24289
24390
|
CurrencyDollar as CurrencyDollar2,
|
|
@@ -24306,7 +24407,7 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
24306
24407
|
}) {
|
|
24307
24408
|
var _a;
|
|
24308
24409
|
const [isVisible, setIsVisible] = useState29(false);
|
|
24309
|
-
const getItem =
|
|
24410
|
+
const getItem = useCallback18(
|
|
24310
24411
|
(key, category, icon2) => ({
|
|
24311
24412
|
key,
|
|
24312
24413
|
element: /* @__PURE__ */ jsxs2(Row20, { gap: `var(${SpacingToken38.Spacing1});`, notPadded: true, children: [
|
|
@@ -24361,7 +24462,7 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
24361
24462
|
var Category_default = WorkflowTemplatesCategoryFilter;
|
|
24362
24463
|
|
|
24363
24464
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Product.tsx
|
|
24364
|
-
import { useCallback as
|
|
24465
|
+
import { useCallback as useCallback19, useState as useState30 } from "react";
|
|
24365
24466
|
import {
|
|
24366
24467
|
Chatgpt,
|
|
24367
24468
|
HelpDeskColored,
|
|
@@ -24384,7 +24485,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24384
24485
|
}) {
|
|
24385
24486
|
var _a;
|
|
24386
24487
|
const [isVisible, setIsVisible] = useState30(false);
|
|
24387
|
-
const getItem =
|
|
24488
|
+
const getItem = useCallback19(
|
|
24388
24489
|
(key, product, icon2) => ({
|
|
24389
24490
|
key,
|
|
24390
24491
|
element: /* @__PURE__ */ jsxs2(Row21, { gap: `var(${SpacingToken39.Spacing1});`, notPadded: true, children: [
|
|
@@ -24441,7 +24542,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24441
24542
|
var Product_default = WorkflowTemplatesProductFilter;
|
|
24442
24543
|
|
|
24443
24544
|
// src/views/Workflows/List/Home/Cards/Scratch.tsx
|
|
24444
|
-
import { useNavigate as
|
|
24545
|
+
import { useNavigate as useNavigate16 } from "react-router-dom";
|
|
24445
24546
|
import {
|
|
24446
24547
|
Heading as Heading6,
|
|
24447
24548
|
Icon as Icon36,
|
|
@@ -24458,7 +24559,7 @@ function WorkflowScratchCard({
|
|
|
24458
24559
|
icon: icon2,
|
|
24459
24560
|
openOne
|
|
24460
24561
|
}) {
|
|
24461
|
-
const navigate =
|
|
24562
|
+
const navigate = useNavigate16();
|
|
24462
24563
|
const { user } = useUserContext10();
|
|
24463
24564
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24464
24565
|
user == null ? void 0 : user.meta.email
|
|
@@ -24490,9 +24591,9 @@ function WorkflowScratchCard({
|
|
|
24490
24591
|
var Scratch_default = WorkflowScratchCard;
|
|
24491
24592
|
|
|
24492
24593
|
// src/views/Workflows/List/Home/Cards/Template.tsx
|
|
24493
|
-
import { useNavigate as
|
|
24594
|
+
import { useNavigate as useNavigate17 } from "react-router-dom";
|
|
24494
24595
|
import {
|
|
24495
|
-
DesignToken as
|
|
24596
|
+
DesignToken as DesignToken42,
|
|
24496
24597
|
Heading as Heading7,
|
|
24497
24598
|
SpacingToken as SpacingToken41
|
|
24498
24599
|
} from "@livechat/design-system-react-components";
|
|
@@ -24501,7 +24602,7 @@ var IconWrapper2 = newStyled.div`
|
|
|
24501
24602
|
display: flex;
|
|
24502
24603
|
align-items: center;
|
|
24503
24604
|
justify-content: center;
|
|
24504
|
-
background-color: var(${
|
|
24605
|
+
background-color: var(${DesignToken42.SurfaceSecondaryDefault});
|
|
24505
24606
|
border-radius: 50%;
|
|
24506
24607
|
width: var(${SpacingToken41.Spacing7});
|
|
24507
24608
|
height: var(${SpacingToken41.Spacing7});
|
|
@@ -24512,7 +24613,7 @@ function WorkflowTemplateCard({
|
|
|
24512
24613
|
icons,
|
|
24513
24614
|
category
|
|
24514
24615
|
}) {
|
|
24515
|
-
const navigate =
|
|
24616
|
+
const navigate = useNavigate17();
|
|
24516
24617
|
return /* @__PURE__ */ jsx4(
|
|
24517
24618
|
Card3,
|
|
24518
24619
|
{
|
|
@@ -24558,7 +24659,7 @@ var Grid = newStyled.div`
|
|
|
24558
24659
|
function WorkflowsHome({ isOnModal }) {
|
|
24559
24660
|
const [product, setProduct] = useState31("All");
|
|
24560
24661
|
const [category, setCategory] = useState31("All");
|
|
24561
|
-
const flowTemplates =
|
|
24662
|
+
const flowTemplates = useMemo10(() => getWorkflowTemplates(), []);
|
|
24562
24663
|
const filters = [
|
|
24563
24664
|
(template) => product === "All" || template.products.includes(product),
|
|
24564
24665
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -24638,7 +24739,7 @@ function WorkflowsHome({ isOnModal }) {
|
|
|
24638
24739
|
/* @__PURE__ */ jsx4(Grid, { children: filteredTemplates.length === 0 ? /* @__PURE__ */ jsx4(
|
|
24639
24740
|
Text20,
|
|
24640
24741
|
{
|
|
24641
|
-
customColor: `var(${
|
|
24742
|
+
customColor: `var(${DesignToken43.ContentBasicSecondary})`,
|
|
24642
24743
|
size: "md",
|
|
24643
24744
|
children: "No templates found"
|
|
24644
24745
|
}
|
|
@@ -24660,8 +24761,8 @@ var Home_default = WorkflowsHome;
|
|
|
24660
24761
|
|
|
24661
24762
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24662
24763
|
function WorkflowCreateModal({ onClose }) {
|
|
24663
|
-
const navigate =
|
|
24664
|
-
const handleClose =
|
|
24764
|
+
const navigate = useNavigate18();
|
|
24765
|
+
const handleClose = useCallback20(() => {
|
|
24665
24766
|
if (onClose) {
|
|
24666
24767
|
onClose();
|
|
24667
24768
|
return;
|
|
@@ -24695,10 +24796,10 @@ var Create_default = WorkflowCreate;
|
|
|
24695
24796
|
|
|
24696
24797
|
// src/views/Workflows/List/View.tsx
|
|
24697
24798
|
import { useState as useState33 } from "react";
|
|
24698
|
-
import { useNavigate as
|
|
24799
|
+
import { useNavigate as useNavigate21 } from "react-router-dom";
|
|
24699
24800
|
import {
|
|
24700
24801
|
Button as Button35,
|
|
24701
|
-
DesignToken as
|
|
24802
|
+
DesignToken as DesignToken46,
|
|
24702
24803
|
SpacingToken as SpacingToken45
|
|
24703
24804
|
} from "@livechat/design-system-react-components";
|
|
24704
24805
|
import { mergeDeep as mergeDeep2 } from "@livechat/developer-studio-api";
|
|
@@ -24711,12 +24812,12 @@ import {
|
|
|
24711
24812
|
} from "@livechat/developer-studio-ui-react";
|
|
24712
24813
|
|
|
24713
24814
|
// src/views/Workflows/Creator/LiveChatNavbar.tsx
|
|
24714
|
-
import { useCallback as
|
|
24715
|
-
import { useNavigate as
|
|
24815
|
+
import { useCallback as useCallback21 } from "react";
|
|
24816
|
+
import { useNavigate as useNavigate19 } from "react-router-dom";
|
|
24716
24817
|
import { LayoutSidebarLeft } from "@livechat/design-system-icons";
|
|
24717
24818
|
import {
|
|
24718
24819
|
Button as Button32,
|
|
24719
|
-
DesignToken as
|
|
24820
|
+
DesignToken as DesignToken44,
|
|
24720
24821
|
Heading as Heading8,
|
|
24721
24822
|
Icon as Icon37,
|
|
24722
24823
|
SpacingToken as SpacingToken43
|
|
@@ -24729,19 +24830,19 @@ var wrapperCss = (hasData) => css`
|
|
|
24729
24830
|
padding: 0 var(${SpacingToken43.Spacing6}) 0 var(${SpacingToken43.Spacing4});
|
|
24730
24831
|
align-items: center;
|
|
24731
24832
|
gap: var(${SpacingToken43.Spacing2});
|
|
24732
|
-
border-bottom: 1px solid var(${
|
|
24833
|
+
border-bottom: 1px solid var(${DesignToken44.BorderBasicSecondary});
|
|
24733
24834
|
|
|
24734
24835
|
${hasData && `> button:last-of-type {
|
|
24735
24836
|
margin-left: auto;
|
|
24736
24837
|
}`}
|
|
24737
24838
|
`;
|
|
24738
24839
|
function LiveChatNavbar() {
|
|
24739
|
-
const navigate =
|
|
24840
|
+
const navigate = useNavigate19();
|
|
24740
24841
|
const workflows = useFetchWorkflows({});
|
|
24741
24842
|
const isLoading = workflows.isLoading;
|
|
24742
24843
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0;
|
|
24743
24844
|
const hasData = !isLoading && !hasNoData;
|
|
24744
|
-
const handleClick =
|
|
24845
|
+
const handleClick = useCallback21(() => {
|
|
24745
24846
|
sendMessage("toggleSideNav" /* ToggleSideNav */);
|
|
24746
24847
|
}, []);
|
|
24747
24848
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperCss(hasData), children: [
|
|
@@ -24843,7 +24944,7 @@ function WorkflowStatusFilter({
|
|
|
24843
24944
|
var StatusFilter_default = WorkflowStatusFilter;
|
|
24844
24945
|
|
|
24845
24946
|
// src/views/Workflows/List/Grid/Table.tsx
|
|
24846
|
-
import { useNavigate as
|
|
24947
|
+
import { useNavigate as useNavigate20 } from "react-router-dom";
|
|
24847
24948
|
import {
|
|
24848
24949
|
Delete as Delete3,
|
|
24849
24950
|
Info as Info2,
|
|
@@ -24854,11 +24955,11 @@ import {
|
|
|
24854
24955
|
ActionMenu as ActionMenu6,
|
|
24855
24956
|
ActionMenuItem as ActionMenuItem2,
|
|
24856
24957
|
Button as Button34,
|
|
24857
|
-
DesignToken as
|
|
24958
|
+
DesignToken as DesignToken45,
|
|
24858
24959
|
Icon as Icon39,
|
|
24859
24960
|
SpacingToken as SpacingToken44,
|
|
24860
24961
|
Switch as Switch2,
|
|
24861
|
-
Tag as
|
|
24962
|
+
Tag as Tag4,
|
|
24862
24963
|
Text as Text21,
|
|
24863
24964
|
Tooltip as Tooltip9
|
|
24864
24965
|
} from "@livechat/design-system-react-components";
|
|
@@ -24873,7 +24974,7 @@ import {
|
|
|
24873
24974
|
} from "@livechat/developer-studio-ui-react";
|
|
24874
24975
|
function WorkflowsTable({ workflowsQuery, state }) {
|
|
24875
24976
|
var _a, _b, _c;
|
|
24876
|
-
const navigate =
|
|
24977
|
+
const navigate = useNavigate20();
|
|
24877
24978
|
const notifications = useNotificationContext5();
|
|
24878
24979
|
const deleteAction = useDeleteWorkflow();
|
|
24879
24980
|
const activateWorkflowAction = useActivateWorkflow();
|
|
@@ -24910,7 +25011,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
24910
25011
|
cursor: pointer;
|
|
24911
25012
|
|
|
24912
25013
|
&:hover {
|
|
24913
|
-
background: var(${
|
|
25014
|
+
background: var(${DesignToken45.SurfacePrimaryHover});
|
|
24914
25015
|
}
|
|
24915
25016
|
`,
|
|
24916
25017
|
onClick: () => {
|
|
@@ -24921,7 +25022,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
24921
25022
|
/* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(Row25, { gap: `var(${SpacingToken44.Spacing2})`, noWrap: true, notPadded: true, children: [
|
|
24922
25023
|
/* @__PURE__ */ jsx4(Text21, { noMargin: true, size: "sm", children: workflow.name }),
|
|
24923
25024
|
workflow.related_workflow_id ? /* @__PURE__ */ jsx4(
|
|
24924
|
-
|
|
25025
|
+
Tag4,
|
|
24925
25026
|
{
|
|
24926
25027
|
css: css`
|
|
24927
25028
|
color: #68afff;
|
|
@@ -25042,7 +25143,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
25042
25143
|
{
|
|
25043
25144
|
css: css`
|
|
25044
25145
|
background: transparent !important;
|
|
25045
|
-
color: var(${
|
|
25146
|
+
color: var(${DesignToken45.ContentBasicSecondary});
|
|
25046
25147
|
`,
|
|
25047
25148
|
children: /* @__PURE__ */ jsx4("td", { align: "left", colSpan: 6, children: /* @__PURE__ */ jsxs2(Text21, { as: "div", size: "md", children: [
|
|
25048
25149
|
"There are no",
|
|
@@ -25113,11 +25214,11 @@ var Grid_default = WorkflowsGrid;
|
|
|
25113
25214
|
|
|
25114
25215
|
// src/views/Workflows/List/View.tsx
|
|
25115
25216
|
var markedStyles = css`
|
|
25116
|
-
color: var(${
|
|
25217
|
+
color: var(${DesignToken46.ActionPrimaryDefault});
|
|
25117
25218
|
`;
|
|
25118
25219
|
function WorkflowListView() {
|
|
25119
25220
|
var _a;
|
|
25120
|
-
const navigate =
|
|
25221
|
+
const navigate = useNavigate21();
|
|
25121
25222
|
const [state, setState] = useState33({
|
|
25122
25223
|
filters: {
|
|
25123
25224
|
status: "All",
|
|
@@ -25207,9 +25308,9 @@ var List_default2 = WorkflowList;
|
|
|
25207
25308
|
// src/views/Workflows/index.tsx
|
|
25208
25309
|
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
25209
25310
|
function Workflows() {
|
|
25210
|
-
const navigate =
|
|
25311
|
+
const navigate = useNavigate22();
|
|
25211
25312
|
const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
|
|
25212
|
-
|
|
25313
|
+
useEffect21(() => {
|
|
25213
25314
|
if (isWorkflowAppLoading) {
|
|
25214
25315
|
return;
|
|
25215
25316
|
}
|
|
@@ -25285,6 +25386,7 @@ function WorkflowsModule({ waitlistImage }) {
|
|
|
25285
25386
|
}
|
|
25286
25387
|
export {
|
|
25287
25388
|
LoginError_default as LoginError,
|
|
25389
|
+
WORKFLOWS_TEST_SELECTORS,
|
|
25288
25390
|
WorkflowsModule,
|
|
25289
25391
|
config,
|
|
25290
25392
|
getWorkflowsEnv,
|