@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.js
CHANGED
|
@@ -469,6 +469,7 @@ var require_extends = __commonJS({
|
|
|
469
469
|
var src_exports = {};
|
|
470
470
|
__export(src_exports, {
|
|
471
471
|
LoginError: () => LoginError_default,
|
|
472
|
+
WORKFLOWS_TEST_SELECTORS: () => WORKFLOWS_TEST_SELECTORS,
|
|
472
473
|
WorkflowsModule: () => WorkflowsModule,
|
|
473
474
|
config: () => config,
|
|
474
475
|
getWorkflowsEnv: () => getWorkflowsEnv,
|
|
@@ -489,8 +490,59 @@ var getWorkflowsEnv = (key) => {
|
|
|
489
490
|
return config.config[key];
|
|
490
491
|
};
|
|
491
492
|
|
|
493
|
+
// src/tests/selectors.ts
|
|
494
|
+
var WORKFLOWS_TEST_SELECTORS = {
|
|
495
|
+
views: {
|
|
496
|
+
workflows: {
|
|
497
|
+
creator: {
|
|
498
|
+
navbar: {
|
|
499
|
+
activateSwitch: "activate-switch",
|
|
500
|
+
publishButton: "publish-btn",
|
|
501
|
+
editButton: "edit-btn"
|
|
502
|
+
},
|
|
503
|
+
builder: {
|
|
504
|
+
nodes: {
|
|
505
|
+
add: {
|
|
506
|
+
task: {
|
|
507
|
+
button: "add-task-btn"
|
|
508
|
+
},
|
|
509
|
+
trigger: {
|
|
510
|
+
button: "add-trigger-btn"
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
modals: {
|
|
516
|
+
addTask: {
|
|
517
|
+
wrapper: "add-task-modal",
|
|
518
|
+
taskCard: (key) => `task-option-${key}`,
|
|
519
|
+
taskCategoryButton: (key) => `task-category-${key}`,
|
|
520
|
+
saveButton: "save-task-btn"
|
|
521
|
+
},
|
|
522
|
+
addTrigger: {
|
|
523
|
+
wrapper: "add-trigger-modal",
|
|
524
|
+
saveButton: "save-trigger-btn",
|
|
525
|
+
triggerCard: (key) => `trigger-option-${key}`,
|
|
526
|
+
triggerCategoryButton: (key) => `trigger-category-${key}`
|
|
527
|
+
},
|
|
528
|
+
publish: {
|
|
529
|
+
wrapper: "publish-workflow-modal",
|
|
530
|
+
saveButton: "publish-workflow-btn",
|
|
531
|
+
cancelButton: "cancel-publish-btn"
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
panels: {
|
|
535
|
+
element: {
|
|
536
|
+
wrapper: "element-wrapper"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
|
|
492
544
|
// src/views/index.tsx
|
|
493
|
-
var
|
|
545
|
+
var import_react_router_dom30 = require("react-router-dom");
|
|
494
546
|
|
|
495
547
|
// src/views/Waitlist/index.tsx
|
|
496
548
|
var import_react3 = require("react");
|
|
@@ -2065,7 +2117,7 @@ var useDeleteWorkflow = () => {
|
|
|
2065
2117
|
);
|
|
2066
2118
|
}),
|
|
2067
2119
|
{
|
|
2068
|
-
onSuccess: (
|
|
2120
|
+
onSuccess: (_2, workflow) => {
|
|
2069
2121
|
queryClient.removeQueries(queryKeys.workflow.get(workflow.id));
|
|
2070
2122
|
if (workflow.related_workflow_id) {
|
|
2071
2123
|
queryClient.setQueryData(
|
|
@@ -2094,7 +2146,7 @@ var usePublishWorkflowDraft = () => {
|
|
|
2094
2146
|
return { id: data.id };
|
|
2095
2147
|
}),
|
|
2096
2148
|
{
|
|
2097
|
-
onSuccess: (
|
|
2149
|
+
onSuccess: (_2, draft) => __async(void 0, null, function* () {
|
|
2098
2150
|
if (draft.related_workflow_id) {
|
|
2099
2151
|
const workflow = yield import_developer_studio_api2.api.integrations.text.platform.workflow.workflows.getWorkflow(
|
|
2100
2152
|
draft.related_workflow_id
|
|
@@ -2131,7 +2183,7 @@ var useActivateWorkflow = () => {
|
|
|
2131
2183
|
);
|
|
2132
2184
|
}),
|
|
2133
2185
|
{
|
|
2134
|
-
onSuccess: (
|
|
2186
|
+
onSuccess: (_2, { id }) => {
|
|
2135
2187
|
queryClient.setQueryData(
|
|
2136
2188
|
queryKeys.workflow.get(id),
|
|
2137
2189
|
(workflow) => workflow ? __spreadProps(__spreadValues({}, workflow), { active: true }) : workflow
|
|
@@ -2302,12 +2354,12 @@ function Waitlist({ image }) {
|
|
|
2302
2354
|
var Waitlist_default = Waitlist;
|
|
2303
2355
|
|
|
2304
2356
|
// src/views/Workflows/index.tsx
|
|
2305
|
-
var
|
|
2306
|
-
var
|
|
2357
|
+
var import_react112 = require("react");
|
|
2358
|
+
var import_react_router_dom29 = require("react-router-dom");
|
|
2307
2359
|
var import_developer_studio_ui_react47 = require("@livechat/developer-studio-ui-react");
|
|
2308
2360
|
|
|
2309
2361
|
// src/views/Workflows/Creator/index.tsx
|
|
2310
|
-
var
|
|
2362
|
+
var import_react_router_dom18 = require("react-router-dom");
|
|
2311
2363
|
var import_developer_studio_ui_react35 = require("@livechat/developer-studio-ui-react");
|
|
2312
2364
|
var import_platform_integrations6 = require("@livechat/platform-integrations");
|
|
2313
2365
|
|
|
@@ -2336,7 +2388,7 @@ var WORKFLOW_TRIGGER_OUTPUT_SCHEMA = (body) => ({
|
|
|
2336
2388
|
}
|
|
2337
2389
|
});
|
|
2338
2390
|
var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
2339
|
-
var _a, _b;
|
|
2391
|
+
var _a, _b, _c;
|
|
2340
2392
|
return {
|
|
2341
2393
|
required: ["type", "name", "inputParameters"],
|
|
2342
2394
|
properties: {
|
|
@@ -2355,7 +2407,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2355
2407
|
(overrides == null ? void 0 : overrides.body) ? "body" : void 0
|
|
2356
2408
|
].filter(Boolean),
|
|
2357
2409
|
properties: {
|
|
2358
|
-
uri: {
|
|
2410
|
+
uri: (_a = overrides == null ? void 0 : overrides.uri) != null ? _a : {
|
|
2359
2411
|
type: "string",
|
|
2360
2412
|
title: "URI"
|
|
2361
2413
|
},
|
|
@@ -2364,7 +2416,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2364
2416
|
title: "Method",
|
|
2365
2417
|
enum: ["GET", "POST", "PATCH", "PUT", "DELETE"]
|
|
2366
2418
|
},
|
|
2367
|
-
headers: (
|
|
2419
|
+
headers: (_b = overrides == null ? void 0 : overrides.headers) != null ? _b : {
|
|
2368
2420
|
type: "object",
|
|
2369
2421
|
title: "Headers",
|
|
2370
2422
|
properties: {},
|
|
@@ -2372,7 +2424,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2372
2424
|
type: "string"
|
|
2373
2425
|
}
|
|
2374
2426
|
},
|
|
2375
|
-
body: (
|
|
2427
|
+
body: (_c = overrides == null ? void 0 : overrides.body) != null ? _c : {
|
|
2376
2428
|
type: "object",
|
|
2377
2429
|
title: "Body",
|
|
2378
2430
|
properties: {},
|
|
@@ -2397,10 +2449,19 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
|
|
|
2397
2449
|
};
|
|
2398
2450
|
var WORKFLOW_HTTP_TASK_INPUT_SCHEMA = (body, query) => ({
|
|
2399
2451
|
type: "object",
|
|
2400
|
-
required: [
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2452
|
+
required: [
|
|
2453
|
+
"uri",
|
|
2454
|
+
body ? "body" : void 0,
|
|
2455
|
+
query ? "query" : void 0
|
|
2456
|
+
].filter(Boolean),
|
|
2457
|
+
properties: __spreadValues(__spreadValues({
|
|
2458
|
+
uri: query ? {
|
|
2459
|
+
type: "string",
|
|
2460
|
+
queryParams: query
|
|
2461
|
+
} : {
|
|
2462
|
+
type: "string"
|
|
2463
|
+
}
|
|
2464
|
+
}, query ? {
|
|
2404
2465
|
query
|
|
2405
2466
|
} : {}), body ? {
|
|
2406
2467
|
body
|
|
@@ -4090,9 +4151,9 @@ var helpdeskTaskConfigs = () => ({
|
|
|
4090
4151
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA(
|
|
4091
4152
|
{
|
|
4092
4153
|
type: "object",
|
|
4093
|
-
required: ["
|
|
4154
|
+
required: ["tagIDs"],
|
|
4094
4155
|
properties: {
|
|
4095
|
-
|
|
4156
|
+
tagIDs: {
|
|
4096
4157
|
type: "array",
|
|
4097
4158
|
title: "Tag IDs",
|
|
4098
4159
|
items: {
|
|
@@ -4353,7 +4414,7 @@ var helpdeskTaskTemplates = () => ({
|
|
|
4353
4414
|
)}/functions/add-tags-to-helpdesk-ticket?id=#{ticket_id}`,
|
|
4354
4415
|
method: "POST",
|
|
4355
4416
|
body: {
|
|
4356
|
-
|
|
4417
|
+
tagIDs: ["#{tag_id}"]
|
|
4357
4418
|
},
|
|
4358
4419
|
headers: {
|
|
4359
4420
|
Accept: "application/json",
|
|
@@ -4945,7 +5006,7 @@ var webhookSpecs2 = {
|
|
|
4945
5006
|
required: [],
|
|
4946
5007
|
properties: {
|
|
4947
5008
|
targetAgentId: {
|
|
4948
|
-
|
|
5009
|
+
$ref: "#/$defs/livechat_agent",
|
|
4949
5010
|
title: "Target Agent email"
|
|
4950
5011
|
}
|
|
4951
5012
|
}
|
|
@@ -6303,12 +6364,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6303
6364
|
specification: {
|
|
6304
6365
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6305
6366
|
type: "object",
|
|
6306
|
-
required: ["list_id", "
|
|
6367
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6307
6368
|
properties: {
|
|
6308
6369
|
list_id: {
|
|
6309
|
-
type: "string",
|
|
6310
|
-
title: "Mailchimp audience ID",
|
|
6311
|
-
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.",
|
|
6312
6370
|
$ref: "#/$defs/mailchimp_audience"
|
|
6313
6371
|
},
|
|
6314
6372
|
email: {
|
|
@@ -6360,9 +6418,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6360
6418
|
required: ["list_id"],
|
|
6361
6419
|
properties: {
|
|
6362
6420
|
list_id: {
|
|
6363
|
-
type: "string",
|
|
6364
|
-
title: "Mailchimp audience ID",
|
|
6365
|
-
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.",
|
|
6366
6421
|
$ref: "#/$defs/mailchimp_audience"
|
|
6367
6422
|
}
|
|
6368
6423
|
}
|
|
@@ -6396,10 +6451,7 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6396
6451
|
required: ["campaign_id"],
|
|
6397
6452
|
properties: {
|
|
6398
6453
|
campaign_id: {
|
|
6399
|
-
|
|
6400
|
-
title: "Campaign ID",
|
|
6401
|
-
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=".`
|
|
6402
|
-
// $ref: '#/$defs/mailchimp_campaign',
|
|
6454
|
+
$ref: "#/$defs/mailchimp_campaign"
|
|
6403
6455
|
}
|
|
6404
6456
|
}
|
|
6405
6457
|
}),
|
|
@@ -6425,12 +6477,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6425
6477
|
specification: {
|
|
6426
6478
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6427
6479
|
type: "object",
|
|
6428
|
-
required: ["list_id", "
|
|
6480
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6429
6481
|
properties: {
|
|
6430
6482
|
list_id: {
|
|
6431
|
-
type: "string",
|
|
6432
|
-
title: "Mailchimp audience ID",
|
|
6433
|
-
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.",
|
|
6434
6483
|
$ref: "#/$defs/mailchimp_audience"
|
|
6435
6484
|
},
|
|
6436
6485
|
email: {
|
|
@@ -6474,12 +6523,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6474
6523
|
specification: {
|
|
6475
6524
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6476
6525
|
type: "object",
|
|
6477
|
-
required: ["list_id", "
|
|
6526
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6478
6527
|
properties: {
|
|
6479
6528
|
list_id: {
|
|
6480
|
-
type: "string",
|
|
6481
|
-
title: "Mailchimp audience ID",
|
|
6482
|
-
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.",
|
|
6483
6529
|
$ref: "#/$defs/mailchimp_audience"
|
|
6484
6530
|
},
|
|
6485
6531
|
email: {
|
|
@@ -6526,9 +6572,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6526
6572
|
required: ["list_id", "email"],
|
|
6527
6573
|
properties: {
|
|
6528
6574
|
list_id: {
|
|
6529
|
-
type: "string",
|
|
6530
|
-
title: "Mailchimp audience ID",
|
|
6531
|
-
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.",
|
|
6532
6575
|
$ref: "#/$defs/mailchimp_audience"
|
|
6533
6576
|
},
|
|
6534
6577
|
email: {
|
|
@@ -6562,9 +6605,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6562
6605
|
required: ["list_id", "email"],
|
|
6563
6606
|
properties: {
|
|
6564
6607
|
list_id: {
|
|
6565
|
-
type: "string",
|
|
6566
|
-
title: "Mailchimp audience ID",
|
|
6567
|
-
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.",
|
|
6568
6608
|
$ref: "#/$defs/mailchimp_audience"
|
|
6569
6609
|
},
|
|
6570
6610
|
email: {
|
|
@@ -6598,9 +6638,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6598
6638
|
required: ["list_id", "email", "tag"],
|
|
6599
6639
|
properties: {
|
|
6600
6640
|
list_id: {
|
|
6601
|
-
type: "string",
|
|
6602
|
-
title: "Mailchimp audience ID",
|
|
6603
|
-
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.",
|
|
6604
6641
|
$ref: "#/$defs/mailchimp_audience"
|
|
6605
6642
|
},
|
|
6606
6643
|
email: {
|
|
@@ -6639,9 +6676,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6639
6676
|
required: ["list_id", "email", "name"],
|
|
6640
6677
|
properties: {
|
|
6641
6678
|
list_id: {
|
|
6642
|
-
type: "string",
|
|
6643
|
-
title: "Mailchimp audience ID",
|
|
6644
|
-
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.",
|
|
6645
6679
|
$ref: "#/$defs/mailchimp_audience"
|
|
6646
6680
|
},
|
|
6647
6681
|
email: {
|
|
@@ -6696,9 +6730,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6696
6730
|
required: ["list_id", "email", "note"],
|
|
6697
6731
|
properties: {
|
|
6698
6732
|
list_id: {
|
|
6699
|
-
type: "string",
|
|
6700
|
-
title: "Mailchimp audience ID",
|
|
6701
|
-
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.",
|
|
6702
6733
|
$ref: "#/$defs/mailchimp_audience"
|
|
6703
6734
|
},
|
|
6704
6735
|
email: {
|
|
@@ -6737,9 +6768,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6737
6768
|
required: ["list_id", "email", "tag"],
|
|
6738
6769
|
properties: {
|
|
6739
6770
|
list_id: {
|
|
6740
|
-
type: "string",
|
|
6741
|
-
title: "Mailchimp audience ID",
|
|
6742
|
-
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.",
|
|
6743
6771
|
$ref: "#/$defs/mailchimp_audience"
|
|
6744
6772
|
},
|
|
6745
6773
|
email: {
|
|
@@ -6777,9 +6805,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6777
6805
|
required: ["list_id", "email"],
|
|
6778
6806
|
properties: {
|
|
6779
6807
|
list_id: {
|
|
6780
|
-
type: "string",
|
|
6781
|
-
title: "Mailchimp audience ID",
|
|
6782
|
-
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.",
|
|
6783
6808
|
$ref: "#/$defs/mailchimp_audience"
|
|
6784
6809
|
},
|
|
6785
6810
|
email: {
|
|
@@ -6843,9 +6868,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6843
6868
|
required: ["list_id", "email"],
|
|
6844
6869
|
properties: {
|
|
6845
6870
|
list_id: {
|
|
6846
|
-
type: "string",
|
|
6847
|
-
title: "Mailchimp audience ID",
|
|
6848
|
-
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.",
|
|
6849
6871
|
$ref: "#/$defs/mailchimp_audience"
|
|
6850
6872
|
},
|
|
6851
6873
|
email: {
|
|
@@ -7019,10 +7041,8 @@ var mailchimpTaskConfigs = () => ({
|
|
|
7019
7041
|
required: ["list_id", "query"],
|
|
7020
7042
|
properties: {
|
|
7021
7043
|
list_id: {
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
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.",
|
|
7025
|
-
$ref: "#/$defs/mailchimp_audience"
|
|
7044
|
+
$ref: "#/$defs/mailchimp_audience",
|
|
7045
|
+
minLength: 1
|
|
7026
7046
|
},
|
|
7027
7047
|
query: {
|
|
7028
7048
|
type: "string",
|
|
@@ -7196,10 +7216,7 @@ var mailchimpTaskConfigs = () => ({
|
|
|
7196
7216
|
required: ["campaign_id"],
|
|
7197
7217
|
properties: {
|
|
7198
7218
|
campaign_id: {
|
|
7199
|
-
|
|
7200
|
-
title: "Campaign ID",
|
|
7201
|
-
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=".`
|
|
7202
|
-
//$ref: '#/$defs/mailchimp_campaign'
|
|
7219
|
+
$ref: "#/$defs/mailchimp_campaign"
|
|
7203
7220
|
}
|
|
7204
7221
|
}
|
|
7205
7222
|
}),
|
|
@@ -9422,7 +9439,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9422
9439
|
},
|
|
9423
9440
|
...Object.values(WorkflowSpecification.config.tasks).map(
|
|
9424
9441
|
(config2) => {
|
|
9425
|
-
var _a, _b;
|
|
9442
|
+
var _a, _b, _c, _d;
|
|
9426
9443
|
return {
|
|
9427
9444
|
if: {
|
|
9428
9445
|
properties: {
|
|
@@ -9431,7 +9448,8 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9431
9448
|
}
|
|
9432
9449
|
},
|
|
9433
9450
|
then: WORKFLOW_HTTP_TASK_SCHEMA(config2.key, {
|
|
9434
|
-
|
|
9451
|
+
uri: (_b = (_a = config2.specification.input) == null ? void 0 : _a.properties) == null ? void 0 : _b.uri,
|
|
9452
|
+
body: (_d = (_c = config2.specification.input) == null ? void 0 : _c.properties) == null ? void 0 : _d.body
|
|
9435
9453
|
})
|
|
9436
9454
|
};
|
|
9437
9455
|
}
|
|
@@ -9458,6 +9476,9 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9458
9476
|
}),
|
|
9459
9477
|
$defs: {
|
|
9460
9478
|
mailchimp_audience: {
|
|
9479
|
+
type: "string",
|
|
9480
|
+
title: "Mailchimp audience ID",
|
|
9481
|
+
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.",
|
|
9461
9482
|
"x-ref": {
|
|
9462
9483
|
provider: "mailchimp",
|
|
9463
9484
|
product: "mailchimp",
|
|
@@ -9467,13 +9488,17 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9467
9488
|
}
|
|
9468
9489
|
},
|
|
9469
9490
|
mailchimp_campaign: {
|
|
9470
|
-
"
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9491
|
+
type: "string",
|
|
9492
|
+
title: "Campaign ID",
|
|
9493
|
+
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=".`
|
|
9494
|
+
// TODO WD: it not ready yet, but WIP on BE side
|
|
9495
|
+
// 'x-ref': {
|
|
9496
|
+
// provider: 'mailchimp',
|
|
9497
|
+
// product: 'mailchimp',
|
|
9498
|
+
// name: 'campaign',
|
|
9499
|
+
// displayField: 'name',
|
|
9500
|
+
// valueField: 'id'
|
|
9501
|
+
// }
|
|
9477
9502
|
},
|
|
9478
9503
|
helpdesk_ticket: {
|
|
9479
9504
|
title: "Ticket ID",
|
|
@@ -9505,7 +9530,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9505
9530
|
product: "helpdesk",
|
|
9506
9531
|
name: "agent",
|
|
9507
9532
|
displayField: "email",
|
|
9508
|
-
valueField: "
|
|
9533
|
+
valueField: "ID"
|
|
9509
9534
|
}
|
|
9510
9535
|
},
|
|
9511
9536
|
livechat_chat_id: {
|
|
@@ -12611,8 +12636,8 @@ var getWorkflowTemplates = () => [
|
|
|
12611
12636
|
];
|
|
12612
12637
|
|
|
12613
12638
|
// src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
|
|
12614
|
-
var
|
|
12615
|
-
var
|
|
12639
|
+
var import_react14 = require("react");
|
|
12640
|
+
var import_react_router_dom4 = require("react-router-dom");
|
|
12616
12641
|
var import_design_system_react_components4 = require("@livechat/design-system-react-components");
|
|
12617
12642
|
var import_developer_studio_api21 = require("@livechat/developer-studio-api");
|
|
12618
12643
|
var import_developer_studio_ui_react7 = require("@livechat/developer-studio-ui-react");
|
|
@@ -13063,8 +13088,8 @@ function ProductIcon({
|
|
|
13063
13088
|
var ProductIcon_default = ProductIcon;
|
|
13064
13089
|
|
|
13065
13090
|
// src/views/Workflows/Creator/Provider/index.tsx
|
|
13066
|
-
var
|
|
13067
|
-
var
|
|
13091
|
+
var import_react12 = require("react");
|
|
13092
|
+
var import_react_router_dom3 = require("react-router-dom");
|
|
13068
13093
|
var import_reactflow = require("reactflow");
|
|
13069
13094
|
var import_lodash = __toESM(require("lodash.debounce"));
|
|
13070
13095
|
var import_developer_studio_api20 = require("@livechat/developer-studio-api");
|
|
@@ -13304,15 +13329,36 @@ var DEFAULT_NODE_HEIGHT = {
|
|
|
13304
13329
|
default: 65
|
|
13305
13330
|
};
|
|
13306
13331
|
|
|
13307
|
-
// src/views/Workflows/Creator/Provider/
|
|
13332
|
+
// src/views/Workflows/Creator/Provider/navigation/hooks.ts
|
|
13308
13333
|
var import_react8 = require("react");
|
|
13334
|
+
var import_react_router_dom2 = require("react-router-dom");
|
|
13335
|
+
function useReplaceWorkflowIdInUrl() {
|
|
13336
|
+
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
13337
|
+
const location = (0, import_react_router_dom2.useLocation)();
|
|
13338
|
+
const { id } = (0, import_react_router_dom2.useParams)();
|
|
13339
|
+
const latestPathRef = (0, import_react8.useRef)(location.pathname);
|
|
13340
|
+
(0, import_react8.useEffect)(() => {
|
|
13341
|
+
latestPathRef.current = location.pathname;
|
|
13342
|
+
}, [location.pathname]);
|
|
13343
|
+
return (0, import_react8.useCallback)(
|
|
13344
|
+
(newId) => {
|
|
13345
|
+
if (!id) return;
|
|
13346
|
+
const latestPath = latestPathRef.current.replace(`/${id}`, `/${newId}`);
|
|
13347
|
+
navigate(latestPath, { replace: true });
|
|
13348
|
+
},
|
|
13349
|
+
[navigate, id]
|
|
13350
|
+
);
|
|
13351
|
+
}
|
|
13352
|
+
|
|
13353
|
+
// src/views/Workflows/Creator/Provider/state/data/hooks.ts
|
|
13354
|
+
var import_react9 = require("react");
|
|
13309
13355
|
function useWorkflowData(workflow) {
|
|
13310
|
-
const [actions, setActions] = (0,
|
|
13311
|
-
const [selection, setSelection] = (0,
|
|
13312
|
-
const [pendingWorkflow, setPendingWorkflow] = (0,
|
|
13356
|
+
const [actions, setActions] = (0, import_react9.useState)({});
|
|
13357
|
+
const [selection, setSelection] = (0, import_react9.useState)();
|
|
13358
|
+
const [pendingWorkflow, setPendingWorkflow] = (0, import_react9.useState)(
|
|
13313
13359
|
() => JSON.parse(JSON.stringify(workflow))
|
|
13314
13360
|
);
|
|
13315
|
-
const setAction = (0,
|
|
13361
|
+
const setAction = (0, import_react9.useCallback)(
|
|
13316
13362
|
(action, value) => {
|
|
13317
13363
|
setActions((prevState) => __spreadProps(__spreadValues({}, prevState), {
|
|
13318
13364
|
[action]: value
|
|
@@ -13320,10 +13366,10 @@ function useWorkflowData(workflow) {
|
|
|
13320
13366
|
},
|
|
13321
13367
|
[]
|
|
13322
13368
|
);
|
|
13323
|
-
(0,
|
|
13369
|
+
(0, import_react9.useEffect)(() => {
|
|
13324
13370
|
setPendingWorkflow(JSON.parse(JSON.stringify(workflow)));
|
|
13325
13371
|
setSelection((prevState) => {
|
|
13326
|
-
if ((prevState == null ? void 0 : prevState.kind) === "trigger") {
|
|
13372
|
+
if ((prevState == null ? void 0 : prevState.kind) === "trigger" && !workflow.trigger.type) {
|
|
13327
13373
|
return void 0;
|
|
13328
13374
|
}
|
|
13329
13375
|
if ((prevState == null ? void 0 : prevState.kind) === "task") {
|
|
@@ -13610,61 +13656,19 @@ var getWorkflowContexts = (workflow, external) => {
|
|
|
13610
13656
|
};
|
|
13611
13657
|
|
|
13612
13658
|
// src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
|
|
13613
|
-
var
|
|
13659
|
+
var import_react11 = require("react");
|
|
13614
13660
|
var import_platform_integrations2 = require("@livechat/platform-integrations");
|
|
13615
13661
|
|
|
13616
|
-
// src/hooks/user.ts
|
|
13617
|
-
var import_react_query3 = require("@tanstack/react-query");
|
|
13618
|
-
var import_developer_studio_api16 = require("@livechat/developer-studio-api");
|
|
13619
|
-
var userQueryKeys = {
|
|
13620
|
-
accounts: {
|
|
13621
|
-
account: {
|
|
13622
|
-
getInfo: ["accounts.account.getInfo"]
|
|
13623
|
-
},
|
|
13624
|
-
products: {
|
|
13625
|
-
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
13626
|
-
}
|
|
13627
|
-
},
|
|
13628
|
-
dps: {
|
|
13629
|
-
getUser: ["dps.getUser"],
|
|
13630
|
-
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
13631
|
-
}
|
|
13632
|
-
};
|
|
13633
|
-
var useFetchOrganizationProducts = () => {
|
|
13634
|
-
var _b;
|
|
13635
|
-
const _a = (0, import_react_query3.useQuery)(
|
|
13636
|
-
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
13637
|
-
() => import_developer_studio_api16.api.platform.accounts.products.getOrganizationProducts()
|
|
13638
|
-
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
13639
|
-
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
13640
|
-
};
|
|
13641
|
-
var useUpdateOrganizationProducts = () => {
|
|
13642
|
-
const queryClient = (0, import_react_query3.useQueryClient)();
|
|
13643
|
-
const { mutateAsync: updateOrganizationProducts, isLoading } = (0, import_react_query3.useMutation)(
|
|
13644
|
-
({ productName }) => import_developer_studio_api16.api.platform.accounts.products.updateOrganizationProducts({
|
|
13645
|
-
product: productName
|
|
13646
|
-
}),
|
|
13647
|
-
{
|
|
13648
|
-
onSuccess: (_) => {
|
|
13649
|
-
void queryClient.refetchQueries({
|
|
13650
|
-
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
13651
|
-
});
|
|
13652
|
-
}
|
|
13653
|
-
}
|
|
13654
|
-
);
|
|
13655
|
-
return { updateOrganizationProducts, isLoading };
|
|
13656
|
-
};
|
|
13657
|
-
|
|
13658
13662
|
// src/views/Workflows/Creator/Provider/state/metadata/utils.ts
|
|
13659
|
-
var
|
|
13663
|
+
var import_developer_studio_api16 = require("@livechat/developer-studio-api");
|
|
13660
13664
|
var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
|
|
13661
|
-
if (task2.type ===
|
|
13665
|
+
if (task2.type === import_developer_studio_api16.WorkflowDefinitionTaskType.switch) {
|
|
13662
13666
|
return [
|
|
13663
13667
|
task2,
|
|
13664
13668
|
...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a)),
|
|
13665
13669
|
...task2.defaultCase ? flattenTasks(task2.defaultCase) : []
|
|
13666
13670
|
];
|
|
13667
|
-
} else if (task2.type ===
|
|
13671
|
+
} else if (task2.type === import_developer_studio_api16.WorkflowDefinitionTaskType.forkJoin) {
|
|
13668
13672
|
return [task2, ...task2.forkTasks.flatMap((a) => flattenTasks(a))];
|
|
13669
13673
|
}
|
|
13670
13674
|
return [task2];
|
|
@@ -13673,15 +13677,59 @@ var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(task
|
|
|
13673
13677
|
// src/views/Workflows/Creator/Provider/state/metadata/validation/utils.ts
|
|
13674
13678
|
var import_ajv = __toESM(require("ajv"));
|
|
13675
13679
|
var import_ajv_errors = __toESM(require("ajv-errors"));
|
|
13676
|
-
var
|
|
13677
|
-
var
|
|
13680
|
+
var import_developer_studio_api17 = require("@livechat/developer-studio-api");
|
|
13681
|
+
var keywords = {
|
|
13682
|
+
urlWithQueryParams: {
|
|
13683
|
+
keyword: "queryParams",
|
|
13684
|
+
type: "string",
|
|
13685
|
+
schemaType: "object",
|
|
13686
|
+
metaSchema: {
|
|
13687
|
+
type: "object",
|
|
13688
|
+
properties: {
|
|
13689
|
+
queryParams: {
|
|
13690
|
+
type: "object"
|
|
13691
|
+
}
|
|
13692
|
+
}
|
|
13693
|
+
},
|
|
13694
|
+
error: {
|
|
13695
|
+
message: () => `This field cannot be empty`,
|
|
13696
|
+
params: (cxt) => import_ajv._`{ param: ${cxt.params.param} }`
|
|
13697
|
+
},
|
|
13698
|
+
code(cxt) {
|
|
13699
|
+
const { data, schema } = cxt;
|
|
13700
|
+
cxt.gen.if(
|
|
13701
|
+
import_ajv._`typeof ${data} === "string" && ${data}.includes("?")`,
|
|
13702
|
+
() => {
|
|
13703
|
+
const params = import_ajv._`Object.fromEntries(new URL(${data}).searchParams.entries())`;
|
|
13704
|
+
for (const param of Object.keys(schema.properties || {})) {
|
|
13705
|
+
cxt.gen.if(
|
|
13706
|
+
import_ajv._`!(${param} in ${params}) || ${params}[${param}].length <= 0`,
|
|
13707
|
+
() => {
|
|
13708
|
+
cxt.error(
|
|
13709
|
+
true,
|
|
13710
|
+
{ param },
|
|
13711
|
+
{
|
|
13712
|
+
instancePath: param
|
|
13713
|
+
}
|
|
13714
|
+
);
|
|
13715
|
+
}
|
|
13716
|
+
);
|
|
13717
|
+
}
|
|
13718
|
+
},
|
|
13719
|
+
() => {
|
|
13720
|
+
cxt.error(true, { param: "URL" });
|
|
13721
|
+
}
|
|
13722
|
+
);
|
|
13723
|
+
}
|
|
13724
|
+
}
|
|
13725
|
+
};
|
|
13726
|
+
var getValidator = () => (0, import_ajv_errors.default)(
|
|
13678
13727
|
new import_ajv.default({
|
|
13679
13728
|
strict: false,
|
|
13680
13729
|
allErrors: true
|
|
13681
|
-
})
|
|
13682
|
-
);
|
|
13683
|
-
var validateSchema = (workflow, frames) => {
|
|
13684
|
-
const validate = ajv.compile(WORKFLOW_SCHEMA());
|
|
13730
|
+
}).addKeyword(keywords.urlWithQueryParams)
|
|
13731
|
+
).compile(WORKFLOW_SCHEMA());
|
|
13732
|
+
var validateSchema = (workflow, frames, validateFunction) => {
|
|
13685
13733
|
const resolved = __spreadProps(__spreadValues({}, workflow), {
|
|
13686
13734
|
definition: __spreadProps(__spreadValues({}, workflow.definition), {
|
|
13687
13735
|
tasks: workflow.definition.tasks.map(
|
|
@@ -13702,8 +13750,8 @@ var validateSchema = (workflow, frames) => {
|
|
|
13702
13750
|
}
|
|
13703
13751
|
)
|
|
13704
13752
|
});
|
|
13705
|
-
|
|
13706
|
-
return
|
|
13753
|
+
validateFunction(resolved);
|
|
13754
|
+
return validateFunction.errors || [];
|
|
13707
13755
|
};
|
|
13708
13756
|
var validateTasks = (workflow, frames, products) => {
|
|
13709
13757
|
function taskCompiler(task2, baseInstancePath) {
|
|
@@ -13776,7 +13824,7 @@ var validateTasks = (workflow, frames, products) => {
|
|
|
13776
13824
|
params: {}
|
|
13777
13825
|
};
|
|
13778
13826
|
});
|
|
13779
|
-
const activationError = (config2 == null ? void 0 : config2.customization.provider.startsWith(
|
|
13827
|
+
const activationError = (config2 == null ? void 0 : config2.customization.provider.startsWith(import_developer_studio_api17.IntegrationNames.Text)) && !products.find(({ product }) => product === config2.customization.product) ? {
|
|
13780
13828
|
instancePath: baseInstancePath,
|
|
13781
13829
|
keyword: "activation",
|
|
13782
13830
|
message: `${config2.customization.product} not activated`,
|
|
@@ -13871,7 +13919,7 @@ var validateTrigger = (workflow, frames, products) => {
|
|
|
13871
13919
|
params: {}
|
|
13872
13920
|
};
|
|
13873
13921
|
});
|
|
13874
|
-
const activationError = config2 && config2.customization.provider.startsWith(
|
|
13922
|
+
const activationError = config2 && config2.customization.provider.startsWith(import_developer_studio_api17.IntegrationNames.Text) && !products.find(({ product }) => product === config2.customization.product) ? {
|
|
13875
13923
|
instancePath: "/trigger",
|
|
13876
13924
|
keyword: "activation",
|
|
13877
13925
|
message: `${config2.customization.product} not activated`,
|
|
@@ -14013,11 +14061,11 @@ function flattenErrorSchema(workflow, schema) {
|
|
|
14013
14061
|
}).filter(([, value]) => Boolean(value))
|
|
14014
14062
|
);
|
|
14015
14063
|
}
|
|
14016
|
-
var getWorkflowValidation = (workflow, internal, external) => {
|
|
14064
|
+
var getWorkflowValidation = (workflow, internal, external, validator3) => {
|
|
14017
14065
|
const rawErrors = [
|
|
14018
14066
|
...validateTrigger(workflow, internal.frames, external.products),
|
|
14019
14067
|
...validateTasks(workflow, internal.frames, external.products),
|
|
14020
|
-
...validateSchema(workflow, internal.frames)
|
|
14068
|
+
...validateSchema(workflow, internal.frames, validator3)
|
|
14021
14069
|
].filter(
|
|
14022
14070
|
(rawError) => Boolean(rawError)
|
|
14023
14071
|
).map((rawError) => {
|
|
@@ -14071,11 +14119,74 @@ var getWorkflowValidation = (workflow, internal, external) => {
|
|
|
14071
14119
|
};
|
|
14072
14120
|
};
|
|
14073
14121
|
|
|
14122
|
+
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
14123
|
+
var import_react10 = require("react");
|
|
14124
|
+
|
|
14125
|
+
// src/hooks/user.ts
|
|
14126
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
14127
|
+
var import_developer_studio_api18 = require("@livechat/developer-studio-api");
|
|
14128
|
+
var userQueryKeys = {
|
|
14129
|
+
accounts: {
|
|
14130
|
+
account: {
|
|
14131
|
+
getInfo: ["accounts.account.getInfo"]
|
|
14132
|
+
},
|
|
14133
|
+
products: {
|
|
14134
|
+
getOrganizationProducts: ["accounts.products.getOrganizationProducts"]
|
|
14135
|
+
}
|
|
14136
|
+
},
|
|
14137
|
+
dps: {
|
|
14138
|
+
getUser: ["dps.getUser"],
|
|
14139
|
+
getUserIntegrations: ["dps.getUserIntegrations"]
|
|
14140
|
+
}
|
|
14141
|
+
};
|
|
14142
|
+
var useFetchOrganizationProducts = () => {
|
|
14143
|
+
var _b;
|
|
14144
|
+
const _a = (0, import_react_query3.useQuery)(
|
|
14145
|
+
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
14146
|
+
() => import_developer_studio_api18.api.platform.accounts.products.getOrganizationProducts()
|
|
14147
|
+
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
14148
|
+
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
14149
|
+
};
|
|
14150
|
+
var useUpdateOrganizationProducts = () => {
|
|
14151
|
+
const queryClient = (0, import_react_query3.useQueryClient)();
|
|
14152
|
+
const { mutateAsync: updateOrganizationProducts, isLoading } = (0, import_react_query3.useMutation)(
|
|
14153
|
+
({ productName }) => import_developer_studio_api18.api.platform.accounts.products.updateOrganizationProducts({
|
|
14154
|
+
product: productName
|
|
14155
|
+
}),
|
|
14156
|
+
{
|
|
14157
|
+
onSuccess: (_2) => {
|
|
14158
|
+
void queryClient.refetchQueries({
|
|
14159
|
+
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
14160
|
+
});
|
|
14161
|
+
}
|
|
14162
|
+
}
|
|
14163
|
+
);
|
|
14164
|
+
return { updateOrganizationProducts, isLoading };
|
|
14165
|
+
};
|
|
14166
|
+
|
|
14167
|
+
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
14168
|
+
function useWorkflowValidator() {
|
|
14169
|
+
const organizationProducts = useFetchOrganizationProducts();
|
|
14170
|
+
const validator3 = (0, import_react10.useMemo)(getValidator, []);
|
|
14171
|
+
const validate = (0, import_react10.useCallback)(
|
|
14172
|
+
(workflow, internal) => getWorkflowValidation(
|
|
14173
|
+
workflow,
|
|
14174
|
+
internal,
|
|
14175
|
+
{
|
|
14176
|
+
products: organizationProducts.data
|
|
14177
|
+
},
|
|
14178
|
+
validator3
|
|
14179
|
+
),
|
|
14180
|
+
[validator3, organizationProducts.data]
|
|
14181
|
+
);
|
|
14182
|
+
return validate;
|
|
14183
|
+
}
|
|
14184
|
+
|
|
14074
14185
|
// src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
|
|
14075
14186
|
function useWorkflowMetadata(workflow) {
|
|
14076
14187
|
const credentialsQuery = (0, import_platform_integrations2.useFetchIntegrationCredentialsQuery)();
|
|
14077
|
-
const
|
|
14078
|
-
const metadata = (0,
|
|
14188
|
+
const validator3 = useWorkflowValidator();
|
|
14189
|
+
const metadata = (0, import_react11.useMemo)(() => {
|
|
14079
14190
|
var _a;
|
|
14080
14191
|
const elements = {
|
|
14081
14192
|
trigger: workflow.trigger,
|
|
@@ -14089,19 +14200,13 @@ function useWorkflowMetadata(workflow) {
|
|
|
14089
14200
|
const frames = getWorkflowContexts(workflow, {
|
|
14090
14201
|
credentials: (_a = credentialsQuery.data) != null ? _a : []
|
|
14091
14202
|
});
|
|
14092
|
-
const validation =
|
|
14093
|
-
workflow,
|
|
14094
|
-
{ frames },
|
|
14095
|
-
{
|
|
14096
|
-
products: organizationProducts.data
|
|
14097
|
-
}
|
|
14098
|
-
);
|
|
14203
|
+
const validation = validator3(workflow, { frames });
|
|
14099
14204
|
return {
|
|
14100
14205
|
elements,
|
|
14101
14206
|
frames,
|
|
14102
14207
|
validation
|
|
14103
14208
|
};
|
|
14104
|
-
}, [workflow, credentialsQuery.data
|
|
14209
|
+
}, [validator3, workflow, credentialsQuery.data]);
|
|
14105
14210
|
return {
|
|
14106
14211
|
metadata
|
|
14107
14212
|
};
|
|
@@ -14198,8 +14303,9 @@ function WorkflowCreatorProviderBase({
|
|
|
14198
14303
|
}) {
|
|
14199
14304
|
var _a, _b;
|
|
14200
14305
|
const { fitView } = (0, import_reactflow.useReactFlow)();
|
|
14201
|
-
const navigate = (0,
|
|
14306
|
+
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
14202
14307
|
const notifications = (0, import_developer_studio_ui_react5.useNotificationContext)();
|
|
14308
|
+
const replaceWorkflowId = useReplaceWorkflowIdInUrl();
|
|
14203
14309
|
const createWorkflowAction = useCreateWorkflow();
|
|
14204
14310
|
const createWorkflowDraftAction = useCreateWorkflowDraft();
|
|
14205
14311
|
const updateWorkflowAction = useUpdateWorkflow();
|
|
@@ -14210,22 +14316,22 @@ function WorkflowCreatorProviderBase({
|
|
|
14210
14316
|
state,
|
|
14211
14317
|
updaters: { setWorkflow, setAction, setSelection }
|
|
14212
14318
|
} = useWorkflowState(workflow, options);
|
|
14213
|
-
const autosaveStateRef = (0,
|
|
14214
|
-
const autosaveWorkflowRef = (0,
|
|
14319
|
+
const autosaveStateRef = (0, import_react12.useRef)(state);
|
|
14320
|
+
const autosaveWorkflowRef = (0, import_react12.useRef)(
|
|
14215
14321
|
(0, import_lodash.default)(() => __async(this, null, function* () {
|
|
14216
14322
|
yield save(true);
|
|
14217
14323
|
}), 500)
|
|
14218
14324
|
);
|
|
14219
14325
|
const autosaveWorkflow = autosaveWorkflowRef.current;
|
|
14220
|
-
(0,
|
|
14326
|
+
(0, import_react12.useEffect)(() => {
|
|
14221
14327
|
return () => {
|
|
14222
14328
|
autosaveWorkflow.cancel();
|
|
14223
14329
|
};
|
|
14224
14330
|
}, [autosaveWorkflow]);
|
|
14225
|
-
(0,
|
|
14331
|
+
(0, import_react12.useEffect)(() => {
|
|
14226
14332
|
autosaveStateRef.current = state;
|
|
14227
14333
|
}, [state]);
|
|
14228
|
-
const focus = (0,
|
|
14334
|
+
const focus = (0, import_react12.useCallback)(
|
|
14229
14335
|
(identifier2) => {
|
|
14230
14336
|
setTimeout(
|
|
14231
14337
|
() => fitView(
|
|
@@ -14246,7 +14352,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14246
14352
|
},
|
|
14247
14353
|
[fitView]
|
|
14248
14354
|
);
|
|
14249
|
-
const toggle = (0,
|
|
14355
|
+
const toggle = (0, import_react12.useCallback)(
|
|
14250
14356
|
(params) => {
|
|
14251
14357
|
setTimeout(() => {
|
|
14252
14358
|
setSelection(() => {
|
|
@@ -14270,7 +14376,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14270
14376
|
},
|
|
14271
14377
|
[focus, setSelection]
|
|
14272
14378
|
);
|
|
14273
|
-
const validate = (0,
|
|
14379
|
+
const validate = (0, import_react12.useCallback)(() => {
|
|
14274
14380
|
var _a2;
|
|
14275
14381
|
const state2 = autosaveStateRef.current;
|
|
14276
14382
|
if (((_a2 = options == null ? void 0 : options.validation) == null ? void 0 : _a2.strategy) !== "non-blocking" && !state2.metadata.validation.isValid) {
|
|
@@ -14301,21 +14407,21 @@ function WorkflowCreatorProviderBase({
|
|
|
14301
14407
|
}
|
|
14302
14408
|
return true;
|
|
14303
14409
|
}, [(_a = options == null ? void 0 : options.validation) == null ? void 0 : _a.strategy, toggle]);
|
|
14304
|
-
const replaceWorkflow = (0,
|
|
14410
|
+
const replaceWorkflow = (0, import_react12.useCallback)(
|
|
14305
14411
|
(workflow2) => {
|
|
14306
14412
|
setWorkflow(workflow2);
|
|
14307
14413
|
void autosaveWorkflowRef.current();
|
|
14308
14414
|
},
|
|
14309
14415
|
[autosaveWorkflowRef, setWorkflow]
|
|
14310
14416
|
);
|
|
14311
|
-
const changeWorkflow = (0,
|
|
14417
|
+
const changeWorkflow = (0, import_react12.useCallback)(
|
|
14312
14418
|
(change) => {
|
|
14313
14419
|
setWorkflow((prevState) => applyChange(prevState, change(prevState)));
|
|
14314
14420
|
void autosaveWorkflowRef.current();
|
|
14315
14421
|
},
|
|
14316
14422
|
[autosaveWorkflowRef, setWorkflow]
|
|
14317
14423
|
);
|
|
14318
|
-
const goToAddTrigger = (0,
|
|
14424
|
+
const goToAddTrigger = (0, import_react12.useCallback)(() => {
|
|
14319
14425
|
navigate(
|
|
14320
14426
|
`${basePath}/trigger/${OTHER_TYPES.SYSTEM}/${"manual" /* Manual */}`,
|
|
14321
14427
|
{
|
|
@@ -14325,7 +14431,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14325
14431
|
}
|
|
14326
14432
|
);
|
|
14327
14433
|
}, [basePath, navigate]);
|
|
14328
|
-
const addTrigger = (0,
|
|
14434
|
+
const addTrigger = (0, import_react12.useCallback)(
|
|
14329
14435
|
(trigger) => {
|
|
14330
14436
|
changeWorkflow(() => ({
|
|
14331
14437
|
trigger
|
|
@@ -14339,7 +14445,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14339
14445
|
},
|
|
14340
14446
|
[changeWorkflow, toggle]
|
|
14341
14447
|
);
|
|
14342
|
-
const updateTrigger = (0,
|
|
14448
|
+
const updateTrigger = (0, import_react12.useCallback)(
|
|
14343
14449
|
(trigger) => {
|
|
14344
14450
|
changeWorkflow(() => ({
|
|
14345
14451
|
trigger
|
|
@@ -14347,7 +14453,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14347
14453
|
},
|
|
14348
14454
|
[changeWorkflow]
|
|
14349
14455
|
);
|
|
14350
|
-
const removeTrigger = (0,
|
|
14456
|
+
const removeTrigger = (0, import_react12.useCallback)(() => {
|
|
14351
14457
|
var _a2;
|
|
14352
14458
|
const state2 = autosaveStateRef.current;
|
|
14353
14459
|
replaceWorkflow(__spreadProps(__spreadValues({}, state2.workflow), {
|
|
@@ -14357,7 +14463,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14357
14463
|
toggle();
|
|
14358
14464
|
}
|
|
14359
14465
|
}, [replaceWorkflow, toggle]);
|
|
14360
|
-
const goToAddTask = (0,
|
|
14466
|
+
const goToAddTask = (0, import_react12.useCallback)(
|
|
14361
14467
|
(taskReference, parentTaskReference) => {
|
|
14362
14468
|
navigate(`${basePath}/add`, {
|
|
14363
14469
|
state: {
|
|
@@ -14369,7 +14475,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14369
14475
|
},
|
|
14370
14476
|
[state.metadata.frames, navigate, basePath]
|
|
14371
14477
|
);
|
|
14372
|
-
const addTask = (0,
|
|
14478
|
+
const addTask = (0, import_react12.useCallback)(
|
|
14373
14479
|
(task2, targetTaskReference, parentTaskReference) => {
|
|
14374
14480
|
var _a2;
|
|
14375
14481
|
const existingTasks = Object.values(state.metadata.elements.tasks).filter((x) => x.taskReferenceName.includes(task2.taskReferenceName)).sort((a, b) => {
|
|
@@ -14478,7 +14584,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14478
14584
|
},
|
|
14479
14585
|
[state.workflow.definition.tasks, changeWorkflow, toggle]
|
|
14480
14586
|
);
|
|
14481
|
-
const updateTask = (0,
|
|
14587
|
+
const updateTask = (0, import_react12.useCallback)(
|
|
14482
14588
|
(targetTaskReferenceName, targetTask) => {
|
|
14483
14589
|
changeWorkflow((workflow2) => ({
|
|
14484
14590
|
definition: {
|
|
@@ -14495,7 +14601,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14495
14601
|
},
|
|
14496
14602
|
[changeWorkflow]
|
|
14497
14603
|
);
|
|
14498
|
-
const removeTask = (0,
|
|
14604
|
+
const removeTask = (0, import_react12.useCallback)(
|
|
14499
14605
|
(targetTaskReferenceName) => {
|
|
14500
14606
|
var _a2;
|
|
14501
14607
|
changeWorkflow((workflow2) => ({
|
|
@@ -14516,7 +14622,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14516
14622
|
},
|
|
14517
14623
|
[(_b = state.selection) == null ? void 0 : _b.id, changeWorkflow, toggle]
|
|
14518
14624
|
);
|
|
14519
|
-
const save = (0,
|
|
14625
|
+
const save = (0, import_react12.useCallback)(
|
|
14520
14626
|
(silent) => __async(this, null, function* () {
|
|
14521
14627
|
const state2 = autosaveStateRef.current;
|
|
14522
14628
|
if (!state2.workflow.draft && !validate()) {
|
|
@@ -14545,7 +14651,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14545
14651
|
"Workflow has been created successfully"
|
|
14546
14652
|
);
|
|
14547
14653
|
}
|
|
14548
|
-
|
|
14654
|
+
replaceWorkflowId(workflowId);
|
|
14549
14655
|
}
|
|
14550
14656
|
} finally {
|
|
14551
14657
|
setAction("isSaving", false);
|
|
@@ -14555,13 +14661,13 @@ function WorkflowCreatorProviderBase({
|
|
|
14555
14661
|
createWorkflowAction,
|
|
14556
14662
|
updateWorkflowAction,
|
|
14557
14663
|
notifications,
|
|
14664
|
+
replaceWorkflowId,
|
|
14558
14665
|
validate,
|
|
14559
|
-
navigate,
|
|
14560
14666
|
setWorkflow,
|
|
14561
14667
|
setAction
|
|
14562
14668
|
]
|
|
14563
14669
|
);
|
|
14564
|
-
const activate = (0,
|
|
14670
|
+
const activate = (0, import_react12.useCallback)(() => __async(this, null, function* () {
|
|
14565
14671
|
const state2 = autosaveStateRef.current;
|
|
14566
14672
|
if (state2.workflow.draft) {
|
|
14567
14673
|
return;
|
|
@@ -14585,7 +14691,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14585
14691
|
setAction("isActivating", false);
|
|
14586
14692
|
}
|
|
14587
14693
|
}), [activateWorkflowAction, notifications, validate, setWorkflow, setAction]);
|
|
14588
|
-
const remove = (0,
|
|
14694
|
+
const remove = (0, import_react12.useCallback)(() => __async(this, null, function* () {
|
|
14589
14695
|
const state2 = autosaveStateRef.current;
|
|
14590
14696
|
setAction("isRemoving", true);
|
|
14591
14697
|
try {
|
|
@@ -14604,7 +14710,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14604
14710
|
setAction("isRemoving", false);
|
|
14605
14711
|
}
|
|
14606
14712
|
}), [setAction, navigate, notifications, deleteWorkflowAction]);
|
|
14607
|
-
const createDraft = (0,
|
|
14713
|
+
const createDraft = (0, import_react12.useCallback)(
|
|
14608
14714
|
(options2) => __async(this, null, function* () {
|
|
14609
14715
|
const state2 = autosaveStateRef.current;
|
|
14610
14716
|
if (state2.workflow.draft) {
|
|
@@ -14642,7 +14748,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14642
14748
|
setAction
|
|
14643
14749
|
]
|
|
14644
14750
|
);
|
|
14645
|
-
const publishDraft = (0,
|
|
14751
|
+
const publishDraft = (0, import_react12.useCallback)(
|
|
14646
14752
|
(options2) => __async(this, null, function* () {
|
|
14647
14753
|
var _a2;
|
|
14648
14754
|
const state2 = autosaveStateRef.current;
|
|
@@ -14687,7 +14793,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14687
14793
|
createWorkflowAction
|
|
14688
14794
|
]
|
|
14689
14795
|
);
|
|
14690
|
-
const discardDraft = (0,
|
|
14796
|
+
const discardDraft = (0, import_react12.useCallback)(() => __async(this, null, function* () {
|
|
14691
14797
|
const state2 = autosaveStateRef.current;
|
|
14692
14798
|
setAction("isDiscarding", true);
|
|
14693
14799
|
try {
|
|
@@ -14714,7 +14820,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14714
14820
|
setAction("isDiscarding", false);
|
|
14715
14821
|
}
|
|
14716
14822
|
}), [deleteWorkflowAction, notifications, navigate, setAction]);
|
|
14717
|
-
const [previewModalVisible, setPreviewModalVisible] = (0,
|
|
14823
|
+
const [previewModalVisible, setPreviewModalVisible] = (0, import_react12.useState)({ isVisible: false });
|
|
14718
14824
|
return /* @__PURE__ */ jsx4(
|
|
14719
14825
|
WorkflowCreatorContext.Provider,
|
|
14720
14826
|
{
|
|
@@ -14750,14 +14856,14 @@ function WorkflowCreatorProviderBase({
|
|
|
14750
14856
|
}
|
|
14751
14857
|
);
|
|
14752
14858
|
}
|
|
14753
|
-
var WorkflowCreatorContext = (0,
|
|
14859
|
+
var WorkflowCreatorContext = (0, import_react12.createContext)(
|
|
14754
14860
|
null
|
|
14755
14861
|
);
|
|
14756
14862
|
function WorkflowCreatorProvider(props) {
|
|
14757
14863
|
return /* @__PURE__ */ jsx4(OneWidgetProvider, { children: /* @__PURE__ */ jsx4(OneMessagesProvider, { children: /* @__PURE__ */ jsx4(import_reactflow.ReactFlowProvider, { children: /* @__PURE__ */ jsx4(WorkflowCreatorProviderBase, __spreadValues({}, props)) }) }) });
|
|
14758
14864
|
}
|
|
14759
14865
|
function useWorkflowCreator() {
|
|
14760
|
-
const context = (0,
|
|
14866
|
+
const context = (0, import_react12.useContext)(WorkflowCreatorContext);
|
|
14761
14867
|
if (context === void 0) {
|
|
14762
14868
|
throw new Error("useWorkflowContext must be used within a WorkflowContext");
|
|
14763
14869
|
}
|
|
@@ -14788,7 +14894,16 @@ var itemOptionCss = (active) => css`
|
|
|
14788
14894
|
`;
|
|
14789
14895
|
function ItemOption({ option, onClick, active }) {
|
|
14790
14896
|
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss(active), onClick, children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react6.Column, { setColumnPadding: "0", width: 6, children: [
|
|
14791
|
-
/* @__PURE__ */ jsx4(
|
|
14897
|
+
/* @__PURE__ */ jsx4(
|
|
14898
|
+
import_design_system_react_components3.Text,
|
|
14899
|
+
{
|
|
14900
|
+
noMargin: true,
|
|
14901
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCard(
|
|
14902
|
+
option.key
|
|
14903
|
+
),
|
|
14904
|
+
children: option.name
|
|
14905
|
+
}
|
|
14906
|
+
),
|
|
14792
14907
|
/* @__PURE__ */ jsx4(
|
|
14793
14908
|
import_design_system_react_components3.Text,
|
|
14794
14909
|
{
|
|
@@ -14850,12 +14965,12 @@ var Options_default = AddWorkflowTaskOptions;
|
|
|
14850
14965
|
// src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
|
|
14851
14966
|
function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
14852
14967
|
var _a;
|
|
14853
|
-
const [search, setSearch] = (0,
|
|
14854
|
-
const location = (0,
|
|
14855
|
-
const navigate = (0,
|
|
14856
|
-
const params = (0,
|
|
14857
|
-
const [state, setState] = (0,
|
|
14858
|
-
const config2 = (0,
|
|
14968
|
+
const [search, setSearch] = (0, import_react14.useState)("");
|
|
14969
|
+
const location = (0, import_react_router_dom4.useLocation)();
|
|
14970
|
+
const navigate = (0, import_react_router_dom4.useNavigate)();
|
|
14971
|
+
const params = (0, import_react_router_dom4.useParams)();
|
|
14972
|
+
const [state, setState] = (0, import_react14.useState)();
|
|
14973
|
+
const config2 = (0, import_react14.useMemo)(
|
|
14859
14974
|
() => [
|
|
14860
14975
|
// {
|
|
14861
14976
|
// name: "system",
|
|
@@ -15015,7 +15130,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15015
15130
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15016
15131
|
user == null ? void 0 : user.meta.email
|
|
15017
15132
|
);
|
|
15018
|
-
(0,
|
|
15133
|
+
(0, import_react14.useEffect)(() => {
|
|
15019
15134
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
15020
15135
|
if (!params.task) {
|
|
15021
15136
|
const service = (_a2 = params.service) != null ? _a2 : "livechat";
|
|
@@ -15095,12 +15210,14 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15095
15210
|
handleAddTask(state == null ? void 0 : state.task);
|
|
15096
15211
|
},
|
|
15097
15212
|
size: "medium",
|
|
15213
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.saveButton,
|
|
15098
15214
|
children: "Add task"
|
|
15099
15215
|
}
|
|
15100
15216
|
)
|
|
15101
15217
|
] }),
|
|
15102
15218
|
heading: /* @__PURE__ */ jsx4(import_design_system_react_components4.ModalHeader, { title: "Add task" }),
|
|
15103
15219
|
onClose,
|
|
15220
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.wrapper,
|
|
15104
15221
|
children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react7.Row, { notPadded: true, children: [
|
|
15105
15222
|
/* @__PURE__ */ jsxs2(
|
|
15106
15223
|
import_developer_studio_ui_react7.Column,
|
|
@@ -15180,7 +15297,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15180
15297
|
children: [
|
|
15181
15298
|
icon2,
|
|
15182
15299
|
/* @__PURE__ */ jsx4(
|
|
15183
|
-
|
|
15300
|
+
import_react_router_dom4.NavLink,
|
|
15184
15301
|
{
|
|
15185
15302
|
className: ({ isActive }) => isActive ? "active" : "",
|
|
15186
15303
|
css: css`
|
|
@@ -15189,7 +15306,16 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15189
15306
|
end: false,
|
|
15190
15307
|
state: location.state,
|
|
15191
15308
|
to: `${basePath}/${name}`,
|
|
15192
|
-
children: /* @__PURE__ */ jsx4(
|
|
15309
|
+
children: /* @__PURE__ */ jsx4(
|
|
15310
|
+
import_developer_studio_ui_react7.Text,
|
|
15311
|
+
{
|
|
15312
|
+
size: "md",
|
|
15313
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCategoryButton(
|
|
15314
|
+
name
|
|
15315
|
+
),
|
|
15316
|
+
children: displayName
|
|
15317
|
+
}
|
|
15318
|
+
)
|
|
15193
15319
|
}
|
|
15194
15320
|
)
|
|
15195
15321
|
]
|
|
@@ -15242,8 +15368,8 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15242
15368
|
var Modal_default = AddWorkflowTaskModal;
|
|
15243
15369
|
|
|
15244
15370
|
// src/views/Workflows/Creator/Modals/AddTrigger/Modal.tsx
|
|
15245
|
-
var
|
|
15246
|
-
var
|
|
15371
|
+
var import_react17 = require("react");
|
|
15372
|
+
var import_react_router_dom5 = require("react-router-dom");
|
|
15247
15373
|
var import_design_system_react_components6 = require("@livechat/design-system-react-components");
|
|
15248
15374
|
var import_developer_studio_api22 = require("@livechat/developer-studio-api");
|
|
15249
15375
|
var import_developer_studio_ui_react9 = require("@livechat/developer-studio-ui-react");
|
|
@@ -15272,7 +15398,17 @@ var itemOptionCss2 = (active) => css`
|
|
|
15272
15398
|
`;
|
|
15273
15399
|
function ItemOption2({ option, onClick, active }) {
|
|
15274
15400
|
return /* @__PURE__ */ jsx4("div", { css: itemOptionCss2(active), onClick, children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react8.Column, { setColumnPadding: "0", width: 6, children: [
|
|
15275
|
-
/* @__PURE__ */ jsx4(
|
|
15401
|
+
/* @__PURE__ */ jsx4(
|
|
15402
|
+
import_design_system_react_components5.Text,
|
|
15403
|
+
{
|
|
15404
|
+
bold: true,
|
|
15405
|
+
noMargin: true,
|
|
15406
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCard(
|
|
15407
|
+
option.key
|
|
15408
|
+
),
|
|
15409
|
+
children: option.name
|
|
15410
|
+
}
|
|
15411
|
+
),
|
|
15276
15412
|
/* @__PURE__ */ jsx4(
|
|
15277
15413
|
import_design_system_react_components5.Text,
|
|
15278
15414
|
{
|
|
@@ -15336,8 +15472,8 @@ function AddWorkflowTriggerModal({
|
|
|
15336
15472
|
basePath,
|
|
15337
15473
|
onClose
|
|
15338
15474
|
}) {
|
|
15339
|
-
const [search, setSearch] = (0,
|
|
15340
|
-
const config2 = (0,
|
|
15475
|
+
const [search, setSearch] = (0, import_react17.useState)("");
|
|
15476
|
+
const config2 = (0, import_react17.useMemo)(
|
|
15341
15477
|
() => [
|
|
15342
15478
|
{
|
|
15343
15479
|
name: OTHER_TYPES.SYSTEM,
|
|
@@ -15463,16 +15599,16 @@ function AddWorkflowTriggerModal({
|
|
|
15463
15599
|
],
|
|
15464
15600
|
[]
|
|
15465
15601
|
);
|
|
15466
|
-
const location = (0,
|
|
15467
|
-
const navigate = (0,
|
|
15468
|
-
const params = (0,
|
|
15469
|
-
const [state, setState] = (0,
|
|
15602
|
+
const location = (0, import_react_router_dom5.useLocation)();
|
|
15603
|
+
const navigate = (0, import_react_router_dom5.useNavigate)();
|
|
15604
|
+
const params = (0, import_react_router_dom5.useParams)();
|
|
15605
|
+
const [state, setState] = (0, import_react17.useState)();
|
|
15470
15606
|
const { addTrigger } = useWorkflowCreator();
|
|
15471
15607
|
const { user } = (0, import_developer_studio_ui_react9.useUserContext)();
|
|
15472
15608
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15473
15609
|
user == null ? void 0 : user.meta.email
|
|
15474
15610
|
);
|
|
15475
|
-
(0,
|
|
15611
|
+
(0, import_react17.useEffect)(() => {
|
|
15476
15612
|
var _a, _b;
|
|
15477
15613
|
if (!params.trigger) {
|
|
15478
15614
|
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;
|
|
@@ -15511,12 +15647,14 @@ function AddWorkflowTriggerModal({
|
|
|
15511
15647
|
handleAddTrigger(state == null ? void 0 : state.trigger);
|
|
15512
15648
|
},
|
|
15513
15649
|
size: "medium",
|
|
15650
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.saveButton,
|
|
15514
15651
|
children: "Add trigger"
|
|
15515
15652
|
}
|
|
15516
15653
|
)
|
|
15517
15654
|
] }),
|
|
15518
15655
|
heading: /* @__PURE__ */ jsx4(import_design_system_react_components6.ModalHeader, { title: "Add trigger" }),
|
|
15519
15656
|
onClose,
|
|
15657
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.wrapper,
|
|
15520
15658
|
children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react9.Row, { notPadded: true, children: [
|
|
15521
15659
|
/* @__PURE__ */ jsxs2(
|
|
15522
15660
|
import_developer_studio_ui_react9.Column,
|
|
@@ -15596,7 +15734,7 @@ function AddWorkflowTriggerModal({
|
|
|
15596
15734
|
children: [
|
|
15597
15735
|
icon2,
|
|
15598
15736
|
/* @__PURE__ */ jsx4(
|
|
15599
|
-
|
|
15737
|
+
import_react_router_dom5.NavLink,
|
|
15600
15738
|
{
|
|
15601
15739
|
className: ({ isActive }) => isActive ? "active" : "",
|
|
15602
15740
|
css: css`
|
|
@@ -15605,7 +15743,16 @@ function AddWorkflowTriggerModal({
|
|
|
15605
15743
|
end: false,
|
|
15606
15744
|
state: location.state,
|
|
15607
15745
|
to: `${basePath}/${name}`,
|
|
15608
|
-
children: /* @__PURE__ */ jsx4(
|
|
15746
|
+
children: /* @__PURE__ */ jsx4(
|
|
15747
|
+
import_developer_studio_ui_react9.Text,
|
|
15748
|
+
{
|
|
15749
|
+
size: "md",
|
|
15750
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCategoryButton(
|
|
15751
|
+
name
|
|
15752
|
+
),
|
|
15753
|
+
children: displayName
|
|
15754
|
+
}
|
|
15755
|
+
)
|
|
15609
15756
|
}
|
|
15610
15757
|
)
|
|
15611
15758
|
]
|
|
@@ -15724,13 +15871,13 @@ function DeleteWorkflowModal({
|
|
|
15724
15871
|
}
|
|
15725
15872
|
|
|
15726
15873
|
// src/views/Workflows/Creator/Modals/Edit/Modal.tsx
|
|
15727
|
-
var
|
|
15874
|
+
var import_react_router_dom6 = require("react-router-dom");
|
|
15728
15875
|
var import_design_system_icons4 = require("@livechat/design-system-icons");
|
|
15729
15876
|
var import_design_system_react_components8 = require("@livechat/design-system-react-components");
|
|
15730
15877
|
var import_developer_studio_ui_react11 = require("@livechat/developer-studio-ui-react");
|
|
15731
15878
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
15732
15879
|
function EditWorkflowModal({ onClose }) {
|
|
15733
|
-
const navigate = (0,
|
|
15880
|
+
const navigate = (0, import_react_router_dom6.useNavigate)();
|
|
15734
15881
|
const {
|
|
15735
15882
|
state: {
|
|
15736
15883
|
workflow,
|
|
@@ -15787,7 +15934,7 @@ function EditWorkflowModal({ onClose }) {
|
|
|
15787
15934
|
}
|
|
15788
15935
|
|
|
15789
15936
|
// src/views/Workflows/Creator/Modals/Execute/Modal.tsx
|
|
15790
|
-
var
|
|
15937
|
+
var import_react19 = require("react");
|
|
15791
15938
|
var import_react_final_form = require("react-final-form");
|
|
15792
15939
|
var import_validator = __toESM(require("validator"));
|
|
15793
15940
|
var import_design_system_react_components9 = require("@livechat/design-system-react-components");
|
|
@@ -15796,7 +15943,7 @@ function ExecuteWorkflowModal({
|
|
|
15796
15943
|
onClose
|
|
15797
15944
|
}) {
|
|
15798
15945
|
const executeMutation = useExecuteWorkflow();
|
|
15799
|
-
const onSubmit = (0,
|
|
15946
|
+
const onSubmit = (0, import_react19.useCallback)(
|
|
15800
15947
|
(data) => __async(this, null, function* () {
|
|
15801
15948
|
yield executeMutation.mutateAsync({
|
|
15802
15949
|
workflow,
|
|
@@ -15878,8 +16025,8 @@ function ExecuteWorkflowModal({
|
|
|
15878
16025
|
var Modal_default3 = ExecuteWorkflowModal;
|
|
15879
16026
|
|
|
15880
16027
|
// src/views/Workflows/Creator/Modals/Preview/Modal.tsx
|
|
15881
|
-
var
|
|
15882
|
-
var
|
|
16028
|
+
var import_react87 = require("react");
|
|
16029
|
+
var import_react_router_dom12 = require("react-router-dom");
|
|
15883
16030
|
|
|
15884
16031
|
// ../../../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
|
|
15885
16032
|
var React4 = __toESM(require("react"));
|
|
@@ -16034,7 +16181,7 @@ var createStyled = function createStyled2(tag, options) {
|
|
|
16034
16181
|
|
|
16035
16182
|
// ../../../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/dist/emotion-styled.esm.js
|
|
16036
16183
|
var import_extends5 = __toESM(require_extends());
|
|
16037
|
-
var
|
|
16184
|
+
var import_react22 = require("react");
|
|
16038
16185
|
var tags = [
|
|
16039
16186
|
"a",
|
|
16040
16187
|
"abbr",
|
|
@@ -16182,12 +16329,12 @@ var import_design_system_react_components63 = require("@livechat/design-system-r
|
|
|
16182
16329
|
var import_developer_studio_ui_react27 = require("@livechat/developer-studio-ui-react");
|
|
16183
16330
|
|
|
16184
16331
|
// src/views/Workflows/Creator/Builder/Diagram.tsx
|
|
16185
|
-
var
|
|
16332
|
+
var import_react86 = require("react");
|
|
16186
16333
|
var import_reactflow16 = __toESM(require("reactflow"));
|
|
16187
16334
|
var import_design_system_react_components62 = require("@livechat/design-system-react-components");
|
|
16188
16335
|
|
|
16189
16336
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/Add/Task/Task.tsx
|
|
16190
|
-
var
|
|
16337
|
+
var import_react23 = require("react");
|
|
16191
16338
|
var import_reactflow2 = require("reactflow");
|
|
16192
16339
|
var import_design_system_icons5 = require("@livechat/design-system-icons");
|
|
16193
16340
|
var import_design_system_react_components10 = require("@livechat/design-system-react-components");
|
|
@@ -16216,16 +16363,17 @@ function AddTaskNode(node2) {
|
|
|
16216
16363
|
node2.data.parentTaskReference
|
|
16217
16364
|
);
|
|
16218
16365
|
},
|
|
16366
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.task.button,
|
|
16219
16367
|
children: workflow.definition.tasks.length > 0 ? "" : "Add task"
|
|
16220
16368
|
}
|
|
16221
16369
|
),
|
|
16222
16370
|
/* @__PURE__ */ jsx4(import_reactflow2.Handle, { isConnectable: false, position: import_reactflow2.Position.Bottom, type: "source" })
|
|
16223
16371
|
] });
|
|
16224
16372
|
}
|
|
16225
|
-
var Task_default = (0,
|
|
16373
|
+
var Task_default = (0, import_react23.memo)(AddTaskNode);
|
|
16226
16374
|
|
|
16227
16375
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/Add/Trigger/Trigger.tsx
|
|
16228
|
-
var
|
|
16376
|
+
var import_react24 = require("react");
|
|
16229
16377
|
var import_reactflow3 = require("reactflow");
|
|
16230
16378
|
var import_design_system_icons6 = require("@livechat/design-system-icons");
|
|
16231
16379
|
var import_design_system_react_components11 = require("@livechat/design-system-react-components");
|
|
@@ -16242,13 +16390,14 @@ function AddTriggerNode(node2) {
|
|
|
16242
16390
|
onClick: () => {
|
|
16243
16391
|
goToAddTrigger();
|
|
16244
16392
|
},
|
|
16393
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.trigger.button,
|
|
16245
16394
|
children: "Add trigger"
|
|
16246
16395
|
}
|
|
16247
16396
|
),
|
|
16248
16397
|
/* @__PURE__ */ jsx4(import_reactflow3.Handle, { isConnectable: false, position: import_reactflow3.Position.Bottom, type: "source" })
|
|
16249
16398
|
] });
|
|
16250
16399
|
}
|
|
16251
|
-
var Trigger_default = (0,
|
|
16400
|
+
var Trigger_default = (0, import_react24.memo)(AddTriggerNode);
|
|
16252
16401
|
|
|
16253
16402
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Base.tsx
|
|
16254
16403
|
var import_design_system_icons7 = require("@livechat/design-system-icons");
|
|
@@ -16343,7 +16492,7 @@ var import_core2 = __toESM(require("@rjsf/core"));
|
|
|
16343
16492
|
var import_validator_ajv8 = __toESM(require("@rjsf/validator-ajv8"));
|
|
16344
16493
|
|
|
16345
16494
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Field.tsx
|
|
16346
|
-
var
|
|
16495
|
+
var import_react39 = require("react");
|
|
16347
16496
|
var import_core = require("@rjsf/core");
|
|
16348
16497
|
var import_design_system_icons10 = require("@livechat/design-system-icons");
|
|
16349
16498
|
var import_design_system_react_components20 = require("@livechat/design-system-react-components");
|
|
@@ -16351,15 +16500,15 @@ var import_developer_studio_ui_react16 = require("@livechat/developer-studio-ui-
|
|
|
16351
16500
|
var import_platform_integrations3 = require("@livechat/platform-integrations");
|
|
16352
16501
|
|
|
16353
16502
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/Field.tsx
|
|
16354
|
-
var
|
|
16503
|
+
var import_react35 = require("react");
|
|
16355
16504
|
var import_developer_studio_ui_react15 = require("@livechat/developer-studio-ui-react");
|
|
16356
16505
|
|
|
16357
16506
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Picker.tsx
|
|
16358
|
-
var
|
|
16507
|
+
var import_react28 = require("react");
|
|
16359
16508
|
var import_design_system_react_components15 = require("@livechat/design-system-react-components");
|
|
16360
16509
|
|
|
16361
16510
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Tree/Node.tsx
|
|
16362
|
-
var
|
|
16511
|
+
var import_react26 = require("react");
|
|
16363
16512
|
var import_design_system_icons8 = require("@livechat/design-system-icons");
|
|
16364
16513
|
var import_design_system_react_components14 = require("@livechat/design-system-react-components");
|
|
16365
16514
|
var import_developer_studio_ui_react12 = require("@livechat/developer-studio-ui-react");
|
|
@@ -16382,8 +16531,8 @@ function CustomTagsPickerTreeNode({
|
|
|
16382
16531
|
onClick
|
|
16383
16532
|
}) {
|
|
16384
16533
|
var _a;
|
|
16385
|
-
const [collapsed, setCollapsed] = (0,
|
|
16386
|
-
const [newPropertyName, setNewPropertyName] = (0,
|
|
16534
|
+
const [collapsed, setCollapsed] = (0, import_react26.useState)(false);
|
|
16535
|
+
const [newPropertyName, setNewPropertyName] = (0, import_react26.useState)(targetName);
|
|
16387
16536
|
if (!data) {
|
|
16388
16537
|
return null;
|
|
16389
16538
|
}
|
|
@@ -16759,8 +16908,8 @@ function CustomTagsPicker({
|
|
|
16759
16908
|
context,
|
|
16760
16909
|
onClick
|
|
16761
16910
|
}) {
|
|
16762
|
-
const [search, setSearch] = (0,
|
|
16763
|
-
const [advanced] = (0,
|
|
16911
|
+
const [search, setSearch] = (0, import_react28.useState)();
|
|
16912
|
+
const [advanced] = (0, import_react28.useState)();
|
|
16764
16913
|
return /* @__PURE__ */ jsxs2(Wrapper, { children: [
|
|
16765
16914
|
/* @__PURE__ */ jsx4(
|
|
16766
16915
|
import_design_system_react_components15.SearchInput,
|
|
@@ -16786,7 +16935,7 @@ function CustomTagsPicker({
|
|
|
16786
16935
|
}
|
|
16787
16936
|
|
|
16788
16937
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Input.tsx
|
|
16789
|
-
var
|
|
16938
|
+
var import_react33 = require("react");
|
|
16790
16939
|
var import_lodash3 = __toESM(require("lodash.debounce"));
|
|
16791
16940
|
var import_design_system_react_components17 = require("@livechat/design-system-react-components");
|
|
16792
16941
|
|
|
@@ -16837,18 +16986,18 @@ function CustomTagTemplate(tagData, { settings: _s }) {
|
|
|
16837
16986
|
}
|
|
16838
16987
|
|
|
16839
16988
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tag/Tooltip.tsx
|
|
16840
|
-
var
|
|
16989
|
+
var import_react30 = require("react");
|
|
16841
16990
|
var import_lodash2 = __toESM(require("lodash.debounce"));
|
|
16842
16991
|
var import_design_system_react_components16 = require("@livechat/design-system-react-components");
|
|
16843
16992
|
var import_developer_studio_ui_react14 = require("@livechat/developer-studio-ui-react");
|
|
16844
16993
|
var useCustomTagsInputTagTooltipData = () => {
|
|
16845
|
-
const [tooltipData, setTooltipData] = (0,
|
|
16994
|
+
const [tooltipData, setTooltipData] = (0, import_react30.useState)(
|
|
16846
16995
|
{
|
|
16847
16996
|
visible: false
|
|
16848
16997
|
}
|
|
16849
16998
|
);
|
|
16850
|
-
const setTooltipDataDebounced = (0,
|
|
16851
|
-
const showTagTooltip = (0,
|
|
16999
|
+
const setTooltipDataDebounced = (0, import_react30.useCallback)((0, import_lodash2.default)(setTooltipData, 50), []);
|
|
17000
|
+
const showTagTooltip = (0, import_react30.useCallback)(
|
|
16852
17001
|
(tag, tagElement) => {
|
|
16853
17002
|
const rect = tagElement.getBoundingClientRect();
|
|
16854
17003
|
const tooltipPosition = {
|
|
@@ -16863,7 +17012,7 @@ var useCustomTagsInputTagTooltipData = () => {
|
|
|
16863
17012
|
},
|
|
16864
17013
|
[setTooltipDataDebounced]
|
|
16865
17014
|
);
|
|
16866
|
-
const hideTagTooltip = (0,
|
|
17015
|
+
const hideTagTooltip = (0, import_react30.useCallback)(() => {
|
|
16867
17016
|
setTooltipDataDebounced({
|
|
16868
17017
|
visible: false
|
|
16869
17018
|
});
|
|
@@ -16932,10 +17081,10 @@ function CustomTagsInputTagTooltip({
|
|
|
16932
17081
|
}
|
|
16933
17082
|
|
|
16934
17083
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tags.tsx
|
|
16935
|
-
var
|
|
17084
|
+
var import_react32 = require("react");
|
|
16936
17085
|
var import_tagify = __toESM(require("@yaireo/tagify"));
|
|
16937
17086
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
16938
|
-
var noop = (
|
|
17087
|
+
var noop = (_2) => _2;
|
|
16939
17088
|
var isSameDeep = (a, b) => {
|
|
16940
17089
|
const trans = (x) => typeof x === "string" ? x : JSON.stringify(x);
|
|
16941
17090
|
return trans(a) === trans(b);
|
|
@@ -17016,12 +17165,12 @@ function TagifyWrapper({
|
|
|
17016
17165
|
defaultValue,
|
|
17017
17166
|
showDropdown
|
|
17018
17167
|
}) {
|
|
17019
|
-
const mountedRef = (0,
|
|
17020
|
-
const inputElmRef = (0,
|
|
17021
|
-
const tagify = (0,
|
|
17022
|
-
const lastClassNameRef = (0,
|
|
17168
|
+
const mountedRef = (0, import_react32.useRef)();
|
|
17169
|
+
const inputElmRef = (0, import_react32.useRef)(null);
|
|
17170
|
+
const tagify = (0, import_react32.useRef)();
|
|
17171
|
+
const lastClassNameRef = (0, import_react32.useRef)();
|
|
17023
17172
|
const _value = defaultValue || value;
|
|
17024
|
-
const inputAttrs = (0,
|
|
17173
|
+
const inputAttrs = (0, import_react32.useMemo)(
|
|
17025
17174
|
() => ({
|
|
17026
17175
|
ref: inputElmRef,
|
|
17027
17176
|
name,
|
|
@@ -17034,10 +17183,10 @@ function TagifyWrapper({
|
|
|
17034
17183
|
}),
|
|
17035
17184
|
[]
|
|
17036
17185
|
);
|
|
17037
|
-
const setFocus = (0,
|
|
17186
|
+
const setFocus = (0, import_react32.useCallback)(() => {
|
|
17038
17187
|
autoFocus && tagify.current.DOM.input.focus();
|
|
17039
17188
|
}, [tagify]);
|
|
17040
|
-
(0,
|
|
17189
|
+
(0, import_react32.useEffect)(() => {
|
|
17041
17190
|
templatesToString(settings2.templates);
|
|
17042
17191
|
settings2.userInput = userInput;
|
|
17043
17192
|
if (InputMode === "textarea") settings2.mode = "mix";
|
|
@@ -17055,70 +17204,70 @@ function TagifyWrapper({
|
|
|
17055
17204
|
t.destroy();
|
|
17056
17205
|
};
|
|
17057
17206
|
}, []);
|
|
17058
|
-
(0,
|
|
17207
|
+
(0, import_react32.useEffect)(() => {
|
|
17059
17208
|
tagify.current.off("change").on("change", onChange);
|
|
17060
17209
|
}, [onChange]);
|
|
17061
|
-
(0,
|
|
17210
|
+
(0, import_react32.useEffect)(() => {
|
|
17062
17211
|
tagify.current.off("input").on("input", onInput);
|
|
17063
17212
|
}, [onInput]);
|
|
17064
|
-
(0,
|
|
17213
|
+
(0, import_react32.useEffect)(() => {
|
|
17065
17214
|
tagify.current.off("add").on("add", onAdd);
|
|
17066
17215
|
}, [onAdd]);
|
|
17067
|
-
(0,
|
|
17216
|
+
(0, import_react32.useEffect)(() => {
|
|
17068
17217
|
tagify.current.off("remove").on("remove", onRemove);
|
|
17069
17218
|
}, [onRemove]);
|
|
17070
|
-
(0,
|
|
17219
|
+
(0, import_react32.useEffect)(() => {
|
|
17071
17220
|
tagify.current.off("invalid").on("invalid", onInvalid);
|
|
17072
17221
|
}, [onInvalid]);
|
|
17073
|
-
(0,
|
|
17222
|
+
(0, import_react32.useEffect)(() => {
|
|
17074
17223
|
tagify.current.off("keydown").on("keydown", onKeydown);
|
|
17075
17224
|
}, [onKeydown]);
|
|
17076
|
-
(0,
|
|
17225
|
+
(0, import_react32.useEffect)(() => {
|
|
17077
17226
|
tagify.current.off("focus").on("focus", onFocus);
|
|
17078
17227
|
}, [onFocus]);
|
|
17079
|
-
(0,
|
|
17228
|
+
(0, import_react32.useEffect)(() => {
|
|
17080
17229
|
tagify.current.off("blur").on("blur", onBlur);
|
|
17081
17230
|
}, [onBlur]);
|
|
17082
|
-
(0,
|
|
17231
|
+
(0, import_react32.useEffect)(() => {
|
|
17083
17232
|
tagify.current.off("click").on("click", onClick);
|
|
17084
17233
|
}, [onClick]);
|
|
17085
|
-
(0,
|
|
17234
|
+
(0, import_react32.useEffect)(() => {
|
|
17086
17235
|
tagify.current.off("edit:input").on("edit:input", onEditInput);
|
|
17087
17236
|
}, [onEditInput]);
|
|
17088
|
-
(0,
|
|
17237
|
+
(0, import_react32.useEffect)(() => {
|
|
17089
17238
|
tagify.current.off("edit:beforeUpdate").on("edit:beforeUpdate", onEditBeforeUpdate);
|
|
17090
17239
|
}, [onEditBeforeUpdate]);
|
|
17091
|
-
(0,
|
|
17240
|
+
(0, import_react32.useEffect)(() => {
|
|
17092
17241
|
tagify.current.off("edit:updated").on("edit:updated", onEditUpdated);
|
|
17093
17242
|
}, [onEditUpdated]);
|
|
17094
|
-
(0,
|
|
17243
|
+
(0, import_react32.useEffect)(() => {
|
|
17095
17244
|
tagify.current.off("edit:start").on("edit:start", onEditStart);
|
|
17096
17245
|
}, [onEditStart]);
|
|
17097
|
-
(0,
|
|
17246
|
+
(0, import_react32.useEffect)(() => {
|
|
17098
17247
|
tagify.current.off("edit:keydown").on("edit:keydown", onEditKeydown);
|
|
17099
17248
|
}, [onEditKeydown]);
|
|
17100
|
-
(0,
|
|
17249
|
+
(0, import_react32.useEffect)(() => {
|
|
17101
17250
|
tagify.current.off("dropdown:show").on("dropdown:show", onDropdownShow);
|
|
17102
17251
|
}, [onDropdownShow]);
|
|
17103
|
-
(0,
|
|
17252
|
+
(0, import_react32.useEffect)(() => {
|
|
17104
17253
|
tagify.current.off("dropdown:hide").on("dropdown:hide", onDropdownHide);
|
|
17105
17254
|
}, [onDropdownHide]);
|
|
17106
|
-
(0,
|
|
17255
|
+
(0, import_react32.useEffect)(() => {
|
|
17107
17256
|
tagify.current.off("dropdown:select").on("dropdown:select", onDropdownSelect);
|
|
17108
17257
|
}, [onDropdownSelect]);
|
|
17109
|
-
(0,
|
|
17258
|
+
(0, import_react32.useEffect)(() => {
|
|
17110
17259
|
tagify.current.off("dropdown:scroll").on("dropdown:scroll", onDropdownScroll);
|
|
17111
17260
|
}, [onDropdownScroll]);
|
|
17112
|
-
(0,
|
|
17261
|
+
(0, import_react32.useEffect)(() => {
|
|
17113
17262
|
tagify.current.off("dropdown:noMatch").on("dropdown:noMatch", onDropdownNoMatch);
|
|
17114
17263
|
}, [onDropdownNoMatch]);
|
|
17115
|
-
(0,
|
|
17264
|
+
(0, import_react32.useEffect)(() => {
|
|
17116
17265
|
tagify.current.off("dropdown:updated").on("dropdown:updated", onDropdownUpdated);
|
|
17117
17266
|
}, [onDropdownUpdated]);
|
|
17118
|
-
(0,
|
|
17267
|
+
(0, import_react32.useEffect)(() => {
|
|
17119
17268
|
setFocus();
|
|
17120
17269
|
}, [autoFocus]);
|
|
17121
|
-
(0,
|
|
17270
|
+
(0, import_react32.useEffect)(() => {
|
|
17122
17271
|
if (mountedRef.current) {
|
|
17123
17272
|
tagify.current.settings.whitelist.length = 0;
|
|
17124
17273
|
(whitelist == null ? void 0 : whitelist.length) && tagify.current.settings.whitelist.push(
|
|
@@ -17126,13 +17275,13 @@ function TagifyWrapper({
|
|
|
17126
17275
|
);
|
|
17127
17276
|
}
|
|
17128
17277
|
}, [whitelist]);
|
|
17129
|
-
(0,
|
|
17278
|
+
(0, import_react32.useEffect)(() => {
|
|
17130
17279
|
const currentValue = tagify.current.getInputValue();
|
|
17131
17280
|
if (mountedRef.current && !isSameDeep(value, currentValue)) {
|
|
17132
17281
|
tagify.current.loadOriginalValues(value);
|
|
17133
17282
|
}
|
|
17134
17283
|
}, [value]);
|
|
17135
|
-
(0,
|
|
17284
|
+
(0, import_react32.useEffect)(() => {
|
|
17136
17285
|
if (mountedRef.current) {
|
|
17137
17286
|
const { added, removed } = compareStrings(
|
|
17138
17287
|
lastClassNameRef.current,
|
|
@@ -17147,33 +17296,33 @@ function TagifyWrapper({
|
|
|
17147
17296
|
}
|
|
17148
17297
|
lastClassNameRef.current = className;
|
|
17149
17298
|
}, [className]);
|
|
17150
|
-
(0,
|
|
17299
|
+
(0, import_react32.useEffect)(() => {
|
|
17151
17300
|
if (mountedRef.current) {
|
|
17152
17301
|
tagify.current.loading(loading);
|
|
17153
17302
|
}
|
|
17154
17303
|
}, [loading]);
|
|
17155
|
-
(0,
|
|
17304
|
+
(0, import_react32.useEffect)(() => {
|
|
17156
17305
|
if (mountedRef.current) {
|
|
17157
17306
|
tagify.current.setReadonly(readOnly != null ? readOnly : false);
|
|
17158
17307
|
}
|
|
17159
17308
|
}, [readOnly]);
|
|
17160
|
-
(0,
|
|
17309
|
+
(0, import_react32.useEffect)(() => {
|
|
17161
17310
|
if (mountedRef.current) {
|
|
17162
17311
|
tagify.current.setDisabled(disabled != null ? disabled : false);
|
|
17163
17312
|
}
|
|
17164
17313
|
}, [disabled]);
|
|
17165
|
-
(0,
|
|
17314
|
+
(0, import_react32.useEffect)(() => {
|
|
17166
17315
|
if (mountedRef.current) {
|
|
17167
17316
|
const current = tagify.current;
|
|
17168
17317
|
current.userInput = userInput;
|
|
17169
17318
|
}
|
|
17170
17319
|
}, [userInput]);
|
|
17171
|
-
(0,
|
|
17320
|
+
(0, import_react32.useEffect)(() => {
|
|
17172
17321
|
if (mountedRef.current) {
|
|
17173
17322
|
tagify.current.setPlaceholder(placeholder2);
|
|
17174
17323
|
}
|
|
17175
17324
|
}, [placeholder2]);
|
|
17176
|
-
(0,
|
|
17325
|
+
(0, import_react32.useEffect)(() => {
|
|
17177
17326
|
const t = tagify.current;
|
|
17178
17327
|
if (mountedRef.current) {
|
|
17179
17328
|
if (showDropdown) {
|
|
@@ -17184,7 +17333,7 @@ function TagifyWrapper({
|
|
|
17184
17333
|
}
|
|
17185
17334
|
}
|
|
17186
17335
|
}, [showDropdown]);
|
|
17187
|
-
(0,
|
|
17336
|
+
(0, import_react32.useEffect)(() => {
|
|
17188
17337
|
mountedRef.current = true;
|
|
17189
17338
|
}, []);
|
|
17190
17339
|
return (
|
|
@@ -17193,7 +17342,7 @@ function TagifyWrapper({
|
|
|
17193
17342
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "tags-input", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InputMode, __spreadValues({}, inputAttrs)) })
|
|
17194
17343
|
);
|
|
17195
17344
|
}
|
|
17196
|
-
var Tags = (0,
|
|
17345
|
+
var Tags = (0, import_react32.memo)(TagifyWrapper);
|
|
17197
17346
|
var Tags_default = Tags;
|
|
17198
17347
|
|
|
17199
17348
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/utils.ts
|
|
@@ -17296,23 +17445,23 @@ function CustomTagsInput({
|
|
|
17296
17445
|
renderPicker,
|
|
17297
17446
|
renderPickerTrigger
|
|
17298
17447
|
}) {
|
|
17299
|
-
const tagifyRef = (0,
|
|
17448
|
+
const tagifyRef = (0, import_react33.useRef)();
|
|
17300
17449
|
const [tooltipData, { showTagTooltip, hideTagTooltip }] = useCustomTagsInputTagTooltipData();
|
|
17301
|
-
const updateAllIcons = (0,
|
|
17450
|
+
const updateAllIcons = (0, import_react33.useCallback)(() => {
|
|
17302
17451
|
const tagify = tagifyRef.current;
|
|
17303
17452
|
if (!tagify) {
|
|
17304
17453
|
return;
|
|
17305
17454
|
}
|
|
17306
17455
|
tagify.value.forEach(updateCustomTagsInputTagIcon);
|
|
17307
17456
|
}, []);
|
|
17308
|
-
const getCurrentValue = (0,
|
|
17457
|
+
const getCurrentValue = (0, import_react33.useCallback)(() => {
|
|
17309
17458
|
const tagify = tagifyRef.current;
|
|
17310
17459
|
if (!tagify) {
|
|
17311
17460
|
return "";
|
|
17312
17461
|
}
|
|
17313
17462
|
return tagify.getMixedTagsAsString().replace(trim2 ? /\s+/g : /\r\n$/, "").replaceAll("[[", "${").replaceAll("]]", "}").replaceAll("\u200B", "").replaceAll("\xA0", "");
|
|
17314
17463
|
}, [trim2]);
|
|
17315
|
-
const setCurrentValue = (0,
|
|
17464
|
+
const setCurrentValue = (0, import_react33.useCallback)(
|
|
17316
17465
|
(value2, frame) => {
|
|
17317
17466
|
const tagify = tagifyRef.current;
|
|
17318
17467
|
if (!tagify) {
|
|
@@ -17323,14 +17472,14 @@ function CustomTagsInput({
|
|
|
17323
17472
|
},
|
|
17324
17473
|
[updateAllIcons]
|
|
17325
17474
|
);
|
|
17326
|
-
const handleChange = (0,
|
|
17475
|
+
const handleChange = (0, import_react33.useCallback)(
|
|
17327
17476
|
(0, import_lodash3.default)(() => {
|
|
17328
17477
|
onChange(getCurrentValue());
|
|
17329
17478
|
updateAllIcons();
|
|
17330
17479
|
}, 300),
|
|
17331
17480
|
[onChange, getCurrentValue, updateAllIcons]
|
|
17332
17481
|
);
|
|
17333
|
-
const handleKeyDown = (0,
|
|
17482
|
+
const handleKeyDown = (0, import_react33.useCallback)(
|
|
17334
17483
|
(e) => {
|
|
17335
17484
|
if (e.detail.event.key !== "Backspace") {
|
|
17336
17485
|
return;
|
|
@@ -17341,7 +17490,7 @@ function CustomTagsInput({
|
|
|
17341
17490
|
},
|
|
17342
17491
|
[handleChange]
|
|
17343
17492
|
);
|
|
17344
|
-
const addTag = (0,
|
|
17493
|
+
const addTag = (0, import_react33.useCallback)(
|
|
17345
17494
|
(tag) => {
|
|
17346
17495
|
const tagify = tagifyRef.current;
|
|
17347
17496
|
if (!tagify) {
|
|
@@ -17357,7 +17506,7 @@ function CustomTagsInput({
|
|
|
17357
17506
|
},
|
|
17358
17507
|
[trim2, onPickerToggle]
|
|
17359
17508
|
);
|
|
17360
|
-
(0,
|
|
17509
|
+
(0, import_react33.useEffect)(() => {
|
|
17361
17510
|
const tagify = tagifyRef.current;
|
|
17362
17511
|
if (!tagify) {
|
|
17363
17512
|
return;
|
|
@@ -17383,7 +17532,7 @@ function CustomTagsInput({
|
|
|
17383
17532
|
showTagTooltip,
|
|
17384
17533
|
hideTagTooltip
|
|
17385
17534
|
]);
|
|
17386
|
-
(0,
|
|
17535
|
+
(0, import_react33.useEffect)(() => {
|
|
17387
17536
|
const tagify = tagifyRef.current;
|
|
17388
17537
|
if (!tagify) {
|
|
17389
17538
|
return;
|
|
@@ -17434,9 +17583,7 @@ function CustomTagsInput({
|
|
|
17434
17583
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Trigger.tsx
|
|
17435
17584
|
var import_design_system_icons9 = require("@livechat/design-system-icons");
|
|
17436
17585
|
var import_design_system_react_components18 = require("@livechat/design-system-react-components");
|
|
17437
|
-
function CustomTagsPickerTrigger({
|
|
17438
|
-
onClick
|
|
17439
|
-
}) {
|
|
17586
|
+
function CustomTagsPickerTrigger({ onClick }) {
|
|
17440
17587
|
return /* @__PURE__ */ jsx4(
|
|
17441
17588
|
import_design_system_react_components18.Button,
|
|
17442
17589
|
{
|
|
@@ -17449,7 +17596,6 @@ function CustomTagsPickerTrigger({
|
|
|
17449
17596
|
min-height: 28px;
|
|
17450
17597
|
width: 28px;
|
|
17451
17598
|
min-width: 28px;
|
|
17452
|
-
z-index: 1000;
|
|
17453
17599
|
`,
|
|
17454
17600
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components18.Icon, { source: import_design_system_icons9.Add }),
|
|
17455
17601
|
kind: "plain",
|
|
@@ -17471,8 +17617,8 @@ function CustomTagsField({
|
|
|
17471
17617
|
wrapperCss: wrapperCss3,
|
|
17472
17618
|
onChange
|
|
17473
17619
|
}) {
|
|
17474
|
-
const wrapperRef = (0,
|
|
17475
|
-
const [isPickerVisible, setIsPickerVisible] = (0,
|
|
17620
|
+
const wrapperRef = (0, import_react35.useRef)(null);
|
|
17621
|
+
const [isPickerVisible, setIsPickerVisible] = (0, import_react35.useState)(false);
|
|
17476
17622
|
(0, import_developer_studio_ui_react15.useOnClickOutside)(wrapperRef, () => {
|
|
17477
17623
|
setIsPickerVisible(false);
|
|
17478
17624
|
});
|
|
@@ -17539,24 +17685,26 @@ function DynamicCustomStringField(props) {
|
|
|
17539
17685
|
}
|
|
17540
17686
|
|
|
17541
17687
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Modes/Predefined.tsx
|
|
17542
|
-
var
|
|
17688
|
+
var import_react37 = require("react");
|
|
17543
17689
|
var import_design_system_react_components19 = require("@livechat/design-system-react-components");
|
|
17544
|
-
var pickerCustomStyles = css`
|
|
17690
|
+
var pickerCustomStyles = (readonly) => css`
|
|
17545
17691
|
flex: 1;
|
|
17546
17692
|
button {
|
|
17547
|
-
color: var(
|
|
17693
|
+
color: var(
|
|
17694
|
+
${readonly ? import_design_system_react_components19.DesignToken.ContentBasicDisabled : import_design_system_react_components19.DesignToken.ContentBasicPrimary}
|
|
17695
|
+
);
|
|
17548
17696
|
}
|
|
17549
17697
|
`;
|
|
17550
17698
|
function PredefinedCustomStringField(props) {
|
|
17551
17699
|
var _a;
|
|
17552
17700
|
const { resourceQuery, onChange, schema } = props;
|
|
17553
17701
|
const resourceConfig = schema["x-ref"];
|
|
17554
|
-
const [pickerOptions, setPickerOptions] = (0,
|
|
17555
|
-
(0,
|
|
17702
|
+
const [pickerOptions, setPickerOptions] = (0, import_react37.useState)([]);
|
|
17703
|
+
(0, import_react37.useEffect)(() => {
|
|
17556
17704
|
var _a2, _b;
|
|
17557
17705
|
if (!resourceConfig) {
|
|
17558
17706
|
if (resourceQuery.data) {
|
|
17559
|
-
onChange(
|
|
17707
|
+
onChange("");
|
|
17560
17708
|
}
|
|
17561
17709
|
return;
|
|
17562
17710
|
}
|
|
@@ -17565,7 +17713,7 @@ function PredefinedCustomStringField(props) {
|
|
|
17565
17713
|
return /* @__PURE__ */ jsx4(
|
|
17566
17714
|
import_design_system_react_components19.Picker,
|
|
17567
17715
|
{
|
|
17568
|
-
css: pickerCustomStyles,
|
|
17716
|
+
css: pickerCustomStyles(props.readonly),
|
|
17569
17717
|
disabled: props.readonly,
|
|
17570
17718
|
error: Boolean((_a = props.rawErrors) == null ? void 0 : _a.length),
|
|
17571
17719
|
hideClearButton: true,
|
|
@@ -17588,17 +17736,29 @@ var {
|
|
|
17588
17736
|
fields: { StringField }
|
|
17589
17737
|
} = (0, import_core.getDefaultRegistry)();
|
|
17590
17738
|
function CustomStringField(props) {
|
|
17591
|
-
var _a;
|
|
17739
|
+
var _a, _b, _c;
|
|
17592
17740
|
const onChange = props.onChange;
|
|
17593
17741
|
const resourceConfig = props.schema["x-ref"];
|
|
17594
17742
|
const resourceQuery = (0, import_platform_integrations3.useFetchIntegrationResourceQuery)(resourceConfig);
|
|
17595
|
-
const [
|
|
17743
|
+
const [pristine, setPristine] = (0, import_react39.useState)(true);
|
|
17744
|
+
const [isPredefinedMode, setIsPredefinedMode] = (0, import_react39.useState)(
|
|
17596
17745
|
() => {
|
|
17597
|
-
var _a2,
|
|
17598
|
-
return ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some((item) => item.key === props.formData)) || !props.formData && ((
|
|
17746
|
+
var _a2, _b2, _c2;
|
|
17747
|
+
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;
|
|
17599
17748
|
}
|
|
17600
17749
|
);
|
|
17601
|
-
const
|
|
17750
|
+
const handleChange = (0, import_react39.useCallback)(
|
|
17751
|
+
(value) => {
|
|
17752
|
+
setPristine(false);
|
|
17753
|
+
if (value !== "") {
|
|
17754
|
+
onChange(value);
|
|
17755
|
+
return;
|
|
17756
|
+
}
|
|
17757
|
+
onChange(props.schema.required ? null : void 0);
|
|
17758
|
+
},
|
|
17759
|
+
[onChange, props.schema.required]
|
|
17760
|
+
);
|
|
17761
|
+
const modeSelectorOptions = (0, import_react39.useMemo)(
|
|
17602
17762
|
() => [
|
|
17603
17763
|
resourceConfig ? {
|
|
17604
17764
|
key: "predefined",
|
|
@@ -17614,8 +17774,10 @@ function CustomStringField(props) {
|
|
|
17614
17774
|
}
|
|
17615
17775
|
) }),
|
|
17616
17776
|
onClick: () => {
|
|
17617
|
-
|
|
17618
|
-
|
|
17777
|
+
handleChange("");
|
|
17778
|
+
setTimeout(() => {
|
|
17779
|
+
setIsPredefinedMode(true);
|
|
17780
|
+
}, 50);
|
|
17619
17781
|
}
|
|
17620
17782
|
} : void 0,
|
|
17621
17783
|
{
|
|
@@ -17632,34 +17794,60 @@ function CustomStringField(props) {
|
|
|
17632
17794
|
}
|
|
17633
17795
|
) }),
|
|
17634
17796
|
onClick: () => {
|
|
17635
|
-
|
|
17797
|
+
handleChange("");
|
|
17636
17798
|
setTimeout(() => {
|
|
17637
17799
|
setIsPredefinedMode(false);
|
|
17638
|
-
},
|
|
17800
|
+
}, 50);
|
|
17639
17801
|
}
|
|
17640
17802
|
}
|
|
17641
17803
|
].filter(Boolean),
|
|
17642
|
-
[resourceConfig,
|
|
17804
|
+
[resourceConfig, handleChange, setIsPredefinedMode]
|
|
17643
17805
|
);
|
|
17644
|
-
(0,
|
|
17645
|
-
var _a2,
|
|
17806
|
+
(0, import_react39.useEffect)(() => {
|
|
17807
|
+
var _a2, _b2, _c2;
|
|
17808
|
+
if (!pristine && !props.formData) {
|
|
17809
|
+
return;
|
|
17810
|
+
}
|
|
17646
17811
|
setIsPredefinedMode(
|
|
17647
17812
|
((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some(
|
|
17648
17813
|
(option) => option.key === props.formData
|
|
17649
|
-
)) || !props.formData && ((
|
|
17814
|
+
)) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0
|
|
17650
17815
|
);
|
|
17651
|
-
}, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData]);
|
|
17816
|
+
}, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData, pristine]);
|
|
17817
|
+
(0, import_react39.useEffect)(() => {
|
|
17818
|
+
setPristine(true);
|
|
17819
|
+
}, [(_c = (_b = props.formContext) == null ? void 0 : _b.frame.__meta) == null ? void 0 : _c.index]);
|
|
17652
17820
|
if (props.schema.enum || props.schema.oneOf) {
|
|
17653
17821
|
return /* @__PURE__ */ jsx4(StringField, __spreadValues({}, props));
|
|
17654
17822
|
}
|
|
17655
17823
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react16.Row, { gap: `var(${import_design_system_react_components20.SpacingToken.Spacing1})`, notPadded: true, children: [
|
|
17656
|
-
|
|
17824
|
+
/* @__PURE__ */ jsx4("br", {}),
|
|
17825
|
+
isPredefinedMode ? /* @__PURE__ */ jsx4(
|
|
17826
|
+
PredefinedCustomStringField,
|
|
17827
|
+
__spreadProps(__spreadValues({}, props), {
|
|
17828
|
+
onChange: handleChange,
|
|
17829
|
+
resourceQuery
|
|
17830
|
+
})
|
|
17831
|
+
) : /* @__PURE__ */ jsx4(
|
|
17832
|
+
DynamicCustomStringField,
|
|
17833
|
+
__spreadProps(__spreadValues({}, props), {
|
|
17834
|
+
onChange: handleChange,
|
|
17835
|
+
resourceQuery
|
|
17836
|
+
})
|
|
17837
|
+
),
|
|
17657
17838
|
modeSelectorOptions.length > 1 && /* @__PURE__ */ jsx4(
|
|
17658
17839
|
import_design_system_react_components20.ActionMenu,
|
|
17659
17840
|
{
|
|
17660
17841
|
options: modeSelectorOptions,
|
|
17661
17842
|
selectedOptions: [isPredefinedMode ? "predefined" : "custom"],
|
|
17662
|
-
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
17843
|
+
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
17844
|
+
import_design_system_react_components20.Button,
|
|
17845
|
+
{
|
|
17846
|
+
disabled: props.readonly,
|
|
17847
|
+
icon: /* @__PURE__ */ jsx4(import_design_system_react_components20.Icon, { source: import_design_system_icons10.MoreHoriz }),
|
|
17848
|
+
kind: "secondary"
|
|
17849
|
+
}
|
|
17850
|
+
)
|
|
17663
17851
|
}
|
|
17664
17852
|
)
|
|
17665
17853
|
] });
|
|
@@ -17678,6 +17866,7 @@ function CustomAddButton(props) {
|
|
|
17678
17866
|
onClick: (e) => {
|
|
17679
17867
|
onClick && onClick(e);
|
|
17680
17868
|
},
|
|
17869
|
+
disabled: props.disabled,
|
|
17681
17870
|
size: "medium",
|
|
17682
17871
|
children: "Add property"
|
|
17683
17872
|
}
|
|
@@ -17696,6 +17885,7 @@ function CustomRemoveButton(props) {
|
|
|
17696
17885
|
`,
|
|
17697
17886
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.Delete }),
|
|
17698
17887
|
kind: "text",
|
|
17888
|
+
disabled: props.disabled,
|
|
17699
17889
|
onClick: (e) => {
|
|
17700
17890
|
onClick && onClick(e);
|
|
17701
17891
|
}
|
|
@@ -17715,6 +17905,7 @@ function CustomMoveUpButton(props) {
|
|
|
17715
17905
|
`,
|
|
17716
17906
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.ArrowUpward }),
|
|
17717
17907
|
kind: "text",
|
|
17908
|
+
disabled: props.disabled,
|
|
17718
17909
|
onClick: (e) => {
|
|
17719
17910
|
onClick && onClick(e);
|
|
17720
17911
|
}
|
|
@@ -17734,6 +17925,7 @@ function CustomMoveDownButton(props) {
|
|
|
17734
17925
|
`,
|
|
17735
17926
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.ArrowDownward }),
|
|
17736
17927
|
kind: "text",
|
|
17928
|
+
disabled: props.disabled,
|
|
17737
17929
|
onClick: (e) => {
|
|
17738
17930
|
onClick && onClick(e);
|
|
17739
17931
|
}
|
|
@@ -17742,10 +17934,10 @@ function CustomMoveDownButton(props) {
|
|
|
17742
17934
|
}
|
|
17743
17935
|
|
|
17744
17936
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomArrayFieldTemplate.tsx
|
|
17745
|
-
var
|
|
17937
|
+
var import_utils16 = require("@rjsf/utils");
|
|
17746
17938
|
|
|
17747
17939
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomArrayFieldHeader.tsx
|
|
17748
|
-
var
|
|
17940
|
+
var import_utils15 = require("@rjsf/utils");
|
|
17749
17941
|
var import_design_system_react_components22 = require("@livechat/design-system-react-components");
|
|
17750
17942
|
var import_developer_studio_ui_react17 = require("@livechat/developer-studio-ui-react");
|
|
17751
17943
|
function CustomArrayFieldHeader(props) {
|
|
@@ -17759,9 +17951,9 @@ function CustomArrayFieldHeader(props) {
|
|
|
17759
17951
|
uiSchema,
|
|
17760
17952
|
hideOptionalBadge
|
|
17761
17953
|
} = props;
|
|
17762
|
-
const options = (0,
|
|
17763
|
-
const ArrayFieldTitleTemplate = (0,
|
|
17764
|
-
const ArrayFieldDescriptionTemplate = (0,
|
|
17954
|
+
const options = (0, import_utils15.getUiOptions)(uiSchema);
|
|
17955
|
+
const ArrayFieldTitleTemplate = (0, import_utils15.getTemplate)("ArrayFieldTitleTemplate", registry, options);
|
|
17956
|
+
const ArrayFieldDescriptionTemplate = (0, import_utils15.getTemplate)("ArrayFieldDescriptionTemplate", registry, options);
|
|
17765
17957
|
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react17.Row, { noWrap: true, notPadded: true, spaceBetween: true, children: /* @__PURE__ */ jsxs2(
|
|
17766
17958
|
import_developer_studio_ui_react17.Row,
|
|
17767
17959
|
{
|
|
@@ -17823,8 +18015,8 @@ function CustomArrayFieldTemplate(props) {
|
|
|
17823
18015
|
schema,
|
|
17824
18016
|
title
|
|
17825
18017
|
} = props;
|
|
17826
|
-
const uiOptions = (0,
|
|
17827
|
-
const ArrayFieldItemTemplate = (0,
|
|
18018
|
+
const uiOptions = (0, import_utils16.getUiOptions)(uiSchema);
|
|
18019
|
+
const ArrayFieldItemTemplate = (0, import_utils16.getTemplate)(
|
|
17828
18020
|
"ArrayFieldItemTemplate",
|
|
17829
18021
|
registry,
|
|
17830
18022
|
uiOptions
|
|
@@ -17902,11 +18094,11 @@ function CustomDescriptionFieldTemplate(props) {
|
|
|
17902
18094
|
}
|
|
17903
18095
|
|
|
17904
18096
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomField.tsx
|
|
17905
|
-
var
|
|
18097
|
+
var import_utils18 = require("@rjsf/utils");
|
|
17906
18098
|
var import_design_system_react_components25 = require("@livechat/design-system-react-components");
|
|
17907
18099
|
|
|
17908
18100
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomFieldHeader.tsx
|
|
17909
|
-
var
|
|
18101
|
+
var import_utils17 = require("@rjsf/utils");
|
|
17910
18102
|
var import_design_system_react_components24 = require("@livechat/design-system-react-components");
|
|
17911
18103
|
var import_developer_studio_ui_react18 = require("@livechat/developer-studio-ui-react");
|
|
17912
18104
|
var OptionalWrapper = newStyled.div`
|
|
@@ -17926,13 +18118,13 @@ function CustomFieldHeader(props) {
|
|
|
17926
18118
|
uiSchema,
|
|
17927
18119
|
hideOptionalBadge
|
|
17928
18120
|
} = props;
|
|
17929
|
-
const options = (0,
|
|
17930
|
-
const TitleFieldTemplate = (0,
|
|
18121
|
+
const options = (0, import_utils17.getUiOptions)(uiSchema);
|
|
18122
|
+
const TitleFieldTemplate = (0, import_utils17.getTemplate)(
|
|
17931
18123
|
"TitleFieldTemplate",
|
|
17932
18124
|
registry,
|
|
17933
18125
|
options
|
|
17934
18126
|
);
|
|
17935
|
-
const DescriptionFieldTemplate = (0,
|
|
18127
|
+
const DescriptionFieldTemplate = (0, import_utils17.getTemplate)("DescriptionFieldTemplate", registry, options);
|
|
17936
18128
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react18.Row, { noWrap: true, notPadded: true, spaceBetween: true, children: [
|
|
17937
18129
|
/* @__PURE__ */ jsxs2(
|
|
17938
18130
|
import_developer_studio_ui_react18.Row,
|
|
@@ -17944,7 +18136,7 @@ function CustomFieldHeader(props) {
|
|
|
17944
18136
|
label ? /* @__PURE__ */ jsx4(
|
|
17945
18137
|
TitleFieldTemplate,
|
|
17946
18138
|
{
|
|
17947
|
-
id: (0,
|
|
18139
|
+
id: (0, import_utils17.titleId)(id),
|
|
17948
18140
|
registry,
|
|
17949
18141
|
required,
|
|
17950
18142
|
schema,
|
|
@@ -17956,7 +18148,7 @@ function CustomFieldHeader(props) {
|
|
|
17956
18148
|
DescriptionFieldTemplate,
|
|
17957
18149
|
{
|
|
17958
18150
|
description,
|
|
17959
|
-
id: (0,
|
|
18151
|
+
id: (0, import_utils17.descriptionId)(id),
|
|
17960
18152
|
registry,
|
|
17961
18153
|
schema,
|
|
17962
18154
|
uiSchema
|
|
@@ -18006,9 +18198,9 @@ function CustomFieldTemplate(props) {
|
|
|
18006
18198
|
"schema",
|
|
18007
18199
|
"uiSchema"
|
|
18008
18200
|
]);
|
|
18009
|
-
const options = (0,
|
|
18010
|
-
const additional =
|
|
18011
|
-
const WrapIfAdditionalTemplate = (0,
|
|
18201
|
+
const options = (0, import_utils18.getUiOptions)(uiSchema);
|
|
18202
|
+
const additional = import_utils18.ADDITIONAL_PROPERTY_FLAG in props.schema;
|
|
18203
|
+
const WrapIfAdditionalTemplate = (0, import_utils18.getTemplate)(
|
|
18012
18204
|
"WrapIfAdditionalTemplate",
|
|
18013
18205
|
registry,
|
|
18014
18206
|
options
|
|
@@ -18059,7 +18251,7 @@ function CustomFieldTemplate(props) {
|
|
|
18059
18251
|
}
|
|
18060
18252
|
|
|
18061
18253
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomFieldWrapper.tsx
|
|
18062
|
-
var
|
|
18254
|
+
var import_utils19 = require("@rjsf/utils");
|
|
18063
18255
|
var import_design_system_react_components26 = require("@livechat/design-system-react-components");
|
|
18064
18256
|
function CustomWrapIfAdditionalTemplate(props) {
|
|
18065
18257
|
const {
|
|
@@ -18074,7 +18266,7 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18074
18266
|
classNames,
|
|
18075
18267
|
style
|
|
18076
18268
|
} = props;
|
|
18077
|
-
const additional =
|
|
18269
|
+
const additional = import_utils19.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
18078
18270
|
if (!additional) {
|
|
18079
18271
|
return /* @__PURE__ */ jsx4("div", { className: classNames, style, children });
|
|
18080
18272
|
}
|
|
@@ -18105,8 +18297,8 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18105
18297
|
}
|
|
18106
18298
|
|
|
18107
18299
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomObjectField.tsx
|
|
18108
|
-
var
|
|
18109
|
-
var
|
|
18300
|
+
var import_react43 = require("react");
|
|
18301
|
+
var import_utils20 = require("@rjsf/utils");
|
|
18110
18302
|
var import_design_system_react_components27 = require("@livechat/design-system-react-components");
|
|
18111
18303
|
function CustomObjectFieldTemplate(props) {
|
|
18112
18304
|
const {
|
|
@@ -18126,11 +18318,11 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18126
18318
|
const {
|
|
18127
18319
|
ButtonTemplates: { AddButton }
|
|
18128
18320
|
} = registry.templates;
|
|
18129
|
-
const [optionalVisible, setOptionalVisible] = (0,
|
|
18130
|
-
const [touched, setTouched] = (0,
|
|
18321
|
+
const [optionalVisible, setOptionalVisible] = (0, import_react43.useState)(false);
|
|
18322
|
+
const [touched, setTouched] = (0, import_react43.useState)({});
|
|
18131
18323
|
const newProperties = properties.map((prop) => {
|
|
18132
18324
|
return __spreadProps(__spreadValues({}, prop), {
|
|
18133
|
-
hidden: !(prop.content.props.required || touched[prop.name] ||
|
|
18325
|
+
hidden: !(prop.content.props.required || touched[prop.name] || import_utils20.ADDITIONAL_PROPERTY_FLAG in prop.content.props.schema || (Array.isArray(prop.content.props.formData) ? prop.content.props.formData.length > 0 : prop.content.props.formData)),
|
|
18134
18326
|
content: __spreadProps(__spreadValues({}, prop.content), {
|
|
18135
18327
|
props: __spreadProps(__spreadValues({}, prop.content.props), {
|
|
18136
18328
|
onChange: (value, newErrorSchema, id) => {
|
|
@@ -18186,7 +18378,7 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18186
18378
|
)
|
|
18187
18379
|
}
|
|
18188
18380
|
) : null,
|
|
18189
|
-
(0,
|
|
18381
|
+
(0, import_utils20.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ jsx4(
|
|
18190
18382
|
"div",
|
|
18191
18383
|
{
|
|
18192
18384
|
style: {
|
|
@@ -18403,7 +18595,7 @@ function ForkJoinNodeForm({
|
|
|
18403
18595
|
var Form_default2 = ForkJoinNodeForm;
|
|
18404
18596
|
|
|
18405
18597
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Node.tsx
|
|
18406
|
-
var
|
|
18598
|
+
var import_react47 = require("react");
|
|
18407
18599
|
var import_reactflow6 = require("reactflow");
|
|
18408
18600
|
|
|
18409
18601
|
// src/views/Workflows/Creator/Builder/Handles/CustomAdd/Handle.tsx
|
|
@@ -18520,7 +18712,7 @@ function CustomNodeWrapper({
|
|
|
18520
18712
|
|
|
18521
18713
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Node.tsx
|
|
18522
18714
|
function ForkJoinNode(node2) {
|
|
18523
|
-
const [isHovered, setIsHovered] = (0,
|
|
18715
|
+
const [isHovered, setIsHovered] = (0, import_react47.useState)(false);
|
|
18524
18716
|
const {
|
|
18525
18717
|
updateTask,
|
|
18526
18718
|
removeTask,
|
|
@@ -18587,7 +18779,7 @@ function ForkJoinNode(node2) {
|
|
|
18587
18779
|
}
|
|
18588
18780
|
);
|
|
18589
18781
|
}
|
|
18590
|
-
var Node_default = (0,
|
|
18782
|
+
var Node_default = (0, import_react47.memo)(ForkJoinNode);
|
|
18591
18783
|
|
|
18592
18784
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Base.tsx
|
|
18593
18785
|
var import_design_system_icons15 = require("@livechat/design-system-icons");
|
|
@@ -18717,20 +18909,20 @@ function HttpNodeBase({
|
|
|
18717
18909
|
var Base_default2 = HttpNodeBase;
|
|
18718
18910
|
|
|
18719
18911
|
// src/views/Workflows/Creator/Builder/Forms/Schema/Wrapper.tsx
|
|
18720
|
-
var
|
|
18912
|
+
var import_react50 = require("react");
|
|
18721
18913
|
var import_design_system_icons16 = require("@livechat/design-system-icons");
|
|
18722
18914
|
var import_design_system_react_components36 = require("@livechat/design-system-react-components");
|
|
18723
18915
|
var import_developer_studio_api24 = require("@livechat/developer-studio-api");
|
|
18724
18916
|
var import_platform_integrations5 = require("@livechat/platform-integrations");
|
|
18725
18917
|
|
|
18726
18918
|
// src/views/Workflows/Creator/Builder/Forms/Schema/integrations/Text/index.tsx
|
|
18727
|
-
var
|
|
18728
|
-
var
|
|
18919
|
+
var import_react49 = require("react");
|
|
18920
|
+
var import_react_router_dom7 = require("react-router-dom");
|
|
18729
18921
|
var import_design_system_react_components35 = require("@livechat/design-system-react-components");
|
|
18730
18922
|
var import_developer_studio_ui_react20 = require("@livechat/developer-studio-ui-react");
|
|
18731
18923
|
var import_platform_integrations4 = require("@livechat/platform-integrations");
|
|
18732
18924
|
function GlobalAccounts(props) {
|
|
18733
|
-
const { pathname } = (0,
|
|
18925
|
+
const { pathname } = (0, import_react_router_dom7.useLocation)();
|
|
18734
18926
|
const notifications = (0, import_developer_studio_ui_react20.useNotificationContext)();
|
|
18735
18927
|
const { user } = (0, import_developer_studio_ui_react20.useUserContext)();
|
|
18736
18928
|
const organizationProductsQuery = useFetchOrganizationProducts();
|
|
@@ -18741,7 +18933,7 @@ function GlobalAccounts(props) {
|
|
|
18741
18933
|
const needToBeActivated = organizationProductsQuery.data ? !organizationProductsQuery.data.find(
|
|
18742
18934
|
(product) => product.product === props.product
|
|
18743
18935
|
) : void 0;
|
|
18744
|
-
const refetch = (0,
|
|
18936
|
+
const refetch = (0, import_react49.useCallback)(() => {
|
|
18745
18937
|
void organizationProductsQuery.refetch();
|
|
18746
18938
|
}, [organizationProductsQuery]);
|
|
18747
18939
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react20.Column, { gap: `var(${import_design_system_react_components35.SpacingToken.Spacing3})`, notPadded: true, children: [
|
|
@@ -18817,11 +19009,11 @@ function CustomSchemaFormWrapper({
|
|
|
18817
19009
|
preselectedTab,
|
|
18818
19010
|
tabsMetadata
|
|
18819
19011
|
}) {
|
|
18820
|
-
const spec = (0,
|
|
18821
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
19012
|
+
const spec = (0, import_react50.useMemo)(() => WorkflowSpecification.getItemConfig(data), [data]);
|
|
19013
|
+
const [selectedTab, setSelectedTab] = (0, import_react50.useState)(
|
|
18822
19014
|
preselectedTab != null ? preselectedTab : !spec || spec.specification.input ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
|
|
18823
19015
|
);
|
|
18824
|
-
const tabItems = (0,
|
|
19016
|
+
const tabItems = (0, import_react50.useMemo)(
|
|
18825
19017
|
() => [
|
|
18826
19018
|
!spec || spec.specification.input ? { id: "parameters", title: "Parameters" } : void 0,
|
|
18827
19019
|
spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? {
|
|
@@ -18891,7 +19083,7 @@ function HttpNodeForm({
|
|
|
18891
19083
|
onChange,
|
|
18892
19084
|
readonly
|
|
18893
19085
|
}) {
|
|
18894
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
19086
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
18895
19087
|
const spec = (_a = metadata.frame.__meta) == null ? void 0 : _a.config;
|
|
18896
19088
|
if (data.name === "http") {
|
|
18897
19089
|
return /* @__PURE__ */ jsx4(
|
|
@@ -18940,15 +19132,7 @@ function HttpNodeForm({
|
|
|
18940
19132
|
data
|
|
18941
19133
|
}),
|
|
18942
19134
|
formData: queryParams,
|
|
18943
|
-
formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ?
|
|
18944
|
-
Object.entries(queryParams).map((entry) => {
|
|
18945
|
-
var _a2, _b2, _c2;
|
|
18946
|
-
return [
|
|
18947
|
-
entry[0],
|
|
18948
|
-
(_c2 = (_b2 = (_a2 = metadata.errors) == null ? void 0 : _a2.inputParameters) == null ? void 0 : _b2.http_request) == null ? void 0 : _c2.uri
|
|
18949
|
-
];
|
|
18950
|
-
})
|
|
18951
|
-
) : void 0,
|
|
19135
|
+
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,
|
|
18952
19136
|
onChange: (formData) => {
|
|
18953
19137
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
18954
19138
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -18962,14 +19146,14 @@ function HttpNodeForm({
|
|
|
18962
19146
|
schema: spec.specification.input.properties.query
|
|
18963
19147
|
}
|
|
18964
19148
|
) : void 0,
|
|
18965
|
-
((
|
|
19149
|
+
((_q = (_p = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _p.properties) == null ? void 0 : _q.body) ? /* @__PURE__ */ jsx4(
|
|
18966
19150
|
Form_default,
|
|
18967
19151
|
{
|
|
18968
19152
|
formContext: __spreadProps(__spreadValues({}, metadata), {
|
|
18969
19153
|
data
|
|
18970
19154
|
}),
|
|
18971
19155
|
formData: data.inputParameters.http_request.body,
|
|
18972
|
-
formErrors: (
|
|
19156
|
+
formErrors: (_t = (_s = (_r = metadata.errors) == null ? void 0 : _r.inputParameters) == null ? void 0 : _s.http_request) == null ? void 0 : _t.body,
|
|
18973
19157
|
onChange: (formData) => {
|
|
18974
19158
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
18975
19159
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -18990,10 +19174,10 @@ function HttpNodeForm({
|
|
|
18990
19174
|
var Form_default3 = HttpNodeForm;
|
|
18991
19175
|
|
|
18992
19176
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Node.tsx
|
|
18993
|
-
var
|
|
19177
|
+
var import_react52 = require("react");
|
|
18994
19178
|
var import_reactflow7 = require("reactflow");
|
|
18995
19179
|
function HttpNode(node2) {
|
|
18996
|
-
const [isHovered, setIsHovered] = (0,
|
|
19180
|
+
const [isHovered, setIsHovered] = (0, import_react52.useState)(false);
|
|
18997
19181
|
const {
|
|
18998
19182
|
removeTask,
|
|
18999
19183
|
goToAddTask,
|
|
@@ -19062,7 +19246,7 @@ function HttpNode(node2) {
|
|
|
19062
19246
|
}
|
|
19063
19247
|
);
|
|
19064
19248
|
}
|
|
19065
|
-
var Node_default2 = (0,
|
|
19249
|
+
var Node_default2 = (0, import_react52.memo)(HttpNode);
|
|
19066
19250
|
|
|
19067
19251
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Base.tsx
|
|
19068
19252
|
var import_design_system_icons17 = require("@livechat/design-system-icons");
|
|
@@ -19173,7 +19357,7 @@ function JoinNodeForm({
|
|
|
19173
19357
|
var Form_default4 = JoinNodeForm;
|
|
19174
19358
|
|
|
19175
19359
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Node.tsx
|
|
19176
|
-
var
|
|
19360
|
+
var import_react54 = require("react");
|
|
19177
19361
|
var import_reactflow8 = require("reactflow");
|
|
19178
19362
|
function JoinNode(node2) {
|
|
19179
19363
|
const {
|
|
@@ -19216,7 +19400,7 @@ function JoinNode(node2) {
|
|
|
19216
19400
|
}
|
|
19217
19401
|
) });
|
|
19218
19402
|
}
|
|
19219
|
-
var Node_default3 = (0,
|
|
19403
|
+
var Node_default3 = (0, import_react54.memo)(JoinNode);
|
|
19220
19404
|
|
|
19221
19405
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Base.tsx
|
|
19222
19406
|
var import_design_system_icons18 = require("@livechat/design-system-icons");
|
|
@@ -19353,7 +19537,7 @@ function SwitchNodeForm({
|
|
|
19353
19537
|
var Form_default5 = SwitchNodeForm;
|
|
19354
19538
|
|
|
19355
19539
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Node.tsx
|
|
19356
|
-
var
|
|
19540
|
+
var import_react56 = require("react");
|
|
19357
19541
|
var import_reactflow9 = require("reactflow");
|
|
19358
19542
|
var import_design_system_react_components39 = require("@livechat/design-system-react-components");
|
|
19359
19543
|
var handlerWrapperCss = css`
|
|
@@ -19373,7 +19557,7 @@ var handlerWrapperCss = css`
|
|
|
19373
19557
|
}
|
|
19374
19558
|
`;
|
|
19375
19559
|
function SwitchNode(node2) {
|
|
19376
|
-
const [isHovered, setIsHovered] = (0,
|
|
19560
|
+
const [isHovered, setIsHovered] = (0, import_react56.useState)(false);
|
|
19377
19561
|
const {
|
|
19378
19562
|
removeTask,
|
|
19379
19563
|
goToAddTask,
|
|
@@ -19460,7 +19644,7 @@ function SwitchNode(node2) {
|
|
|
19460
19644
|
}
|
|
19461
19645
|
);
|
|
19462
19646
|
}
|
|
19463
|
-
var Node_default4 = (0,
|
|
19647
|
+
var Node_default4 = (0, import_react56.memo)(SwitchNode);
|
|
19464
19648
|
|
|
19465
19649
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Base.tsx
|
|
19466
19650
|
var import_design_system_icons19 = require("@livechat/design-system-icons");
|
|
@@ -19562,10 +19746,10 @@ function TerminateNodeForm({
|
|
|
19562
19746
|
var Form_default6 = TerminateNodeForm;
|
|
19563
19747
|
|
|
19564
19748
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Node.tsx
|
|
19565
|
-
var
|
|
19749
|
+
var import_react58 = require("react");
|
|
19566
19750
|
var import_reactflow10 = require("reactflow");
|
|
19567
19751
|
function TerminateNode(node2) {
|
|
19568
|
-
const [isHovered, setIsHovered] = (0,
|
|
19752
|
+
const [isHovered, setIsHovered] = (0, import_react58.useState)(false);
|
|
19569
19753
|
const {
|
|
19570
19754
|
removeTask,
|
|
19571
19755
|
goToAddTask,
|
|
@@ -19617,7 +19801,7 @@ function TerminateNode(node2) {
|
|
|
19617
19801
|
}
|
|
19618
19802
|
);
|
|
19619
19803
|
}
|
|
19620
|
-
var Node_default5 = (0,
|
|
19804
|
+
var Node_default5 = (0, import_react58.memo)(TerminateNode);
|
|
19621
19805
|
|
|
19622
19806
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Base.tsx
|
|
19623
19807
|
var import_design_system_react_components41 = require("@livechat/design-system-react-components");
|
|
@@ -19731,7 +19915,7 @@ function TriggerNodeBase({
|
|
|
19731
19915
|
var Base_default6 = TriggerNodeBase;
|
|
19732
19916
|
|
|
19733
19917
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Form.tsx
|
|
19734
|
-
var
|
|
19918
|
+
var import_react60 = require("react");
|
|
19735
19919
|
var import_react_js_cron = require("react-js-cron");
|
|
19736
19920
|
var import_design_system_react_components42 = require("@livechat/design-system-react-components");
|
|
19737
19921
|
var cronCss = css`
|
|
@@ -19768,7 +19952,7 @@ var cronCss = css`
|
|
|
19768
19952
|
}
|
|
19769
19953
|
`;
|
|
19770
19954
|
function CronWrapper(props) {
|
|
19771
|
-
const [state, setState] = (0,
|
|
19955
|
+
const [state, setState] = (0, import_react60.useState)(props.value);
|
|
19772
19956
|
return /* @__PURE__ */ jsx4(
|
|
19773
19957
|
import_react_js_cron.Cron,
|
|
19774
19958
|
{
|
|
@@ -19841,10 +20025,10 @@ function TriggerNodeForm({
|
|
|
19841
20025
|
var Form_default7 = TriggerNodeForm;
|
|
19842
20026
|
|
|
19843
20027
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Node.tsx
|
|
19844
|
-
var
|
|
20028
|
+
var import_react62 = require("react");
|
|
19845
20029
|
var import_reactflow11 = require("reactflow");
|
|
19846
20030
|
function TriggerNode(node2) {
|
|
19847
|
-
const [isHovered, setIsHovered] = (0,
|
|
20031
|
+
const [isHovered, setIsHovered] = (0, import_react62.useState)(false);
|
|
19848
20032
|
const {
|
|
19849
20033
|
goToAddTask,
|
|
19850
20034
|
removeTrigger,
|
|
@@ -19899,11 +20083,11 @@ function TriggerNode(node2) {
|
|
|
19899
20083
|
}
|
|
19900
20084
|
);
|
|
19901
20085
|
}
|
|
19902
|
-
var Node_default6 = (0,
|
|
20086
|
+
var Node_default6 = (0, import_react62.memo)(TriggerNode);
|
|
19903
20087
|
|
|
19904
20088
|
// src/views/Workflows/Creator/Builder/Controls/CustomControls.tsx
|
|
19905
|
-
var
|
|
19906
|
-
var
|
|
20089
|
+
var import_react82 = require("react");
|
|
20090
|
+
var import_react_router_dom10 = require("react-router-dom");
|
|
19907
20091
|
var import_reactflow12 = require("reactflow");
|
|
19908
20092
|
var import_design_system_icons26 = require("@livechat/design-system-icons");
|
|
19909
20093
|
var import_design_system_react_components58 = require("@livechat/design-system-react-components");
|
|
@@ -20035,12 +20219,12 @@ function StopGenerateButton() {
|
|
|
20035
20219
|
}
|
|
20036
20220
|
|
|
20037
20221
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20038
|
-
var
|
|
20222
|
+
var import_react66 = require("react");
|
|
20039
20223
|
var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerContext");
|
|
20040
20224
|
var import_design_system_react_components45 = require("@livechat/design-system-react-components");
|
|
20041
20225
|
|
|
20042
20226
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20043
|
-
var
|
|
20227
|
+
var import_react64 = require("react");
|
|
20044
20228
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
20045
20229
|
|
|
20046
20230
|
// src/views/Workflows/Common/One/widget/message-box/constants.ts
|
|
@@ -20049,8 +20233,8 @@ var ONE_CHARACTER_LIMIT = 1e4;
|
|
|
20049
20233
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20050
20234
|
var useAboveCharacterLimit = () => {
|
|
20051
20235
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
20052
|
-
const [aboveLimit, setAboveLimit] = (0,
|
|
20053
|
-
(0,
|
|
20236
|
+
const [aboveLimit, setAboveLimit] = (0, import_react64.useState)(0);
|
|
20237
|
+
(0, import_react64.useEffect)(() => {
|
|
20054
20238
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20055
20239
|
(textContent) => {
|
|
20056
20240
|
setAboveLimit(textContent.length - ONE_CHARACTER_LIMIT);
|
|
@@ -20067,13 +20251,13 @@ var useAboveCharacterLimit = () => {
|
|
|
20067
20251
|
};
|
|
20068
20252
|
|
|
20069
20253
|
// src/views/Workflows/Common/One/hooks/useSendOneMessage.ts
|
|
20070
|
-
var
|
|
20254
|
+
var import_react65 = require("react");
|
|
20071
20255
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
20072
20256
|
var import_lexical = require("lexical");
|
|
20073
20257
|
var useSendOneMessage = () => {
|
|
20074
20258
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
20075
|
-
const { sendMessage: sendMessage2 } = (0,
|
|
20076
|
-
const onSend = (0,
|
|
20259
|
+
const { sendMessage: sendMessage2 } = (0, import_react65.useContext)(OneMessagesContext);
|
|
20260
|
+
const onSend = (0, import_react65.useCallback)(() => {
|
|
20077
20261
|
var _a;
|
|
20078
20262
|
const messageToSend = (_a = editor.getRootElement()) == null ? void 0 : _a.innerText.trim();
|
|
20079
20263
|
if (!messageToSend) {
|
|
@@ -20087,12 +20271,12 @@ var useSendOneMessage = () => {
|
|
|
20087
20271
|
|
|
20088
20272
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20089
20273
|
function AskButton() {
|
|
20090
|
-
const [isDisabled, setIsDisabled] = (0,
|
|
20274
|
+
const [isDisabled, setIsDisabled] = (0, import_react66.useState)(true);
|
|
20091
20275
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
20092
20276
|
const isLoading = false;
|
|
20093
20277
|
const { isAboveLimit } = useAboveCharacterLimit();
|
|
20094
20278
|
const handleSend = useSendOneMessage();
|
|
20095
|
-
(0,
|
|
20279
|
+
(0, import_react66.useEffect)(() => {
|
|
20096
20280
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20097
20281
|
(textContent) => {
|
|
20098
20282
|
setIsDisabled(!textContent);
|
|
@@ -20166,34 +20350,34 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
20166
20350
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
20167
20351
|
|
|
20168
20352
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/AutoFocusPlugin.tsx
|
|
20169
|
-
var
|
|
20353
|
+
var import_react67 = require("react");
|
|
20170
20354
|
var import_LexicalComposerContext4 = require("@lexical/react/LexicalComposerContext");
|
|
20171
20355
|
function AutoFocusPlugin() {
|
|
20172
20356
|
const [editor] = (0, import_LexicalComposerContext4.useLexicalComposerContext)();
|
|
20173
|
-
const handleFocus = (0,
|
|
20357
|
+
const handleFocus = (0, import_react67.useCallback)(() => {
|
|
20174
20358
|
editor.focus();
|
|
20175
20359
|
}, [editor]);
|
|
20176
|
-
(0,
|
|
20360
|
+
(0, import_react67.useEffect)(() => {
|
|
20177
20361
|
handleFocus();
|
|
20178
20362
|
}, []);
|
|
20179
20363
|
return null;
|
|
20180
20364
|
}
|
|
20181
20365
|
|
|
20182
20366
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/EnterDownPlugin.tsx
|
|
20183
|
-
var
|
|
20367
|
+
var import_react68 = require("react");
|
|
20184
20368
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
20185
20369
|
var import_lexical2 = require("lexical");
|
|
20186
20370
|
function EnterDownPlugin({ isCommandMenuVisibleRef }) {
|
|
20187
20371
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
20188
20372
|
const isLoading = false;
|
|
20189
20373
|
const handleSendMessage = useSendOneMessage();
|
|
20190
|
-
const onEnterDown = (0,
|
|
20374
|
+
const onEnterDown = (0, import_react68.useCallback)(() => {
|
|
20191
20375
|
if (isLoading || (isCommandMenuVisibleRef == null ? void 0 : isCommandMenuVisibleRef.current)) {
|
|
20192
20376
|
return;
|
|
20193
20377
|
}
|
|
20194
20378
|
handleSendMessage({ enter: true, messageBox: true });
|
|
20195
20379
|
}, [handleSendMessage, isLoading, isCommandMenuVisibleRef]);
|
|
20196
|
-
(0,
|
|
20380
|
+
(0, import_react68.useEffect)(
|
|
20197
20381
|
() => editor.registerCommand(
|
|
20198
20382
|
import_lexical2.KEY_ENTER_COMMAND,
|
|
20199
20383
|
(event) => {
|
|
@@ -20254,10 +20438,10 @@ function OneMessageBox() {
|
|
|
20254
20438
|
}
|
|
20255
20439
|
|
|
20256
20440
|
// src/views/Workflows/Common/One/widget/OneChatFeedContent.tsx
|
|
20257
|
-
var
|
|
20441
|
+
var import_react81 = require("react");
|
|
20258
20442
|
|
|
20259
20443
|
// src/views/Workflows/Common/One/hooks/useScroll.ts
|
|
20260
|
-
var
|
|
20444
|
+
var import_react69 = require("react");
|
|
20261
20445
|
var import_lodash4 = __toESM(require("lodash.debounce"));
|
|
20262
20446
|
var useScroll = ({
|
|
20263
20447
|
oneChatFeedRef,
|
|
@@ -20265,10 +20449,10 @@ var useScroll = ({
|
|
|
20265
20449
|
additionalEvents
|
|
20266
20450
|
}) => {
|
|
20267
20451
|
const oneScrollPosition = 0;
|
|
20268
|
-
const currentScrollPosition = (0,
|
|
20269
|
-
const isScrolledToBottom = (0,
|
|
20270
|
-
const timeoutRef = (0,
|
|
20271
|
-
const scrollToBottom = (0,
|
|
20452
|
+
const currentScrollPosition = (0, import_react69.useRef)(null);
|
|
20453
|
+
const isScrolledToBottom = (0, import_react69.useRef)(true);
|
|
20454
|
+
const timeoutRef = (0, import_react69.useRef)(null);
|
|
20455
|
+
const scrollToBottom = (0, import_react69.useCallback)(() => {
|
|
20272
20456
|
if (timeoutRef.current) {
|
|
20273
20457
|
clearTimeout(timeoutRef.current);
|
|
20274
20458
|
}
|
|
@@ -20284,7 +20468,7 @@ var useScroll = ({
|
|
|
20284
20468
|
}
|
|
20285
20469
|
};
|
|
20286
20470
|
}, []);
|
|
20287
|
-
(0,
|
|
20471
|
+
(0, import_react69.useEffect)(() => {
|
|
20288
20472
|
var _a;
|
|
20289
20473
|
if (!oneScrollPosition) {
|
|
20290
20474
|
scrollToBottom();
|
|
@@ -20293,12 +20477,12 @@ var useScroll = ({
|
|
|
20293
20477
|
(_a = oneChatFeedRef.current) == null ? void 0 : _a.scrollTo({ top: oneScrollPosition });
|
|
20294
20478
|
currentScrollPosition.current = oneScrollPosition;
|
|
20295
20479
|
}, []);
|
|
20296
|
-
(0,
|
|
20480
|
+
(0, import_react69.useEffect)(() => {
|
|
20297
20481
|
if (additionalEvents && isScrolledToBottom.current) {
|
|
20298
20482
|
scrollToBottom();
|
|
20299
20483
|
}
|
|
20300
20484
|
}, [scrollToBottom, additionalEvents]);
|
|
20301
|
-
(0,
|
|
20485
|
+
(0, import_react69.useEffect)(() => {
|
|
20302
20486
|
const [lastGroupEvent] = groupedEvents.slice(-1)[0];
|
|
20303
20487
|
const isLastMessageFromAgent = lastGroupEvent.authorType === "agent" /* Agent */;
|
|
20304
20488
|
if (isLastMessageFromAgent || isScrolledToBottom.current) {
|
|
@@ -20858,7 +21042,7 @@ function OneErrorEvent({ eventId }) {
|
|
|
20858
21042
|
}
|
|
20859
21043
|
|
|
20860
21044
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
20861
|
-
var
|
|
21045
|
+
var import_react73 = require("react");
|
|
20862
21046
|
|
|
20863
21047
|
// src/views/Workflows/Common/One/components/SkeletonLine.tsx
|
|
20864
21048
|
var import_design_system_react_components49 = require("@livechat/design-system-react-components");
|
|
@@ -20921,8 +21105,8 @@ function SkeletonLine({
|
|
|
20921
21105
|
|
|
20922
21106
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
20923
21107
|
function OneImageEvent({ imageUrl }) {
|
|
20924
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
20925
|
-
(0,
|
|
21108
|
+
const [isLoaded, setIsLoaded] = (0, import_react73.useState)(false);
|
|
21109
|
+
(0, import_react73.useEffect)(() => {
|
|
20926
21110
|
const image = new Image();
|
|
20927
21111
|
image.src = imageUrl;
|
|
20928
21112
|
image.onload = () => {
|
|
@@ -20944,7 +21128,7 @@ function OneImageEvent({ imageUrl }) {
|
|
|
20944
21128
|
}
|
|
20945
21129
|
|
|
20946
21130
|
// src/views/Workflows/Common/One/components/TypingIndicator.tsx
|
|
20947
|
-
var
|
|
21131
|
+
var import_react74 = require("react");
|
|
20948
21132
|
var import_design_system_react_components50 = require("@livechat/design-system-react-components");
|
|
20949
21133
|
var typingAnimation = keyframes`
|
|
20950
21134
|
0% {
|
|
@@ -20985,7 +21169,7 @@ var typingIndicator2 = css`
|
|
|
20985
21169
|
}
|
|
20986
21170
|
}
|
|
20987
21171
|
`;
|
|
20988
|
-
var TypingIndicator = (0,
|
|
21172
|
+
var TypingIndicator = (0, import_react74.memo)(function TypingIndicatorInner() {
|
|
20989
21173
|
return /* @__PURE__ */ jsxs2("div", { css: typingIndicator2, "data-test": "typing-indicator", children: [
|
|
20990
21174
|
/* @__PURE__ */ jsx4("span", {}),
|
|
20991
21175
|
/* @__PURE__ */ jsx4("span", {}),
|
|
@@ -21005,10 +21189,10 @@ var import_design_system_react_components55 = require("@livechat/design-system-r
|
|
|
21005
21189
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
21006
21190
|
|
|
21007
21191
|
// src/views/Workflows/Common/One/widget/events/OneLinkWithTooltip.tsx
|
|
21008
|
-
var
|
|
21192
|
+
var import_react_router_dom8 = require("react-router-dom");
|
|
21009
21193
|
var import_design_system_react_components51 = require("@livechat/design-system-react-components");
|
|
21010
21194
|
function OneLinkWithTooltip({ children, href }) {
|
|
21011
|
-
const trigger = href ? /* @__PURE__ */ jsx4(
|
|
21195
|
+
const trigger = href ? /* @__PURE__ */ jsx4(import_react_router_dom8.Link, { css: linkTrigger, to: href, children }) : /* @__PURE__ */ jsx4("span", { css: linkTrigger, children });
|
|
21012
21196
|
return /* @__PURE__ */ jsx4(
|
|
21013
21197
|
import_design_system_react_components51.Tooltip,
|
|
21014
21198
|
{
|
|
@@ -21073,7 +21257,7 @@ var MarkdownEventRenderer = ({ children }) => /* @__PURE__ */ jsx4(
|
|
|
21073
21257
|
);
|
|
21074
21258
|
|
|
21075
21259
|
// src/views/Workflows/Common/One/components/NavigateButton.tsx
|
|
21076
|
-
var
|
|
21260
|
+
var import_react_router_dom9 = require("react-router-dom");
|
|
21077
21261
|
var import_design_system_icons22 = require("@livechat/design-system-icons");
|
|
21078
21262
|
var import_design_system_react_components52 = require("@livechat/design-system-react-components");
|
|
21079
21263
|
var navigateButtonCss = css`
|
|
@@ -21091,7 +21275,7 @@ function NavigateButton({
|
|
|
21091
21275
|
kind,
|
|
21092
21276
|
iconPosition
|
|
21093
21277
|
}) {
|
|
21094
|
-
const navigate = (0,
|
|
21278
|
+
const navigate = (0, import_react_router_dom9.useNavigate)();
|
|
21095
21279
|
const handleButtonClick = () => {
|
|
21096
21280
|
if (isExternal) {
|
|
21097
21281
|
window.open(url, "_blank");
|
|
@@ -21116,13 +21300,13 @@ function NavigateButton({
|
|
|
21116
21300
|
}
|
|
21117
21301
|
|
|
21118
21302
|
// src/views/Workflows/Common/One/widget/events/OneAssistantMessageBottomBar.tsx
|
|
21119
|
-
var
|
|
21303
|
+
var import_react80 = require("react");
|
|
21120
21304
|
var import_design_system_icons24 = require("@livechat/design-system-icons");
|
|
21121
21305
|
var import_design_system_react_components54 = require("@livechat/design-system-react-components");
|
|
21122
21306
|
var import_developer_studio_ui_react24 = require("@livechat/developer-studio-ui-react");
|
|
21123
21307
|
|
|
21124
21308
|
// src/views/Workflows/Common/One/components/ApplyWorkflowButton.tsx
|
|
21125
|
-
var
|
|
21309
|
+
var import_react78 = require("react");
|
|
21126
21310
|
var import_design_system_icons23 = require("@livechat/design-system-icons");
|
|
21127
21311
|
var import_design_system_react_components53 = require("@livechat/design-system-react-components");
|
|
21128
21312
|
var buttonCss = css`
|
|
@@ -21134,7 +21318,7 @@ function ApplyWorkflowButton({
|
|
|
21134
21318
|
updateWorkflow,
|
|
21135
21319
|
previewWorkflow
|
|
21136
21320
|
}) {
|
|
21137
|
-
const [isApplied, setIsApplied] = (0,
|
|
21321
|
+
const [isApplied, setIsApplied] = (0, import_react78.useState)(false);
|
|
21138
21322
|
const workflowExtraction = extractWorkflowFromEvent(event);
|
|
21139
21323
|
const isEditingWorkflow = false;
|
|
21140
21324
|
const applyWorkflow = () => {
|
|
@@ -21204,7 +21388,7 @@ function OneAssistantMessageBottomBar({
|
|
|
21204
21388
|
previewWorkflow
|
|
21205
21389
|
}) {
|
|
21206
21390
|
var _a, _b, _c;
|
|
21207
|
-
const [isSourcesVisible, setIsSourcesVisible] = (0,
|
|
21391
|
+
const [isSourcesVisible, setIsSourcesVisible] = (0, import_react80.useState)(false);
|
|
21208
21392
|
const toggleIsSourcesVisible = () => {
|
|
21209
21393
|
setIsSourcesVisible((prev2) => !prev2);
|
|
21210
21394
|
};
|
|
@@ -21504,7 +21688,7 @@ function OneChatFeedContent({
|
|
|
21504
21688
|
updateWorkflow,
|
|
21505
21689
|
previewWorkflow
|
|
21506
21690
|
}) {
|
|
21507
|
-
const oneChatFeedRef = (0,
|
|
21691
|
+
const oneChatFeedRef = (0, import_react81.useRef)(null);
|
|
21508
21692
|
const { groupedEvents, hasAdditionalEvents } = useOneMessagesContext();
|
|
21509
21693
|
const { handleScroll } = useScroll({
|
|
21510
21694
|
oneChatFeedRef,
|
|
@@ -21599,15 +21783,15 @@ function CustomControls({
|
|
|
21599
21783
|
previewWorkflow
|
|
21600
21784
|
}) {
|
|
21601
21785
|
var _a;
|
|
21602
|
-
const navigate = (0,
|
|
21786
|
+
const navigate = (0, import_react_router_dom10.useNavigate)();
|
|
21603
21787
|
const { fitView, zoomIn, zoomOut } = (0, import_reactflow12.useReactFlow)();
|
|
21604
21788
|
const { toggleOneWidget, isOpen } = useOneWidgetContext();
|
|
21605
21789
|
const {
|
|
21606
21790
|
state: { visibility },
|
|
21607
21791
|
focus
|
|
21608
21792
|
} = useWorkflowCreator();
|
|
21609
|
-
const location = (0,
|
|
21610
|
-
(0,
|
|
21793
|
+
const location = (0, import_react_router_dom10.useLocation)();
|
|
21794
|
+
(0, import_react82.useEffect)(() => {
|
|
21611
21795
|
var _a2;
|
|
21612
21796
|
if ((_a2 = location.state) == null ? void 0 : _a2.openOne) {
|
|
21613
21797
|
if (!isOpen) {
|
|
@@ -21712,8 +21896,8 @@ function CustomControls({
|
|
|
21712
21896
|
var CustomControls_default = CustomControls;
|
|
21713
21897
|
|
|
21714
21898
|
// src/views/Workflows/Creator/Builder/Controls/SwitcherControls.tsx
|
|
21715
|
-
var
|
|
21716
|
-
var
|
|
21899
|
+
var import_react84 = require("react");
|
|
21900
|
+
var import_react_router_dom11 = require("react-router-dom");
|
|
21717
21901
|
var import_reactflow13 = require("reactflow");
|
|
21718
21902
|
var import_design_system_react_components59 = require("@livechat/design-system-react-components");
|
|
21719
21903
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
@@ -21722,10 +21906,10 @@ function SwitcherControls({
|
|
|
21722
21906
|
hasRelatedWorkflow,
|
|
21723
21907
|
relatedWorkflowId
|
|
21724
21908
|
}) {
|
|
21725
|
-
const [currentView, setCurrentView] = (0,
|
|
21909
|
+
const [currentView, setCurrentView] = (0, import_react84.useState)(
|
|
21726
21910
|
isDraft ? "draft" : "published"
|
|
21727
21911
|
);
|
|
21728
|
-
const navigate = (0,
|
|
21912
|
+
const navigate = (0, import_react_router_dom11.useNavigate)();
|
|
21729
21913
|
const {
|
|
21730
21914
|
focus,
|
|
21731
21915
|
state: { visibility }
|
|
@@ -22247,13 +22431,13 @@ function WorkflowBuilder() {
|
|
|
22247
22431
|
[]
|
|
22248
22432
|
);
|
|
22249
22433
|
const [edges, setEdges, onEdgesChange] = (0, import_reactflow16.useEdgesState)([]);
|
|
22250
|
-
const onConnect = (0,
|
|
22434
|
+
const onConnect = (0, import_react86.useCallback)(
|
|
22251
22435
|
(params) => {
|
|
22252
22436
|
setEdges((eds) => (0, import_reactflow16.addEdge)(params, eds));
|
|
22253
22437
|
},
|
|
22254
22438
|
[setEdges]
|
|
22255
22439
|
);
|
|
22256
|
-
(0,
|
|
22440
|
+
(0, import_react86.useEffect)(() => {
|
|
22257
22441
|
void (() => __async(this, null, function* () {
|
|
22258
22442
|
const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(
|
|
22259
22443
|
workflow
|
|
@@ -22385,8 +22569,8 @@ function PreviewWorkflowModal({
|
|
|
22385
22569
|
onApply,
|
|
22386
22570
|
onClose
|
|
22387
22571
|
}) {
|
|
22388
|
-
const navigate = (0,
|
|
22389
|
-
const handleClose = (0,
|
|
22572
|
+
const navigate = (0, import_react_router_dom12.useNavigate)();
|
|
22573
|
+
const handleClose = (0, import_react87.useCallback)(
|
|
22390
22574
|
(target) => {
|
|
22391
22575
|
if (onClose) {
|
|
22392
22576
|
onClose();
|
|
@@ -22400,7 +22584,7 @@ function PreviewWorkflowModal({
|
|
|
22400
22584
|
},
|
|
22401
22585
|
[onClose, navigate]
|
|
22402
22586
|
);
|
|
22403
|
-
const handleApply = (0,
|
|
22587
|
+
const handleApply = (0, import_react87.useCallback)(() => {
|
|
22404
22588
|
if (onApply) {
|
|
22405
22589
|
onApply();
|
|
22406
22590
|
}
|
|
@@ -22486,40 +22670,57 @@ function PublishWorkflowModal({
|
|
|
22486
22670
|
},
|
|
22487
22671
|
publishDraft
|
|
22488
22672
|
} = useWorkflowCreator();
|
|
22489
|
-
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22490
|
-
|
|
22673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22674
|
+
import_design_system_react_components64.Modal,
|
|
22491
22675
|
{
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
kind: "primary",
|
|
22498
|
-
loading: isPublishing,
|
|
22499
|
-
onClick: () => void publishDraft({
|
|
22500
|
-
confirmed: true
|
|
22501
|
-
}),
|
|
22502
|
-
children: "Publish workflow"
|
|
22503
|
-
}
|
|
22504
|
-
)
|
|
22505
|
-
] }),
|
|
22506
|
-
heading: "You are publishing a workflow",
|
|
22507
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22508
|
-
import_design_system_react_components64.Icon,
|
|
22676
|
+
heading: true,
|
|
22677
|
+
onClose,
|
|
22678
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.wrapper,
|
|
22679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22680
|
+
import_developer_studio_ui_react28.ActionModalContent,
|
|
22509
22681
|
{
|
|
22510
|
-
|
|
22511
|
-
|
|
22512
|
-
|
|
22682
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
|
|
22683
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22684
|
+
import_design_system_react_components64.Button,
|
|
22685
|
+
{
|
|
22686
|
+
kind: "secondary",
|
|
22687
|
+
onClick: onClose,
|
|
22688
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.cancelButton,
|
|
22689
|
+
children: "Cancel"
|
|
22690
|
+
}
|
|
22691
|
+
),
|
|
22692
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22693
|
+
import_design_system_react_components64.Button,
|
|
22694
|
+
{
|
|
22695
|
+
kind: "primary",
|
|
22696
|
+
loading: isPublishing,
|
|
22697
|
+
onClick: () => void publishDraft({
|
|
22698
|
+
confirmed: true
|
|
22699
|
+
}),
|
|
22700
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.saveButton,
|
|
22701
|
+
children: "Publish workflow"
|
|
22702
|
+
}
|
|
22703
|
+
)
|
|
22704
|
+
] }),
|
|
22705
|
+
heading: "You are publishing a workflow",
|
|
22706
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22707
|
+
import_design_system_react_components64.Icon,
|
|
22708
|
+
{
|
|
22709
|
+
customColor: `var(${import_design_system_react_components64.DesignToken.ContentBasicDisabled})`,
|
|
22710
|
+
size: "xxlarge",
|
|
22711
|
+
source: import_design_system_icons27.Error
|
|
22712
|
+
}
|
|
22713
|
+
),
|
|
22714
|
+
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22513
22715
|
}
|
|
22514
|
-
)
|
|
22515
|
-
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22716
|
+
)
|
|
22516
22717
|
}
|
|
22517
|
-
)
|
|
22718
|
+
);
|
|
22518
22719
|
}
|
|
22519
22720
|
|
|
22520
22721
|
// src/views/Workflows/Creator/View.tsx
|
|
22521
|
-
var
|
|
22522
|
-
var
|
|
22722
|
+
var import_react95 = require("react");
|
|
22723
|
+
var import_react_router_dom17 = require("react-router-dom");
|
|
22523
22724
|
var import_reactflow17 = require("reactflow");
|
|
22524
22725
|
var import_design_system_react_components71 = require("@livechat/design-system-react-components");
|
|
22525
22726
|
|
|
@@ -22529,10 +22730,10 @@ var sendMessage = (type) => {
|
|
|
22529
22730
|
};
|
|
22530
22731
|
|
|
22531
22732
|
// src/views/Workflows/Creator/Panels/Details/index.tsx
|
|
22532
|
-
var
|
|
22733
|
+
var import_react_router_dom14 = require("react-router-dom");
|
|
22533
22734
|
|
|
22534
22735
|
// src/views/Workflows/Creator/Panels/Details/Panel.tsx
|
|
22535
|
-
var
|
|
22736
|
+
var import_react_router_dom13 = require("react-router-dom");
|
|
22536
22737
|
var import_design_system_icons29 = require("@livechat/design-system-icons");
|
|
22537
22738
|
var import_design_system_react_components67 = require("@livechat/design-system-react-components");
|
|
22538
22739
|
var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22540,6 +22741,7 @@ var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-
|
|
|
22540
22741
|
// src/views/Workflows/Creator/Panels/Details/Executions/List.tsx
|
|
22541
22742
|
var import_design_system_icons28 = require("@livechat/design-system-icons");
|
|
22542
22743
|
var import_design_system_react_components65 = require("@livechat/design-system-react-components");
|
|
22744
|
+
var import_developer_studio_api27 = require("@livechat/developer-studio-api");
|
|
22543
22745
|
var import_developer_studio_ui_react29 = require("@livechat/developer-studio-ui-react");
|
|
22544
22746
|
var tableCss = css`
|
|
22545
22747
|
font-size: 13px;
|
|
@@ -22573,22 +22775,18 @@ function WorkflowExecutionList({
|
|
|
22573
22775
|
/* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react29.formatUSADate)(execution.started_at) }),
|
|
22574
22776
|
/* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react29.formatUSADate)(execution.ended_at) }),
|
|
22575
22777
|
/* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
|
|
22576
|
-
import_design_system_react_components65.
|
|
22778
|
+
import_design_system_react_components65.Tag,
|
|
22577
22779
|
{
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
|
|
22581
|
-
|
|
22582
|
-
|
|
22583
|
-
|
|
22584
|
-
|
|
22585
|
-
|
|
22586
|
-
|
|
22587
|
-
|
|
22588
|
-
}
|
|
22589
|
-
),
|
|
22590
|
-
execution.status
|
|
22591
|
-
] })
|
|
22780
|
+
size: "small",
|
|
22781
|
+
kind: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? "success" : "error",
|
|
22782
|
+
leftNode: /* @__PURE__ */ jsx4(
|
|
22783
|
+
import_design_system_react_components65.Icon,
|
|
22784
|
+
{
|
|
22785
|
+
size: "small",
|
|
22786
|
+
source: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? import_design_system_icons28.CheckCircle : import_design_system_icons28.CloseCircle
|
|
22787
|
+
}
|
|
22788
|
+
),
|
|
22789
|
+
children: execution.status
|
|
22592
22790
|
}
|
|
22593
22791
|
) })
|
|
22594
22792
|
] }, execution.id)) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
|
|
@@ -22686,8 +22884,8 @@ function WorkflowDetailsPanel({
|
|
|
22686
22884
|
onClose
|
|
22687
22885
|
}) {
|
|
22688
22886
|
var _a, _b, _c, _d, _e;
|
|
22689
|
-
const navigate = (0,
|
|
22690
|
-
const { id, tab } = (0,
|
|
22887
|
+
const navigate = (0, import_react_router_dom13.useNavigate)();
|
|
22888
|
+
const { id, tab } = (0, import_react_router_dom13.useParams)();
|
|
22691
22889
|
const workflowQuery = useFetchWorkflow(id);
|
|
22692
22890
|
const workflowExecutionsQuery = useFetchWorkflowExecutionList(id);
|
|
22693
22891
|
const relatedWorkflowQuery = useFetchWorkflow(
|
|
@@ -22788,10 +22986,10 @@ function WorkflowDetails({
|
|
|
22788
22986
|
onClose,
|
|
22789
22987
|
headerType
|
|
22790
22988
|
}) {
|
|
22791
|
-
return /* @__PURE__ */ jsxs2(
|
|
22792
|
-
/* @__PURE__ */ jsx4(
|
|
22989
|
+
return /* @__PURE__ */ jsxs2(import_react_router_dom14.Routes, { children: [
|
|
22990
|
+
/* @__PURE__ */ jsx4(import_react_router_dom14.Route, { element: /* @__PURE__ */ jsx4(import_react_router_dom14.Navigate, { replace: true, to: "info" }), path: "" }),
|
|
22793
22991
|
/* @__PURE__ */ jsx4(
|
|
22794
|
-
|
|
22992
|
+
import_react_router_dom14.Route,
|
|
22795
22993
|
{
|
|
22796
22994
|
element: /* @__PURE__ */ jsx4(Panel_default, { headerType, onClose }),
|
|
22797
22995
|
path: ":tab/*"
|
|
@@ -22801,9 +22999,9 @@ function WorkflowDetails({
|
|
|
22801
22999
|
}
|
|
22802
23000
|
|
|
22803
23001
|
// src/views/Workflows/Creator/Panels/Editor/Panel.tsx
|
|
22804
|
-
var
|
|
22805
|
-
var
|
|
22806
|
-
var
|
|
23002
|
+
var import_react90 = require("react");
|
|
23003
|
+
var import_react_router_dom15 = require("react-router-dom");
|
|
23004
|
+
var import_react91 = require("@monaco-editor/react");
|
|
22807
23005
|
var import_design_system_icons30 = require("@livechat/design-system-icons");
|
|
22808
23006
|
var import_design_system_react_components68 = require("@livechat/design-system-react-components");
|
|
22809
23007
|
var import_developer_studio_ui_react32 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22829,15 +23027,15 @@ function configureMonaco(monaco) {
|
|
|
22829
23027
|
});
|
|
22830
23028
|
}
|
|
22831
23029
|
function WorkflowEditorPanel({ onClose }) {
|
|
22832
|
-
const navigate = (0,
|
|
23030
|
+
const navigate = (0, import_react_router_dom15.useNavigate)();
|
|
22833
23031
|
const {
|
|
22834
23032
|
state: { workflow },
|
|
22835
23033
|
replaceWorkflow,
|
|
22836
23034
|
focus
|
|
22837
23035
|
} = useWorkflowCreator();
|
|
22838
|
-
const editorRef = (0,
|
|
22839
|
-
const [, setIsModified] = (0,
|
|
22840
|
-
const [, setJsonErrors] = (0,
|
|
23036
|
+
const editorRef = (0, import_react90.useRef)();
|
|
23037
|
+
const [, setIsModified] = (0, import_react90.useState)(false);
|
|
23038
|
+
const [, setJsonErrors] = (0, import_react90.useState)([]);
|
|
22841
23039
|
const filteredWorkflow = {
|
|
22842
23040
|
definition: workflow.definition,
|
|
22843
23041
|
trigger: workflow.trigger
|
|
@@ -22862,7 +23060,7 @@ function WorkflowEditorPanel({ onClose }) {
|
|
|
22862
23060
|
)
|
|
22863
23061
|
] }),
|
|
22864
23062
|
/* @__PURE__ */ jsx4(WorkflowSidebarContent, { children: /* @__PURE__ */ jsx4(
|
|
22865
|
-
|
|
23063
|
+
import_react91.Editor,
|
|
22866
23064
|
{
|
|
22867
23065
|
height: "100%",
|
|
22868
23066
|
language: "json",
|
|
@@ -22905,7 +23103,7 @@ var Panel_default2 = WorkflowEditorPanel;
|
|
|
22905
23103
|
// src/views/Workflows/Creator/Panels/Element/Panel.tsx
|
|
22906
23104
|
var import_design_system_icons31 = require("@livechat/design-system-icons");
|
|
22907
23105
|
var import_design_system_react_components69 = require("@livechat/design-system-react-components");
|
|
22908
|
-
var
|
|
23106
|
+
var import_developer_studio_api28 = require("@livechat/developer-studio-api");
|
|
22909
23107
|
var import_developer_studio_ui_react33 = require("@livechat/developer-studio-ui-react");
|
|
22910
23108
|
var import_styles4 = require("react-js-cron/dist/styles.css");
|
|
22911
23109
|
var formCss = () => css`
|
|
@@ -23063,71 +23261,78 @@ function WorkflowElementPanel() {
|
|
|
23063
23261
|
default:
|
|
23064
23262
|
}
|
|
23065
23263
|
};
|
|
23066
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.provider) ===
|
|
23067
|
-
return /* @__PURE__ */ jsxs2(
|
|
23068
|
-
|
|
23069
|
-
|
|
23070
|
-
|
|
23071
|
-
|
|
23072
|
-
|
|
23264
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.provider) === import_developer_studio_api28.IntegrationNames.OpenAI || (config2 == null ? void 0 : config2.customization.provider) === import_developer_studio_api28.IntegrationNames.BigCommerce);
|
|
23265
|
+
return /* @__PURE__ */ jsxs2(
|
|
23266
|
+
Wrapper4,
|
|
23267
|
+
{
|
|
23268
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.element.wrapper,
|
|
23269
|
+
children: [
|
|
23270
|
+
" ",
|
|
23271
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react33.Row, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
|
|
23272
|
+
/* @__PURE__ */ jsx4(
|
|
23273
|
+
Header7,
|
|
23274
|
+
{
|
|
23275
|
+
css: css`
|
|
23073
23276
|
max-width: 85%;
|
|
23074
23277
|
`,
|
|
23075
|
-
|
|
23076
|
-
|
|
23077
|
-
|
|
23078
|
-
|
|
23079
|
-
|
|
23080
|
-
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23278
|
+
children: /* @__PURE__ */ jsxs2(Title7, { children: [
|
|
23279
|
+
(config2 == null ? void 0 : config2.customization.product) ? /* @__PURE__ */ jsx4(
|
|
23280
|
+
ProductIcon_default,
|
|
23281
|
+
{
|
|
23282
|
+
center: true,
|
|
23283
|
+
disabled: false,
|
|
23284
|
+
height: 10,
|
|
23285
|
+
product: config2.customization.provider,
|
|
23286
|
+
revertColors: revertIconColor,
|
|
23287
|
+
width: 10
|
|
23288
|
+
}
|
|
23289
|
+
) : /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
|
|
23290
|
+
import_design_system_react_components69.Icon,
|
|
23291
|
+
{
|
|
23292
|
+
css: css`
|
|
23090
23293
|
width: var(${import_design_system_react_components69.SpacingToken.Spacing6});
|
|
23091
23294
|
`,
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23103
|
-
|
|
23104
|
-
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23117
|
-
|
|
23118
|
-
|
|
23295
|
+
size: "xlarge",
|
|
23296
|
+
source: import_design_system_icons31.Automation
|
|
23297
|
+
}
|
|
23298
|
+
) }),
|
|
23299
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react33.Column, { noFlexBasis: true, notPadded: true, children: [
|
|
23300
|
+
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
23301
|
+
((_d = frame == null ? void 0 : frame.__meta) == null ? void 0 : _d.index) !== void 0 ? `${frame.__meta.index}. ` : "",
|
|
23302
|
+
(_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" : ""
|
|
23303
|
+
] }),
|
|
23304
|
+
(_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" : ""
|
|
23305
|
+
] })
|
|
23306
|
+
] })
|
|
23307
|
+
}
|
|
23308
|
+
),
|
|
23309
|
+
/* @__PURE__ */ jsx4(
|
|
23310
|
+
import_design_system_react_components69.Button,
|
|
23311
|
+
{
|
|
23312
|
+
kind: "plain",
|
|
23313
|
+
onClick: () => {
|
|
23314
|
+
toggle();
|
|
23315
|
+
},
|
|
23316
|
+
children: /* @__PURE__ */ jsx4(import_design_system_react_components69.Icon, { source: import_design_system_icons31.Close })
|
|
23317
|
+
}
|
|
23318
|
+
)
|
|
23319
|
+
] }),
|
|
23320
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react33.Row, { css: formCss, children: contentHandler() })
|
|
23321
|
+
]
|
|
23322
|
+
}
|
|
23323
|
+
);
|
|
23119
23324
|
}
|
|
23120
23325
|
var Panel_default3 = WorkflowElementPanel;
|
|
23121
23326
|
|
|
23122
23327
|
// src/views/Workflows/Creator/Navbar.tsx
|
|
23123
|
-
var
|
|
23124
|
-
var
|
|
23328
|
+
var import_react93 = require("react");
|
|
23329
|
+
var import_react_router_dom16 = require("react-router-dom");
|
|
23125
23330
|
var import_design_system_icons32 = require("@livechat/design-system-icons");
|
|
23126
23331
|
var import_design_system_react_components70 = require("@livechat/design-system-react-components");
|
|
23127
23332
|
var import_developer_studio_ui_react34 = require("@livechat/developer-studio-ui-react");
|
|
23128
23333
|
function WorkflowCreatorNavbar() {
|
|
23129
23334
|
var _a, _b, _c, _d, _e;
|
|
23130
|
-
const navigate = (0,
|
|
23335
|
+
const navigate = (0, import_react_router_dom16.useNavigate)();
|
|
23131
23336
|
const {
|
|
23132
23337
|
state: {
|
|
23133
23338
|
workflow,
|
|
@@ -23140,14 +23345,14 @@ function WorkflowCreatorNavbar() {
|
|
|
23140
23345
|
publishDraft,
|
|
23141
23346
|
toggle
|
|
23142
23347
|
} = useWorkflowCreator();
|
|
23143
|
-
const inputRef = (0,
|
|
23144
|
-
const [isNameChanging, setIsNameChanging] = (0,
|
|
23145
|
-
const [workflowName, setWorkflowName] = (0,
|
|
23348
|
+
const inputRef = (0, import_react93.useRef)(null);
|
|
23349
|
+
const [isNameChanging, setIsNameChanging] = (0, import_react93.useState)(false);
|
|
23350
|
+
const [workflowName, setWorkflowName] = (0, import_react93.useState)(workflow.name);
|
|
23146
23351
|
const { user } = (0, import_developer_studio_ui_react34.useUserContext)();
|
|
23147
23352
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23148
23353
|
user == null ? void 0 : user.meta.email
|
|
23149
23354
|
);
|
|
23150
|
-
(0,
|
|
23355
|
+
(0, import_react93.useEffect)(() => {
|
|
23151
23356
|
setWorkflowName(workflow.name);
|
|
23152
23357
|
}, [workflow.name]);
|
|
23153
23358
|
(0, import_developer_studio_ui_react34.useOnClickOutside)(inputRef, () => {
|
|
@@ -23322,7 +23527,8 @@ function WorkflowCreatorNavbar() {
|
|
|
23322
23527
|
on: workflow.active,
|
|
23323
23528
|
onChange: () => void activate(),
|
|
23324
23529
|
size: "medium",
|
|
23325
|
-
state: isActivating ? "loading" : workflow.draft ? "locked" : "regular"
|
|
23530
|
+
state: isActivating ? "loading" : workflow.draft ? "locked" : "regular",
|
|
23531
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.activateSwitch
|
|
23326
23532
|
}
|
|
23327
23533
|
),
|
|
23328
23534
|
children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
|
|
@@ -23341,7 +23547,15 @@ function WorkflowCreatorNavbar() {
|
|
|
23341
23547
|
workflow.draft ? !workflow.trigger.type || !workflow.definition.tasks.length ? /* @__PURE__ */ jsxs2(
|
|
23342
23548
|
import_design_system_react_components70.Tooltip,
|
|
23343
23549
|
{
|
|
23344
|
-
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23550
|
+
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23551
|
+
import_design_system_react_components70.Button,
|
|
23552
|
+
{
|
|
23553
|
+
disabled: true,
|
|
23554
|
+
kind: "primary",
|
|
23555
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23556
|
+
children: "Publish"
|
|
23557
|
+
}
|
|
23558
|
+
),
|
|
23345
23559
|
children: [
|
|
23346
23560
|
!workflow.trigger.type && "To publish a workflow, add a trigger.",
|
|
23347
23561
|
!workflow.definition.tasks.length && "To publish a workflow, add at least one task."
|
|
@@ -23359,6 +23573,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23359
23573
|
);
|
|
23360
23574
|
void publishDraft();
|
|
23361
23575
|
},
|
|
23576
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23362
23577
|
children: "Publish"
|
|
23363
23578
|
}
|
|
23364
23579
|
) : /* @__PURE__ */ jsx4(
|
|
@@ -23374,6 +23589,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23374
23589
|
}
|
|
23375
23590
|
void createDraft();
|
|
23376
23591
|
},
|
|
23592
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.editButton,
|
|
23377
23593
|
children: "Edit"
|
|
23378
23594
|
}
|
|
23379
23595
|
)
|
|
@@ -23407,7 +23623,7 @@ function WorkflowCreatorView() {
|
|
|
23407
23623
|
focus
|
|
23408
23624
|
} = useWorkflowCreator();
|
|
23409
23625
|
const { fitView } = (0, import_reactflow17.useReactFlow)();
|
|
23410
|
-
(0,
|
|
23626
|
+
(0, import_react95.useEffect)(() => {
|
|
23411
23627
|
if (getWorkflowsEnv("isLiveChatMode")) {
|
|
23412
23628
|
sendMessage("closeSideNav" /* CloseSideNav */);
|
|
23413
23629
|
const timeoutId = setTimeout(() => {
|
|
@@ -23426,10 +23642,10 @@ function WorkflowCreatorView() {
|
|
|
23426
23642
|
/* @__PURE__ */ jsx4(Navbar_default, {}),
|
|
23427
23643
|
/* @__PURE__ */ jsxs2(WorkflowCreatorContent, { grayBackground: getWorkflowsEnv("isHeadless"), children: [
|
|
23428
23644
|
/* @__PURE__ */ jsx4(Diagram_default, {}),
|
|
23429
|
-
(selection == null ? void 0 : selection.isEditable) ? /* @__PURE__ */ jsx4(Panel_default3, {}) : /* @__PURE__ */ jsxs2(
|
|
23430
|
-
/* @__PURE__ */ jsx4(
|
|
23645
|
+
(selection == null ? void 0 : selection.isEditable) ? /* @__PURE__ */ jsx4(Panel_default3, {}) : /* @__PURE__ */ jsxs2(import_react_router_dom17.Routes, { children: [
|
|
23646
|
+
/* @__PURE__ */ jsx4(import_react_router_dom17.Route, { element: /* @__PURE__ */ jsx4(Panel_default2, {}), path: "editor" }),
|
|
23431
23647
|
/* @__PURE__ */ jsx4(
|
|
23432
|
-
|
|
23648
|
+
import_react_router_dom17.Route,
|
|
23433
23649
|
{
|
|
23434
23650
|
element: /* @__PURE__ */ jsx4(
|
|
23435
23651
|
WorkflowDetails,
|
|
@@ -23451,9 +23667,9 @@ var View_default = WorkflowCreatorView;
|
|
|
23451
23667
|
// src/views/Workflows/Creator/index.tsx
|
|
23452
23668
|
function WorkflowCreator() {
|
|
23453
23669
|
var _a, _b, _c;
|
|
23454
|
-
const location = (0,
|
|
23455
|
-
const { id } = (0,
|
|
23456
|
-
const navigate = (0,
|
|
23670
|
+
const location = (0, import_react_router_dom18.useLocation)();
|
|
23671
|
+
const { id } = (0, import_react_router_dom18.useParams)();
|
|
23672
|
+
const navigate = (0, import_react_router_dom18.useNavigate)();
|
|
23457
23673
|
const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
|
|
23458
23674
|
const credentialsQuery = (0, import_platform_integrations6.useFetchIntegrationCredentialsQuery)();
|
|
23459
23675
|
const organizationProducts = (0, import_developer_studio_ui_react35.useFetchOrganizationProducts)();
|
|
@@ -23475,9 +23691,9 @@ function WorkflowCreator() {
|
|
|
23475
23691
|
}
|
|
23476
23692
|
return /* @__PURE__ */ jsxs2(WorkflowCreatorProvider, { basePath, workflow, children: [
|
|
23477
23693
|
/* @__PURE__ */ jsx4(View_default, {}),
|
|
23478
|
-
/* @__PURE__ */ jsxs2(
|
|
23694
|
+
/* @__PURE__ */ jsxs2(import_react_router_dom18.Routes, { children: [
|
|
23479
23695
|
/* @__PURE__ */ jsx4(
|
|
23480
|
-
|
|
23696
|
+
import_react_router_dom18.Route,
|
|
23481
23697
|
{
|
|
23482
23698
|
element: /* @__PURE__ */ jsx4(
|
|
23483
23699
|
Modal_default2,
|
|
@@ -23492,7 +23708,7 @@ function WorkflowCreator() {
|
|
|
23492
23708
|
}
|
|
23493
23709
|
),
|
|
23494
23710
|
/* @__PURE__ */ jsx4(
|
|
23495
|
-
|
|
23711
|
+
import_react_router_dom18.Route,
|
|
23496
23712
|
{
|
|
23497
23713
|
element: /* @__PURE__ */ jsx4(
|
|
23498
23714
|
Modal_default,
|
|
@@ -23507,7 +23723,7 @@ function WorkflowCreator() {
|
|
|
23507
23723
|
}
|
|
23508
23724
|
),
|
|
23509
23725
|
/* @__PURE__ */ jsx4(
|
|
23510
|
-
|
|
23726
|
+
import_react_router_dom18.Route,
|
|
23511
23727
|
{
|
|
23512
23728
|
element: /* @__PURE__ */ jsx4(
|
|
23513
23729
|
Modal_default3,
|
|
@@ -23522,7 +23738,7 @@ function WorkflowCreator() {
|
|
|
23522
23738
|
}
|
|
23523
23739
|
),
|
|
23524
23740
|
/* @__PURE__ */ jsx4(
|
|
23525
|
-
|
|
23741
|
+
import_react_router_dom18.Route,
|
|
23526
23742
|
{
|
|
23527
23743
|
element: /* @__PURE__ */ jsx4(
|
|
23528
23744
|
PublishWorkflowModal,
|
|
@@ -23536,7 +23752,7 @@ function WorkflowCreator() {
|
|
|
23536
23752
|
}
|
|
23537
23753
|
),
|
|
23538
23754
|
/* @__PURE__ */ jsx4(
|
|
23539
|
-
|
|
23755
|
+
import_react_router_dom18.Route,
|
|
23540
23756
|
{
|
|
23541
23757
|
element: /* @__PURE__ */ jsx4(
|
|
23542
23758
|
EditWorkflowModal,
|
|
@@ -23550,7 +23766,7 @@ function WorkflowCreator() {
|
|
|
23550
23766
|
}
|
|
23551
23767
|
),
|
|
23552
23768
|
/* @__PURE__ */ jsx4(
|
|
23553
|
-
|
|
23769
|
+
import_react_router_dom18.Route,
|
|
23554
23770
|
{
|
|
23555
23771
|
element: /* @__PURE__ */ jsx4(
|
|
23556
23772
|
DeleteWorkflowModal,
|
|
@@ -23565,7 +23781,7 @@ function WorkflowCreator() {
|
|
|
23565
23781
|
}
|
|
23566
23782
|
),
|
|
23567
23783
|
/* @__PURE__ */ jsx4(
|
|
23568
|
-
|
|
23784
|
+
import_react_router_dom18.Route,
|
|
23569
23785
|
{
|
|
23570
23786
|
element: /* @__PURE__ */ jsx4(
|
|
23571
23787
|
DeleteWorkflowModal,
|
|
@@ -23585,19 +23801,19 @@ function WorkflowCreator() {
|
|
|
23585
23801
|
var Creator_default = WorkflowCreator;
|
|
23586
23802
|
|
|
23587
23803
|
// src/views/Workflows/List/index.tsx
|
|
23588
|
-
var
|
|
23804
|
+
var import_react_router_dom28 = require("react-router-dom");
|
|
23589
23805
|
var import_developer_studio_ui_react46 = require("@livechat/developer-studio-ui-react");
|
|
23590
23806
|
|
|
23591
23807
|
// src/views/Workflows/List/Modals/Create/index.tsx
|
|
23592
|
-
var
|
|
23808
|
+
var import_react_router_dom24 = require("react-router-dom");
|
|
23593
23809
|
|
|
23594
23810
|
// src/views/Workflows/List/Modals/PreviewTemplate/index.tsx
|
|
23595
|
-
var
|
|
23596
|
-
var
|
|
23811
|
+
var import_react98 = require("react");
|
|
23812
|
+
var import_react_router_dom20 = require("react-router-dom");
|
|
23597
23813
|
|
|
23598
23814
|
// src/views/Workflows/List/Modals/PreviewTemplate/Modal.tsx
|
|
23599
|
-
var
|
|
23600
|
-
var
|
|
23815
|
+
var import_react96 = require("react");
|
|
23816
|
+
var import_react_router_dom19 = require("react-router-dom");
|
|
23601
23817
|
var import_design_system_icons34 = require("@livechat/design-system-icons");
|
|
23602
23818
|
var import_design_system_react_components73 = require("@livechat/design-system-react-components");
|
|
23603
23819
|
var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-react");
|
|
@@ -23605,15 +23821,15 @@ var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-
|
|
|
23605
23821
|
// src/views/Workflows/Common/Icons/TemplateCategoryIcon.tsx
|
|
23606
23822
|
var import_design_system_icons33 = require("@livechat/design-system-icons");
|
|
23607
23823
|
var import_design_system_react_components72 = require("@livechat/design-system-react-components");
|
|
23608
|
-
var
|
|
23824
|
+
var import_developer_studio_api29 = require("@livechat/developer-studio-api");
|
|
23609
23825
|
var import_developer_studio_ui_react36 = require("@livechat/developer-studio-ui-react");
|
|
23610
23826
|
function WorkflowTemplateCategoryIcon(props) {
|
|
23611
23827
|
const icons = {
|
|
23612
|
-
[
|
|
23613
|
-
[
|
|
23614
|
-
[
|
|
23615
|
-
[
|
|
23616
|
-
[
|
|
23828
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.NotificationAndAlerts]: import_design_system_icons33.Notifications,
|
|
23829
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.SalesManagement]: import_design_system_icons33.CurrencyDollar,
|
|
23830
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.LeadCollection]: import_design_system_icons33.TargetArrow,
|
|
23831
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.ChatManagement]: import_design_system_icons33.ChatDots,
|
|
23832
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.CustomerExperience]: import_design_system_icons33.Smiles
|
|
23617
23833
|
};
|
|
23618
23834
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react36.Row, { gap: `var(${import_design_system_react_components72.SpacingToken.Spacing1})`, noWrap: true, notPadded: true, children: [
|
|
23619
23835
|
/* @__PURE__ */ jsx4(
|
|
@@ -23678,7 +23894,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
23678
23894
|
template,
|
|
23679
23895
|
onClose
|
|
23680
23896
|
}) {
|
|
23681
|
-
const navigate = (0,
|
|
23897
|
+
const navigate = (0, import_react_router_dom19.useNavigate)();
|
|
23682
23898
|
const {
|
|
23683
23899
|
save,
|
|
23684
23900
|
state: {
|
|
@@ -23689,7 +23905,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
23689
23905
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23690
23906
|
user == null ? void 0 : user.meta.email
|
|
23691
23907
|
);
|
|
23692
|
-
const handleClose = (0,
|
|
23908
|
+
const handleClose = (0, import_react96.useCallback)(
|
|
23693
23909
|
(target) => {
|
|
23694
23910
|
if (onClose) {
|
|
23695
23911
|
onClose();
|
|
@@ -23835,8 +24051,8 @@ function WorkflowTemplatePreview({
|
|
|
23835
24051
|
workflow,
|
|
23836
24052
|
onClose
|
|
23837
24053
|
}) {
|
|
23838
|
-
const flowTemplates = (0,
|
|
23839
|
-
const params = (0,
|
|
24054
|
+
const flowTemplates = (0, import_react98.useMemo)(() => getWorkflowTemplates(), []);
|
|
24055
|
+
const params = (0, import_react_router_dom20.useParams)();
|
|
23840
24056
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
23841
24057
|
const targetWorkflow = workflow || (template == null ? void 0 : template.workflow);
|
|
23842
24058
|
if (!template) {
|
|
@@ -23867,29 +24083,29 @@ function WorkflowTemplatePreview({
|
|
|
23867
24083
|
var PreviewTemplate_default = WorkflowTemplatePreview;
|
|
23868
24084
|
|
|
23869
24085
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
23870
|
-
var
|
|
23871
|
-
var
|
|
24086
|
+
var import_react103 = require("react");
|
|
24087
|
+
var import_react_router_dom23 = require("react-router-dom");
|
|
23872
24088
|
var import_design_system_react_components79 = require("@livechat/design-system-react-components");
|
|
23873
24089
|
|
|
23874
24090
|
// src/views/Workflows/List/Home/Home.tsx
|
|
23875
|
-
var
|
|
24091
|
+
var import_react102 = require("react");
|
|
23876
24092
|
var import_design_system_icons37 = require("@livechat/design-system-icons");
|
|
23877
24093
|
var import_design_system_react_components78 = require("@livechat/design-system-react-components");
|
|
23878
24094
|
var import_developer_studio_ui_react42 = require("@livechat/developer-studio-ui-react");
|
|
23879
24095
|
|
|
23880
24096
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Category.tsx
|
|
23881
|
-
var
|
|
24097
|
+
var import_react99 = require("react");
|
|
23882
24098
|
var import_design_system_icons35 = require("@livechat/design-system-icons");
|
|
23883
24099
|
var import_design_system_react_components74 = require("@livechat/design-system-react-components");
|
|
23884
|
-
var
|
|
24100
|
+
var import_developer_studio_api30 = require("@livechat/developer-studio-api");
|
|
23885
24101
|
var import_developer_studio_ui_react38 = require("@livechat/developer-studio-ui-react");
|
|
23886
24102
|
function WorkflowTemplatesCategoryFilter({
|
|
23887
24103
|
handleStatus,
|
|
23888
24104
|
status
|
|
23889
24105
|
}) {
|
|
23890
24106
|
var _a;
|
|
23891
|
-
const [isVisible, setIsVisible] = (0,
|
|
23892
|
-
const getItem = (0,
|
|
24107
|
+
const [isVisible, setIsVisible] = (0, import_react99.useState)(false);
|
|
24108
|
+
const getItem = (0, import_react99.useCallback)(
|
|
23893
24109
|
(key, category, icon2) => ({
|
|
23894
24110
|
key,
|
|
23895
24111
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react38.Row, { gap: `var(${import_design_system_react_components74.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -23905,11 +24121,11 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
23905
24121
|
);
|
|
23906
24122
|
const options = [
|
|
23907
24123
|
getItem("0", "All"),
|
|
23908
|
-
getItem("1",
|
|
23909
|
-
getItem("2",
|
|
23910
|
-
getItem("3",
|
|
23911
|
-
getItem("4",
|
|
23912
|
-
getItem("5",
|
|
24124
|
+
getItem("1", import_developer_studio_api30.WorkflowTemplateCategory.NotificationAndAlerts, import_design_system_icons35.Notifications),
|
|
24125
|
+
getItem("2", import_developer_studio_api30.WorkflowTemplateCategory.SalesManagement, import_design_system_icons35.CurrencyDollar),
|
|
24126
|
+
getItem("3", import_developer_studio_api30.WorkflowTemplateCategory.LeadCollection, import_design_system_icons35.TargetArrow),
|
|
24127
|
+
getItem("4", import_developer_studio_api30.WorkflowTemplateCategory.ChatManagement, import_design_system_icons35.ChatDots),
|
|
24128
|
+
getItem("5", import_developer_studio_api30.WorkflowTemplateCategory.CustomerExperience, import_design_system_icons35.Smiles)
|
|
23913
24129
|
];
|
|
23914
24130
|
const selectedKey = (_a = options.find(
|
|
23915
24131
|
(option) => option.element.props.children[1] === status
|
|
@@ -23944,18 +24160,18 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
23944
24160
|
var Category_default = WorkflowTemplatesCategoryFilter;
|
|
23945
24161
|
|
|
23946
24162
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Product.tsx
|
|
23947
|
-
var
|
|
24163
|
+
var import_react100 = require("react");
|
|
23948
24164
|
var import_design_system_icons36 = require("@livechat/design-system-icons");
|
|
23949
24165
|
var import_design_system_react_components75 = require("@livechat/design-system-react-components");
|
|
23950
|
-
var
|
|
24166
|
+
var import_developer_studio_api31 = require("@livechat/developer-studio-api");
|
|
23951
24167
|
var import_developer_studio_ui_react39 = require("@livechat/developer-studio-ui-react");
|
|
23952
24168
|
function WorkflowTemplatesProductFilter({
|
|
23953
24169
|
handleStatus,
|
|
23954
24170
|
status
|
|
23955
24171
|
}) {
|
|
23956
24172
|
var _a;
|
|
23957
|
-
const [isVisible, setIsVisible] = (0,
|
|
23958
|
-
const getItem = (0,
|
|
24173
|
+
const [isVisible, setIsVisible] = (0, import_react100.useState)(false);
|
|
24174
|
+
const getItem = (0, import_react100.useCallback)(
|
|
23959
24175
|
(key, product, icon2) => ({
|
|
23960
24176
|
key,
|
|
23961
24177
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react39.Row, { gap: `var(${import_design_system_react_components75.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -23971,11 +24187,11 @@ function WorkflowTemplatesProductFilter({
|
|
|
23971
24187
|
);
|
|
23972
24188
|
const options = [
|
|
23973
24189
|
getItem("0", "All"),
|
|
23974
|
-
getItem("1",
|
|
23975
|
-
getItem("2",
|
|
23976
|
-
getItem("3",
|
|
23977
|
-
getItem("4",
|
|
23978
|
-
getItem("5",
|
|
24190
|
+
getItem("1", import_developer_studio_api31.IntegrationDisplayNames.LiveChat, import_design_system_icons36.LiveChatColored),
|
|
24191
|
+
getItem("2", import_developer_studio_api31.IntegrationDisplayNames.HelpDesk, import_design_system_icons36.HelpDeskColored),
|
|
24192
|
+
getItem("3", import_developer_studio_api31.IntegrationDisplayNames.OpenAI, import_design_system_icons36.Chatgpt),
|
|
24193
|
+
getItem("4", import_developer_studio_api31.IntegrationDisplayNames.Shopify, import_design_system_icons36.ShopifyColored),
|
|
24194
|
+
getItem("5", import_developer_studio_api31.IntegrationDisplayNames.Mailchimp, import_design_system_icons36.Mailchimp)
|
|
23979
24195
|
// getItem('6', IntegrationDisplayNames.Stripe, Stripe),
|
|
23980
24196
|
// getItem('7', IntegrationDisplayNames.GoogleSheets, GoogleSheets),
|
|
23981
24197
|
];
|
|
@@ -24012,7 +24228,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24012
24228
|
var Product_default = WorkflowTemplatesProductFilter;
|
|
24013
24229
|
|
|
24014
24230
|
// src/views/Workflows/List/Home/Cards/Scratch.tsx
|
|
24015
|
-
var
|
|
24231
|
+
var import_react_router_dom21 = require("react-router-dom");
|
|
24016
24232
|
var import_design_system_react_components76 = require("@livechat/design-system-react-components");
|
|
24017
24233
|
var import_developer_studio_ui_react40 = require("@livechat/developer-studio-ui-react");
|
|
24018
24234
|
function WorkflowScratchCard({
|
|
@@ -24020,7 +24236,7 @@ function WorkflowScratchCard({
|
|
|
24020
24236
|
icon: icon2,
|
|
24021
24237
|
openOne
|
|
24022
24238
|
}) {
|
|
24023
|
-
const navigate = (0,
|
|
24239
|
+
const navigate = (0, import_react_router_dom21.useNavigate)();
|
|
24024
24240
|
const { user } = (0, import_developer_studio_ui_react40.useUserContext)();
|
|
24025
24241
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24026
24242
|
user == null ? void 0 : user.meta.email
|
|
@@ -24052,7 +24268,7 @@ function WorkflowScratchCard({
|
|
|
24052
24268
|
var Scratch_default = WorkflowScratchCard;
|
|
24053
24269
|
|
|
24054
24270
|
// src/views/Workflows/List/Home/Cards/Template.tsx
|
|
24055
|
-
var
|
|
24271
|
+
var import_react_router_dom22 = require("react-router-dom");
|
|
24056
24272
|
var import_design_system_react_components77 = require("@livechat/design-system-react-components");
|
|
24057
24273
|
var import_developer_studio_ui_react41 = require("@livechat/developer-studio-ui-react");
|
|
24058
24274
|
var IconWrapper2 = newStyled.div`
|
|
@@ -24070,7 +24286,7 @@ function WorkflowTemplateCard({
|
|
|
24070
24286
|
icons,
|
|
24071
24287
|
category
|
|
24072
24288
|
}) {
|
|
24073
|
-
const navigate = (0,
|
|
24289
|
+
const navigate = (0, import_react_router_dom22.useNavigate)();
|
|
24074
24290
|
return /* @__PURE__ */ jsx4(
|
|
24075
24291
|
import_developer_studio_ui_react41.Card,
|
|
24076
24292
|
{
|
|
@@ -24114,9 +24330,9 @@ var Grid = newStyled.div`
|
|
|
24114
24330
|
gap: var(${import_design_system_react_components78.SpacingToken.Spacing3});
|
|
24115
24331
|
`;
|
|
24116
24332
|
function WorkflowsHome({ isOnModal }) {
|
|
24117
|
-
const [product, setProduct] = (0,
|
|
24118
|
-
const [category, setCategory] = (0,
|
|
24119
|
-
const flowTemplates = (0,
|
|
24333
|
+
const [product, setProduct] = (0, import_react102.useState)("All");
|
|
24334
|
+
const [category, setCategory] = (0, import_react102.useState)("All");
|
|
24335
|
+
const flowTemplates = (0, import_react102.useMemo)(() => getWorkflowTemplates(), []);
|
|
24120
24336
|
const filters = [
|
|
24121
24337
|
(template) => product === "All" || template.products.includes(product),
|
|
24122
24338
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -24218,8 +24434,8 @@ var Home_default = WorkflowsHome;
|
|
|
24218
24434
|
|
|
24219
24435
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24220
24436
|
function WorkflowCreateModal({ onClose }) {
|
|
24221
|
-
const navigate = (0,
|
|
24222
|
-
const handleClose = (0,
|
|
24437
|
+
const navigate = (0, import_react_router_dom23.useNavigate)();
|
|
24438
|
+
const handleClose = (0, import_react103.useCallback)(() => {
|
|
24223
24439
|
if (onClose) {
|
|
24224
24440
|
onClose();
|
|
24225
24441
|
return;
|
|
@@ -24246,21 +24462,21 @@ var Modal_default6 = WorkflowCreateModal;
|
|
|
24246
24462
|
function WorkflowCreate() {
|
|
24247
24463
|
return /* @__PURE__ */ jsxs2(Fragment4, { children: [
|
|
24248
24464
|
/* @__PURE__ */ jsx4(Modal_default6, {}),
|
|
24249
|
-
/* @__PURE__ */ jsx4(
|
|
24465
|
+
/* @__PURE__ */ jsx4(import_react_router_dom24.Routes, { children: /* @__PURE__ */ jsx4(import_react_router_dom24.Route, { element: /* @__PURE__ */ jsx4(PreviewTemplate_default, {}), path: "preview/:template" }) })
|
|
24250
24466
|
] });
|
|
24251
24467
|
}
|
|
24252
24468
|
var Create_default = WorkflowCreate;
|
|
24253
24469
|
|
|
24254
24470
|
// src/views/Workflows/List/View.tsx
|
|
24255
|
-
var
|
|
24256
|
-
var
|
|
24471
|
+
var import_react110 = require("react");
|
|
24472
|
+
var import_react_router_dom27 = require("react-router-dom");
|
|
24257
24473
|
var import_design_system_react_components84 = require("@livechat/design-system-react-components");
|
|
24258
|
-
var
|
|
24474
|
+
var import_developer_studio_api33 = require("@livechat/developer-studio-api");
|
|
24259
24475
|
var import_developer_studio_ui_react45 = require("@livechat/developer-studio-ui-react");
|
|
24260
24476
|
|
|
24261
24477
|
// src/views/Workflows/Creator/LiveChatNavbar.tsx
|
|
24262
|
-
var
|
|
24263
|
-
var
|
|
24478
|
+
var import_react105 = require("react");
|
|
24479
|
+
var import_react_router_dom25 = require("react-router-dom");
|
|
24264
24480
|
var import_design_system_icons38 = require("@livechat/design-system-icons");
|
|
24265
24481
|
var import_design_system_react_components80 = require("@livechat/design-system-react-components");
|
|
24266
24482
|
var wrapperCss = (hasData) => css`
|
|
@@ -24278,12 +24494,12 @@ var wrapperCss = (hasData) => css`
|
|
|
24278
24494
|
}`}
|
|
24279
24495
|
`;
|
|
24280
24496
|
function LiveChatNavbar() {
|
|
24281
|
-
const navigate = (0,
|
|
24497
|
+
const navigate = (0, import_react_router_dom25.useNavigate)();
|
|
24282
24498
|
const workflows = useFetchWorkflows({});
|
|
24283
24499
|
const isLoading = workflows.isLoading;
|
|
24284
24500
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0;
|
|
24285
24501
|
const hasData = !isLoading && !hasNoData;
|
|
24286
|
-
const handleClick = (0,
|
|
24502
|
+
const handleClick = (0, import_react105.useCallback)(() => {
|
|
24287
24503
|
sendMessage("toggleSideNav" /* ToggleSideNav */);
|
|
24288
24504
|
}, []);
|
|
24289
24505
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperCss(hasData), children: [
|
|
@@ -24315,7 +24531,7 @@ var import_design_system_react_components83 = require("@livechat/design-system-r
|
|
|
24315
24531
|
var import_developer_studio_ui_react44 = require("@livechat/developer-studio-ui-react");
|
|
24316
24532
|
|
|
24317
24533
|
// src/views/Workflows/List/Grid/Filters/StatusFilter.tsx
|
|
24318
|
-
var
|
|
24534
|
+
var import_react107 = require("react");
|
|
24319
24535
|
var import_design_system_icons39 = require("@livechat/design-system-icons");
|
|
24320
24536
|
var import_design_system_react_components81 = require("@livechat/design-system-react-components");
|
|
24321
24537
|
function WorkflowStatusFilter({
|
|
@@ -24323,7 +24539,7 @@ function WorkflowStatusFilter({
|
|
|
24323
24539
|
status
|
|
24324
24540
|
}) {
|
|
24325
24541
|
var _a;
|
|
24326
|
-
const [isVisible, setIsVisible] = (0,
|
|
24542
|
+
const [isVisible, setIsVisible] = (0, import_react107.useState)(false);
|
|
24327
24543
|
const items = [
|
|
24328
24544
|
{
|
|
24329
24545
|
key: "0",
|
|
@@ -24381,14 +24597,14 @@ function WorkflowStatusFilter({
|
|
|
24381
24597
|
var StatusFilter_default = WorkflowStatusFilter;
|
|
24382
24598
|
|
|
24383
24599
|
// src/views/Workflows/List/Grid/Table.tsx
|
|
24384
|
-
var
|
|
24600
|
+
var import_react_router_dom26 = require("react-router-dom");
|
|
24385
24601
|
var import_design_system_icons40 = require("@livechat/design-system-icons");
|
|
24386
24602
|
var import_design_system_react_components82 = require("@livechat/design-system-react-components");
|
|
24387
|
-
var
|
|
24603
|
+
var import_developer_studio_api32 = require("@livechat/developer-studio-api");
|
|
24388
24604
|
var import_developer_studio_ui_react43 = require("@livechat/developer-studio-ui-react");
|
|
24389
24605
|
function WorkflowsTable({ workflowsQuery, state }) {
|
|
24390
24606
|
var _a, _b, _c;
|
|
24391
|
-
const navigate = (0,
|
|
24607
|
+
const navigate = (0, import_react_router_dom26.useNavigate)();
|
|
24392
24608
|
const notifications = (0, import_developer_studio_ui_react43.useNotificationContext)();
|
|
24393
24609
|
const deleteAction = useDeleteWorkflow();
|
|
24394
24610
|
const activateWorkflowAction = useActivateWorkflow();
|
|
@@ -24449,7 +24665,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
24449
24665
|
) : null
|
|
24450
24666
|
] }) }),
|
|
24451
24667
|
/* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react43.Row, { gap: 12, notPadded: true, children: (_d = workflow.tags) == null ? void 0 : _d.map((tag) => {
|
|
24452
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() ===
|
|
24668
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === import_developer_studio_api32.IntegrationNames.BigCommerce.toLowerCase());
|
|
24453
24669
|
return /* @__PURE__ */ jsx4(
|
|
24454
24670
|
ProductIcon_default,
|
|
24455
24671
|
{
|
|
@@ -24632,8 +24848,8 @@ var markedStyles = css`
|
|
|
24632
24848
|
`;
|
|
24633
24849
|
function WorkflowListView() {
|
|
24634
24850
|
var _a;
|
|
24635
|
-
const navigate = (0,
|
|
24636
|
-
const [state, setState] = (0,
|
|
24851
|
+
const navigate = (0, import_react_router_dom27.useNavigate)();
|
|
24852
|
+
const [state, setState] = (0, import_react110.useState)({
|
|
24637
24853
|
filters: {
|
|
24638
24854
|
status: "All",
|
|
24639
24855
|
tasks: "All"
|
|
@@ -24694,7 +24910,7 @@ function WorkflowListView() {
|
|
|
24694
24910
|
Grid_default,
|
|
24695
24911
|
{
|
|
24696
24912
|
onStateChange: (change) => {
|
|
24697
|
-
setState((prevState) => (0,
|
|
24913
|
+
setState((prevState) => (0, import_developer_studio_api33.mergeDeep)(prevState, change));
|
|
24698
24914
|
},
|
|
24699
24915
|
state,
|
|
24700
24916
|
workflowQuery: workflows
|
|
@@ -24710,10 +24926,10 @@ var View_default2 = WorkflowListView;
|
|
|
24710
24926
|
function WorkflowList() {
|
|
24711
24927
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react46.Row, { noMaxWidth: true, noWrap: true, notPadded: true, stretch: true, children: [
|
|
24712
24928
|
/* @__PURE__ */ jsx4(View_default2, {}),
|
|
24713
|
-
/* @__PURE__ */ jsxs2(
|
|
24714
|
-
/* @__PURE__ */ jsx4(
|
|
24715
|
-
/* @__PURE__ */ jsx4(
|
|
24716
|
-
/* @__PURE__ */ jsx4(
|
|
24929
|
+
/* @__PURE__ */ jsxs2(import_react_router_dom28.Routes, { children: [
|
|
24930
|
+
/* @__PURE__ */ jsx4(import_react_router_dom28.Route, { element: /* @__PURE__ */ jsx4(PreviewTemplate_default, {}), path: "preview/:template" }),
|
|
24931
|
+
/* @__PURE__ */ jsx4(import_react_router_dom28.Route, { element: /* @__PURE__ */ jsx4(Create_default, {}), path: "create/*" }),
|
|
24932
|
+
/* @__PURE__ */ jsx4(import_react_router_dom28.Route, { element: /* @__PURE__ */ jsx4(WorkflowDetails, { headerType: "name" }), path: ":id/*" })
|
|
24717
24933
|
] })
|
|
24718
24934
|
] });
|
|
24719
24935
|
}
|
|
@@ -24722,9 +24938,9 @@ var List_default2 = WorkflowList;
|
|
|
24722
24938
|
// src/views/Workflows/index.tsx
|
|
24723
24939
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
24724
24940
|
function Workflows() {
|
|
24725
|
-
const navigate = (0,
|
|
24941
|
+
const navigate = (0, import_react_router_dom29.useNavigate)();
|
|
24726
24942
|
const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
|
|
24727
|
-
(0,
|
|
24943
|
+
(0, import_react112.useEffect)(() => {
|
|
24728
24944
|
if (isWorkflowAppLoading) {
|
|
24729
24945
|
return;
|
|
24730
24946
|
}
|
|
@@ -24735,10 +24951,10 @@ function Workflows() {
|
|
|
24735
24951
|
if (isWorkflowAppLoading) {
|
|
24736
24952
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_developer_studio_ui_react47.Loader, { stretch: true });
|
|
24737
24953
|
}
|
|
24738
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
24739
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
24740
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
24741
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
24954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_react_router_dom29.Routes, { children: [
|
|
24955
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_router_dom29.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_router_dom29.Navigate, { replace: true, to: "list" }), path: "" }),
|
|
24956
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_router_dom29.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(List_default2, {}), path: "list/*" }),
|
|
24957
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_router_dom29.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Creator_default, {}), path: ":id/*" })
|
|
24742
24958
|
] });
|
|
24743
24959
|
}
|
|
24744
24960
|
var Workflows_default = Workflows;
|
|
@@ -24787,14 +25003,15 @@ var LoginError_default = LoginErrorPage;
|
|
|
24787
25003
|
// src/views/index.tsx
|
|
24788
25004
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
24789
25005
|
function WorkflowsModule({ waitlistImage }) {
|
|
24790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
24791
|
-
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
24792
|
-
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
25006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_react_router_dom30.Routes, { children: [
|
|
25007
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_react_router_dom30.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Workflows_default, {}), path: "*" }),
|
|
25008
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_react_router_dom30.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Waitlist_default, { image: waitlistImage }), path: "/waitlist" })
|
|
24793
25009
|
] });
|
|
24794
25010
|
}
|
|
24795
25011
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24796
25012
|
0 && (module.exports = {
|
|
24797
25013
|
LoginError,
|
|
25014
|
+
WORKFLOWS_TEST_SELECTORS,
|
|
24798
25015
|
WorkflowsModule,
|
|
24799
25016
|
config,
|
|
24800
25017
|
getWorkflowsEnv,
|