@livechat/platform-workflows 0.0.89 → 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 +837 -633
- package/dist/index.mjs +645 -556
- package/package.json +9 -4
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
|
|
@@ -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,7 +17685,7 @@ 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
17690
|
var pickerCustomStyles = (readonly) => css`
|
|
17545
17691
|
flex: 1;
|
|
@@ -17553,12 +17699,12 @@ function PredefinedCustomStringField(props) {
|
|
|
17553
17699
|
var _a;
|
|
17554
17700
|
const { resourceQuery, onChange, schema } = props;
|
|
17555
17701
|
const resourceConfig = schema["x-ref"];
|
|
17556
|
-
const [pickerOptions, setPickerOptions] = (0,
|
|
17557
|
-
(0,
|
|
17702
|
+
const [pickerOptions, setPickerOptions] = (0, import_react37.useState)([]);
|
|
17703
|
+
(0, import_react37.useEffect)(() => {
|
|
17558
17704
|
var _a2, _b;
|
|
17559
17705
|
if (!resourceConfig) {
|
|
17560
17706
|
if (resourceQuery.data) {
|
|
17561
|
-
onChange(
|
|
17707
|
+
onChange("");
|
|
17562
17708
|
}
|
|
17563
17709
|
return;
|
|
17564
17710
|
}
|
|
@@ -17590,17 +17736,29 @@ var {
|
|
|
17590
17736
|
fields: { StringField }
|
|
17591
17737
|
} = (0, import_core.getDefaultRegistry)();
|
|
17592
17738
|
function CustomStringField(props) {
|
|
17593
|
-
var _a;
|
|
17739
|
+
var _a, _b, _c;
|
|
17594
17740
|
const onChange = props.onChange;
|
|
17595
17741
|
const resourceConfig = props.schema["x-ref"];
|
|
17596
17742
|
const resourceQuery = (0, import_platform_integrations3.useFetchIntegrationResourceQuery)(resourceConfig);
|
|
17597
|
-
const [
|
|
17743
|
+
const [pristine, setPristine] = (0, import_react39.useState)(true);
|
|
17744
|
+
const [isPredefinedMode, setIsPredefinedMode] = (0, import_react39.useState)(
|
|
17598
17745
|
() => {
|
|
17599
|
-
var _a2,
|
|
17600
|
-
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;
|
|
17601
17748
|
}
|
|
17602
17749
|
);
|
|
17603
|
-
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)(
|
|
17604
17762
|
() => [
|
|
17605
17763
|
resourceConfig ? {
|
|
17606
17764
|
key: "predefined",
|
|
@@ -17616,8 +17774,10 @@ function CustomStringField(props) {
|
|
|
17616
17774
|
}
|
|
17617
17775
|
) }),
|
|
17618
17776
|
onClick: () => {
|
|
17619
|
-
|
|
17620
|
-
|
|
17777
|
+
handleChange("");
|
|
17778
|
+
setTimeout(() => {
|
|
17779
|
+
setIsPredefinedMode(true);
|
|
17780
|
+
}, 50);
|
|
17621
17781
|
}
|
|
17622
17782
|
} : void 0,
|
|
17623
17783
|
{
|
|
@@ -17634,28 +17794,47 @@ function CustomStringField(props) {
|
|
|
17634
17794
|
}
|
|
17635
17795
|
) }),
|
|
17636
17796
|
onClick: () => {
|
|
17637
|
-
|
|
17797
|
+
handleChange("");
|
|
17638
17798
|
setTimeout(() => {
|
|
17639
17799
|
setIsPredefinedMode(false);
|
|
17640
|
-
},
|
|
17800
|
+
}, 50);
|
|
17641
17801
|
}
|
|
17642
17802
|
}
|
|
17643
17803
|
].filter(Boolean),
|
|
17644
|
-
[resourceConfig,
|
|
17804
|
+
[resourceConfig, handleChange, setIsPredefinedMode]
|
|
17645
17805
|
);
|
|
17646
|
-
(0,
|
|
17647
|
-
var _a2,
|
|
17806
|
+
(0, import_react39.useEffect)(() => {
|
|
17807
|
+
var _a2, _b2, _c2;
|
|
17808
|
+
if (!pristine && !props.formData) {
|
|
17809
|
+
return;
|
|
17810
|
+
}
|
|
17648
17811
|
setIsPredefinedMode(
|
|
17649
17812
|
((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some(
|
|
17650
17813
|
(option) => option.key === props.formData
|
|
17651
|
-
)) || !props.formData && ((
|
|
17814
|
+
)) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0
|
|
17652
17815
|
);
|
|
17653
|
-
}, [(_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]);
|
|
17654
17820
|
if (props.schema.enum || props.schema.oneOf) {
|
|
17655
17821
|
return /* @__PURE__ */ jsx4(StringField, __spreadValues({}, props));
|
|
17656
17822
|
}
|
|
17657
17823
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react16.Row, { gap: `var(${import_design_system_react_components20.SpacingToken.Spacing1})`, notPadded: true, children: [
|
|
17658
|
-
|
|
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
|
+
),
|
|
17659
17838
|
modeSelectorOptions.length > 1 && /* @__PURE__ */ jsx4(
|
|
17660
17839
|
import_design_system_react_components20.ActionMenu,
|
|
17661
17840
|
{
|
|
@@ -17664,9 +17843,9 @@ function CustomStringField(props) {
|
|
|
17664
17843
|
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
17665
17844
|
import_design_system_react_components20.Button,
|
|
17666
17845
|
{
|
|
17846
|
+
disabled: props.readonly,
|
|
17667
17847
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components20.Icon, { source: import_design_system_icons10.MoreHoriz }),
|
|
17668
|
-
kind: "secondary"
|
|
17669
|
-
disabled: props.readonly
|
|
17848
|
+
kind: "secondary"
|
|
17670
17849
|
}
|
|
17671
17850
|
)
|
|
17672
17851
|
}
|
|
@@ -17755,10 +17934,10 @@ function CustomMoveDownButton(props) {
|
|
|
17755
17934
|
}
|
|
17756
17935
|
|
|
17757
17936
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomArrayFieldTemplate.tsx
|
|
17758
|
-
var
|
|
17937
|
+
var import_utils16 = require("@rjsf/utils");
|
|
17759
17938
|
|
|
17760
17939
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomArrayFieldHeader.tsx
|
|
17761
|
-
var
|
|
17940
|
+
var import_utils15 = require("@rjsf/utils");
|
|
17762
17941
|
var import_design_system_react_components22 = require("@livechat/design-system-react-components");
|
|
17763
17942
|
var import_developer_studio_ui_react17 = require("@livechat/developer-studio-ui-react");
|
|
17764
17943
|
function CustomArrayFieldHeader(props) {
|
|
@@ -17772,9 +17951,9 @@ function CustomArrayFieldHeader(props) {
|
|
|
17772
17951
|
uiSchema,
|
|
17773
17952
|
hideOptionalBadge
|
|
17774
17953
|
} = props;
|
|
17775
|
-
const options = (0,
|
|
17776
|
-
const ArrayFieldTitleTemplate = (0,
|
|
17777
|
-
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);
|
|
17778
17957
|
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react17.Row, { noWrap: true, notPadded: true, spaceBetween: true, children: /* @__PURE__ */ jsxs2(
|
|
17779
17958
|
import_developer_studio_ui_react17.Row,
|
|
17780
17959
|
{
|
|
@@ -17836,8 +18015,8 @@ function CustomArrayFieldTemplate(props) {
|
|
|
17836
18015
|
schema,
|
|
17837
18016
|
title
|
|
17838
18017
|
} = props;
|
|
17839
|
-
const uiOptions = (0,
|
|
17840
|
-
const ArrayFieldItemTemplate = (0,
|
|
18018
|
+
const uiOptions = (0, import_utils16.getUiOptions)(uiSchema);
|
|
18019
|
+
const ArrayFieldItemTemplate = (0, import_utils16.getTemplate)(
|
|
17841
18020
|
"ArrayFieldItemTemplate",
|
|
17842
18021
|
registry,
|
|
17843
18022
|
uiOptions
|
|
@@ -17915,11 +18094,11 @@ function CustomDescriptionFieldTemplate(props) {
|
|
|
17915
18094
|
}
|
|
17916
18095
|
|
|
17917
18096
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomField.tsx
|
|
17918
|
-
var
|
|
18097
|
+
var import_utils18 = require("@rjsf/utils");
|
|
17919
18098
|
var import_design_system_react_components25 = require("@livechat/design-system-react-components");
|
|
17920
18099
|
|
|
17921
18100
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomFieldHeader.tsx
|
|
17922
|
-
var
|
|
18101
|
+
var import_utils17 = require("@rjsf/utils");
|
|
17923
18102
|
var import_design_system_react_components24 = require("@livechat/design-system-react-components");
|
|
17924
18103
|
var import_developer_studio_ui_react18 = require("@livechat/developer-studio-ui-react");
|
|
17925
18104
|
var OptionalWrapper = newStyled.div`
|
|
@@ -17939,13 +18118,13 @@ function CustomFieldHeader(props) {
|
|
|
17939
18118
|
uiSchema,
|
|
17940
18119
|
hideOptionalBadge
|
|
17941
18120
|
} = props;
|
|
17942
|
-
const options = (0,
|
|
17943
|
-
const TitleFieldTemplate = (0,
|
|
18121
|
+
const options = (0, import_utils17.getUiOptions)(uiSchema);
|
|
18122
|
+
const TitleFieldTemplate = (0, import_utils17.getTemplate)(
|
|
17944
18123
|
"TitleFieldTemplate",
|
|
17945
18124
|
registry,
|
|
17946
18125
|
options
|
|
17947
18126
|
);
|
|
17948
|
-
const DescriptionFieldTemplate = (0,
|
|
18127
|
+
const DescriptionFieldTemplate = (0, import_utils17.getTemplate)("DescriptionFieldTemplate", registry, options);
|
|
17949
18128
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react18.Row, { noWrap: true, notPadded: true, spaceBetween: true, children: [
|
|
17950
18129
|
/* @__PURE__ */ jsxs2(
|
|
17951
18130
|
import_developer_studio_ui_react18.Row,
|
|
@@ -17957,7 +18136,7 @@ function CustomFieldHeader(props) {
|
|
|
17957
18136
|
label ? /* @__PURE__ */ jsx4(
|
|
17958
18137
|
TitleFieldTemplate,
|
|
17959
18138
|
{
|
|
17960
|
-
id: (0,
|
|
18139
|
+
id: (0, import_utils17.titleId)(id),
|
|
17961
18140
|
registry,
|
|
17962
18141
|
required,
|
|
17963
18142
|
schema,
|
|
@@ -17969,7 +18148,7 @@ function CustomFieldHeader(props) {
|
|
|
17969
18148
|
DescriptionFieldTemplate,
|
|
17970
18149
|
{
|
|
17971
18150
|
description,
|
|
17972
|
-
id: (0,
|
|
18151
|
+
id: (0, import_utils17.descriptionId)(id),
|
|
17973
18152
|
registry,
|
|
17974
18153
|
schema,
|
|
17975
18154
|
uiSchema
|
|
@@ -18019,9 +18198,9 @@ function CustomFieldTemplate(props) {
|
|
|
18019
18198
|
"schema",
|
|
18020
18199
|
"uiSchema"
|
|
18021
18200
|
]);
|
|
18022
|
-
const options = (0,
|
|
18023
|
-
const additional =
|
|
18024
|
-
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)(
|
|
18025
18204
|
"WrapIfAdditionalTemplate",
|
|
18026
18205
|
registry,
|
|
18027
18206
|
options
|
|
@@ -18072,7 +18251,7 @@ function CustomFieldTemplate(props) {
|
|
|
18072
18251
|
}
|
|
18073
18252
|
|
|
18074
18253
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomFieldWrapper.tsx
|
|
18075
|
-
var
|
|
18254
|
+
var import_utils19 = require("@rjsf/utils");
|
|
18076
18255
|
var import_design_system_react_components26 = require("@livechat/design-system-react-components");
|
|
18077
18256
|
function CustomWrapIfAdditionalTemplate(props) {
|
|
18078
18257
|
const {
|
|
@@ -18087,7 +18266,7 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18087
18266
|
classNames,
|
|
18088
18267
|
style
|
|
18089
18268
|
} = props;
|
|
18090
|
-
const additional =
|
|
18269
|
+
const additional = import_utils19.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
18091
18270
|
if (!additional) {
|
|
18092
18271
|
return /* @__PURE__ */ jsx4("div", { className: classNames, style, children });
|
|
18093
18272
|
}
|
|
@@ -18118,8 +18297,8 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18118
18297
|
}
|
|
18119
18298
|
|
|
18120
18299
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomObjectField.tsx
|
|
18121
|
-
var
|
|
18122
|
-
var
|
|
18300
|
+
var import_react43 = require("react");
|
|
18301
|
+
var import_utils20 = require("@rjsf/utils");
|
|
18123
18302
|
var import_design_system_react_components27 = require("@livechat/design-system-react-components");
|
|
18124
18303
|
function CustomObjectFieldTemplate(props) {
|
|
18125
18304
|
const {
|
|
@@ -18139,11 +18318,11 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18139
18318
|
const {
|
|
18140
18319
|
ButtonTemplates: { AddButton }
|
|
18141
18320
|
} = registry.templates;
|
|
18142
|
-
const [optionalVisible, setOptionalVisible] = (0,
|
|
18143
|
-
const [touched, setTouched] = (0,
|
|
18321
|
+
const [optionalVisible, setOptionalVisible] = (0, import_react43.useState)(false);
|
|
18322
|
+
const [touched, setTouched] = (0, import_react43.useState)({});
|
|
18144
18323
|
const newProperties = properties.map((prop) => {
|
|
18145
18324
|
return __spreadProps(__spreadValues({}, prop), {
|
|
18146
|
-
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)),
|
|
18147
18326
|
content: __spreadProps(__spreadValues({}, prop.content), {
|
|
18148
18327
|
props: __spreadProps(__spreadValues({}, prop.content.props), {
|
|
18149
18328
|
onChange: (value, newErrorSchema, id) => {
|
|
@@ -18199,7 +18378,7 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18199
18378
|
)
|
|
18200
18379
|
}
|
|
18201
18380
|
) : null,
|
|
18202
|
-
(0,
|
|
18381
|
+
(0, import_utils20.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ jsx4(
|
|
18203
18382
|
"div",
|
|
18204
18383
|
{
|
|
18205
18384
|
style: {
|
|
@@ -18416,7 +18595,7 @@ function ForkJoinNodeForm({
|
|
|
18416
18595
|
var Form_default2 = ForkJoinNodeForm;
|
|
18417
18596
|
|
|
18418
18597
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Node.tsx
|
|
18419
|
-
var
|
|
18598
|
+
var import_react47 = require("react");
|
|
18420
18599
|
var import_reactflow6 = require("reactflow");
|
|
18421
18600
|
|
|
18422
18601
|
// src/views/Workflows/Creator/Builder/Handles/CustomAdd/Handle.tsx
|
|
@@ -18533,7 +18712,7 @@ function CustomNodeWrapper({
|
|
|
18533
18712
|
|
|
18534
18713
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Node.tsx
|
|
18535
18714
|
function ForkJoinNode(node2) {
|
|
18536
|
-
const [isHovered, setIsHovered] = (0,
|
|
18715
|
+
const [isHovered, setIsHovered] = (0, import_react47.useState)(false);
|
|
18537
18716
|
const {
|
|
18538
18717
|
updateTask,
|
|
18539
18718
|
removeTask,
|
|
@@ -18600,7 +18779,7 @@ function ForkJoinNode(node2) {
|
|
|
18600
18779
|
}
|
|
18601
18780
|
);
|
|
18602
18781
|
}
|
|
18603
|
-
var Node_default = (0,
|
|
18782
|
+
var Node_default = (0, import_react47.memo)(ForkJoinNode);
|
|
18604
18783
|
|
|
18605
18784
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Base.tsx
|
|
18606
18785
|
var import_design_system_icons15 = require("@livechat/design-system-icons");
|
|
@@ -18730,20 +18909,20 @@ function HttpNodeBase({
|
|
|
18730
18909
|
var Base_default2 = HttpNodeBase;
|
|
18731
18910
|
|
|
18732
18911
|
// src/views/Workflows/Creator/Builder/Forms/Schema/Wrapper.tsx
|
|
18733
|
-
var
|
|
18912
|
+
var import_react50 = require("react");
|
|
18734
18913
|
var import_design_system_icons16 = require("@livechat/design-system-icons");
|
|
18735
18914
|
var import_design_system_react_components36 = require("@livechat/design-system-react-components");
|
|
18736
18915
|
var import_developer_studio_api24 = require("@livechat/developer-studio-api");
|
|
18737
18916
|
var import_platform_integrations5 = require("@livechat/platform-integrations");
|
|
18738
18917
|
|
|
18739
18918
|
// src/views/Workflows/Creator/Builder/Forms/Schema/integrations/Text/index.tsx
|
|
18740
|
-
var
|
|
18741
|
-
var
|
|
18919
|
+
var import_react49 = require("react");
|
|
18920
|
+
var import_react_router_dom7 = require("react-router-dom");
|
|
18742
18921
|
var import_design_system_react_components35 = require("@livechat/design-system-react-components");
|
|
18743
18922
|
var import_developer_studio_ui_react20 = require("@livechat/developer-studio-ui-react");
|
|
18744
18923
|
var import_platform_integrations4 = require("@livechat/platform-integrations");
|
|
18745
18924
|
function GlobalAccounts(props) {
|
|
18746
|
-
const { pathname } = (0,
|
|
18925
|
+
const { pathname } = (0, import_react_router_dom7.useLocation)();
|
|
18747
18926
|
const notifications = (0, import_developer_studio_ui_react20.useNotificationContext)();
|
|
18748
18927
|
const { user } = (0, import_developer_studio_ui_react20.useUserContext)();
|
|
18749
18928
|
const organizationProductsQuery = useFetchOrganizationProducts();
|
|
@@ -18754,7 +18933,7 @@ function GlobalAccounts(props) {
|
|
|
18754
18933
|
const needToBeActivated = organizationProductsQuery.data ? !organizationProductsQuery.data.find(
|
|
18755
18934
|
(product) => product.product === props.product
|
|
18756
18935
|
) : void 0;
|
|
18757
|
-
const refetch = (0,
|
|
18936
|
+
const refetch = (0, import_react49.useCallback)(() => {
|
|
18758
18937
|
void organizationProductsQuery.refetch();
|
|
18759
18938
|
}, [organizationProductsQuery]);
|
|
18760
18939
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react20.Column, { gap: `var(${import_design_system_react_components35.SpacingToken.Spacing3})`, notPadded: true, children: [
|
|
@@ -18830,11 +19009,11 @@ function CustomSchemaFormWrapper({
|
|
|
18830
19009
|
preselectedTab,
|
|
18831
19010
|
tabsMetadata
|
|
18832
19011
|
}) {
|
|
18833
|
-
const spec = (0,
|
|
18834
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
19012
|
+
const spec = (0, import_react50.useMemo)(() => WorkflowSpecification.getItemConfig(data), [data]);
|
|
19013
|
+
const [selectedTab, setSelectedTab] = (0, import_react50.useState)(
|
|
18835
19014
|
preselectedTab != null ? preselectedTab : !spec || spec.specification.input ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
|
|
18836
19015
|
);
|
|
18837
|
-
const tabItems = (0,
|
|
19016
|
+
const tabItems = (0, import_react50.useMemo)(
|
|
18838
19017
|
() => [
|
|
18839
19018
|
!spec || spec.specification.input ? { id: "parameters", title: "Parameters" } : void 0,
|
|
18840
19019
|
spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? {
|
|
@@ -18904,7 +19083,7 @@ function HttpNodeForm({
|
|
|
18904
19083
|
onChange,
|
|
18905
19084
|
readonly
|
|
18906
19085
|
}) {
|
|
18907
|
-
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;
|
|
18908
19087
|
const spec = (_a = metadata.frame.__meta) == null ? void 0 : _a.config;
|
|
18909
19088
|
if (data.name === "http") {
|
|
18910
19089
|
return /* @__PURE__ */ jsx4(
|
|
@@ -18953,15 +19132,7 @@ function HttpNodeForm({
|
|
|
18953
19132
|
data
|
|
18954
19133
|
}),
|
|
18955
19134
|
formData: queryParams,
|
|
18956
|
-
formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ?
|
|
18957
|
-
Object.entries(queryParams).map((entry) => {
|
|
18958
|
-
var _a2, _b2, _c2;
|
|
18959
|
-
return [
|
|
18960
|
-
entry[0],
|
|
18961
|
-
(_c2 = (_b2 = (_a2 = metadata.errors) == null ? void 0 : _a2.inputParameters) == null ? void 0 : _b2.http_request) == null ? void 0 : _c2.uri
|
|
18962
|
-
];
|
|
18963
|
-
})
|
|
18964
|
-
) : 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,
|
|
18965
19136
|
onChange: (formData) => {
|
|
18966
19137
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
18967
19138
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -18975,14 +19146,14 @@ function HttpNodeForm({
|
|
|
18975
19146
|
schema: spec.specification.input.properties.query
|
|
18976
19147
|
}
|
|
18977
19148
|
) : void 0,
|
|
18978
|
-
((
|
|
19149
|
+
((_q = (_p = spec == null ? void 0 : spec.specification.input) == null ? void 0 : _p.properties) == null ? void 0 : _q.body) ? /* @__PURE__ */ jsx4(
|
|
18979
19150
|
Form_default,
|
|
18980
19151
|
{
|
|
18981
19152
|
formContext: __spreadProps(__spreadValues({}, metadata), {
|
|
18982
19153
|
data
|
|
18983
19154
|
}),
|
|
18984
19155
|
formData: data.inputParameters.http_request.body,
|
|
18985
|
-
formErrors: (
|
|
19156
|
+
formErrors: (_t = (_s = (_r = metadata.errors) == null ? void 0 : _r.inputParameters) == null ? void 0 : _s.http_request) == null ? void 0 : _t.body,
|
|
18986
19157
|
onChange: (formData) => {
|
|
18987
19158
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
18988
19159
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -19003,10 +19174,10 @@ function HttpNodeForm({
|
|
|
19003
19174
|
var Form_default3 = HttpNodeForm;
|
|
19004
19175
|
|
|
19005
19176
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Node.tsx
|
|
19006
|
-
var
|
|
19177
|
+
var import_react52 = require("react");
|
|
19007
19178
|
var import_reactflow7 = require("reactflow");
|
|
19008
19179
|
function HttpNode(node2) {
|
|
19009
|
-
const [isHovered, setIsHovered] = (0,
|
|
19180
|
+
const [isHovered, setIsHovered] = (0, import_react52.useState)(false);
|
|
19010
19181
|
const {
|
|
19011
19182
|
removeTask,
|
|
19012
19183
|
goToAddTask,
|
|
@@ -19075,7 +19246,7 @@ function HttpNode(node2) {
|
|
|
19075
19246
|
}
|
|
19076
19247
|
);
|
|
19077
19248
|
}
|
|
19078
|
-
var Node_default2 = (0,
|
|
19249
|
+
var Node_default2 = (0, import_react52.memo)(HttpNode);
|
|
19079
19250
|
|
|
19080
19251
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Base.tsx
|
|
19081
19252
|
var import_design_system_icons17 = require("@livechat/design-system-icons");
|
|
@@ -19186,7 +19357,7 @@ function JoinNodeForm({
|
|
|
19186
19357
|
var Form_default4 = JoinNodeForm;
|
|
19187
19358
|
|
|
19188
19359
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Node.tsx
|
|
19189
|
-
var
|
|
19360
|
+
var import_react54 = require("react");
|
|
19190
19361
|
var import_reactflow8 = require("reactflow");
|
|
19191
19362
|
function JoinNode(node2) {
|
|
19192
19363
|
const {
|
|
@@ -19229,7 +19400,7 @@ function JoinNode(node2) {
|
|
|
19229
19400
|
}
|
|
19230
19401
|
) });
|
|
19231
19402
|
}
|
|
19232
|
-
var Node_default3 = (0,
|
|
19403
|
+
var Node_default3 = (0, import_react54.memo)(JoinNode);
|
|
19233
19404
|
|
|
19234
19405
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Base.tsx
|
|
19235
19406
|
var import_design_system_icons18 = require("@livechat/design-system-icons");
|
|
@@ -19366,7 +19537,7 @@ function SwitchNodeForm({
|
|
|
19366
19537
|
var Form_default5 = SwitchNodeForm;
|
|
19367
19538
|
|
|
19368
19539
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Node.tsx
|
|
19369
|
-
var
|
|
19540
|
+
var import_react56 = require("react");
|
|
19370
19541
|
var import_reactflow9 = require("reactflow");
|
|
19371
19542
|
var import_design_system_react_components39 = require("@livechat/design-system-react-components");
|
|
19372
19543
|
var handlerWrapperCss = css`
|
|
@@ -19386,7 +19557,7 @@ var handlerWrapperCss = css`
|
|
|
19386
19557
|
}
|
|
19387
19558
|
`;
|
|
19388
19559
|
function SwitchNode(node2) {
|
|
19389
|
-
const [isHovered, setIsHovered] = (0,
|
|
19560
|
+
const [isHovered, setIsHovered] = (0, import_react56.useState)(false);
|
|
19390
19561
|
const {
|
|
19391
19562
|
removeTask,
|
|
19392
19563
|
goToAddTask,
|
|
@@ -19473,7 +19644,7 @@ function SwitchNode(node2) {
|
|
|
19473
19644
|
}
|
|
19474
19645
|
);
|
|
19475
19646
|
}
|
|
19476
|
-
var Node_default4 = (0,
|
|
19647
|
+
var Node_default4 = (0, import_react56.memo)(SwitchNode);
|
|
19477
19648
|
|
|
19478
19649
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Base.tsx
|
|
19479
19650
|
var import_design_system_icons19 = require("@livechat/design-system-icons");
|
|
@@ -19575,10 +19746,10 @@ function TerminateNodeForm({
|
|
|
19575
19746
|
var Form_default6 = TerminateNodeForm;
|
|
19576
19747
|
|
|
19577
19748
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Node.tsx
|
|
19578
|
-
var
|
|
19749
|
+
var import_react58 = require("react");
|
|
19579
19750
|
var import_reactflow10 = require("reactflow");
|
|
19580
19751
|
function TerminateNode(node2) {
|
|
19581
|
-
const [isHovered, setIsHovered] = (0,
|
|
19752
|
+
const [isHovered, setIsHovered] = (0, import_react58.useState)(false);
|
|
19582
19753
|
const {
|
|
19583
19754
|
removeTask,
|
|
19584
19755
|
goToAddTask,
|
|
@@ -19630,7 +19801,7 @@ function TerminateNode(node2) {
|
|
|
19630
19801
|
}
|
|
19631
19802
|
);
|
|
19632
19803
|
}
|
|
19633
|
-
var Node_default5 = (0,
|
|
19804
|
+
var Node_default5 = (0, import_react58.memo)(TerminateNode);
|
|
19634
19805
|
|
|
19635
19806
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Base.tsx
|
|
19636
19807
|
var import_design_system_react_components41 = require("@livechat/design-system-react-components");
|
|
@@ -19744,7 +19915,7 @@ function TriggerNodeBase({
|
|
|
19744
19915
|
var Base_default6 = TriggerNodeBase;
|
|
19745
19916
|
|
|
19746
19917
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Form.tsx
|
|
19747
|
-
var
|
|
19918
|
+
var import_react60 = require("react");
|
|
19748
19919
|
var import_react_js_cron = require("react-js-cron");
|
|
19749
19920
|
var import_design_system_react_components42 = require("@livechat/design-system-react-components");
|
|
19750
19921
|
var cronCss = css`
|
|
@@ -19781,7 +19952,7 @@ var cronCss = css`
|
|
|
19781
19952
|
}
|
|
19782
19953
|
`;
|
|
19783
19954
|
function CronWrapper(props) {
|
|
19784
|
-
const [state, setState] = (0,
|
|
19955
|
+
const [state, setState] = (0, import_react60.useState)(props.value);
|
|
19785
19956
|
return /* @__PURE__ */ jsx4(
|
|
19786
19957
|
import_react_js_cron.Cron,
|
|
19787
19958
|
{
|
|
@@ -19854,10 +20025,10 @@ function TriggerNodeForm({
|
|
|
19854
20025
|
var Form_default7 = TriggerNodeForm;
|
|
19855
20026
|
|
|
19856
20027
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Node.tsx
|
|
19857
|
-
var
|
|
20028
|
+
var import_react62 = require("react");
|
|
19858
20029
|
var import_reactflow11 = require("reactflow");
|
|
19859
20030
|
function TriggerNode(node2) {
|
|
19860
|
-
const [isHovered, setIsHovered] = (0,
|
|
20031
|
+
const [isHovered, setIsHovered] = (0, import_react62.useState)(false);
|
|
19861
20032
|
const {
|
|
19862
20033
|
goToAddTask,
|
|
19863
20034
|
removeTrigger,
|
|
@@ -19912,11 +20083,11 @@ function TriggerNode(node2) {
|
|
|
19912
20083
|
}
|
|
19913
20084
|
);
|
|
19914
20085
|
}
|
|
19915
|
-
var Node_default6 = (0,
|
|
20086
|
+
var Node_default6 = (0, import_react62.memo)(TriggerNode);
|
|
19916
20087
|
|
|
19917
20088
|
// src/views/Workflows/Creator/Builder/Controls/CustomControls.tsx
|
|
19918
|
-
var
|
|
19919
|
-
var
|
|
20089
|
+
var import_react82 = require("react");
|
|
20090
|
+
var import_react_router_dom10 = require("react-router-dom");
|
|
19920
20091
|
var import_reactflow12 = require("reactflow");
|
|
19921
20092
|
var import_design_system_icons26 = require("@livechat/design-system-icons");
|
|
19922
20093
|
var import_design_system_react_components58 = require("@livechat/design-system-react-components");
|
|
@@ -20048,12 +20219,12 @@ function StopGenerateButton() {
|
|
|
20048
20219
|
}
|
|
20049
20220
|
|
|
20050
20221
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20051
|
-
var
|
|
20222
|
+
var import_react66 = require("react");
|
|
20052
20223
|
var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerContext");
|
|
20053
20224
|
var import_design_system_react_components45 = require("@livechat/design-system-react-components");
|
|
20054
20225
|
|
|
20055
20226
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20056
|
-
var
|
|
20227
|
+
var import_react64 = require("react");
|
|
20057
20228
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
20058
20229
|
|
|
20059
20230
|
// src/views/Workflows/Common/One/widget/message-box/constants.ts
|
|
@@ -20062,8 +20233,8 @@ var ONE_CHARACTER_LIMIT = 1e4;
|
|
|
20062
20233
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20063
20234
|
var useAboveCharacterLimit = () => {
|
|
20064
20235
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
20065
|
-
const [aboveLimit, setAboveLimit] = (0,
|
|
20066
|
-
(0,
|
|
20236
|
+
const [aboveLimit, setAboveLimit] = (0, import_react64.useState)(0);
|
|
20237
|
+
(0, import_react64.useEffect)(() => {
|
|
20067
20238
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20068
20239
|
(textContent) => {
|
|
20069
20240
|
setAboveLimit(textContent.length - ONE_CHARACTER_LIMIT);
|
|
@@ -20080,13 +20251,13 @@ var useAboveCharacterLimit = () => {
|
|
|
20080
20251
|
};
|
|
20081
20252
|
|
|
20082
20253
|
// src/views/Workflows/Common/One/hooks/useSendOneMessage.ts
|
|
20083
|
-
var
|
|
20254
|
+
var import_react65 = require("react");
|
|
20084
20255
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
20085
20256
|
var import_lexical = require("lexical");
|
|
20086
20257
|
var useSendOneMessage = () => {
|
|
20087
20258
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
20088
|
-
const { sendMessage: sendMessage2 } = (0,
|
|
20089
|
-
const onSend = (0,
|
|
20259
|
+
const { sendMessage: sendMessage2 } = (0, import_react65.useContext)(OneMessagesContext);
|
|
20260
|
+
const onSend = (0, import_react65.useCallback)(() => {
|
|
20090
20261
|
var _a;
|
|
20091
20262
|
const messageToSend = (_a = editor.getRootElement()) == null ? void 0 : _a.innerText.trim();
|
|
20092
20263
|
if (!messageToSend) {
|
|
@@ -20100,12 +20271,12 @@ var useSendOneMessage = () => {
|
|
|
20100
20271
|
|
|
20101
20272
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20102
20273
|
function AskButton() {
|
|
20103
|
-
const [isDisabled, setIsDisabled] = (0,
|
|
20274
|
+
const [isDisabled, setIsDisabled] = (0, import_react66.useState)(true);
|
|
20104
20275
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
20105
20276
|
const isLoading = false;
|
|
20106
20277
|
const { isAboveLimit } = useAboveCharacterLimit();
|
|
20107
20278
|
const handleSend = useSendOneMessage();
|
|
20108
|
-
(0,
|
|
20279
|
+
(0, import_react66.useEffect)(() => {
|
|
20109
20280
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20110
20281
|
(textContent) => {
|
|
20111
20282
|
setIsDisabled(!textContent);
|
|
@@ -20179,34 +20350,34 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
20179
20350
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
20180
20351
|
|
|
20181
20352
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/AutoFocusPlugin.tsx
|
|
20182
|
-
var
|
|
20353
|
+
var import_react67 = require("react");
|
|
20183
20354
|
var import_LexicalComposerContext4 = require("@lexical/react/LexicalComposerContext");
|
|
20184
20355
|
function AutoFocusPlugin() {
|
|
20185
20356
|
const [editor] = (0, import_LexicalComposerContext4.useLexicalComposerContext)();
|
|
20186
|
-
const handleFocus = (0,
|
|
20357
|
+
const handleFocus = (0, import_react67.useCallback)(() => {
|
|
20187
20358
|
editor.focus();
|
|
20188
20359
|
}, [editor]);
|
|
20189
|
-
(0,
|
|
20360
|
+
(0, import_react67.useEffect)(() => {
|
|
20190
20361
|
handleFocus();
|
|
20191
20362
|
}, []);
|
|
20192
20363
|
return null;
|
|
20193
20364
|
}
|
|
20194
20365
|
|
|
20195
20366
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/EnterDownPlugin.tsx
|
|
20196
|
-
var
|
|
20367
|
+
var import_react68 = require("react");
|
|
20197
20368
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
20198
20369
|
var import_lexical2 = require("lexical");
|
|
20199
20370
|
function EnterDownPlugin({ isCommandMenuVisibleRef }) {
|
|
20200
20371
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
20201
20372
|
const isLoading = false;
|
|
20202
20373
|
const handleSendMessage = useSendOneMessage();
|
|
20203
|
-
const onEnterDown = (0,
|
|
20374
|
+
const onEnterDown = (0, import_react68.useCallback)(() => {
|
|
20204
20375
|
if (isLoading || (isCommandMenuVisibleRef == null ? void 0 : isCommandMenuVisibleRef.current)) {
|
|
20205
20376
|
return;
|
|
20206
20377
|
}
|
|
20207
20378
|
handleSendMessage({ enter: true, messageBox: true });
|
|
20208
20379
|
}, [handleSendMessage, isLoading, isCommandMenuVisibleRef]);
|
|
20209
|
-
(0,
|
|
20380
|
+
(0, import_react68.useEffect)(
|
|
20210
20381
|
() => editor.registerCommand(
|
|
20211
20382
|
import_lexical2.KEY_ENTER_COMMAND,
|
|
20212
20383
|
(event) => {
|
|
@@ -20267,10 +20438,10 @@ function OneMessageBox() {
|
|
|
20267
20438
|
}
|
|
20268
20439
|
|
|
20269
20440
|
// src/views/Workflows/Common/One/widget/OneChatFeedContent.tsx
|
|
20270
|
-
var
|
|
20441
|
+
var import_react81 = require("react");
|
|
20271
20442
|
|
|
20272
20443
|
// src/views/Workflows/Common/One/hooks/useScroll.ts
|
|
20273
|
-
var
|
|
20444
|
+
var import_react69 = require("react");
|
|
20274
20445
|
var import_lodash4 = __toESM(require("lodash.debounce"));
|
|
20275
20446
|
var useScroll = ({
|
|
20276
20447
|
oneChatFeedRef,
|
|
@@ -20278,10 +20449,10 @@ var useScroll = ({
|
|
|
20278
20449
|
additionalEvents
|
|
20279
20450
|
}) => {
|
|
20280
20451
|
const oneScrollPosition = 0;
|
|
20281
|
-
const currentScrollPosition = (0,
|
|
20282
|
-
const isScrolledToBottom = (0,
|
|
20283
|
-
const timeoutRef = (0,
|
|
20284
|
-
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)(() => {
|
|
20285
20456
|
if (timeoutRef.current) {
|
|
20286
20457
|
clearTimeout(timeoutRef.current);
|
|
20287
20458
|
}
|
|
@@ -20297,7 +20468,7 @@ var useScroll = ({
|
|
|
20297
20468
|
}
|
|
20298
20469
|
};
|
|
20299
20470
|
}, []);
|
|
20300
|
-
(0,
|
|
20471
|
+
(0, import_react69.useEffect)(() => {
|
|
20301
20472
|
var _a;
|
|
20302
20473
|
if (!oneScrollPosition) {
|
|
20303
20474
|
scrollToBottom();
|
|
@@ -20306,12 +20477,12 @@ var useScroll = ({
|
|
|
20306
20477
|
(_a = oneChatFeedRef.current) == null ? void 0 : _a.scrollTo({ top: oneScrollPosition });
|
|
20307
20478
|
currentScrollPosition.current = oneScrollPosition;
|
|
20308
20479
|
}, []);
|
|
20309
|
-
(0,
|
|
20480
|
+
(0, import_react69.useEffect)(() => {
|
|
20310
20481
|
if (additionalEvents && isScrolledToBottom.current) {
|
|
20311
20482
|
scrollToBottom();
|
|
20312
20483
|
}
|
|
20313
20484
|
}, [scrollToBottom, additionalEvents]);
|
|
20314
|
-
(0,
|
|
20485
|
+
(0, import_react69.useEffect)(() => {
|
|
20315
20486
|
const [lastGroupEvent] = groupedEvents.slice(-1)[0];
|
|
20316
20487
|
const isLastMessageFromAgent = lastGroupEvent.authorType === "agent" /* Agent */;
|
|
20317
20488
|
if (isLastMessageFromAgent || isScrolledToBottom.current) {
|
|
@@ -20871,7 +21042,7 @@ function OneErrorEvent({ eventId }) {
|
|
|
20871
21042
|
}
|
|
20872
21043
|
|
|
20873
21044
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
20874
|
-
var
|
|
21045
|
+
var import_react73 = require("react");
|
|
20875
21046
|
|
|
20876
21047
|
// src/views/Workflows/Common/One/components/SkeletonLine.tsx
|
|
20877
21048
|
var import_design_system_react_components49 = require("@livechat/design-system-react-components");
|
|
@@ -20934,8 +21105,8 @@ function SkeletonLine({
|
|
|
20934
21105
|
|
|
20935
21106
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
20936
21107
|
function OneImageEvent({ imageUrl }) {
|
|
20937
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
20938
|
-
(0,
|
|
21108
|
+
const [isLoaded, setIsLoaded] = (0, import_react73.useState)(false);
|
|
21109
|
+
(0, import_react73.useEffect)(() => {
|
|
20939
21110
|
const image = new Image();
|
|
20940
21111
|
image.src = imageUrl;
|
|
20941
21112
|
image.onload = () => {
|
|
@@ -20957,7 +21128,7 @@ function OneImageEvent({ imageUrl }) {
|
|
|
20957
21128
|
}
|
|
20958
21129
|
|
|
20959
21130
|
// src/views/Workflows/Common/One/components/TypingIndicator.tsx
|
|
20960
|
-
var
|
|
21131
|
+
var import_react74 = require("react");
|
|
20961
21132
|
var import_design_system_react_components50 = require("@livechat/design-system-react-components");
|
|
20962
21133
|
var typingAnimation = keyframes`
|
|
20963
21134
|
0% {
|
|
@@ -20998,7 +21169,7 @@ var typingIndicator2 = css`
|
|
|
20998
21169
|
}
|
|
20999
21170
|
}
|
|
21000
21171
|
`;
|
|
21001
|
-
var TypingIndicator = (0,
|
|
21172
|
+
var TypingIndicator = (0, import_react74.memo)(function TypingIndicatorInner() {
|
|
21002
21173
|
return /* @__PURE__ */ jsxs2("div", { css: typingIndicator2, "data-test": "typing-indicator", children: [
|
|
21003
21174
|
/* @__PURE__ */ jsx4("span", {}),
|
|
21004
21175
|
/* @__PURE__ */ jsx4("span", {}),
|
|
@@ -21018,10 +21189,10 @@ var import_design_system_react_components55 = require("@livechat/design-system-r
|
|
|
21018
21189
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
21019
21190
|
|
|
21020
21191
|
// src/views/Workflows/Common/One/widget/events/OneLinkWithTooltip.tsx
|
|
21021
|
-
var
|
|
21192
|
+
var import_react_router_dom8 = require("react-router-dom");
|
|
21022
21193
|
var import_design_system_react_components51 = require("@livechat/design-system-react-components");
|
|
21023
21194
|
function OneLinkWithTooltip({ children, href }) {
|
|
21024
|
-
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 });
|
|
21025
21196
|
return /* @__PURE__ */ jsx4(
|
|
21026
21197
|
import_design_system_react_components51.Tooltip,
|
|
21027
21198
|
{
|
|
@@ -21086,7 +21257,7 @@ var MarkdownEventRenderer = ({ children }) => /* @__PURE__ */ jsx4(
|
|
|
21086
21257
|
);
|
|
21087
21258
|
|
|
21088
21259
|
// src/views/Workflows/Common/One/components/NavigateButton.tsx
|
|
21089
|
-
var
|
|
21260
|
+
var import_react_router_dom9 = require("react-router-dom");
|
|
21090
21261
|
var import_design_system_icons22 = require("@livechat/design-system-icons");
|
|
21091
21262
|
var import_design_system_react_components52 = require("@livechat/design-system-react-components");
|
|
21092
21263
|
var navigateButtonCss = css`
|
|
@@ -21104,7 +21275,7 @@ function NavigateButton({
|
|
|
21104
21275
|
kind,
|
|
21105
21276
|
iconPosition
|
|
21106
21277
|
}) {
|
|
21107
|
-
const navigate = (0,
|
|
21278
|
+
const navigate = (0, import_react_router_dom9.useNavigate)();
|
|
21108
21279
|
const handleButtonClick = () => {
|
|
21109
21280
|
if (isExternal) {
|
|
21110
21281
|
window.open(url, "_blank");
|
|
@@ -21129,13 +21300,13 @@ function NavigateButton({
|
|
|
21129
21300
|
}
|
|
21130
21301
|
|
|
21131
21302
|
// src/views/Workflows/Common/One/widget/events/OneAssistantMessageBottomBar.tsx
|
|
21132
|
-
var
|
|
21303
|
+
var import_react80 = require("react");
|
|
21133
21304
|
var import_design_system_icons24 = require("@livechat/design-system-icons");
|
|
21134
21305
|
var import_design_system_react_components54 = require("@livechat/design-system-react-components");
|
|
21135
21306
|
var import_developer_studio_ui_react24 = require("@livechat/developer-studio-ui-react");
|
|
21136
21307
|
|
|
21137
21308
|
// src/views/Workflows/Common/One/components/ApplyWorkflowButton.tsx
|
|
21138
|
-
var
|
|
21309
|
+
var import_react78 = require("react");
|
|
21139
21310
|
var import_design_system_icons23 = require("@livechat/design-system-icons");
|
|
21140
21311
|
var import_design_system_react_components53 = require("@livechat/design-system-react-components");
|
|
21141
21312
|
var buttonCss = css`
|
|
@@ -21147,7 +21318,7 @@ function ApplyWorkflowButton({
|
|
|
21147
21318
|
updateWorkflow,
|
|
21148
21319
|
previewWorkflow
|
|
21149
21320
|
}) {
|
|
21150
|
-
const [isApplied, setIsApplied] = (0,
|
|
21321
|
+
const [isApplied, setIsApplied] = (0, import_react78.useState)(false);
|
|
21151
21322
|
const workflowExtraction = extractWorkflowFromEvent(event);
|
|
21152
21323
|
const isEditingWorkflow = false;
|
|
21153
21324
|
const applyWorkflow = () => {
|
|
@@ -21217,7 +21388,7 @@ function OneAssistantMessageBottomBar({
|
|
|
21217
21388
|
previewWorkflow
|
|
21218
21389
|
}) {
|
|
21219
21390
|
var _a, _b, _c;
|
|
21220
|
-
const [isSourcesVisible, setIsSourcesVisible] = (0,
|
|
21391
|
+
const [isSourcesVisible, setIsSourcesVisible] = (0, import_react80.useState)(false);
|
|
21221
21392
|
const toggleIsSourcesVisible = () => {
|
|
21222
21393
|
setIsSourcesVisible((prev2) => !prev2);
|
|
21223
21394
|
};
|
|
@@ -21517,7 +21688,7 @@ function OneChatFeedContent({
|
|
|
21517
21688
|
updateWorkflow,
|
|
21518
21689
|
previewWorkflow
|
|
21519
21690
|
}) {
|
|
21520
|
-
const oneChatFeedRef = (0,
|
|
21691
|
+
const oneChatFeedRef = (0, import_react81.useRef)(null);
|
|
21521
21692
|
const { groupedEvents, hasAdditionalEvents } = useOneMessagesContext();
|
|
21522
21693
|
const { handleScroll } = useScroll({
|
|
21523
21694
|
oneChatFeedRef,
|
|
@@ -21612,15 +21783,15 @@ function CustomControls({
|
|
|
21612
21783
|
previewWorkflow
|
|
21613
21784
|
}) {
|
|
21614
21785
|
var _a;
|
|
21615
|
-
const navigate = (0,
|
|
21786
|
+
const navigate = (0, import_react_router_dom10.useNavigate)();
|
|
21616
21787
|
const { fitView, zoomIn, zoomOut } = (0, import_reactflow12.useReactFlow)();
|
|
21617
21788
|
const { toggleOneWidget, isOpen } = useOneWidgetContext();
|
|
21618
21789
|
const {
|
|
21619
21790
|
state: { visibility },
|
|
21620
21791
|
focus
|
|
21621
21792
|
} = useWorkflowCreator();
|
|
21622
|
-
const location = (0,
|
|
21623
|
-
(0,
|
|
21793
|
+
const location = (0, import_react_router_dom10.useLocation)();
|
|
21794
|
+
(0, import_react82.useEffect)(() => {
|
|
21624
21795
|
var _a2;
|
|
21625
21796
|
if ((_a2 = location.state) == null ? void 0 : _a2.openOne) {
|
|
21626
21797
|
if (!isOpen) {
|
|
@@ -21725,8 +21896,8 @@ function CustomControls({
|
|
|
21725
21896
|
var CustomControls_default = CustomControls;
|
|
21726
21897
|
|
|
21727
21898
|
// src/views/Workflows/Creator/Builder/Controls/SwitcherControls.tsx
|
|
21728
|
-
var
|
|
21729
|
-
var
|
|
21899
|
+
var import_react84 = require("react");
|
|
21900
|
+
var import_react_router_dom11 = require("react-router-dom");
|
|
21730
21901
|
var import_reactflow13 = require("reactflow");
|
|
21731
21902
|
var import_design_system_react_components59 = require("@livechat/design-system-react-components");
|
|
21732
21903
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
@@ -21735,10 +21906,10 @@ function SwitcherControls({
|
|
|
21735
21906
|
hasRelatedWorkflow,
|
|
21736
21907
|
relatedWorkflowId
|
|
21737
21908
|
}) {
|
|
21738
|
-
const [currentView, setCurrentView] = (0,
|
|
21909
|
+
const [currentView, setCurrentView] = (0, import_react84.useState)(
|
|
21739
21910
|
isDraft ? "draft" : "published"
|
|
21740
21911
|
);
|
|
21741
|
-
const navigate = (0,
|
|
21912
|
+
const navigate = (0, import_react_router_dom11.useNavigate)();
|
|
21742
21913
|
const {
|
|
21743
21914
|
focus,
|
|
21744
21915
|
state: { visibility }
|
|
@@ -22260,13 +22431,13 @@ function WorkflowBuilder() {
|
|
|
22260
22431
|
[]
|
|
22261
22432
|
);
|
|
22262
22433
|
const [edges, setEdges, onEdgesChange] = (0, import_reactflow16.useEdgesState)([]);
|
|
22263
|
-
const onConnect = (0,
|
|
22434
|
+
const onConnect = (0, import_react86.useCallback)(
|
|
22264
22435
|
(params) => {
|
|
22265
22436
|
setEdges((eds) => (0, import_reactflow16.addEdge)(params, eds));
|
|
22266
22437
|
},
|
|
22267
22438
|
[setEdges]
|
|
22268
22439
|
);
|
|
22269
|
-
(0,
|
|
22440
|
+
(0, import_react86.useEffect)(() => {
|
|
22270
22441
|
void (() => __async(this, null, function* () {
|
|
22271
22442
|
const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(
|
|
22272
22443
|
workflow
|
|
@@ -22398,8 +22569,8 @@ function PreviewWorkflowModal({
|
|
|
22398
22569
|
onApply,
|
|
22399
22570
|
onClose
|
|
22400
22571
|
}) {
|
|
22401
|
-
const navigate = (0,
|
|
22402
|
-
const handleClose = (0,
|
|
22572
|
+
const navigate = (0, import_react_router_dom12.useNavigate)();
|
|
22573
|
+
const handleClose = (0, import_react87.useCallback)(
|
|
22403
22574
|
(target) => {
|
|
22404
22575
|
if (onClose) {
|
|
22405
22576
|
onClose();
|
|
@@ -22413,7 +22584,7 @@ function PreviewWorkflowModal({
|
|
|
22413
22584
|
},
|
|
22414
22585
|
[onClose, navigate]
|
|
22415
22586
|
);
|
|
22416
|
-
const handleApply = (0,
|
|
22587
|
+
const handleApply = (0, import_react87.useCallback)(() => {
|
|
22417
22588
|
if (onApply) {
|
|
22418
22589
|
onApply();
|
|
22419
22590
|
}
|
|
@@ -22499,40 +22670,57 @@ function PublishWorkflowModal({
|
|
|
22499
22670
|
},
|
|
22500
22671
|
publishDraft
|
|
22501
22672
|
} = useWorkflowCreator();
|
|
22502
|
-
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22503
|
-
|
|
22673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22674
|
+
import_design_system_react_components64.Modal,
|
|
22504
22675
|
{
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
kind: "primary",
|
|
22511
|
-
loading: isPublishing,
|
|
22512
|
-
onClick: () => void publishDraft({
|
|
22513
|
-
confirmed: true
|
|
22514
|
-
}),
|
|
22515
|
-
children: "Publish workflow"
|
|
22516
|
-
}
|
|
22517
|
-
)
|
|
22518
|
-
] }),
|
|
22519
|
-
heading: "You are publishing a workflow",
|
|
22520
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22521
|
-
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,
|
|
22522
22681
|
{
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
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."
|
|
22526
22715
|
}
|
|
22527
|
-
)
|
|
22528
|
-
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22716
|
+
)
|
|
22529
22717
|
}
|
|
22530
|
-
)
|
|
22718
|
+
);
|
|
22531
22719
|
}
|
|
22532
22720
|
|
|
22533
22721
|
// src/views/Workflows/Creator/View.tsx
|
|
22534
|
-
var
|
|
22535
|
-
var
|
|
22722
|
+
var import_react95 = require("react");
|
|
22723
|
+
var import_react_router_dom17 = require("react-router-dom");
|
|
22536
22724
|
var import_reactflow17 = require("reactflow");
|
|
22537
22725
|
var import_design_system_react_components71 = require("@livechat/design-system-react-components");
|
|
22538
22726
|
|
|
@@ -22542,10 +22730,10 @@ var sendMessage = (type) => {
|
|
|
22542
22730
|
};
|
|
22543
22731
|
|
|
22544
22732
|
// src/views/Workflows/Creator/Panels/Details/index.tsx
|
|
22545
|
-
var
|
|
22733
|
+
var import_react_router_dom14 = require("react-router-dom");
|
|
22546
22734
|
|
|
22547
22735
|
// src/views/Workflows/Creator/Panels/Details/Panel.tsx
|
|
22548
|
-
var
|
|
22736
|
+
var import_react_router_dom13 = require("react-router-dom");
|
|
22549
22737
|
var import_design_system_icons29 = require("@livechat/design-system-icons");
|
|
22550
22738
|
var import_design_system_react_components67 = require("@livechat/design-system-react-components");
|
|
22551
22739
|
var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22553,6 +22741,7 @@ var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-
|
|
|
22553
22741
|
// src/views/Workflows/Creator/Panels/Details/Executions/List.tsx
|
|
22554
22742
|
var import_design_system_icons28 = require("@livechat/design-system-icons");
|
|
22555
22743
|
var import_design_system_react_components65 = require("@livechat/design-system-react-components");
|
|
22744
|
+
var import_developer_studio_api27 = require("@livechat/developer-studio-api");
|
|
22556
22745
|
var import_developer_studio_ui_react29 = require("@livechat/developer-studio-ui-react");
|
|
22557
22746
|
var tableCss = css`
|
|
22558
22747
|
font-size: 13px;
|
|
@@ -22586,22 +22775,18 @@ function WorkflowExecutionList({
|
|
|
22586
22775
|
/* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react29.formatUSADate)(execution.started_at) }),
|
|
22587
22776
|
/* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react29.formatUSADate)(execution.ended_at) }),
|
|
22588
22777
|
/* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
|
|
22589
|
-
import_design_system_react_components65.
|
|
22778
|
+
import_design_system_react_components65.Tag,
|
|
22590
22779
|
{
|
|
22591
|
-
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
|
|
22596
|
-
|
|
22597
|
-
|
|
22598
|
-
|
|
22599
|
-
|
|
22600
|
-
|
|
22601
|
-
}
|
|
22602
|
-
),
|
|
22603
|
-
execution.status
|
|
22604
|
-
] })
|
|
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
|
|
22605
22790
|
}
|
|
22606
22791
|
) })
|
|
22607
22792
|
] }, execution.id)) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
|
|
@@ -22699,8 +22884,8 @@ function WorkflowDetailsPanel({
|
|
|
22699
22884
|
onClose
|
|
22700
22885
|
}) {
|
|
22701
22886
|
var _a, _b, _c, _d, _e;
|
|
22702
|
-
const navigate = (0,
|
|
22703
|
-
const { id, tab } = (0,
|
|
22887
|
+
const navigate = (0, import_react_router_dom13.useNavigate)();
|
|
22888
|
+
const { id, tab } = (0, import_react_router_dom13.useParams)();
|
|
22704
22889
|
const workflowQuery = useFetchWorkflow(id);
|
|
22705
22890
|
const workflowExecutionsQuery = useFetchWorkflowExecutionList(id);
|
|
22706
22891
|
const relatedWorkflowQuery = useFetchWorkflow(
|
|
@@ -22801,10 +22986,10 @@ function WorkflowDetails({
|
|
|
22801
22986
|
onClose,
|
|
22802
22987
|
headerType
|
|
22803
22988
|
}) {
|
|
22804
|
-
return /* @__PURE__ */ jsxs2(
|
|
22805
|
-
/* @__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: "" }),
|
|
22806
22991
|
/* @__PURE__ */ jsx4(
|
|
22807
|
-
|
|
22992
|
+
import_react_router_dom14.Route,
|
|
22808
22993
|
{
|
|
22809
22994
|
element: /* @__PURE__ */ jsx4(Panel_default, { headerType, onClose }),
|
|
22810
22995
|
path: ":tab/*"
|
|
@@ -22814,9 +22999,9 @@ function WorkflowDetails({
|
|
|
22814
22999
|
}
|
|
22815
23000
|
|
|
22816
23001
|
// src/views/Workflows/Creator/Panels/Editor/Panel.tsx
|
|
22817
|
-
var
|
|
22818
|
-
var
|
|
22819
|
-
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");
|
|
22820
23005
|
var import_design_system_icons30 = require("@livechat/design-system-icons");
|
|
22821
23006
|
var import_design_system_react_components68 = require("@livechat/design-system-react-components");
|
|
22822
23007
|
var import_developer_studio_ui_react32 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22842,15 +23027,15 @@ function configureMonaco(monaco) {
|
|
|
22842
23027
|
});
|
|
22843
23028
|
}
|
|
22844
23029
|
function WorkflowEditorPanel({ onClose }) {
|
|
22845
|
-
const navigate = (0,
|
|
23030
|
+
const navigate = (0, import_react_router_dom15.useNavigate)();
|
|
22846
23031
|
const {
|
|
22847
23032
|
state: { workflow },
|
|
22848
23033
|
replaceWorkflow,
|
|
22849
23034
|
focus
|
|
22850
23035
|
} = useWorkflowCreator();
|
|
22851
|
-
const editorRef = (0,
|
|
22852
|
-
const [, setIsModified] = (0,
|
|
22853
|
-
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)([]);
|
|
22854
23039
|
const filteredWorkflow = {
|
|
22855
23040
|
definition: workflow.definition,
|
|
22856
23041
|
trigger: workflow.trigger
|
|
@@ -22875,7 +23060,7 @@ function WorkflowEditorPanel({ onClose }) {
|
|
|
22875
23060
|
)
|
|
22876
23061
|
] }),
|
|
22877
23062
|
/* @__PURE__ */ jsx4(WorkflowSidebarContent, { children: /* @__PURE__ */ jsx4(
|
|
22878
|
-
|
|
23063
|
+
import_react91.Editor,
|
|
22879
23064
|
{
|
|
22880
23065
|
height: "100%",
|
|
22881
23066
|
language: "json",
|
|
@@ -22918,7 +23103,7 @@ var Panel_default2 = WorkflowEditorPanel;
|
|
|
22918
23103
|
// src/views/Workflows/Creator/Panels/Element/Panel.tsx
|
|
22919
23104
|
var import_design_system_icons31 = require("@livechat/design-system-icons");
|
|
22920
23105
|
var import_design_system_react_components69 = require("@livechat/design-system-react-components");
|
|
22921
|
-
var
|
|
23106
|
+
var import_developer_studio_api28 = require("@livechat/developer-studio-api");
|
|
22922
23107
|
var import_developer_studio_ui_react33 = require("@livechat/developer-studio-ui-react");
|
|
22923
23108
|
var import_styles4 = require("react-js-cron/dist/styles.css");
|
|
22924
23109
|
var formCss = () => css`
|
|
@@ -23076,71 +23261,78 @@ function WorkflowElementPanel() {
|
|
|
23076
23261
|
default:
|
|
23077
23262
|
}
|
|
23078
23263
|
};
|
|
23079
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.provider) ===
|
|
23080
|
-
return /* @__PURE__ */ jsxs2(
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
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`
|
|
23086
23276
|
max-width: 85%;
|
|
23087
23277
|
`,
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
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`
|
|
23103
23293
|
width: var(${import_design_system_react_components69.SpacingToken.Spacing6});
|
|
23104
23294
|
`,
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23117
|
-
|
|
23118
|
-
|
|
23119
|
-
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
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
|
+
);
|
|
23132
23324
|
}
|
|
23133
23325
|
var Panel_default3 = WorkflowElementPanel;
|
|
23134
23326
|
|
|
23135
23327
|
// src/views/Workflows/Creator/Navbar.tsx
|
|
23136
|
-
var
|
|
23137
|
-
var
|
|
23328
|
+
var import_react93 = require("react");
|
|
23329
|
+
var import_react_router_dom16 = require("react-router-dom");
|
|
23138
23330
|
var import_design_system_icons32 = require("@livechat/design-system-icons");
|
|
23139
23331
|
var import_design_system_react_components70 = require("@livechat/design-system-react-components");
|
|
23140
23332
|
var import_developer_studio_ui_react34 = require("@livechat/developer-studio-ui-react");
|
|
23141
23333
|
function WorkflowCreatorNavbar() {
|
|
23142
23334
|
var _a, _b, _c, _d, _e;
|
|
23143
|
-
const navigate = (0,
|
|
23335
|
+
const navigate = (0, import_react_router_dom16.useNavigate)();
|
|
23144
23336
|
const {
|
|
23145
23337
|
state: {
|
|
23146
23338
|
workflow,
|
|
@@ -23153,14 +23345,14 @@ function WorkflowCreatorNavbar() {
|
|
|
23153
23345
|
publishDraft,
|
|
23154
23346
|
toggle
|
|
23155
23347
|
} = useWorkflowCreator();
|
|
23156
|
-
const inputRef = (0,
|
|
23157
|
-
const [isNameChanging, setIsNameChanging] = (0,
|
|
23158
|
-
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);
|
|
23159
23351
|
const { user } = (0, import_developer_studio_ui_react34.useUserContext)();
|
|
23160
23352
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23161
23353
|
user == null ? void 0 : user.meta.email
|
|
23162
23354
|
);
|
|
23163
|
-
(0,
|
|
23355
|
+
(0, import_react93.useEffect)(() => {
|
|
23164
23356
|
setWorkflowName(workflow.name);
|
|
23165
23357
|
}, [workflow.name]);
|
|
23166
23358
|
(0, import_developer_studio_ui_react34.useOnClickOutside)(inputRef, () => {
|
|
@@ -23335,7 +23527,8 @@ function WorkflowCreatorNavbar() {
|
|
|
23335
23527
|
on: workflow.active,
|
|
23336
23528
|
onChange: () => void activate(),
|
|
23337
23529
|
size: "medium",
|
|
23338
|
-
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
|
|
23339
23532
|
}
|
|
23340
23533
|
),
|
|
23341
23534
|
children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
|
|
@@ -23354,7 +23547,15 @@ function WorkflowCreatorNavbar() {
|
|
|
23354
23547
|
workflow.draft ? !workflow.trigger.type || !workflow.definition.tasks.length ? /* @__PURE__ */ jsxs2(
|
|
23355
23548
|
import_design_system_react_components70.Tooltip,
|
|
23356
23549
|
{
|
|
23357
|
-
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
|
+
),
|
|
23358
23559
|
children: [
|
|
23359
23560
|
!workflow.trigger.type && "To publish a workflow, add a trigger.",
|
|
23360
23561
|
!workflow.definition.tasks.length && "To publish a workflow, add at least one task."
|
|
@@ -23372,6 +23573,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23372
23573
|
);
|
|
23373
23574
|
void publishDraft();
|
|
23374
23575
|
},
|
|
23576
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23375
23577
|
children: "Publish"
|
|
23376
23578
|
}
|
|
23377
23579
|
) : /* @__PURE__ */ jsx4(
|
|
@@ -23387,6 +23589,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23387
23589
|
}
|
|
23388
23590
|
void createDraft();
|
|
23389
23591
|
},
|
|
23592
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.editButton,
|
|
23390
23593
|
children: "Edit"
|
|
23391
23594
|
}
|
|
23392
23595
|
)
|
|
@@ -23420,7 +23623,7 @@ function WorkflowCreatorView() {
|
|
|
23420
23623
|
focus
|
|
23421
23624
|
} = useWorkflowCreator();
|
|
23422
23625
|
const { fitView } = (0, import_reactflow17.useReactFlow)();
|
|
23423
|
-
(0,
|
|
23626
|
+
(0, import_react95.useEffect)(() => {
|
|
23424
23627
|
if (getWorkflowsEnv("isLiveChatMode")) {
|
|
23425
23628
|
sendMessage("closeSideNav" /* CloseSideNav */);
|
|
23426
23629
|
const timeoutId = setTimeout(() => {
|
|
@@ -23439,10 +23642,10 @@ function WorkflowCreatorView() {
|
|
|
23439
23642
|
/* @__PURE__ */ jsx4(Navbar_default, {}),
|
|
23440
23643
|
/* @__PURE__ */ jsxs2(WorkflowCreatorContent, { grayBackground: getWorkflowsEnv("isHeadless"), children: [
|
|
23441
23644
|
/* @__PURE__ */ jsx4(Diagram_default, {}),
|
|
23442
|
-
(selection == null ? void 0 : selection.isEditable) ? /* @__PURE__ */ jsx4(Panel_default3, {}) : /* @__PURE__ */ jsxs2(
|
|
23443
|
-
/* @__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" }),
|
|
23444
23647
|
/* @__PURE__ */ jsx4(
|
|
23445
|
-
|
|
23648
|
+
import_react_router_dom17.Route,
|
|
23446
23649
|
{
|
|
23447
23650
|
element: /* @__PURE__ */ jsx4(
|
|
23448
23651
|
WorkflowDetails,
|
|
@@ -23464,9 +23667,9 @@ var View_default = WorkflowCreatorView;
|
|
|
23464
23667
|
// src/views/Workflows/Creator/index.tsx
|
|
23465
23668
|
function WorkflowCreator() {
|
|
23466
23669
|
var _a, _b, _c;
|
|
23467
|
-
const location = (0,
|
|
23468
|
-
const { id } = (0,
|
|
23469
|
-
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)();
|
|
23470
23673
|
const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
|
|
23471
23674
|
const credentialsQuery = (0, import_platform_integrations6.useFetchIntegrationCredentialsQuery)();
|
|
23472
23675
|
const organizationProducts = (0, import_developer_studio_ui_react35.useFetchOrganizationProducts)();
|
|
@@ -23488,9 +23691,9 @@ function WorkflowCreator() {
|
|
|
23488
23691
|
}
|
|
23489
23692
|
return /* @__PURE__ */ jsxs2(WorkflowCreatorProvider, { basePath, workflow, children: [
|
|
23490
23693
|
/* @__PURE__ */ jsx4(View_default, {}),
|
|
23491
|
-
/* @__PURE__ */ jsxs2(
|
|
23694
|
+
/* @__PURE__ */ jsxs2(import_react_router_dom18.Routes, { children: [
|
|
23492
23695
|
/* @__PURE__ */ jsx4(
|
|
23493
|
-
|
|
23696
|
+
import_react_router_dom18.Route,
|
|
23494
23697
|
{
|
|
23495
23698
|
element: /* @__PURE__ */ jsx4(
|
|
23496
23699
|
Modal_default2,
|
|
@@ -23505,7 +23708,7 @@ function WorkflowCreator() {
|
|
|
23505
23708
|
}
|
|
23506
23709
|
),
|
|
23507
23710
|
/* @__PURE__ */ jsx4(
|
|
23508
|
-
|
|
23711
|
+
import_react_router_dom18.Route,
|
|
23509
23712
|
{
|
|
23510
23713
|
element: /* @__PURE__ */ jsx4(
|
|
23511
23714
|
Modal_default,
|
|
@@ -23520,7 +23723,7 @@ function WorkflowCreator() {
|
|
|
23520
23723
|
}
|
|
23521
23724
|
),
|
|
23522
23725
|
/* @__PURE__ */ jsx4(
|
|
23523
|
-
|
|
23726
|
+
import_react_router_dom18.Route,
|
|
23524
23727
|
{
|
|
23525
23728
|
element: /* @__PURE__ */ jsx4(
|
|
23526
23729
|
Modal_default3,
|
|
@@ -23535,7 +23738,7 @@ function WorkflowCreator() {
|
|
|
23535
23738
|
}
|
|
23536
23739
|
),
|
|
23537
23740
|
/* @__PURE__ */ jsx4(
|
|
23538
|
-
|
|
23741
|
+
import_react_router_dom18.Route,
|
|
23539
23742
|
{
|
|
23540
23743
|
element: /* @__PURE__ */ jsx4(
|
|
23541
23744
|
PublishWorkflowModal,
|
|
@@ -23549,7 +23752,7 @@ function WorkflowCreator() {
|
|
|
23549
23752
|
}
|
|
23550
23753
|
),
|
|
23551
23754
|
/* @__PURE__ */ jsx4(
|
|
23552
|
-
|
|
23755
|
+
import_react_router_dom18.Route,
|
|
23553
23756
|
{
|
|
23554
23757
|
element: /* @__PURE__ */ jsx4(
|
|
23555
23758
|
EditWorkflowModal,
|
|
@@ -23563,7 +23766,7 @@ function WorkflowCreator() {
|
|
|
23563
23766
|
}
|
|
23564
23767
|
),
|
|
23565
23768
|
/* @__PURE__ */ jsx4(
|
|
23566
|
-
|
|
23769
|
+
import_react_router_dom18.Route,
|
|
23567
23770
|
{
|
|
23568
23771
|
element: /* @__PURE__ */ jsx4(
|
|
23569
23772
|
DeleteWorkflowModal,
|
|
@@ -23578,7 +23781,7 @@ function WorkflowCreator() {
|
|
|
23578
23781
|
}
|
|
23579
23782
|
),
|
|
23580
23783
|
/* @__PURE__ */ jsx4(
|
|
23581
|
-
|
|
23784
|
+
import_react_router_dom18.Route,
|
|
23582
23785
|
{
|
|
23583
23786
|
element: /* @__PURE__ */ jsx4(
|
|
23584
23787
|
DeleteWorkflowModal,
|
|
@@ -23598,19 +23801,19 @@ function WorkflowCreator() {
|
|
|
23598
23801
|
var Creator_default = WorkflowCreator;
|
|
23599
23802
|
|
|
23600
23803
|
// src/views/Workflows/List/index.tsx
|
|
23601
|
-
var
|
|
23804
|
+
var import_react_router_dom28 = require("react-router-dom");
|
|
23602
23805
|
var import_developer_studio_ui_react46 = require("@livechat/developer-studio-ui-react");
|
|
23603
23806
|
|
|
23604
23807
|
// src/views/Workflows/List/Modals/Create/index.tsx
|
|
23605
|
-
var
|
|
23808
|
+
var import_react_router_dom24 = require("react-router-dom");
|
|
23606
23809
|
|
|
23607
23810
|
// src/views/Workflows/List/Modals/PreviewTemplate/index.tsx
|
|
23608
|
-
var
|
|
23609
|
-
var
|
|
23811
|
+
var import_react98 = require("react");
|
|
23812
|
+
var import_react_router_dom20 = require("react-router-dom");
|
|
23610
23813
|
|
|
23611
23814
|
// src/views/Workflows/List/Modals/PreviewTemplate/Modal.tsx
|
|
23612
|
-
var
|
|
23613
|
-
var
|
|
23815
|
+
var import_react96 = require("react");
|
|
23816
|
+
var import_react_router_dom19 = require("react-router-dom");
|
|
23614
23817
|
var import_design_system_icons34 = require("@livechat/design-system-icons");
|
|
23615
23818
|
var import_design_system_react_components73 = require("@livechat/design-system-react-components");
|
|
23616
23819
|
var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-react");
|
|
@@ -23618,15 +23821,15 @@ var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-
|
|
|
23618
23821
|
// src/views/Workflows/Common/Icons/TemplateCategoryIcon.tsx
|
|
23619
23822
|
var import_design_system_icons33 = require("@livechat/design-system-icons");
|
|
23620
23823
|
var import_design_system_react_components72 = require("@livechat/design-system-react-components");
|
|
23621
|
-
var
|
|
23824
|
+
var import_developer_studio_api29 = require("@livechat/developer-studio-api");
|
|
23622
23825
|
var import_developer_studio_ui_react36 = require("@livechat/developer-studio-ui-react");
|
|
23623
23826
|
function WorkflowTemplateCategoryIcon(props) {
|
|
23624
23827
|
const icons = {
|
|
23625
|
-
[
|
|
23626
|
-
[
|
|
23627
|
-
[
|
|
23628
|
-
[
|
|
23629
|
-
[
|
|
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
|
|
23630
23833
|
};
|
|
23631
23834
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react36.Row, { gap: `var(${import_design_system_react_components72.SpacingToken.Spacing1})`, noWrap: true, notPadded: true, children: [
|
|
23632
23835
|
/* @__PURE__ */ jsx4(
|
|
@@ -23691,7 +23894,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
23691
23894
|
template,
|
|
23692
23895
|
onClose
|
|
23693
23896
|
}) {
|
|
23694
|
-
const navigate = (0,
|
|
23897
|
+
const navigate = (0, import_react_router_dom19.useNavigate)();
|
|
23695
23898
|
const {
|
|
23696
23899
|
save,
|
|
23697
23900
|
state: {
|
|
@@ -23702,7 +23905,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
23702
23905
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23703
23906
|
user == null ? void 0 : user.meta.email
|
|
23704
23907
|
);
|
|
23705
|
-
const handleClose = (0,
|
|
23908
|
+
const handleClose = (0, import_react96.useCallback)(
|
|
23706
23909
|
(target) => {
|
|
23707
23910
|
if (onClose) {
|
|
23708
23911
|
onClose();
|
|
@@ -23848,8 +24051,8 @@ function WorkflowTemplatePreview({
|
|
|
23848
24051
|
workflow,
|
|
23849
24052
|
onClose
|
|
23850
24053
|
}) {
|
|
23851
|
-
const flowTemplates = (0,
|
|
23852
|
-
const params = (0,
|
|
24054
|
+
const flowTemplates = (0, import_react98.useMemo)(() => getWorkflowTemplates(), []);
|
|
24055
|
+
const params = (0, import_react_router_dom20.useParams)();
|
|
23853
24056
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
23854
24057
|
const targetWorkflow = workflow || (template == null ? void 0 : template.workflow);
|
|
23855
24058
|
if (!template) {
|
|
@@ -23880,29 +24083,29 @@ function WorkflowTemplatePreview({
|
|
|
23880
24083
|
var PreviewTemplate_default = WorkflowTemplatePreview;
|
|
23881
24084
|
|
|
23882
24085
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
23883
|
-
var
|
|
23884
|
-
var
|
|
24086
|
+
var import_react103 = require("react");
|
|
24087
|
+
var import_react_router_dom23 = require("react-router-dom");
|
|
23885
24088
|
var import_design_system_react_components79 = require("@livechat/design-system-react-components");
|
|
23886
24089
|
|
|
23887
24090
|
// src/views/Workflows/List/Home/Home.tsx
|
|
23888
|
-
var
|
|
24091
|
+
var import_react102 = require("react");
|
|
23889
24092
|
var import_design_system_icons37 = require("@livechat/design-system-icons");
|
|
23890
24093
|
var import_design_system_react_components78 = require("@livechat/design-system-react-components");
|
|
23891
24094
|
var import_developer_studio_ui_react42 = require("@livechat/developer-studio-ui-react");
|
|
23892
24095
|
|
|
23893
24096
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Category.tsx
|
|
23894
|
-
var
|
|
24097
|
+
var import_react99 = require("react");
|
|
23895
24098
|
var import_design_system_icons35 = require("@livechat/design-system-icons");
|
|
23896
24099
|
var import_design_system_react_components74 = require("@livechat/design-system-react-components");
|
|
23897
|
-
var
|
|
24100
|
+
var import_developer_studio_api30 = require("@livechat/developer-studio-api");
|
|
23898
24101
|
var import_developer_studio_ui_react38 = require("@livechat/developer-studio-ui-react");
|
|
23899
24102
|
function WorkflowTemplatesCategoryFilter({
|
|
23900
24103
|
handleStatus,
|
|
23901
24104
|
status
|
|
23902
24105
|
}) {
|
|
23903
24106
|
var _a;
|
|
23904
|
-
const [isVisible, setIsVisible] = (0,
|
|
23905
|
-
const getItem = (0,
|
|
24107
|
+
const [isVisible, setIsVisible] = (0, import_react99.useState)(false);
|
|
24108
|
+
const getItem = (0, import_react99.useCallback)(
|
|
23906
24109
|
(key, category, icon2) => ({
|
|
23907
24110
|
key,
|
|
23908
24111
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react38.Row, { gap: `var(${import_design_system_react_components74.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -23918,11 +24121,11 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
23918
24121
|
);
|
|
23919
24122
|
const options = [
|
|
23920
24123
|
getItem("0", "All"),
|
|
23921
|
-
getItem("1",
|
|
23922
|
-
getItem("2",
|
|
23923
|
-
getItem("3",
|
|
23924
|
-
getItem("4",
|
|
23925
|
-
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)
|
|
23926
24129
|
];
|
|
23927
24130
|
const selectedKey = (_a = options.find(
|
|
23928
24131
|
(option) => option.element.props.children[1] === status
|
|
@@ -23957,18 +24160,18 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
23957
24160
|
var Category_default = WorkflowTemplatesCategoryFilter;
|
|
23958
24161
|
|
|
23959
24162
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Product.tsx
|
|
23960
|
-
var
|
|
24163
|
+
var import_react100 = require("react");
|
|
23961
24164
|
var import_design_system_icons36 = require("@livechat/design-system-icons");
|
|
23962
24165
|
var import_design_system_react_components75 = require("@livechat/design-system-react-components");
|
|
23963
|
-
var
|
|
24166
|
+
var import_developer_studio_api31 = require("@livechat/developer-studio-api");
|
|
23964
24167
|
var import_developer_studio_ui_react39 = require("@livechat/developer-studio-ui-react");
|
|
23965
24168
|
function WorkflowTemplatesProductFilter({
|
|
23966
24169
|
handleStatus,
|
|
23967
24170
|
status
|
|
23968
24171
|
}) {
|
|
23969
24172
|
var _a;
|
|
23970
|
-
const [isVisible, setIsVisible] = (0,
|
|
23971
|
-
const getItem = (0,
|
|
24173
|
+
const [isVisible, setIsVisible] = (0, import_react100.useState)(false);
|
|
24174
|
+
const getItem = (0, import_react100.useCallback)(
|
|
23972
24175
|
(key, product, icon2) => ({
|
|
23973
24176
|
key,
|
|
23974
24177
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react39.Row, { gap: `var(${import_design_system_react_components75.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -23984,11 +24187,11 @@ function WorkflowTemplatesProductFilter({
|
|
|
23984
24187
|
);
|
|
23985
24188
|
const options = [
|
|
23986
24189
|
getItem("0", "All"),
|
|
23987
|
-
getItem("1",
|
|
23988
|
-
getItem("2",
|
|
23989
|
-
getItem("3",
|
|
23990
|
-
getItem("4",
|
|
23991
|
-
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)
|
|
23992
24195
|
// getItem('6', IntegrationDisplayNames.Stripe, Stripe),
|
|
23993
24196
|
// getItem('7', IntegrationDisplayNames.GoogleSheets, GoogleSheets),
|
|
23994
24197
|
];
|
|
@@ -24025,7 +24228,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24025
24228
|
var Product_default = WorkflowTemplatesProductFilter;
|
|
24026
24229
|
|
|
24027
24230
|
// src/views/Workflows/List/Home/Cards/Scratch.tsx
|
|
24028
|
-
var
|
|
24231
|
+
var import_react_router_dom21 = require("react-router-dom");
|
|
24029
24232
|
var import_design_system_react_components76 = require("@livechat/design-system-react-components");
|
|
24030
24233
|
var import_developer_studio_ui_react40 = require("@livechat/developer-studio-ui-react");
|
|
24031
24234
|
function WorkflowScratchCard({
|
|
@@ -24033,7 +24236,7 @@ function WorkflowScratchCard({
|
|
|
24033
24236
|
icon: icon2,
|
|
24034
24237
|
openOne
|
|
24035
24238
|
}) {
|
|
24036
|
-
const navigate = (0,
|
|
24239
|
+
const navigate = (0, import_react_router_dom21.useNavigate)();
|
|
24037
24240
|
const { user } = (0, import_developer_studio_ui_react40.useUserContext)();
|
|
24038
24241
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24039
24242
|
user == null ? void 0 : user.meta.email
|
|
@@ -24065,7 +24268,7 @@ function WorkflowScratchCard({
|
|
|
24065
24268
|
var Scratch_default = WorkflowScratchCard;
|
|
24066
24269
|
|
|
24067
24270
|
// src/views/Workflows/List/Home/Cards/Template.tsx
|
|
24068
|
-
var
|
|
24271
|
+
var import_react_router_dom22 = require("react-router-dom");
|
|
24069
24272
|
var import_design_system_react_components77 = require("@livechat/design-system-react-components");
|
|
24070
24273
|
var import_developer_studio_ui_react41 = require("@livechat/developer-studio-ui-react");
|
|
24071
24274
|
var IconWrapper2 = newStyled.div`
|
|
@@ -24083,7 +24286,7 @@ function WorkflowTemplateCard({
|
|
|
24083
24286
|
icons,
|
|
24084
24287
|
category
|
|
24085
24288
|
}) {
|
|
24086
|
-
const navigate = (0,
|
|
24289
|
+
const navigate = (0, import_react_router_dom22.useNavigate)();
|
|
24087
24290
|
return /* @__PURE__ */ jsx4(
|
|
24088
24291
|
import_developer_studio_ui_react41.Card,
|
|
24089
24292
|
{
|
|
@@ -24127,9 +24330,9 @@ var Grid = newStyled.div`
|
|
|
24127
24330
|
gap: var(${import_design_system_react_components78.SpacingToken.Spacing3});
|
|
24128
24331
|
`;
|
|
24129
24332
|
function WorkflowsHome({ isOnModal }) {
|
|
24130
|
-
const [product, setProduct] = (0,
|
|
24131
|
-
const [category, setCategory] = (0,
|
|
24132
|
-
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(), []);
|
|
24133
24336
|
const filters = [
|
|
24134
24337
|
(template) => product === "All" || template.products.includes(product),
|
|
24135
24338
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -24231,8 +24434,8 @@ var Home_default = WorkflowsHome;
|
|
|
24231
24434
|
|
|
24232
24435
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24233
24436
|
function WorkflowCreateModal({ onClose }) {
|
|
24234
|
-
const navigate = (0,
|
|
24235
|
-
const handleClose = (0,
|
|
24437
|
+
const navigate = (0, import_react_router_dom23.useNavigate)();
|
|
24438
|
+
const handleClose = (0, import_react103.useCallback)(() => {
|
|
24236
24439
|
if (onClose) {
|
|
24237
24440
|
onClose();
|
|
24238
24441
|
return;
|
|
@@ -24259,21 +24462,21 @@ var Modal_default6 = WorkflowCreateModal;
|
|
|
24259
24462
|
function WorkflowCreate() {
|
|
24260
24463
|
return /* @__PURE__ */ jsxs2(Fragment4, { children: [
|
|
24261
24464
|
/* @__PURE__ */ jsx4(Modal_default6, {}),
|
|
24262
|
-
/* @__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" }) })
|
|
24263
24466
|
] });
|
|
24264
24467
|
}
|
|
24265
24468
|
var Create_default = WorkflowCreate;
|
|
24266
24469
|
|
|
24267
24470
|
// src/views/Workflows/List/View.tsx
|
|
24268
|
-
var
|
|
24269
|
-
var
|
|
24471
|
+
var import_react110 = require("react");
|
|
24472
|
+
var import_react_router_dom27 = require("react-router-dom");
|
|
24270
24473
|
var import_design_system_react_components84 = require("@livechat/design-system-react-components");
|
|
24271
|
-
var
|
|
24474
|
+
var import_developer_studio_api33 = require("@livechat/developer-studio-api");
|
|
24272
24475
|
var import_developer_studio_ui_react45 = require("@livechat/developer-studio-ui-react");
|
|
24273
24476
|
|
|
24274
24477
|
// src/views/Workflows/Creator/LiveChatNavbar.tsx
|
|
24275
|
-
var
|
|
24276
|
-
var
|
|
24478
|
+
var import_react105 = require("react");
|
|
24479
|
+
var import_react_router_dom25 = require("react-router-dom");
|
|
24277
24480
|
var import_design_system_icons38 = require("@livechat/design-system-icons");
|
|
24278
24481
|
var import_design_system_react_components80 = require("@livechat/design-system-react-components");
|
|
24279
24482
|
var wrapperCss = (hasData) => css`
|
|
@@ -24291,12 +24494,12 @@ var wrapperCss = (hasData) => css`
|
|
|
24291
24494
|
}`}
|
|
24292
24495
|
`;
|
|
24293
24496
|
function LiveChatNavbar() {
|
|
24294
|
-
const navigate = (0,
|
|
24497
|
+
const navigate = (0, import_react_router_dom25.useNavigate)();
|
|
24295
24498
|
const workflows = useFetchWorkflows({});
|
|
24296
24499
|
const isLoading = workflows.isLoading;
|
|
24297
24500
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0;
|
|
24298
24501
|
const hasData = !isLoading && !hasNoData;
|
|
24299
|
-
const handleClick = (0,
|
|
24502
|
+
const handleClick = (0, import_react105.useCallback)(() => {
|
|
24300
24503
|
sendMessage("toggleSideNav" /* ToggleSideNav */);
|
|
24301
24504
|
}, []);
|
|
24302
24505
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperCss(hasData), children: [
|
|
@@ -24328,7 +24531,7 @@ var import_design_system_react_components83 = require("@livechat/design-system-r
|
|
|
24328
24531
|
var import_developer_studio_ui_react44 = require("@livechat/developer-studio-ui-react");
|
|
24329
24532
|
|
|
24330
24533
|
// src/views/Workflows/List/Grid/Filters/StatusFilter.tsx
|
|
24331
|
-
var
|
|
24534
|
+
var import_react107 = require("react");
|
|
24332
24535
|
var import_design_system_icons39 = require("@livechat/design-system-icons");
|
|
24333
24536
|
var import_design_system_react_components81 = require("@livechat/design-system-react-components");
|
|
24334
24537
|
function WorkflowStatusFilter({
|
|
@@ -24336,7 +24539,7 @@ function WorkflowStatusFilter({
|
|
|
24336
24539
|
status
|
|
24337
24540
|
}) {
|
|
24338
24541
|
var _a;
|
|
24339
|
-
const [isVisible, setIsVisible] = (0,
|
|
24542
|
+
const [isVisible, setIsVisible] = (0, import_react107.useState)(false);
|
|
24340
24543
|
const items = [
|
|
24341
24544
|
{
|
|
24342
24545
|
key: "0",
|
|
@@ -24394,14 +24597,14 @@ function WorkflowStatusFilter({
|
|
|
24394
24597
|
var StatusFilter_default = WorkflowStatusFilter;
|
|
24395
24598
|
|
|
24396
24599
|
// src/views/Workflows/List/Grid/Table.tsx
|
|
24397
|
-
var
|
|
24600
|
+
var import_react_router_dom26 = require("react-router-dom");
|
|
24398
24601
|
var import_design_system_icons40 = require("@livechat/design-system-icons");
|
|
24399
24602
|
var import_design_system_react_components82 = require("@livechat/design-system-react-components");
|
|
24400
|
-
var
|
|
24603
|
+
var import_developer_studio_api32 = require("@livechat/developer-studio-api");
|
|
24401
24604
|
var import_developer_studio_ui_react43 = require("@livechat/developer-studio-ui-react");
|
|
24402
24605
|
function WorkflowsTable({ workflowsQuery, state }) {
|
|
24403
24606
|
var _a, _b, _c;
|
|
24404
|
-
const navigate = (0,
|
|
24607
|
+
const navigate = (0, import_react_router_dom26.useNavigate)();
|
|
24405
24608
|
const notifications = (0, import_developer_studio_ui_react43.useNotificationContext)();
|
|
24406
24609
|
const deleteAction = useDeleteWorkflow();
|
|
24407
24610
|
const activateWorkflowAction = useActivateWorkflow();
|
|
@@ -24462,7 +24665,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
24462
24665
|
) : null
|
|
24463
24666
|
] }) }),
|
|
24464
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) => {
|
|
24465
|
-
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());
|
|
24466
24669
|
return /* @__PURE__ */ jsx4(
|
|
24467
24670
|
ProductIcon_default,
|
|
24468
24671
|
{
|
|
@@ -24645,8 +24848,8 @@ var markedStyles = css`
|
|
|
24645
24848
|
`;
|
|
24646
24849
|
function WorkflowListView() {
|
|
24647
24850
|
var _a;
|
|
24648
|
-
const navigate = (0,
|
|
24649
|
-
const [state, setState] = (0,
|
|
24851
|
+
const navigate = (0, import_react_router_dom27.useNavigate)();
|
|
24852
|
+
const [state, setState] = (0, import_react110.useState)({
|
|
24650
24853
|
filters: {
|
|
24651
24854
|
status: "All",
|
|
24652
24855
|
tasks: "All"
|
|
@@ -24707,7 +24910,7 @@ function WorkflowListView() {
|
|
|
24707
24910
|
Grid_default,
|
|
24708
24911
|
{
|
|
24709
24912
|
onStateChange: (change) => {
|
|
24710
|
-
setState((prevState) => (0,
|
|
24913
|
+
setState((prevState) => (0, import_developer_studio_api33.mergeDeep)(prevState, change));
|
|
24711
24914
|
},
|
|
24712
24915
|
state,
|
|
24713
24916
|
workflowQuery: workflows
|
|
@@ -24723,10 +24926,10 @@ var View_default2 = WorkflowListView;
|
|
|
24723
24926
|
function WorkflowList() {
|
|
24724
24927
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react46.Row, { noMaxWidth: true, noWrap: true, notPadded: true, stretch: true, children: [
|
|
24725
24928
|
/* @__PURE__ */ jsx4(View_default2, {}),
|
|
24726
|
-
/* @__PURE__ */ jsxs2(
|
|
24727
|
-
/* @__PURE__ */ jsx4(
|
|
24728
|
-
/* @__PURE__ */ jsx4(
|
|
24729
|
-
/* @__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/*" })
|
|
24730
24933
|
] })
|
|
24731
24934
|
] });
|
|
24732
24935
|
}
|
|
@@ -24735,9 +24938,9 @@ var List_default2 = WorkflowList;
|
|
|
24735
24938
|
// src/views/Workflows/index.tsx
|
|
24736
24939
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
24737
24940
|
function Workflows() {
|
|
24738
|
-
const navigate = (0,
|
|
24941
|
+
const navigate = (0, import_react_router_dom29.useNavigate)();
|
|
24739
24942
|
const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
|
|
24740
|
-
(0,
|
|
24943
|
+
(0, import_react112.useEffect)(() => {
|
|
24741
24944
|
if (isWorkflowAppLoading) {
|
|
24742
24945
|
return;
|
|
24743
24946
|
}
|
|
@@ -24748,10 +24951,10 @@ function Workflows() {
|
|
|
24748
24951
|
if (isWorkflowAppLoading) {
|
|
24749
24952
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_developer_studio_ui_react47.Loader, { stretch: true });
|
|
24750
24953
|
}
|
|
24751
|
-
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
|
|
24752
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
24753
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
24754
|
-
/* @__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/*" })
|
|
24755
24958
|
] });
|
|
24756
24959
|
}
|
|
24757
24960
|
var Workflows_default = Workflows;
|
|
@@ -24800,14 +25003,15 @@ var LoginError_default = LoginErrorPage;
|
|
|
24800
25003
|
// src/views/index.tsx
|
|
24801
25004
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
24802
25005
|
function WorkflowsModule({ waitlistImage }) {
|
|
24803
|
-
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
24804
|
-
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
24805
|
-
/* @__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" })
|
|
24806
25009
|
] });
|
|
24807
25010
|
}
|
|
24808
25011
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24809
25012
|
0 && (module.exports = {
|
|
24810
25013
|
LoginError,
|
|
25014
|
+
WORKFLOWS_TEST_SELECTORS,
|
|
24811
25015
|
WorkflowsModule,
|
|
24812
25016
|
config,
|
|
24813
25017
|
getWorkflowsEnv,
|