@livechat/platform-workflows 0.0.89 → 0.0.91
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 +832 -618
- package/dist/index.mjs +644 -545
- package/package.json +9 -4
package/dist/index.js
CHANGED
|
@@ -448,9 +448,9 @@ var require_hoist_non_react_statics_cjs = __commonJS({
|
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
|
|
451
|
-
// ../../../node_modules/.pnpm/@babel+runtime@7.26.
|
|
451
|
+
// ../../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/extends.js
|
|
452
452
|
var require_extends = __commonJS({
|
|
453
|
-
"../../../node_modules/.pnpm/@babel+runtime@7.26.
|
|
453
|
+
"../../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/extends.js"(exports2, module2) {
|
|
454
454
|
"use strict";
|
|
455
455
|
function _extends2() {
|
|
456
456
|
return module2.exports = _extends2 = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -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");
|
|
@@ -1356,7 +1408,7 @@ var createCache = function createCache2(options) {
|
|
|
1356
1408
|
return cache;
|
|
1357
1409
|
};
|
|
1358
1410
|
|
|
1359
|
-
// ../../../node_modules/.pnpm/@babel+runtime@7.26.
|
|
1411
|
+
// ../../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
1360
1412
|
function _extends() {
|
|
1361
1413
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
1362
1414
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -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
|
}
|
|
@@ -5431,9 +5492,7 @@ var webhookSpecs2 = {
|
|
|
5431
5492
|
required: [],
|
|
5432
5493
|
properties: {
|
|
5433
5494
|
tag: {
|
|
5434
|
-
|
|
5435
|
-
title: "Tag",
|
|
5436
|
-
description: "The name of the tag."
|
|
5495
|
+
$ref: "#/$defs/livechat_tag"
|
|
5437
5496
|
},
|
|
5438
5497
|
exact: {
|
|
5439
5498
|
type: "boolean",
|
|
@@ -6092,7 +6151,7 @@ var livechatTriggerTemplates = () => ({
|
|
|
6092
6151
|
source: import_developer_studio_api7.IntegrationNames.LiveChat,
|
|
6093
6152
|
event: {
|
|
6094
6153
|
name: import_developer_studio_api7.TextLivechatEventNames.ChatTagged,
|
|
6095
|
-
tag:
|
|
6154
|
+
tag: void 0,
|
|
6096
6155
|
exact: false
|
|
6097
6156
|
},
|
|
6098
6157
|
headers: {
|
|
@@ -6303,12 +6362,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6303
6362
|
specification: {
|
|
6304
6363
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6305
6364
|
type: "object",
|
|
6306
|
-
required: ["list_id", "
|
|
6365
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6307
6366
|
properties: {
|
|
6308
6367
|
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
6368
|
$ref: "#/$defs/mailchimp_audience"
|
|
6313
6369
|
},
|
|
6314
6370
|
email: {
|
|
@@ -6360,9 +6416,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6360
6416
|
required: ["list_id"],
|
|
6361
6417
|
properties: {
|
|
6362
6418
|
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
6419
|
$ref: "#/$defs/mailchimp_audience"
|
|
6367
6420
|
}
|
|
6368
6421
|
}
|
|
@@ -6396,10 +6449,7 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6396
6449
|
required: ["campaign_id"],
|
|
6397
6450
|
properties: {
|
|
6398
6451
|
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',
|
|
6452
|
+
$ref: "#/$defs/mailchimp_campaign"
|
|
6403
6453
|
}
|
|
6404
6454
|
}
|
|
6405
6455
|
}),
|
|
@@ -6425,12 +6475,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6425
6475
|
specification: {
|
|
6426
6476
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6427
6477
|
type: "object",
|
|
6428
|
-
required: ["list_id", "
|
|
6478
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6429
6479
|
properties: {
|
|
6430
6480
|
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
6481
|
$ref: "#/$defs/mailchimp_audience"
|
|
6435
6482
|
},
|
|
6436
6483
|
email: {
|
|
@@ -6474,12 +6521,9 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6474
6521
|
specification: {
|
|
6475
6522
|
input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
|
|
6476
6523
|
type: "object",
|
|
6477
|
-
required: ["list_id", "
|
|
6524
|
+
required: ["list_id", "email", "first_name", "last_name"],
|
|
6478
6525
|
properties: {
|
|
6479
6526
|
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
6527
|
$ref: "#/$defs/mailchimp_audience"
|
|
6484
6528
|
},
|
|
6485
6529
|
email: {
|
|
@@ -6526,9 +6570,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6526
6570
|
required: ["list_id", "email"],
|
|
6527
6571
|
properties: {
|
|
6528
6572
|
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
6573
|
$ref: "#/$defs/mailchimp_audience"
|
|
6533
6574
|
},
|
|
6534
6575
|
email: {
|
|
@@ -6562,9 +6603,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6562
6603
|
required: ["list_id", "email"],
|
|
6563
6604
|
properties: {
|
|
6564
6605
|
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
6606
|
$ref: "#/$defs/mailchimp_audience"
|
|
6569
6607
|
},
|
|
6570
6608
|
email: {
|
|
@@ -6598,9 +6636,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6598
6636
|
required: ["list_id", "email", "tag"],
|
|
6599
6637
|
properties: {
|
|
6600
6638
|
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
6639
|
$ref: "#/$defs/mailchimp_audience"
|
|
6605
6640
|
},
|
|
6606
6641
|
email: {
|
|
@@ -6639,9 +6674,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6639
6674
|
required: ["list_id", "email", "name"],
|
|
6640
6675
|
properties: {
|
|
6641
6676
|
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
6677
|
$ref: "#/$defs/mailchimp_audience"
|
|
6646
6678
|
},
|
|
6647
6679
|
email: {
|
|
@@ -6696,9 +6728,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6696
6728
|
required: ["list_id", "email", "note"],
|
|
6697
6729
|
properties: {
|
|
6698
6730
|
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
6731
|
$ref: "#/$defs/mailchimp_audience"
|
|
6703
6732
|
},
|
|
6704
6733
|
email: {
|
|
@@ -6737,9 +6766,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6737
6766
|
required: ["list_id", "email", "tag"],
|
|
6738
6767
|
properties: {
|
|
6739
6768
|
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
6769
|
$ref: "#/$defs/mailchimp_audience"
|
|
6744
6770
|
},
|
|
6745
6771
|
email: {
|
|
@@ -6777,9 +6803,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6777
6803
|
required: ["list_id", "email"],
|
|
6778
6804
|
properties: {
|
|
6779
6805
|
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
6806
|
$ref: "#/$defs/mailchimp_audience"
|
|
6784
6807
|
},
|
|
6785
6808
|
email: {
|
|
@@ -6843,9 +6866,6 @@ var mailchimpTaskConfigs = () => ({
|
|
|
6843
6866
|
required: ["list_id", "email"],
|
|
6844
6867
|
properties: {
|
|
6845
6868
|
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
6869
|
$ref: "#/$defs/mailchimp_audience"
|
|
6850
6870
|
},
|
|
6851
6871
|
email: {
|
|
@@ -7019,10 +7039,8 @@ var mailchimpTaskConfigs = () => ({
|
|
|
7019
7039
|
required: ["list_id", "query"],
|
|
7020
7040
|
properties: {
|
|
7021
7041
|
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"
|
|
7042
|
+
$ref: "#/$defs/mailchimp_audience",
|
|
7043
|
+
minLength: 1
|
|
7026
7044
|
},
|
|
7027
7045
|
query: {
|
|
7028
7046
|
type: "string",
|
|
@@ -7196,10 +7214,7 @@ var mailchimpTaskConfigs = () => ({
|
|
|
7196
7214
|
required: ["campaign_id"],
|
|
7197
7215
|
properties: {
|
|
7198
7216
|
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'
|
|
7217
|
+
$ref: "#/$defs/mailchimp_campaign"
|
|
7203
7218
|
}
|
|
7204
7219
|
}
|
|
7205
7220
|
}),
|
|
@@ -9422,7 +9437,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9422
9437
|
},
|
|
9423
9438
|
...Object.values(WorkflowSpecification.config.tasks).map(
|
|
9424
9439
|
(config2) => {
|
|
9425
|
-
var _a, _b;
|
|
9440
|
+
var _a, _b, _c, _d;
|
|
9426
9441
|
return {
|
|
9427
9442
|
if: {
|
|
9428
9443
|
properties: {
|
|
@@ -9431,7 +9446,8 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9431
9446
|
}
|
|
9432
9447
|
},
|
|
9433
9448
|
then: WORKFLOW_HTTP_TASK_SCHEMA(config2.key, {
|
|
9434
|
-
|
|
9449
|
+
uri: (_b = (_a = config2.specification.input) == null ? void 0 : _a.properties) == null ? void 0 : _b.uri,
|
|
9450
|
+
body: (_d = (_c = config2.specification.input) == null ? void 0 : _c.properties) == null ? void 0 : _d.body
|
|
9435
9451
|
})
|
|
9436
9452
|
};
|
|
9437
9453
|
}
|
|
@@ -9458,6 +9474,10 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9458
9474
|
}),
|
|
9459
9475
|
$defs: {
|
|
9460
9476
|
mailchimp_audience: {
|
|
9477
|
+
type: "string",
|
|
9478
|
+
title: "Mailchimp audience ID",
|
|
9479
|
+
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.",
|
|
9480
|
+
visible: true,
|
|
9461
9481
|
"x-ref": {
|
|
9462
9482
|
provider: "mailchimp",
|
|
9463
9483
|
product: "mailchimp",
|
|
@@ -9467,17 +9487,23 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9467
9487
|
}
|
|
9468
9488
|
},
|
|
9469
9489
|
mailchimp_campaign: {
|
|
9470
|
-
"
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9490
|
+
type: "string",
|
|
9491
|
+
title: "Campaign ID",
|
|
9492
|
+
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=".`,
|
|
9493
|
+
visible: true
|
|
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",
|
|
9480
9505
|
type: "string",
|
|
9506
|
+
visible: true,
|
|
9481
9507
|
"x-ref": {
|
|
9482
9508
|
provider: "text",
|
|
9483
9509
|
product: "helpdesk",
|
|
@@ -9489,6 +9515,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9489
9515
|
helpdesk_tag: {
|
|
9490
9516
|
title: "Tag",
|
|
9491
9517
|
type: "string",
|
|
9518
|
+
visible: true,
|
|
9492
9519
|
"x-ref": {
|
|
9493
9520
|
provider: "text",
|
|
9494
9521
|
product: "helpdesk",
|
|
@@ -9500,21 +9527,24 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9500
9527
|
helpdesk_agent: {
|
|
9501
9528
|
title: "Agent",
|
|
9502
9529
|
type: "string",
|
|
9530
|
+
visible: true,
|
|
9503
9531
|
"x-ref": {
|
|
9504
9532
|
provider: "text",
|
|
9505
9533
|
product: "helpdesk",
|
|
9506
9534
|
name: "agent",
|
|
9507
9535
|
displayField: "email",
|
|
9508
|
-
valueField: "
|
|
9536
|
+
valueField: "ID"
|
|
9509
9537
|
}
|
|
9510
9538
|
},
|
|
9511
9539
|
livechat_chat_id: {
|
|
9512
9540
|
title: "Chat ID",
|
|
9513
|
-
type: "string"
|
|
9541
|
+
type: "string",
|
|
9542
|
+
visible: true
|
|
9514
9543
|
},
|
|
9515
9544
|
livechat_tag: {
|
|
9516
9545
|
title: "Tag",
|
|
9517
9546
|
type: "string",
|
|
9547
|
+
visible: true,
|
|
9518
9548
|
"x-ref": {
|
|
9519
9549
|
provider: "text",
|
|
9520
9550
|
product: "livechat",
|
|
@@ -9527,6 +9557,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9527
9557
|
title: "Agent",
|
|
9528
9558
|
type: "string",
|
|
9529
9559
|
format: "email",
|
|
9560
|
+
visible: true,
|
|
9530
9561
|
"x-ref": {
|
|
9531
9562
|
provider: "text",
|
|
9532
9563
|
product: "livechat",
|
|
@@ -9538,6 +9569,7 @@ var WORKFLOW_SCHEMA_DEFS = {
|
|
|
9538
9569
|
livechat_group: {
|
|
9539
9570
|
title: "Group",
|
|
9540
9571
|
type: "number",
|
|
9572
|
+
visible: true,
|
|
9541
9573
|
"x-ref": {
|
|
9542
9574
|
provider: "text",
|
|
9543
9575
|
product: "livechat",
|
|
@@ -12611,8 +12643,8 @@ var getWorkflowTemplates = () => [
|
|
|
12611
12643
|
];
|
|
12612
12644
|
|
|
12613
12645
|
// src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
|
|
12614
|
-
var
|
|
12615
|
-
var
|
|
12646
|
+
var import_react14 = require("react");
|
|
12647
|
+
var import_react_router_dom4 = require("react-router-dom");
|
|
12616
12648
|
var import_design_system_react_components4 = require("@livechat/design-system-react-components");
|
|
12617
12649
|
var import_developer_studio_api21 = require("@livechat/developer-studio-api");
|
|
12618
12650
|
var import_developer_studio_ui_react7 = require("@livechat/developer-studio-ui-react");
|
|
@@ -13063,8 +13095,8 @@ function ProductIcon({
|
|
|
13063
13095
|
var ProductIcon_default = ProductIcon;
|
|
13064
13096
|
|
|
13065
13097
|
// src/views/Workflows/Creator/Provider/index.tsx
|
|
13066
|
-
var
|
|
13067
|
-
var
|
|
13098
|
+
var import_react12 = require("react");
|
|
13099
|
+
var import_react_router_dom3 = require("react-router-dom");
|
|
13068
13100
|
var import_reactflow = require("reactflow");
|
|
13069
13101
|
var import_lodash = __toESM(require("lodash.debounce"));
|
|
13070
13102
|
var import_developer_studio_api20 = require("@livechat/developer-studio-api");
|
|
@@ -13304,15 +13336,39 @@ var DEFAULT_NODE_HEIGHT = {
|
|
|
13304
13336
|
default: 65
|
|
13305
13337
|
};
|
|
13306
13338
|
|
|
13307
|
-
// src/views/Workflows/Creator/Provider/
|
|
13339
|
+
// src/views/Workflows/Creator/Provider/navigation/hooks.ts
|
|
13308
13340
|
var import_react8 = require("react");
|
|
13341
|
+
var import_react_router_dom2 = require("react-router-dom");
|
|
13342
|
+
function useReplaceWorkflowIdInUrl() {
|
|
13343
|
+
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
13344
|
+
const location = (0, import_react_router_dom2.useLocation)();
|
|
13345
|
+
const { id } = (0, import_react_router_dom2.useParams)();
|
|
13346
|
+
const latestPathRef = (0, import_react8.useRef)(location.pathname);
|
|
13347
|
+
(0, import_react8.useEffect)(() => {
|
|
13348
|
+
latestPathRef.current = location.pathname;
|
|
13349
|
+
}, [location.pathname]);
|
|
13350
|
+
return (0, import_react8.useCallback)(
|
|
13351
|
+
(newId) => {
|
|
13352
|
+
if (!id) {
|
|
13353
|
+
navigate(`/workflow/${newId}`);
|
|
13354
|
+
return;
|
|
13355
|
+
}
|
|
13356
|
+
const latestPath = latestPathRef.current.replace(`/${id}`, `/${newId}`);
|
|
13357
|
+
navigate(latestPath, { replace: true });
|
|
13358
|
+
},
|
|
13359
|
+
[navigate, id]
|
|
13360
|
+
);
|
|
13361
|
+
}
|
|
13362
|
+
|
|
13363
|
+
// src/views/Workflows/Creator/Provider/state/data/hooks.ts
|
|
13364
|
+
var import_react9 = require("react");
|
|
13309
13365
|
function useWorkflowData(workflow) {
|
|
13310
|
-
const [actions, setActions] = (0,
|
|
13311
|
-
const [selection, setSelection] = (0,
|
|
13312
|
-
const [pendingWorkflow, setPendingWorkflow] = (0,
|
|
13366
|
+
const [actions, setActions] = (0, import_react9.useState)({});
|
|
13367
|
+
const [selection, setSelection] = (0, import_react9.useState)();
|
|
13368
|
+
const [pendingWorkflow, setPendingWorkflow] = (0, import_react9.useState)(
|
|
13313
13369
|
() => JSON.parse(JSON.stringify(workflow))
|
|
13314
13370
|
);
|
|
13315
|
-
const setAction = (0,
|
|
13371
|
+
const setAction = (0, import_react9.useCallback)(
|
|
13316
13372
|
(action, value) => {
|
|
13317
13373
|
setActions((prevState) => __spreadProps(__spreadValues({}, prevState), {
|
|
13318
13374
|
[action]: value
|
|
@@ -13320,10 +13376,10 @@ function useWorkflowData(workflow) {
|
|
|
13320
13376
|
},
|
|
13321
13377
|
[]
|
|
13322
13378
|
);
|
|
13323
|
-
(0,
|
|
13379
|
+
(0, import_react9.useEffect)(() => {
|
|
13324
13380
|
setPendingWorkflow(JSON.parse(JSON.stringify(workflow)));
|
|
13325
13381
|
setSelection((prevState) => {
|
|
13326
|
-
if ((prevState == null ? void 0 : prevState.kind) === "trigger") {
|
|
13382
|
+
if ((prevState == null ? void 0 : prevState.kind) === "trigger" && !workflow.trigger.type) {
|
|
13327
13383
|
return void 0;
|
|
13328
13384
|
}
|
|
13329
13385
|
if ((prevState == null ? void 0 : prevState.kind) === "task") {
|
|
@@ -13610,12 +13666,30 @@ var getWorkflowContexts = (workflow, external) => {
|
|
|
13610
13666
|
};
|
|
13611
13667
|
|
|
13612
13668
|
// src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
|
|
13613
|
-
var
|
|
13669
|
+
var import_react11 = require("react");
|
|
13614
13670
|
var import_platform_integrations2 = require("@livechat/platform-integrations");
|
|
13615
13671
|
|
|
13672
|
+
// src/views/Workflows/Creator/Provider/state/metadata/utils.ts
|
|
13673
|
+
var import_developer_studio_api16 = require("@livechat/developer-studio-api");
|
|
13674
|
+
var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
|
|
13675
|
+
if (task2.type === import_developer_studio_api16.WorkflowDefinitionTaskType.switch) {
|
|
13676
|
+
return [
|
|
13677
|
+
task2,
|
|
13678
|
+
...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a)),
|
|
13679
|
+
...task2.defaultCase ? flattenTasks(task2.defaultCase) : []
|
|
13680
|
+
];
|
|
13681
|
+
} else if (task2.type === import_developer_studio_api16.WorkflowDefinitionTaskType.forkJoin) {
|
|
13682
|
+
return [task2, ...task2.forkTasks.flatMap((a) => flattenTasks(a))];
|
|
13683
|
+
}
|
|
13684
|
+
return [task2];
|
|
13685
|
+
});
|
|
13686
|
+
|
|
13687
|
+
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
13688
|
+
var import_react10 = require("react");
|
|
13689
|
+
|
|
13616
13690
|
// src/hooks/user.ts
|
|
13617
13691
|
var import_react_query3 = require("@tanstack/react-query");
|
|
13618
|
-
var
|
|
13692
|
+
var import_developer_studio_api17 = require("@livechat/developer-studio-api");
|
|
13619
13693
|
var userQueryKeys = {
|
|
13620
13694
|
accounts: {
|
|
13621
13695
|
account: {
|
|
@@ -13634,18 +13708,18 @@ var useFetchOrganizationProducts = () => {
|
|
|
13634
13708
|
var _b;
|
|
13635
13709
|
const _a = (0, import_react_query3.useQuery)(
|
|
13636
13710
|
userQueryKeys.accounts.products.getOrganizationProducts,
|
|
13637
|
-
() =>
|
|
13711
|
+
() => import_developer_studio_api17.api.platform.accounts.products.getOrganizationProducts()
|
|
13638
13712
|
), { data, isLoading } = _a, rest = __objRest(_a, ["data", "isLoading"]);
|
|
13639
13713
|
return __spreadValues({ data: (_b = data == null ? void 0 : data.data) != null ? _b : [], isLoading }, rest);
|
|
13640
13714
|
};
|
|
13641
13715
|
var useUpdateOrganizationProducts = () => {
|
|
13642
13716
|
const queryClient = (0, import_react_query3.useQueryClient)();
|
|
13643
13717
|
const { mutateAsync: updateOrganizationProducts, isLoading } = (0, import_react_query3.useMutation)(
|
|
13644
|
-
({ productName }) =>
|
|
13718
|
+
({ productName }) => import_developer_studio_api17.api.platform.accounts.products.updateOrganizationProducts({
|
|
13645
13719
|
product: productName
|
|
13646
13720
|
}),
|
|
13647
13721
|
{
|
|
13648
|
-
onSuccess: (
|
|
13722
|
+
onSuccess: (_2) => {
|
|
13649
13723
|
void queryClient.refetchQueries({
|
|
13650
13724
|
queryKey: userQueryKeys.accounts.products.getOrganizationProducts
|
|
13651
13725
|
});
|
|
@@ -13655,33 +13729,62 @@ var useUpdateOrganizationProducts = () => {
|
|
|
13655
13729
|
return { updateOrganizationProducts, isLoading };
|
|
13656
13730
|
};
|
|
13657
13731
|
|
|
13658
|
-
// src/views/Workflows/Creator/Provider/state/metadata/utils.ts
|
|
13659
|
-
var import_developer_studio_api17 = require("@livechat/developer-studio-api");
|
|
13660
|
-
var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
|
|
13661
|
-
if (task2.type === import_developer_studio_api17.WorkflowDefinitionTaskType.switch) {
|
|
13662
|
-
return [
|
|
13663
|
-
task2,
|
|
13664
|
-
...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a)),
|
|
13665
|
-
...task2.defaultCase ? flattenTasks(task2.defaultCase) : []
|
|
13666
|
-
];
|
|
13667
|
-
} else if (task2.type === import_developer_studio_api17.WorkflowDefinitionTaskType.forkJoin) {
|
|
13668
|
-
return [task2, ...task2.forkTasks.flatMap((a) => flattenTasks(a))];
|
|
13669
|
-
}
|
|
13670
|
-
return [task2];
|
|
13671
|
-
});
|
|
13672
|
-
|
|
13673
13732
|
// src/views/Workflows/Creator/Provider/state/metadata/validation/utils.ts
|
|
13674
13733
|
var import_ajv = __toESM(require("ajv"));
|
|
13675
13734
|
var import_ajv_errors = __toESM(require("ajv-errors"));
|
|
13676
13735
|
var import_developer_studio_api18 = require("@livechat/developer-studio-api");
|
|
13677
|
-
var
|
|
13736
|
+
var keywords = {
|
|
13737
|
+
urlWithQueryParams: {
|
|
13738
|
+
keyword: "queryParams",
|
|
13739
|
+
type: "string",
|
|
13740
|
+
schemaType: "object",
|
|
13741
|
+
metaSchema: {
|
|
13742
|
+
type: "object",
|
|
13743
|
+
properties: {
|
|
13744
|
+
queryParams: {
|
|
13745
|
+
type: "object"
|
|
13746
|
+
}
|
|
13747
|
+
}
|
|
13748
|
+
},
|
|
13749
|
+
error: {
|
|
13750
|
+
message: () => "This field cannot be empty",
|
|
13751
|
+
params: (cxt) => import_ajv._`{ param: ${cxt.params.param} }`
|
|
13752
|
+
},
|
|
13753
|
+
code(cxt) {
|
|
13754
|
+
const { data, schema } = cxt;
|
|
13755
|
+
cxt.gen.if(
|
|
13756
|
+
import_ajv._`typeof ${data} === "string" && ${data}.includes("?")`,
|
|
13757
|
+
() => {
|
|
13758
|
+
const params = import_ajv._`Object.fromEntries(new URL(${data}).searchParams.entries())`;
|
|
13759
|
+
for (const param of Object.keys(schema.properties || {})) {
|
|
13760
|
+
cxt.gen.if(
|
|
13761
|
+
import_ajv._`!(${param} in ${params}) || ${params}[${param}].length <= 0`,
|
|
13762
|
+
() => {
|
|
13763
|
+
cxt.error(
|
|
13764
|
+
true,
|
|
13765
|
+
{ param },
|
|
13766
|
+
{
|
|
13767
|
+
instancePath: param
|
|
13768
|
+
}
|
|
13769
|
+
);
|
|
13770
|
+
}
|
|
13771
|
+
);
|
|
13772
|
+
}
|
|
13773
|
+
},
|
|
13774
|
+
() => {
|
|
13775
|
+
cxt.error(true, { param: "URL" });
|
|
13776
|
+
}
|
|
13777
|
+
);
|
|
13778
|
+
}
|
|
13779
|
+
}
|
|
13780
|
+
};
|
|
13781
|
+
var getValidator = () => (0, import_ajv_errors.default)(
|
|
13678
13782
|
new import_ajv.default({
|
|
13679
13783
|
strict: false,
|
|
13680
13784
|
allErrors: true
|
|
13681
|
-
})
|
|
13682
|
-
);
|
|
13683
|
-
var validateSchema = (workflow, frames) => {
|
|
13684
|
-
const validate = ajv.compile(WORKFLOW_SCHEMA());
|
|
13785
|
+
}).addKeyword(keywords.urlWithQueryParams)
|
|
13786
|
+
).compile(WORKFLOW_SCHEMA());
|
|
13787
|
+
var validateSchema = (workflow, frames, validateFunction) => {
|
|
13685
13788
|
const resolved = __spreadProps(__spreadValues({}, workflow), {
|
|
13686
13789
|
definition: __spreadProps(__spreadValues({}, workflow.definition), {
|
|
13687
13790
|
tasks: workflow.definition.tasks.map(
|
|
@@ -13702,8 +13805,8 @@ var validateSchema = (workflow, frames) => {
|
|
|
13702
13805
|
}
|
|
13703
13806
|
)
|
|
13704
13807
|
});
|
|
13705
|
-
|
|
13706
|
-
return
|
|
13808
|
+
validateFunction(resolved);
|
|
13809
|
+
return validateFunction.errors || [];
|
|
13707
13810
|
};
|
|
13708
13811
|
var validateTasks = (workflow, frames, products) => {
|
|
13709
13812
|
function taskCompiler(task2, baseInstancePath) {
|
|
@@ -14013,11 +14116,11 @@ function flattenErrorSchema(workflow, schema) {
|
|
|
14013
14116
|
}).filter(([, value]) => Boolean(value))
|
|
14014
14117
|
);
|
|
14015
14118
|
}
|
|
14016
|
-
var getWorkflowValidation = (workflow, internal, external) => {
|
|
14119
|
+
var getWorkflowValidation = (workflow, internal, external, validator3) => {
|
|
14017
14120
|
const rawErrors = [
|
|
14018
14121
|
...validateTrigger(workflow, internal.frames, external.products),
|
|
14019
14122
|
...validateTasks(workflow, internal.frames, external.products),
|
|
14020
|
-
...validateSchema(workflow, internal.frames)
|
|
14123
|
+
...validateSchema(workflow, internal.frames, validator3)
|
|
14021
14124
|
].filter(
|
|
14022
14125
|
(rawError) => Boolean(rawError)
|
|
14023
14126
|
).map((rawError) => {
|
|
@@ -14071,11 +14174,29 @@ var getWorkflowValidation = (workflow, internal, external) => {
|
|
|
14071
14174
|
};
|
|
14072
14175
|
};
|
|
14073
14176
|
|
|
14177
|
+
// src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
|
|
14178
|
+
function useWorkflowValidator() {
|
|
14179
|
+
const organizationProducts = useFetchOrganizationProducts();
|
|
14180
|
+
const validator3 = (0, import_react10.useMemo)(getValidator, []);
|
|
14181
|
+
const validate = (0, import_react10.useCallback)(
|
|
14182
|
+
(workflow, internal) => getWorkflowValidation(
|
|
14183
|
+
workflow,
|
|
14184
|
+
internal,
|
|
14185
|
+
{
|
|
14186
|
+
products: organizationProducts.data
|
|
14187
|
+
},
|
|
14188
|
+
validator3
|
|
14189
|
+
),
|
|
14190
|
+
[validator3, organizationProducts.data]
|
|
14191
|
+
);
|
|
14192
|
+
return validate;
|
|
14193
|
+
}
|
|
14194
|
+
|
|
14074
14195
|
// src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
|
|
14075
14196
|
function useWorkflowMetadata(workflow) {
|
|
14076
14197
|
const credentialsQuery = (0, import_platform_integrations2.useFetchIntegrationCredentialsQuery)();
|
|
14077
|
-
const
|
|
14078
|
-
const metadata = (0,
|
|
14198
|
+
const validator3 = useWorkflowValidator();
|
|
14199
|
+
const metadata = (0, import_react11.useMemo)(() => {
|
|
14079
14200
|
var _a;
|
|
14080
14201
|
const elements = {
|
|
14081
14202
|
trigger: workflow.trigger,
|
|
@@ -14089,19 +14210,13 @@ function useWorkflowMetadata(workflow) {
|
|
|
14089
14210
|
const frames = getWorkflowContexts(workflow, {
|
|
14090
14211
|
credentials: (_a = credentialsQuery.data) != null ? _a : []
|
|
14091
14212
|
});
|
|
14092
|
-
const validation =
|
|
14093
|
-
workflow,
|
|
14094
|
-
{ frames },
|
|
14095
|
-
{
|
|
14096
|
-
products: organizationProducts.data
|
|
14097
|
-
}
|
|
14098
|
-
);
|
|
14213
|
+
const validation = validator3(workflow, { frames });
|
|
14099
14214
|
return {
|
|
14100
14215
|
elements,
|
|
14101
14216
|
frames,
|
|
14102
14217
|
validation
|
|
14103
14218
|
};
|
|
14104
|
-
}, [workflow, credentialsQuery.data
|
|
14219
|
+
}, [validator3, workflow, credentialsQuery.data]);
|
|
14105
14220
|
return {
|
|
14106
14221
|
metadata
|
|
14107
14222
|
};
|
|
@@ -14198,8 +14313,9 @@ function WorkflowCreatorProviderBase({
|
|
|
14198
14313
|
}) {
|
|
14199
14314
|
var _a, _b;
|
|
14200
14315
|
const { fitView } = (0, import_reactflow.useReactFlow)();
|
|
14201
|
-
const navigate = (0,
|
|
14316
|
+
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
14202
14317
|
const notifications = (0, import_developer_studio_ui_react5.useNotificationContext)();
|
|
14318
|
+
const replaceWorkflowId = useReplaceWorkflowIdInUrl();
|
|
14203
14319
|
const createWorkflowAction = useCreateWorkflow();
|
|
14204
14320
|
const createWorkflowDraftAction = useCreateWorkflowDraft();
|
|
14205
14321
|
const updateWorkflowAction = useUpdateWorkflow();
|
|
@@ -14210,22 +14326,22 @@ function WorkflowCreatorProviderBase({
|
|
|
14210
14326
|
state,
|
|
14211
14327
|
updaters: { setWorkflow, setAction, setSelection }
|
|
14212
14328
|
} = useWorkflowState(workflow, options);
|
|
14213
|
-
const autosaveStateRef = (0,
|
|
14214
|
-
const autosaveWorkflowRef = (0,
|
|
14329
|
+
const autosaveStateRef = (0, import_react12.useRef)(state);
|
|
14330
|
+
const autosaveWorkflowRef = (0, import_react12.useRef)(
|
|
14215
14331
|
(0, import_lodash.default)(() => __async(this, null, function* () {
|
|
14216
14332
|
yield save(true);
|
|
14217
14333
|
}), 500)
|
|
14218
14334
|
);
|
|
14219
14335
|
const autosaveWorkflow = autosaveWorkflowRef.current;
|
|
14220
|
-
(0,
|
|
14336
|
+
(0, import_react12.useEffect)(() => {
|
|
14221
14337
|
return () => {
|
|
14222
14338
|
autosaveWorkflow.cancel();
|
|
14223
14339
|
};
|
|
14224
14340
|
}, [autosaveWorkflow]);
|
|
14225
|
-
(0,
|
|
14341
|
+
(0, import_react12.useEffect)(() => {
|
|
14226
14342
|
autosaveStateRef.current = state;
|
|
14227
14343
|
}, [state]);
|
|
14228
|
-
const focus = (0,
|
|
14344
|
+
const focus = (0, import_react12.useCallback)(
|
|
14229
14345
|
(identifier2) => {
|
|
14230
14346
|
setTimeout(
|
|
14231
14347
|
() => fitView(
|
|
@@ -14246,7 +14362,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14246
14362
|
},
|
|
14247
14363
|
[fitView]
|
|
14248
14364
|
);
|
|
14249
|
-
const toggle = (0,
|
|
14365
|
+
const toggle = (0, import_react12.useCallback)(
|
|
14250
14366
|
(params) => {
|
|
14251
14367
|
setTimeout(() => {
|
|
14252
14368
|
setSelection(() => {
|
|
@@ -14270,7 +14386,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14270
14386
|
},
|
|
14271
14387
|
[focus, setSelection]
|
|
14272
14388
|
);
|
|
14273
|
-
const validate = (0,
|
|
14389
|
+
const validate = (0, import_react12.useCallback)(() => {
|
|
14274
14390
|
var _a2;
|
|
14275
14391
|
const state2 = autosaveStateRef.current;
|
|
14276
14392
|
if (((_a2 = options == null ? void 0 : options.validation) == null ? void 0 : _a2.strategy) !== "non-blocking" && !state2.metadata.validation.isValid) {
|
|
@@ -14301,21 +14417,21 @@ function WorkflowCreatorProviderBase({
|
|
|
14301
14417
|
}
|
|
14302
14418
|
return true;
|
|
14303
14419
|
}, [(_a = options == null ? void 0 : options.validation) == null ? void 0 : _a.strategy, toggle]);
|
|
14304
|
-
const replaceWorkflow = (0,
|
|
14420
|
+
const replaceWorkflow = (0, import_react12.useCallback)(
|
|
14305
14421
|
(workflow2) => {
|
|
14306
14422
|
setWorkflow(workflow2);
|
|
14307
14423
|
void autosaveWorkflowRef.current();
|
|
14308
14424
|
},
|
|
14309
14425
|
[autosaveWorkflowRef, setWorkflow]
|
|
14310
14426
|
);
|
|
14311
|
-
const changeWorkflow = (0,
|
|
14427
|
+
const changeWorkflow = (0, import_react12.useCallback)(
|
|
14312
14428
|
(change) => {
|
|
14313
14429
|
setWorkflow((prevState) => applyChange(prevState, change(prevState)));
|
|
14314
14430
|
void autosaveWorkflowRef.current();
|
|
14315
14431
|
},
|
|
14316
14432
|
[autosaveWorkflowRef, setWorkflow]
|
|
14317
14433
|
);
|
|
14318
|
-
const goToAddTrigger = (0,
|
|
14434
|
+
const goToAddTrigger = (0, import_react12.useCallback)(() => {
|
|
14319
14435
|
navigate(
|
|
14320
14436
|
`${basePath}/trigger/${OTHER_TYPES.SYSTEM}/${"manual" /* Manual */}`,
|
|
14321
14437
|
{
|
|
@@ -14325,7 +14441,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14325
14441
|
}
|
|
14326
14442
|
);
|
|
14327
14443
|
}, [basePath, navigate]);
|
|
14328
|
-
const addTrigger = (0,
|
|
14444
|
+
const addTrigger = (0, import_react12.useCallback)(
|
|
14329
14445
|
(trigger) => {
|
|
14330
14446
|
changeWorkflow(() => ({
|
|
14331
14447
|
trigger
|
|
@@ -14339,7 +14455,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14339
14455
|
},
|
|
14340
14456
|
[changeWorkflow, toggle]
|
|
14341
14457
|
);
|
|
14342
|
-
const updateTrigger = (0,
|
|
14458
|
+
const updateTrigger = (0, import_react12.useCallback)(
|
|
14343
14459
|
(trigger) => {
|
|
14344
14460
|
changeWorkflow(() => ({
|
|
14345
14461
|
trigger
|
|
@@ -14347,7 +14463,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14347
14463
|
},
|
|
14348
14464
|
[changeWorkflow]
|
|
14349
14465
|
);
|
|
14350
|
-
const removeTrigger = (0,
|
|
14466
|
+
const removeTrigger = (0, import_react12.useCallback)(() => {
|
|
14351
14467
|
var _a2;
|
|
14352
14468
|
const state2 = autosaveStateRef.current;
|
|
14353
14469
|
replaceWorkflow(__spreadProps(__spreadValues({}, state2.workflow), {
|
|
@@ -14357,7 +14473,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14357
14473
|
toggle();
|
|
14358
14474
|
}
|
|
14359
14475
|
}, [replaceWorkflow, toggle]);
|
|
14360
|
-
const goToAddTask = (0,
|
|
14476
|
+
const goToAddTask = (0, import_react12.useCallback)(
|
|
14361
14477
|
(taskReference, parentTaskReference) => {
|
|
14362
14478
|
navigate(`${basePath}/add`, {
|
|
14363
14479
|
state: {
|
|
@@ -14369,7 +14485,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14369
14485
|
},
|
|
14370
14486
|
[state.metadata.frames, navigate, basePath]
|
|
14371
14487
|
);
|
|
14372
|
-
const addTask = (0,
|
|
14488
|
+
const addTask = (0, import_react12.useCallback)(
|
|
14373
14489
|
(task2, targetTaskReference, parentTaskReference) => {
|
|
14374
14490
|
var _a2;
|
|
14375
14491
|
const existingTasks = Object.values(state.metadata.elements.tasks).filter((x) => x.taskReferenceName.includes(task2.taskReferenceName)).sort((a, b) => {
|
|
@@ -14478,7 +14594,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14478
14594
|
},
|
|
14479
14595
|
[state.workflow.definition.tasks, changeWorkflow, toggle]
|
|
14480
14596
|
);
|
|
14481
|
-
const updateTask = (0,
|
|
14597
|
+
const updateTask = (0, import_react12.useCallback)(
|
|
14482
14598
|
(targetTaskReferenceName, targetTask) => {
|
|
14483
14599
|
changeWorkflow((workflow2) => ({
|
|
14484
14600
|
definition: {
|
|
@@ -14495,7 +14611,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14495
14611
|
},
|
|
14496
14612
|
[changeWorkflow]
|
|
14497
14613
|
);
|
|
14498
|
-
const removeTask = (0,
|
|
14614
|
+
const removeTask = (0, import_react12.useCallback)(
|
|
14499
14615
|
(targetTaskReferenceName) => {
|
|
14500
14616
|
var _a2;
|
|
14501
14617
|
changeWorkflow((workflow2) => ({
|
|
@@ -14516,7 +14632,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14516
14632
|
},
|
|
14517
14633
|
[(_b = state.selection) == null ? void 0 : _b.id, changeWorkflow, toggle]
|
|
14518
14634
|
);
|
|
14519
|
-
const save = (0,
|
|
14635
|
+
const save = (0, import_react12.useCallback)(
|
|
14520
14636
|
(silent) => __async(this, null, function* () {
|
|
14521
14637
|
const state2 = autosaveStateRef.current;
|
|
14522
14638
|
if (!state2.workflow.draft && !validate()) {
|
|
@@ -14545,7 +14661,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14545
14661
|
"Workflow has been created successfully"
|
|
14546
14662
|
);
|
|
14547
14663
|
}
|
|
14548
|
-
|
|
14664
|
+
replaceWorkflowId(workflowId);
|
|
14549
14665
|
}
|
|
14550
14666
|
} finally {
|
|
14551
14667
|
setAction("isSaving", false);
|
|
@@ -14555,13 +14671,13 @@ function WorkflowCreatorProviderBase({
|
|
|
14555
14671
|
createWorkflowAction,
|
|
14556
14672
|
updateWorkflowAction,
|
|
14557
14673
|
notifications,
|
|
14674
|
+
replaceWorkflowId,
|
|
14558
14675
|
validate,
|
|
14559
|
-
navigate,
|
|
14560
14676
|
setWorkflow,
|
|
14561
14677
|
setAction
|
|
14562
14678
|
]
|
|
14563
14679
|
);
|
|
14564
|
-
const activate = (0,
|
|
14680
|
+
const activate = (0, import_react12.useCallback)(() => __async(this, null, function* () {
|
|
14565
14681
|
const state2 = autosaveStateRef.current;
|
|
14566
14682
|
if (state2.workflow.draft) {
|
|
14567
14683
|
return;
|
|
@@ -14585,7 +14701,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14585
14701
|
setAction("isActivating", false);
|
|
14586
14702
|
}
|
|
14587
14703
|
}), [activateWorkflowAction, notifications, validate, setWorkflow, setAction]);
|
|
14588
|
-
const remove = (0,
|
|
14704
|
+
const remove = (0, import_react12.useCallback)(() => __async(this, null, function* () {
|
|
14589
14705
|
const state2 = autosaveStateRef.current;
|
|
14590
14706
|
setAction("isRemoving", true);
|
|
14591
14707
|
try {
|
|
@@ -14604,7 +14720,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14604
14720
|
setAction("isRemoving", false);
|
|
14605
14721
|
}
|
|
14606
14722
|
}), [setAction, navigate, notifications, deleteWorkflowAction]);
|
|
14607
|
-
const createDraft = (0,
|
|
14723
|
+
const createDraft = (0, import_react12.useCallback)(
|
|
14608
14724
|
(options2) => __async(this, null, function* () {
|
|
14609
14725
|
const state2 = autosaveStateRef.current;
|
|
14610
14726
|
if (state2.workflow.draft) {
|
|
@@ -14642,7 +14758,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14642
14758
|
setAction
|
|
14643
14759
|
]
|
|
14644
14760
|
);
|
|
14645
|
-
const publishDraft = (0,
|
|
14761
|
+
const publishDraft = (0, import_react12.useCallback)(
|
|
14646
14762
|
(options2) => __async(this, null, function* () {
|
|
14647
14763
|
var _a2;
|
|
14648
14764
|
const state2 = autosaveStateRef.current;
|
|
@@ -14687,7 +14803,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14687
14803
|
createWorkflowAction
|
|
14688
14804
|
]
|
|
14689
14805
|
);
|
|
14690
|
-
const discardDraft = (0,
|
|
14806
|
+
const discardDraft = (0, import_react12.useCallback)(() => __async(this, null, function* () {
|
|
14691
14807
|
const state2 = autosaveStateRef.current;
|
|
14692
14808
|
setAction("isDiscarding", true);
|
|
14693
14809
|
try {
|
|
@@ -14714,7 +14830,7 @@ function WorkflowCreatorProviderBase({
|
|
|
14714
14830
|
setAction("isDiscarding", false);
|
|
14715
14831
|
}
|
|
14716
14832
|
}), [deleteWorkflowAction, notifications, navigate, setAction]);
|
|
14717
|
-
const [previewModalVisible, setPreviewModalVisible] = (0,
|
|
14833
|
+
const [previewModalVisible, setPreviewModalVisible] = (0, import_react12.useState)({ isVisible: false });
|
|
14718
14834
|
return /* @__PURE__ */ jsx4(
|
|
14719
14835
|
WorkflowCreatorContext.Provider,
|
|
14720
14836
|
{
|
|
@@ -14750,14 +14866,14 @@ function WorkflowCreatorProviderBase({
|
|
|
14750
14866
|
}
|
|
14751
14867
|
);
|
|
14752
14868
|
}
|
|
14753
|
-
var WorkflowCreatorContext = (0,
|
|
14869
|
+
var WorkflowCreatorContext = (0, import_react12.createContext)(
|
|
14754
14870
|
null
|
|
14755
14871
|
);
|
|
14756
14872
|
function WorkflowCreatorProvider(props) {
|
|
14757
14873
|
return /* @__PURE__ */ jsx4(OneWidgetProvider, { children: /* @__PURE__ */ jsx4(OneMessagesProvider, { children: /* @__PURE__ */ jsx4(import_reactflow.ReactFlowProvider, { children: /* @__PURE__ */ jsx4(WorkflowCreatorProviderBase, __spreadValues({}, props)) }) }) });
|
|
14758
14874
|
}
|
|
14759
14875
|
function useWorkflowCreator() {
|
|
14760
|
-
const context = (0,
|
|
14876
|
+
const context = (0, import_react12.useContext)(WorkflowCreatorContext);
|
|
14761
14877
|
if (context === void 0) {
|
|
14762
14878
|
throw new Error("useWorkflowContext must be used within a WorkflowContext");
|
|
14763
14879
|
}
|
|
@@ -14788,7 +14904,16 @@ var itemOptionCss = (active) => css`
|
|
|
14788
14904
|
`;
|
|
14789
14905
|
function ItemOption({ option, onClick, active }) {
|
|
14790
14906
|
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(
|
|
14907
|
+
/* @__PURE__ */ jsx4(
|
|
14908
|
+
import_design_system_react_components3.Text,
|
|
14909
|
+
{
|
|
14910
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCard(
|
|
14911
|
+
option.key
|
|
14912
|
+
),
|
|
14913
|
+
noMargin: true,
|
|
14914
|
+
children: option.name
|
|
14915
|
+
}
|
|
14916
|
+
),
|
|
14792
14917
|
/* @__PURE__ */ jsx4(
|
|
14793
14918
|
import_design_system_react_components3.Text,
|
|
14794
14919
|
{
|
|
@@ -14850,12 +14975,12 @@ var Options_default = AddWorkflowTaskOptions;
|
|
|
14850
14975
|
// src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
|
|
14851
14976
|
function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
14852
14977
|
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,
|
|
14978
|
+
const [search, setSearch] = (0, import_react14.useState)("");
|
|
14979
|
+
const location = (0, import_react_router_dom4.useLocation)();
|
|
14980
|
+
const navigate = (0, import_react_router_dom4.useNavigate)();
|
|
14981
|
+
const params = (0, import_react_router_dom4.useParams)();
|
|
14982
|
+
const [state, setState] = (0, import_react14.useState)();
|
|
14983
|
+
const config2 = (0, import_react14.useMemo)(
|
|
14859
14984
|
() => [
|
|
14860
14985
|
// {
|
|
14861
14986
|
// name: "system",
|
|
@@ -15015,7 +15140,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15015
15140
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15016
15141
|
user == null ? void 0 : user.meta.email
|
|
15017
15142
|
);
|
|
15018
|
-
(0,
|
|
15143
|
+
(0, import_react14.useEffect)(() => {
|
|
15019
15144
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
15020
15145
|
if (!params.task) {
|
|
15021
15146
|
const service = (_a2 = params.service) != null ? _a2 : "livechat";
|
|
@@ -15084,11 +15209,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15084
15209
|
height: 500px;
|
|
15085
15210
|
width: 650px;
|
|
15086
15211
|
`,
|
|
15212
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.wrapper,
|
|
15087
15213
|
footer: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react7.Row, { flexEnd: true, gap: `var(${import_design_system_react_components4.SpacingToken.Spacing2})`, notPadded: true, children: [
|
|
15088
15214
|
/* @__PURE__ */ jsx4(import_design_system_react_components4.Button, { kind: "secondary", onClick: onClose, size: "medium", children: "Cancel" }),
|
|
15089
15215
|
/* @__PURE__ */ jsx4(
|
|
15090
15216
|
import_design_system_react_components4.Button,
|
|
15091
15217
|
{
|
|
15218
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.saveButton,
|
|
15092
15219
|
disabled: !(state == null ? void 0 : state.task),
|
|
15093
15220
|
kind: "primary",
|
|
15094
15221
|
onClick: () => {
|
|
@@ -15180,7 +15307,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15180
15307
|
children: [
|
|
15181
15308
|
icon2,
|
|
15182
15309
|
/* @__PURE__ */ jsx4(
|
|
15183
|
-
|
|
15310
|
+
import_react_router_dom4.NavLink,
|
|
15184
15311
|
{
|
|
15185
15312
|
className: ({ isActive }) => isActive ? "active" : "",
|
|
15186
15313
|
css: css`
|
|
@@ -15189,7 +15316,16 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15189
15316
|
end: false,
|
|
15190
15317
|
state: location.state,
|
|
15191
15318
|
to: `${basePath}/${name}`,
|
|
15192
|
-
children: /* @__PURE__ */ jsx4(
|
|
15319
|
+
children: /* @__PURE__ */ jsx4(
|
|
15320
|
+
import_developer_studio_ui_react7.Text,
|
|
15321
|
+
{
|
|
15322
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCategoryButton(
|
|
15323
|
+
name
|
|
15324
|
+
),
|
|
15325
|
+
size: "md",
|
|
15326
|
+
children: displayName
|
|
15327
|
+
}
|
|
15328
|
+
)
|
|
15193
15329
|
}
|
|
15194
15330
|
)
|
|
15195
15331
|
]
|
|
@@ -15242,8 +15378,8 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
|
|
|
15242
15378
|
var Modal_default = AddWorkflowTaskModal;
|
|
15243
15379
|
|
|
15244
15380
|
// src/views/Workflows/Creator/Modals/AddTrigger/Modal.tsx
|
|
15245
|
-
var
|
|
15246
|
-
var
|
|
15381
|
+
var import_react17 = require("react");
|
|
15382
|
+
var import_react_router_dom5 = require("react-router-dom");
|
|
15247
15383
|
var import_design_system_react_components6 = require("@livechat/design-system-react-components");
|
|
15248
15384
|
var import_developer_studio_api22 = require("@livechat/developer-studio-api");
|
|
15249
15385
|
var import_developer_studio_ui_react9 = require("@livechat/developer-studio-ui-react");
|
|
@@ -15272,7 +15408,17 @@ var itemOptionCss2 = (active) => css`
|
|
|
15272
15408
|
`;
|
|
15273
15409
|
function ItemOption2({ option, onClick, active }) {
|
|
15274
15410
|
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(
|
|
15411
|
+
/* @__PURE__ */ jsx4(
|
|
15412
|
+
import_design_system_react_components5.Text,
|
|
15413
|
+
{
|
|
15414
|
+
bold: true,
|
|
15415
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCard(
|
|
15416
|
+
option.key
|
|
15417
|
+
),
|
|
15418
|
+
noMargin: true,
|
|
15419
|
+
children: option.name
|
|
15420
|
+
}
|
|
15421
|
+
),
|
|
15276
15422
|
/* @__PURE__ */ jsx4(
|
|
15277
15423
|
import_design_system_react_components5.Text,
|
|
15278
15424
|
{
|
|
@@ -15336,8 +15482,8 @@ function AddWorkflowTriggerModal({
|
|
|
15336
15482
|
basePath,
|
|
15337
15483
|
onClose
|
|
15338
15484
|
}) {
|
|
15339
|
-
const [search, setSearch] = (0,
|
|
15340
|
-
const config2 = (0,
|
|
15485
|
+
const [search, setSearch] = (0, import_react17.useState)("");
|
|
15486
|
+
const config2 = (0, import_react17.useMemo)(
|
|
15341
15487
|
() => [
|
|
15342
15488
|
{
|
|
15343
15489
|
name: OTHER_TYPES.SYSTEM,
|
|
@@ -15463,16 +15609,16 @@ function AddWorkflowTriggerModal({
|
|
|
15463
15609
|
],
|
|
15464
15610
|
[]
|
|
15465
15611
|
);
|
|
15466
|
-
const location = (0,
|
|
15467
|
-
const navigate = (0,
|
|
15468
|
-
const params = (0,
|
|
15469
|
-
const [state, setState] = (0,
|
|
15612
|
+
const location = (0, import_react_router_dom5.useLocation)();
|
|
15613
|
+
const navigate = (0, import_react_router_dom5.useNavigate)();
|
|
15614
|
+
const params = (0, import_react_router_dom5.useParams)();
|
|
15615
|
+
const [state, setState] = (0, import_react17.useState)();
|
|
15470
15616
|
const { addTrigger } = useWorkflowCreator();
|
|
15471
15617
|
const { user } = (0, import_developer_studio_ui_react9.useUserContext)();
|
|
15472
15618
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
15473
15619
|
user == null ? void 0 : user.meta.email
|
|
15474
15620
|
);
|
|
15475
|
-
(0,
|
|
15621
|
+
(0, import_react17.useEffect)(() => {
|
|
15476
15622
|
var _a, _b;
|
|
15477
15623
|
if (!params.trigger) {
|
|
15478
15624
|
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;
|
|
@@ -15500,11 +15646,13 @@ function AddWorkflowTriggerModal({
|
|
|
15500
15646
|
height: 500px;
|
|
15501
15647
|
width: 650px;
|
|
15502
15648
|
`,
|
|
15649
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.wrapper,
|
|
15503
15650
|
footer: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react9.Row, { flexEnd: true, gap: `var(${import_design_system_react_components6.SpacingToken.Spacing2})`, notPadded: true, children: [
|
|
15504
15651
|
/* @__PURE__ */ jsx4(import_design_system_react_components6.Button, { kind: "secondary", onClick: onClose, size: "medium", children: "Cancel" }),
|
|
15505
15652
|
/* @__PURE__ */ jsx4(
|
|
15506
15653
|
import_design_system_react_components6.Button,
|
|
15507
15654
|
{
|
|
15655
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.saveButton,
|
|
15508
15656
|
disabled: !(state == null ? void 0 : state.trigger),
|
|
15509
15657
|
kind: "primary",
|
|
15510
15658
|
onClick: () => {
|
|
@@ -15596,7 +15744,7 @@ function AddWorkflowTriggerModal({
|
|
|
15596
15744
|
children: [
|
|
15597
15745
|
icon2,
|
|
15598
15746
|
/* @__PURE__ */ jsx4(
|
|
15599
|
-
|
|
15747
|
+
import_react_router_dom5.NavLink,
|
|
15600
15748
|
{
|
|
15601
15749
|
className: ({ isActive }) => isActive ? "active" : "",
|
|
15602
15750
|
css: css`
|
|
@@ -15605,7 +15753,16 @@ function AddWorkflowTriggerModal({
|
|
|
15605
15753
|
end: false,
|
|
15606
15754
|
state: location.state,
|
|
15607
15755
|
to: `${basePath}/${name}`,
|
|
15608
|
-
children: /* @__PURE__ */ jsx4(
|
|
15756
|
+
children: /* @__PURE__ */ jsx4(
|
|
15757
|
+
import_developer_studio_ui_react9.Text,
|
|
15758
|
+
{
|
|
15759
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCategoryButton(
|
|
15760
|
+
name
|
|
15761
|
+
),
|
|
15762
|
+
size: "md",
|
|
15763
|
+
children: displayName
|
|
15764
|
+
}
|
|
15765
|
+
)
|
|
15609
15766
|
}
|
|
15610
15767
|
)
|
|
15611
15768
|
]
|
|
@@ -15724,13 +15881,13 @@ function DeleteWorkflowModal({
|
|
|
15724
15881
|
}
|
|
15725
15882
|
|
|
15726
15883
|
// src/views/Workflows/Creator/Modals/Edit/Modal.tsx
|
|
15727
|
-
var
|
|
15884
|
+
var import_react_router_dom6 = require("react-router-dom");
|
|
15728
15885
|
var import_design_system_icons4 = require("@livechat/design-system-icons");
|
|
15729
15886
|
var import_design_system_react_components8 = require("@livechat/design-system-react-components");
|
|
15730
15887
|
var import_developer_studio_ui_react11 = require("@livechat/developer-studio-ui-react");
|
|
15731
15888
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
15732
15889
|
function EditWorkflowModal({ onClose }) {
|
|
15733
|
-
const navigate = (0,
|
|
15890
|
+
const navigate = (0, import_react_router_dom6.useNavigate)();
|
|
15734
15891
|
const {
|
|
15735
15892
|
state: {
|
|
15736
15893
|
workflow,
|
|
@@ -15787,7 +15944,7 @@ function EditWorkflowModal({ onClose }) {
|
|
|
15787
15944
|
}
|
|
15788
15945
|
|
|
15789
15946
|
// src/views/Workflows/Creator/Modals/Execute/Modal.tsx
|
|
15790
|
-
var
|
|
15947
|
+
var import_react19 = require("react");
|
|
15791
15948
|
var import_react_final_form = require("react-final-form");
|
|
15792
15949
|
var import_validator = __toESM(require("validator"));
|
|
15793
15950
|
var import_design_system_react_components9 = require("@livechat/design-system-react-components");
|
|
@@ -15796,7 +15953,7 @@ function ExecuteWorkflowModal({
|
|
|
15796
15953
|
onClose
|
|
15797
15954
|
}) {
|
|
15798
15955
|
const executeMutation = useExecuteWorkflow();
|
|
15799
|
-
const onSubmit = (0,
|
|
15956
|
+
const onSubmit = (0, import_react19.useCallback)(
|
|
15800
15957
|
(data) => __async(this, null, function* () {
|
|
15801
15958
|
yield executeMutation.mutateAsync({
|
|
15802
15959
|
workflow,
|
|
@@ -15878,10 +16035,10 @@ function ExecuteWorkflowModal({
|
|
|
15878
16035
|
var Modal_default3 = ExecuteWorkflowModal;
|
|
15879
16036
|
|
|
15880
16037
|
// src/views/Workflows/Creator/Modals/Preview/Modal.tsx
|
|
15881
|
-
var
|
|
15882
|
-
var
|
|
16038
|
+
var import_react87 = require("react");
|
|
16039
|
+
var import_react_router_dom12 = require("react-router-dom");
|
|
15883
16040
|
|
|
15884
|
-
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.
|
|
16041
|
+
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
|
|
15885
16042
|
var React4 = __toESM(require("react"));
|
|
15886
16043
|
|
|
15887
16044
|
// ../../../node_modules/.pnpm/@emotion+is-prop-valid@1.3.1/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
@@ -15893,7 +16050,7 @@ var isPropValid = /* @__PURE__ */ memoize(
|
|
|
15893
16050
|
/* Z+1 */
|
|
15894
16051
|
);
|
|
15895
16052
|
|
|
15896
|
-
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.
|
|
16053
|
+
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
|
|
15897
16054
|
var isBrowser5 = typeof document !== "undefined";
|
|
15898
16055
|
var isDevelopment4 = false;
|
|
15899
16056
|
var testOmitPropsOnStringTag = isPropValid;
|
|
@@ -16032,9 +16189,9 @@ var createStyled = function createStyled2(tag, options) {
|
|
|
16032
16189
|
};
|
|
16033
16190
|
};
|
|
16034
16191
|
|
|
16035
|
-
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.
|
|
16192
|
+
// ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/dist/emotion-styled.esm.js
|
|
16036
16193
|
var import_extends5 = __toESM(require_extends());
|
|
16037
|
-
var
|
|
16194
|
+
var import_react22 = require("react");
|
|
16038
16195
|
var tags = [
|
|
16039
16196
|
"a",
|
|
16040
16197
|
"abbr",
|
|
@@ -16182,12 +16339,12 @@ var import_design_system_react_components63 = require("@livechat/design-system-r
|
|
|
16182
16339
|
var import_developer_studio_ui_react27 = require("@livechat/developer-studio-ui-react");
|
|
16183
16340
|
|
|
16184
16341
|
// src/views/Workflows/Creator/Builder/Diagram.tsx
|
|
16185
|
-
var
|
|
16342
|
+
var import_react86 = require("react");
|
|
16186
16343
|
var import_reactflow16 = __toESM(require("reactflow"));
|
|
16187
16344
|
var import_design_system_react_components62 = require("@livechat/design-system-react-components");
|
|
16188
16345
|
|
|
16189
16346
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/Add/Task/Task.tsx
|
|
16190
|
-
var
|
|
16347
|
+
var import_react23 = require("react");
|
|
16191
16348
|
var import_reactflow2 = require("reactflow");
|
|
16192
16349
|
var import_design_system_icons5 = require("@livechat/design-system-icons");
|
|
16193
16350
|
var import_design_system_react_components10 = require("@livechat/design-system-react-components");
|
|
@@ -16204,6 +16361,7 @@ function AddTaskNode(node2) {
|
|
|
16204
16361
|
/* @__PURE__ */ jsx4(
|
|
16205
16362
|
import_design_system_react_components10.Button,
|
|
16206
16363
|
{
|
|
16364
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.task.button,
|
|
16207
16365
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components10.Icon, { size: "large", source: import_design_system_icons5.Add }),
|
|
16208
16366
|
id: node2.id,
|
|
16209
16367
|
kind: "secondary",
|
|
@@ -16222,10 +16380,10 @@ function AddTaskNode(node2) {
|
|
|
16222
16380
|
/* @__PURE__ */ jsx4(import_reactflow2.Handle, { isConnectable: false, position: import_reactflow2.Position.Bottom, type: "source" })
|
|
16223
16381
|
] });
|
|
16224
16382
|
}
|
|
16225
|
-
var Task_default = (0,
|
|
16383
|
+
var Task_default = (0, import_react23.memo)(AddTaskNode);
|
|
16226
16384
|
|
|
16227
16385
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/Add/Trigger/Trigger.tsx
|
|
16228
|
-
var
|
|
16386
|
+
var import_react24 = require("react");
|
|
16229
16387
|
var import_reactflow3 = require("reactflow");
|
|
16230
16388
|
var import_design_system_icons6 = require("@livechat/design-system-icons");
|
|
16231
16389
|
var import_design_system_react_components11 = require("@livechat/design-system-react-components");
|
|
@@ -16236,6 +16394,7 @@ function AddTriggerNode(node2) {
|
|
|
16236
16394
|
/* @__PURE__ */ jsx4(
|
|
16237
16395
|
import_design_system_react_components11.Button,
|
|
16238
16396
|
{
|
|
16397
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.trigger.button,
|
|
16239
16398
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components11.Icon, { size: "large", source: import_design_system_icons6.Add }),
|
|
16240
16399
|
id: node2.id,
|
|
16241
16400
|
kind: "primary",
|
|
@@ -16248,7 +16407,7 @@ function AddTriggerNode(node2) {
|
|
|
16248
16407
|
/* @__PURE__ */ jsx4(import_reactflow3.Handle, { isConnectable: false, position: import_reactflow3.Position.Bottom, type: "source" })
|
|
16249
16408
|
] });
|
|
16250
16409
|
}
|
|
16251
|
-
var Trigger_default = (0,
|
|
16410
|
+
var Trigger_default = (0, import_react24.memo)(AddTriggerNode);
|
|
16252
16411
|
|
|
16253
16412
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Base.tsx
|
|
16254
16413
|
var import_design_system_icons7 = require("@livechat/design-system-icons");
|
|
@@ -16343,7 +16502,7 @@ var import_core2 = __toESM(require("@rjsf/core"));
|
|
|
16343
16502
|
var import_validator_ajv8 = __toESM(require("@rjsf/validator-ajv8"));
|
|
16344
16503
|
|
|
16345
16504
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Field.tsx
|
|
16346
|
-
var
|
|
16505
|
+
var import_react39 = require("react");
|
|
16347
16506
|
var import_core = require("@rjsf/core");
|
|
16348
16507
|
var import_design_system_icons10 = require("@livechat/design-system-icons");
|
|
16349
16508
|
var import_design_system_react_components20 = require("@livechat/design-system-react-components");
|
|
@@ -16351,15 +16510,15 @@ var import_developer_studio_ui_react16 = require("@livechat/developer-studio-ui-
|
|
|
16351
16510
|
var import_platform_integrations3 = require("@livechat/platform-integrations");
|
|
16352
16511
|
|
|
16353
16512
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/Field.tsx
|
|
16354
|
-
var
|
|
16513
|
+
var import_react35 = require("react");
|
|
16355
16514
|
var import_developer_studio_ui_react15 = require("@livechat/developer-studio-ui-react");
|
|
16356
16515
|
|
|
16357
16516
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Picker.tsx
|
|
16358
|
-
var
|
|
16517
|
+
var import_react28 = require("react");
|
|
16359
16518
|
var import_design_system_react_components15 = require("@livechat/design-system-react-components");
|
|
16360
16519
|
|
|
16361
16520
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Tree/Node.tsx
|
|
16362
|
-
var
|
|
16521
|
+
var import_react26 = require("react");
|
|
16363
16522
|
var import_design_system_icons8 = require("@livechat/design-system-icons");
|
|
16364
16523
|
var import_design_system_react_components14 = require("@livechat/design-system-react-components");
|
|
16365
16524
|
var import_developer_studio_ui_react12 = require("@livechat/developer-studio-ui-react");
|
|
@@ -16382,8 +16541,8 @@ function CustomTagsPickerTreeNode({
|
|
|
16382
16541
|
onClick
|
|
16383
16542
|
}) {
|
|
16384
16543
|
var _a;
|
|
16385
|
-
const [collapsed, setCollapsed] = (0,
|
|
16386
|
-
const [newPropertyName, setNewPropertyName] = (0,
|
|
16544
|
+
const [collapsed, setCollapsed] = (0, import_react26.useState)(false);
|
|
16545
|
+
const [newPropertyName, setNewPropertyName] = (0, import_react26.useState)(targetName);
|
|
16387
16546
|
if (!data) {
|
|
16388
16547
|
return null;
|
|
16389
16548
|
}
|
|
@@ -16759,8 +16918,8 @@ function CustomTagsPicker({
|
|
|
16759
16918
|
context,
|
|
16760
16919
|
onClick
|
|
16761
16920
|
}) {
|
|
16762
|
-
const [search, setSearch] = (0,
|
|
16763
|
-
const [advanced] = (0,
|
|
16921
|
+
const [search, setSearch] = (0, import_react28.useState)();
|
|
16922
|
+
const [advanced] = (0, import_react28.useState)();
|
|
16764
16923
|
return /* @__PURE__ */ jsxs2(Wrapper, { children: [
|
|
16765
16924
|
/* @__PURE__ */ jsx4(
|
|
16766
16925
|
import_design_system_react_components15.SearchInput,
|
|
@@ -16786,7 +16945,7 @@ function CustomTagsPicker({
|
|
|
16786
16945
|
}
|
|
16787
16946
|
|
|
16788
16947
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Input.tsx
|
|
16789
|
-
var
|
|
16948
|
+
var import_react33 = require("react");
|
|
16790
16949
|
var import_lodash3 = __toESM(require("lodash.debounce"));
|
|
16791
16950
|
var import_design_system_react_components17 = require("@livechat/design-system-react-components");
|
|
16792
16951
|
|
|
@@ -16837,18 +16996,18 @@ function CustomTagTemplate(tagData, { settings: _s }) {
|
|
|
16837
16996
|
}
|
|
16838
16997
|
|
|
16839
16998
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tag/Tooltip.tsx
|
|
16840
|
-
var
|
|
16999
|
+
var import_react30 = require("react");
|
|
16841
17000
|
var import_lodash2 = __toESM(require("lodash.debounce"));
|
|
16842
17001
|
var import_design_system_react_components16 = require("@livechat/design-system-react-components");
|
|
16843
17002
|
var import_developer_studio_ui_react14 = require("@livechat/developer-studio-ui-react");
|
|
16844
17003
|
var useCustomTagsInputTagTooltipData = () => {
|
|
16845
|
-
const [tooltipData, setTooltipData] = (0,
|
|
17004
|
+
const [tooltipData, setTooltipData] = (0, import_react30.useState)(
|
|
16846
17005
|
{
|
|
16847
17006
|
visible: false
|
|
16848
17007
|
}
|
|
16849
17008
|
);
|
|
16850
|
-
const setTooltipDataDebounced = (0,
|
|
16851
|
-
const showTagTooltip = (0,
|
|
17009
|
+
const setTooltipDataDebounced = (0, import_react30.useCallback)((0, import_lodash2.default)(setTooltipData, 50), []);
|
|
17010
|
+
const showTagTooltip = (0, import_react30.useCallback)(
|
|
16852
17011
|
(tag, tagElement) => {
|
|
16853
17012
|
const rect = tagElement.getBoundingClientRect();
|
|
16854
17013
|
const tooltipPosition = {
|
|
@@ -16863,7 +17022,7 @@ var useCustomTagsInputTagTooltipData = () => {
|
|
|
16863
17022
|
},
|
|
16864
17023
|
[setTooltipDataDebounced]
|
|
16865
17024
|
);
|
|
16866
|
-
const hideTagTooltip = (0,
|
|
17025
|
+
const hideTagTooltip = (0, import_react30.useCallback)(() => {
|
|
16867
17026
|
setTooltipDataDebounced({
|
|
16868
17027
|
visible: false
|
|
16869
17028
|
});
|
|
@@ -16932,10 +17091,10 @@ function CustomTagsInputTagTooltip({
|
|
|
16932
17091
|
}
|
|
16933
17092
|
|
|
16934
17093
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tags.tsx
|
|
16935
|
-
var
|
|
17094
|
+
var import_react32 = require("react");
|
|
16936
17095
|
var import_tagify = __toESM(require("@yaireo/tagify"));
|
|
16937
17096
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
16938
|
-
var noop = (
|
|
17097
|
+
var noop = (_2) => _2;
|
|
16939
17098
|
var isSameDeep = (a, b) => {
|
|
16940
17099
|
const trans = (x) => typeof x === "string" ? x : JSON.stringify(x);
|
|
16941
17100
|
return trans(a) === trans(b);
|
|
@@ -17016,12 +17175,12 @@ function TagifyWrapper({
|
|
|
17016
17175
|
defaultValue,
|
|
17017
17176
|
showDropdown
|
|
17018
17177
|
}) {
|
|
17019
|
-
const mountedRef = (0,
|
|
17020
|
-
const inputElmRef = (0,
|
|
17021
|
-
const tagify = (0,
|
|
17022
|
-
const lastClassNameRef = (0,
|
|
17178
|
+
const mountedRef = (0, import_react32.useRef)();
|
|
17179
|
+
const inputElmRef = (0, import_react32.useRef)(null);
|
|
17180
|
+
const tagify = (0, import_react32.useRef)();
|
|
17181
|
+
const lastClassNameRef = (0, import_react32.useRef)();
|
|
17023
17182
|
const _value = defaultValue || value;
|
|
17024
|
-
const inputAttrs = (0,
|
|
17183
|
+
const inputAttrs = (0, import_react32.useMemo)(
|
|
17025
17184
|
() => ({
|
|
17026
17185
|
ref: inputElmRef,
|
|
17027
17186
|
name,
|
|
@@ -17034,10 +17193,10 @@ function TagifyWrapper({
|
|
|
17034
17193
|
}),
|
|
17035
17194
|
[]
|
|
17036
17195
|
);
|
|
17037
|
-
const setFocus = (0,
|
|
17196
|
+
const setFocus = (0, import_react32.useCallback)(() => {
|
|
17038
17197
|
autoFocus && tagify.current.DOM.input.focus();
|
|
17039
17198
|
}, [tagify]);
|
|
17040
|
-
(0,
|
|
17199
|
+
(0, import_react32.useEffect)(() => {
|
|
17041
17200
|
templatesToString(settings2.templates);
|
|
17042
17201
|
settings2.userInput = userInput;
|
|
17043
17202
|
if (InputMode === "textarea") settings2.mode = "mix";
|
|
@@ -17055,70 +17214,70 @@ function TagifyWrapper({
|
|
|
17055
17214
|
t.destroy();
|
|
17056
17215
|
};
|
|
17057
17216
|
}, []);
|
|
17058
|
-
(0,
|
|
17217
|
+
(0, import_react32.useEffect)(() => {
|
|
17059
17218
|
tagify.current.off("change").on("change", onChange);
|
|
17060
17219
|
}, [onChange]);
|
|
17061
|
-
(0,
|
|
17220
|
+
(0, import_react32.useEffect)(() => {
|
|
17062
17221
|
tagify.current.off("input").on("input", onInput);
|
|
17063
17222
|
}, [onInput]);
|
|
17064
|
-
(0,
|
|
17223
|
+
(0, import_react32.useEffect)(() => {
|
|
17065
17224
|
tagify.current.off("add").on("add", onAdd);
|
|
17066
17225
|
}, [onAdd]);
|
|
17067
|
-
(0,
|
|
17226
|
+
(0, import_react32.useEffect)(() => {
|
|
17068
17227
|
tagify.current.off("remove").on("remove", onRemove);
|
|
17069
17228
|
}, [onRemove]);
|
|
17070
|
-
(0,
|
|
17229
|
+
(0, import_react32.useEffect)(() => {
|
|
17071
17230
|
tagify.current.off("invalid").on("invalid", onInvalid);
|
|
17072
17231
|
}, [onInvalid]);
|
|
17073
|
-
(0,
|
|
17232
|
+
(0, import_react32.useEffect)(() => {
|
|
17074
17233
|
tagify.current.off("keydown").on("keydown", onKeydown);
|
|
17075
17234
|
}, [onKeydown]);
|
|
17076
|
-
(0,
|
|
17235
|
+
(0, import_react32.useEffect)(() => {
|
|
17077
17236
|
tagify.current.off("focus").on("focus", onFocus);
|
|
17078
17237
|
}, [onFocus]);
|
|
17079
|
-
(0,
|
|
17238
|
+
(0, import_react32.useEffect)(() => {
|
|
17080
17239
|
tagify.current.off("blur").on("blur", onBlur);
|
|
17081
17240
|
}, [onBlur]);
|
|
17082
|
-
(0,
|
|
17241
|
+
(0, import_react32.useEffect)(() => {
|
|
17083
17242
|
tagify.current.off("click").on("click", onClick);
|
|
17084
17243
|
}, [onClick]);
|
|
17085
|
-
(0,
|
|
17244
|
+
(0, import_react32.useEffect)(() => {
|
|
17086
17245
|
tagify.current.off("edit:input").on("edit:input", onEditInput);
|
|
17087
17246
|
}, [onEditInput]);
|
|
17088
|
-
(0,
|
|
17247
|
+
(0, import_react32.useEffect)(() => {
|
|
17089
17248
|
tagify.current.off("edit:beforeUpdate").on("edit:beforeUpdate", onEditBeforeUpdate);
|
|
17090
17249
|
}, [onEditBeforeUpdate]);
|
|
17091
|
-
(0,
|
|
17250
|
+
(0, import_react32.useEffect)(() => {
|
|
17092
17251
|
tagify.current.off("edit:updated").on("edit:updated", onEditUpdated);
|
|
17093
17252
|
}, [onEditUpdated]);
|
|
17094
|
-
(0,
|
|
17253
|
+
(0, import_react32.useEffect)(() => {
|
|
17095
17254
|
tagify.current.off("edit:start").on("edit:start", onEditStart);
|
|
17096
17255
|
}, [onEditStart]);
|
|
17097
|
-
(0,
|
|
17256
|
+
(0, import_react32.useEffect)(() => {
|
|
17098
17257
|
tagify.current.off("edit:keydown").on("edit:keydown", onEditKeydown);
|
|
17099
17258
|
}, [onEditKeydown]);
|
|
17100
|
-
(0,
|
|
17259
|
+
(0, import_react32.useEffect)(() => {
|
|
17101
17260
|
tagify.current.off("dropdown:show").on("dropdown:show", onDropdownShow);
|
|
17102
17261
|
}, [onDropdownShow]);
|
|
17103
|
-
(0,
|
|
17262
|
+
(0, import_react32.useEffect)(() => {
|
|
17104
17263
|
tagify.current.off("dropdown:hide").on("dropdown:hide", onDropdownHide);
|
|
17105
17264
|
}, [onDropdownHide]);
|
|
17106
|
-
(0,
|
|
17265
|
+
(0, import_react32.useEffect)(() => {
|
|
17107
17266
|
tagify.current.off("dropdown:select").on("dropdown:select", onDropdownSelect);
|
|
17108
17267
|
}, [onDropdownSelect]);
|
|
17109
|
-
(0,
|
|
17268
|
+
(0, import_react32.useEffect)(() => {
|
|
17110
17269
|
tagify.current.off("dropdown:scroll").on("dropdown:scroll", onDropdownScroll);
|
|
17111
17270
|
}, [onDropdownScroll]);
|
|
17112
|
-
(0,
|
|
17271
|
+
(0, import_react32.useEffect)(() => {
|
|
17113
17272
|
tagify.current.off("dropdown:noMatch").on("dropdown:noMatch", onDropdownNoMatch);
|
|
17114
17273
|
}, [onDropdownNoMatch]);
|
|
17115
|
-
(0,
|
|
17274
|
+
(0, import_react32.useEffect)(() => {
|
|
17116
17275
|
tagify.current.off("dropdown:updated").on("dropdown:updated", onDropdownUpdated);
|
|
17117
17276
|
}, [onDropdownUpdated]);
|
|
17118
|
-
(0,
|
|
17277
|
+
(0, import_react32.useEffect)(() => {
|
|
17119
17278
|
setFocus();
|
|
17120
17279
|
}, [autoFocus]);
|
|
17121
|
-
(0,
|
|
17280
|
+
(0, import_react32.useEffect)(() => {
|
|
17122
17281
|
if (mountedRef.current) {
|
|
17123
17282
|
tagify.current.settings.whitelist.length = 0;
|
|
17124
17283
|
(whitelist == null ? void 0 : whitelist.length) && tagify.current.settings.whitelist.push(
|
|
@@ -17126,13 +17285,13 @@ function TagifyWrapper({
|
|
|
17126
17285
|
);
|
|
17127
17286
|
}
|
|
17128
17287
|
}, [whitelist]);
|
|
17129
|
-
(0,
|
|
17288
|
+
(0, import_react32.useEffect)(() => {
|
|
17130
17289
|
const currentValue = tagify.current.getInputValue();
|
|
17131
17290
|
if (mountedRef.current && !isSameDeep(value, currentValue)) {
|
|
17132
17291
|
tagify.current.loadOriginalValues(value);
|
|
17133
17292
|
}
|
|
17134
17293
|
}, [value]);
|
|
17135
|
-
(0,
|
|
17294
|
+
(0, import_react32.useEffect)(() => {
|
|
17136
17295
|
if (mountedRef.current) {
|
|
17137
17296
|
const { added, removed } = compareStrings(
|
|
17138
17297
|
lastClassNameRef.current,
|
|
@@ -17147,33 +17306,33 @@ function TagifyWrapper({
|
|
|
17147
17306
|
}
|
|
17148
17307
|
lastClassNameRef.current = className;
|
|
17149
17308
|
}, [className]);
|
|
17150
|
-
(0,
|
|
17309
|
+
(0, import_react32.useEffect)(() => {
|
|
17151
17310
|
if (mountedRef.current) {
|
|
17152
17311
|
tagify.current.loading(loading);
|
|
17153
17312
|
}
|
|
17154
17313
|
}, [loading]);
|
|
17155
|
-
(0,
|
|
17314
|
+
(0, import_react32.useEffect)(() => {
|
|
17156
17315
|
if (mountedRef.current) {
|
|
17157
17316
|
tagify.current.setReadonly(readOnly != null ? readOnly : false);
|
|
17158
17317
|
}
|
|
17159
17318
|
}, [readOnly]);
|
|
17160
|
-
(0,
|
|
17319
|
+
(0, import_react32.useEffect)(() => {
|
|
17161
17320
|
if (mountedRef.current) {
|
|
17162
17321
|
tagify.current.setDisabled(disabled != null ? disabled : false);
|
|
17163
17322
|
}
|
|
17164
17323
|
}, [disabled]);
|
|
17165
|
-
(0,
|
|
17324
|
+
(0, import_react32.useEffect)(() => {
|
|
17166
17325
|
if (mountedRef.current) {
|
|
17167
17326
|
const current = tagify.current;
|
|
17168
17327
|
current.userInput = userInput;
|
|
17169
17328
|
}
|
|
17170
17329
|
}, [userInput]);
|
|
17171
|
-
(0,
|
|
17330
|
+
(0, import_react32.useEffect)(() => {
|
|
17172
17331
|
if (mountedRef.current) {
|
|
17173
17332
|
tagify.current.setPlaceholder(placeholder2);
|
|
17174
17333
|
}
|
|
17175
17334
|
}, [placeholder2]);
|
|
17176
|
-
(0,
|
|
17335
|
+
(0, import_react32.useEffect)(() => {
|
|
17177
17336
|
const t = tagify.current;
|
|
17178
17337
|
if (mountedRef.current) {
|
|
17179
17338
|
if (showDropdown) {
|
|
@@ -17184,7 +17343,7 @@ function TagifyWrapper({
|
|
|
17184
17343
|
}
|
|
17185
17344
|
}
|
|
17186
17345
|
}, [showDropdown]);
|
|
17187
|
-
(0,
|
|
17346
|
+
(0, import_react32.useEffect)(() => {
|
|
17188
17347
|
mountedRef.current = true;
|
|
17189
17348
|
}, []);
|
|
17190
17349
|
return (
|
|
@@ -17193,7 +17352,7 @@ function TagifyWrapper({
|
|
|
17193
17352
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "tags-input", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(InputMode, __spreadValues({}, inputAttrs)) })
|
|
17194
17353
|
);
|
|
17195
17354
|
}
|
|
17196
|
-
var Tags = (0,
|
|
17355
|
+
var Tags = (0, import_react32.memo)(TagifyWrapper);
|
|
17197
17356
|
var Tags_default = Tags;
|
|
17198
17357
|
|
|
17199
17358
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/utils.ts
|
|
@@ -17296,23 +17455,23 @@ function CustomTagsInput({
|
|
|
17296
17455
|
renderPicker,
|
|
17297
17456
|
renderPickerTrigger
|
|
17298
17457
|
}) {
|
|
17299
|
-
const tagifyRef = (0,
|
|
17458
|
+
const tagifyRef = (0, import_react33.useRef)();
|
|
17300
17459
|
const [tooltipData, { showTagTooltip, hideTagTooltip }] = useCustomTagsInputTagTooltipData();
|
|
17301
|
-
const updateAllIcons = (0,
|
|
17460
|
+
const updateAllIcons = (0, import_react33.useCallback)(() => {
|
|
17302
17461
|
const tagify = tagifyRef.current;
|
|
17303
17462
|
if (!tagify) {
|
|
17304
17463
|
return;
|
|
17305
17464
|
}
|
|
17306
17465
|
tagify.value.forEach(updateCustomTagsInputTagIcon);
|
|
17307
17466
|
}, []);
|
|
17308
|
-
const getCurrentValue = (0,
|
|
17467
|
+
const getCurrentValue = (0, import_react33.useCallback)(() => {
|
|
17309
17468
|
const tagify = tagifyRef.current;
|
|
17310
17469
|
if (!tagify) {
|
|
17311
17470
|
return "";
|
|
17312
17471
|
}
|
|
17313
17472
|
return tagify.getMixedTagsAsString().replace(trim2 ? /\s+/g : /\r\n$/, "").replaceAll("[[", "${").replaceAll("]]", "}").replaceAll("\u200B", "").replaceAll("\xA0", "");
|
|
17314
17473
|
}, [trim2]);
|
|
17315
|
-
const setCurrentValue = (0,
|
|
17474
|
+
const setCurrentValue = (0, import_react33.useCallback)(
|
|
17316
17475
|
(value2, frame) => {
|
|
17317
17476
|
const tagify = tagifyRef.current;
|
|
17318
17477
|
if (!tagify) {
|
|
@@ -17323,14 +17482,14 @@ function CustomTagsInput({
|
|
|
17323
17482
|
},
|
|
17324
17483
|
[updateAllIcons]
|
|
17325
17484
|
);
|
|
17326
|
-
const handleChange = (0,
|
|
17485
|
+
const handleChange = (0, import_react33.useCallback)(
|
|
17327
17486
|
(0, import_lodash3.default)(() => {
|
|
17328
17487
|
onChange(getCurrentValue());
|
|
17329
17488
|
updateAllIcons();
|
|
17330
17489
|
}, 300),
|
|
17331
17490
|
[onChange, getCurrentValue, updateAllIcons]
|
|
17332
17491
|
);
|
|
17333
|
-
const handleKeyDown = (0,
|
|
17492
|
+
const handleKeyDown = (0, import_react33.useCallback)(
|
|
17334
17493
|
(e) => {
|
|
17335
17494
|
if (e.detail.event.key !== "Backspace") {
|
|
17336
17495
|
return;
|
|
@@ -17341,7 +17500,7 @@ function CustomTagsInput({
|
|
|
17341
17500
|
},
|
|
17342
17501
|
[handleChange]
|
|
17343
17502
|
);
|
|
17344
|
-
const addTag = (0,
|
|
17503
|
+
const addTag = (0, import_react33.useCallback)(
|
|
17345
17504
|
(tag) => {
|
|
17346
17505
|
const tagify = tagifyRef.current;
|
|
17347
17506
|
if (!tagify) {
|
|
@@ -17357,7 +17516,7 @@ function CustomTagsInput({
|
|
|
17357
17516
|
},
|
|
17358
17517
|
[trim2, onPickerToggle]
|
|
17359
17518
|
);
|
|
17360
|
-
(0,
|
|
17519
|
+
(0, import_react33.useEffect)(() => {
|
|
17361
17520
|
const tagify = tagifyRef.current;
|
|
17362
17521
|
if (!tagify) {
|
|
17363
17522
|
return;
|
|
@@ -17383,7 +17542,7 @@ function CustomTagsInput({
|
|
|
17383
17542
|
showTagTooltip,
|
|
17384
17543
|
hideTagTooltip
|
|
17385
17544
|
]);
|
|
17386
|
-
(0,
|
|
17545
|
+
(0, import_react33.useEffect)(() => {
|
|
17387
17546
|
const tagify = tagifyRef.current;
|
|
17388
17547
|
if (!tagify) {
|
|
17389
17548
|
return;
|
|
@@ -17434,9 +17593,7 @@ function CustomTagsInput({
|
|
|
17434
17593
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Trigger.tsx
|
|
17435
17594
|
var import_design_system_icons9 = require("@livechat/design-system-icons");
|
|
17436
17595
|
var import_design_system_react_components18 = require("@livechat/design-system-react-components");
|
|
17437
|
-
function CustomTagsPickerTrigger({
|
|
17438
|
-
onClick
|
|
17439
|
-
}) {
|
|
17596
|
+
function CustomTagsPickerTrigger({ onClick }) {
|
|
17440
17597
|
return /* @__PURE__ */ jsx4(
|
|
17441
17598
|
import_design_system_react_components18.Button,
|
|
17442
17599
|
{
|
|
@@ -17449,7 +17606,6 @@ function CustomTagsPickerTrigger({
|
|
|
17449
17606
|
min-height: 28px;
|
|
17450
17607
|
width: 28px;
|
|
17451
17608
|
min-width: 28px;
|
|
17452
|
-
z-index: 1000;
|
|
17453
17609
|
`,
|
|
17454
17610
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components18.Icon, { source: import_design_system_icons9.Add }),
|
|
17455
17611
|
kind: "plain",
|
|
@@ -17471,8 +17627,8 @@ function CustomTagsField({
|
|
|
17471
17627
|
wrapperCss: wrapperCss3,
|
|
17472
17628
|
onChange
|
|
17473
17629
|
}) {
|
|
17474
|
-
const wrapperRef = (0,
|
|
17475
|
-
const [isPickerVisible, setIsPickerVisible] = (0,
|
|
17630
|
+
const wrapperRef = (0, import_react35.useRef)(null);
|
|
17631
|
+
const [isPickerVisible, setIsPickerVisible] = (0, import_react35.useState)(false);
|
|
17476
17632
|
(0, import_developer_studio_ui_react15.useOnClickOutside)(wrapperRef, () => {
|
|
17477
17633
|
setIsPickerVisible(false);
|
|
17478
17634
|
});
|
|
@@ -17539,7 +17695,7 @@ function DynamicCustomStringField(props) {
|
|
|
17539
17695
|
}
|
|
17540
17696
|
|
|
17541
17697
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Modes/Predefined.tsx
|
|
17542
|
-
var
|
|
17698
|
+
var import_react37 = require("react");
|
|
17543
17699
|
var import_design_system_react_components19 = require("@livechat/design-system-react-components");
|
|
17544
17700
|
var pickerCustomStyles = (readonly) => css`
|
|
17545
17701
|
flex: 1;
|
|
@@ -17553,12 +17709,12 @@ function PredefinedCustomStringField(props) {
|
|
|
17553
17709
|
var _a;
|
|
17554
17710
|
const { resourceQuery, onChange, schema } = props;
|
|
17555
17711
|
const resourceConfig = schema["x-ref"];
|
|
17556
|
-
const [pickerOptions, setPickerOptions] = (0,
|
|
17557
|
-
(0,
|
|
17712
|
+
const [pickerOptions, setPickerOptions] = (0, import_react37.useState)([]);
|
|
17713
|
+
(0, import_react37.useEffect)(() => {
|
|
17558
17714
|
var _a2, _b;
|
|
17559
17715
|
if (!resourceConfig) {
|
|
17560
17716
|
if (resourceQuery.data) {
|
|
17561
|
-
onChange(
|
|
17717
|
+
onChange("");
|
|
17562
17718
|
}
|
|
17563
17719
|
return;
|
|
17564
17720
|
}
|
|
@@ -17590,17 +17746,29 @@ var {
|
|
|
17590
17746
|
fields: { StringField }
|
|
17591
17747
|
} = (0, import_core.getDefaultRegistry)();
|
|
17592
17748
|
function CustomStringField(props) {
|
|
17593
|
-
var _a;
|
|
17749
|
+
var _a, _b, _c;
|
|
17594
17750
|
const onChange = props.onChange;
|
|
17595
17751
|
const resourceConfig = props.schema["x-ref"];
|
|
17596
17752
|
const resourceQuery = (0, import_platform_integrations3.useFetchIntegrationResourceQuery)(resourceConfig);
|
|
17597
|
-
const [
|
|
17753
|
+
const [pristine, setPristine] = (0, import_react39.useState)(true);
|
|
17754
|
+
const [isPredefinedMode, setIsPredefinedMode] = (0, import_react39.useState)(
|
|
17598
17755
|
() => {
|
|
17599
|
-
var _a2,
|
|
17600
|
-
return ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some((item) => item.key === props.formData)) || !props.formData && ((
|
|
17756
|
+
var _a2, _b2, _c2;
|
|
17757
|
+
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
17758
|
}
|
|
17602
17759
|
);
|
|
17603
|
-
const
|
|
17760
|
+
const handleChange = (0, import_react39.useCallback)(
|
|
17761
|
+
(value) => {
|
|
17762
|
+
setPristine(false);
|
|
17763
|
+
if (value !== "") {
|
|
17764
|
+
onChange(value);
|
|
17765
|
+
return;
|
|
17766
|
+
}
|
|
17767
|
+
onChange(props.schema.required ? null : void 0);
|
|
17768
|
+
},
|
|
17769
|
+
[onChange, props.schema.required]
|
|
17770
|
+
);
|
|
17771
|
+
const modeSelectorOptions = (0, import_react39.useMemo)(
|
|
17604
17772
|
() => [
|
|
17605
17773
|
resourceConfig ? {
|
|
17606
17774
|
key: "predefined",
|
|
@@ -17616,8 +17784,10 @@ function CustomStringField(props) {
|
|
|
17616
17784
|
}
|
|
17617
17785
|
) }),
|
|
17618
17786
|
onClick: () => {
|
|
17619
|
-
|
|
17620
|
-
|
|
17787
|
+
handleChange("");
|
|
17788
|
+
setTimeout(() => {
|
|
17789
|
+
setIsPredefinedMode(true);
|
|
17790
|
+
}, 50);
|
|
17621
17791
|
}
|
|
17622
17792
|
} : void 0,
|
|
17623
17793
|
{
|
|
@@ -17634,28 +17804,47 @@ function CustomStringField(props) {
|
|
|
17634
17804
|
}
|
|
17635
17805
|
) }),
|
|
17636
17806
|
onClick: () => {
|
|
17637
|
-
|
|
17807
|
+
handleChange("");
|
|
17638
17808
|
setTimeout(() => {
|
|
17639
17809
|
setIsPredefinedMode(false);
|
|
17640
|
-
},
|
|
17810
|
+
}, 50);
|
|
17641
17811
|
}
|
|
17642
17812
|
}
|
|
17643
17813
|
].filter(Boolean),
|
|
17644
|
-
[resourceConfig,
|
|
17814
|
+
[resourceConfig, handleChange, setIsPredefinedMode]
|
|
17645
17815
|
);
|
|
17646
|
-
(0,
|
|
17647
|
-
var _a2,
|
|
17816
|
+
(0, import_react39.useEffect)(() => {
|
|
17817
|
+
var _a2, _b2, _c2;
|
|
17818
|
+
if (!pristine && !props.formData) {
|
|
17819
|
+
return;
|
|
17820
|
+
}
|
|
17648
17821
|
setIsPredefinedMode(
|
|
17649
17822
|
((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some(
|
|
17650
17823
|
(option) => option.key === props.formData
|
|
17651
|
-
)) || !props.formData && ((
|
|
17824
|
+
)) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0
|
|
17652
17825
|
);
|
|
17653
|
-
}, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData]);
|
|
17826
|
+
}, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData, pristine]);
|
|
17827
|
+
(0, import_react39.useEffect)(() => {
|
|
17828
|
+
setPristine(true);
|
|
17829
|
+
}, [(_c = (_b = props.formContext) == null ? void 0 : _b.frame.__meta) == null ? void 0 : _c.index]);
|
|
17654
17830
|
if (props.schema.enum || props.schema.oneOf) {
|
|
17655
17831
|
return /* @__PURE__ */ jsx4(StringField, __spreadValues({}, props));
|
|
17656
17832
|
}
|
|
17657
17833
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react16.Row, { gap: `var(${import_design_system_react_components20.SpacingToken.Spacing1})`, notPadded: true, children: [
|
|
17658
|
-
|
|
17834
|
+
/* @__PURE__ */ jsx4("br", {}),
|
|
17835
|
+
isPredefinedMode ? /* @__PURE__ */ jsx4(
|
|
17836
|
+
PredefinedCustomStringField,
|
|
17837
|
+
__spreadProps(__spreadValues({}, props), {
|
|
17838
|
+
onChange: handleChange,
|
|
17839
|
+
resourceQuery
|
|
17840
|
+
})
|
|
17841
|
+
) : /* @__PURE__ */ jsx4(
|
|
17842
|
+
DynamicCustomStringField,
|
|
17843
|
+
__spreadProps(__spreadValues({}, props), {
|
|
17844
|
+
onChange: handleChange,
|
|
17845
|
+
resourceQuery
|
|
17846
|
+
})
|
|
17847
|
+
),
|
|
17659
17848
|
modeSelectorOptions.length > 1 && /* @__PURE__ */ jsx4(
|
|
17660
17849
|
import_design_system_react_components20.ActionMenu,
|
|
17661
17850
|
{
|
|
@@ -17664,9 +17853,9 @@ function CustomStringField(props) {
|
|
|
17664
17853
|
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
17665
17854
|
import_design_system_react_components20.Button,
|
|
17666
17855
|
{
|
|
17856
|
+
disabled: props.readonly,
|
|
17667
17857
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components20.Icon, { source: import_design_system_icons10.MoreHoriz }),
|
|
17668
|
-
kind: "secondary"
|
|
17669
|
-
disabled: props.readonly
|
|
17858
|
+
kind: "secondary"
|
|
17670
17859
|
}
|
|
17671
17860
|
)
|
|
17672
17861
|
}
|
|
@@ -17682,12 +17871,12 @@ function CustomAddButton(props) {
|
|
|
17682
17871
|
return /* @__PURE__ */ jsx4(
|
|
17683
17872
|
import_design_system_react_components21.Button,
|
|
17684
17873
|
{
|
|
17874
|
+
disabled: props.disabled,
|
|
17685
17875
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.Add }),
|
|
17686
17876
|
kind: "secondary",
|
|
17687
17877
|
onClick: (e) => {
|
|
17688
17878
|
onClick && onClick(e);
|
|
17689
17879
|
},
|
|
17690
|
-
disabled: props.disabled,
|
|
17691
17880
|
size: "medium",
|
|
17692
17881
|
children: "Add property"
|
|
17693
17882
|
}
|
|
@@ -17704,9 +17893,9 @@ function CustomRemoveButton(props) {
|
|
|
17704
17893
|
width: var(${import_design_system_react_components21.SpacingToken.Spacing6}) !important;
|
|
17705
17894
|
padding: 1px;
|
|
17706
17895
|
`,
|
|
17896
|
+
disabled: props.disabled,
|
|
17707
17897
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.Delete }),
|
|
17708
17898
|
kind: "text",
|
|
17709
|
-
disabled: props.disabled,
|
|
17710
17899
|
onClick: (e) => {
|
|
17711
17900
|
onClick && onClick(e);
|
|
17712
17901
|
}
|
|
@@ -17724,9 +17913,9 @@ function CustomMoveUpButton(props) {
|
|
|
17724
17913
|
width: var(${import_design_system_react_components21.SpacingToken.Spacing6}) !important;
|
|
17725
17914
|
padding: 1px;
|
|
17726
17915
|
`,
|
|
17916
|
+
disabled: props.disabled,
|
|
17727
17917
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.ArrowUpward }),
|
|
17728
17918
|
kind: "text",
|
|
17729
|
-
disabled: props.disabled,
|
|
17730
17919
|
onClick: (e) => {
|
|
17731
17920
|
onClick && onClick(e);
|
|
17732
17921
|
}
|
|
@@ -17744,9 +17933,9 @@ function CustomMoveDownButton(props) {
|
|
|
17744
17933
|
width: var(${import_design_system_react_components21.SpacingToken.Spacing6}) !important;
|
|
17745
17934
|
padding: 1px;
|
|
17746
17935
|
`,
|
|
17936
|
+
disabled: props.disabled,
|
|
17747
17937
|
icon: /* @__PURE__ */ jsx4(import_design_system_react_components21.Icon, { source: import_design_system_icons11.ArrowDownward }),
|
|
17748
17938
|
kind: "text",
|
|
17749
|
-
disabled: props.disabled,
|
|
17750
17939
|
onClick: (e) => {
|
|
17751
17940
|
onClick && onClick(e);
|
|
17752
17941
|
}
|
|
@@ -17755,10 +17944,10 @@ function CustomMoveDownButton(props) {
|
|
|
17755
17944
|
}
|
|
17756
17945
|
|
|
17757
17946
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomArrayFieldTemplate.tsx
|
|
17758
|
-
var
|
|
17947
|
+
var import_utils16 = require("@rjsf/utils");
|
|
17759
17948
|
|
|
17760
17949
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomArrayFieldHeader.tsx
|
|
17761
|
-
var
|
|
17950
|
+
var import_utils15 = require("@rjsf/utils");
|
|
17762
17951
|
var import_design_system_react_components22 = require("@livechat/design-system-react-components");
|
|
17763
17952
|
var import_developer_studio_ui_react17 = require("@livechat/developer-studio-ui-react");
|
|
17764
17953
|
function CustomArrayFieldHeader(props) {
|
|
@@ -17772,9 +17961,9 @@ function CustomArrayFieldHeader(props) {
|
|
|
17772
17961
|
uiSchema,
|
|
17773
17962
|
hideOptionalBadge
|
|
17774
17963
|
} = props;
|
|
17775
|
-
const options = (0,
|
|
17776
|
-
const ArrayFieldTitleTemplate = (0,
|
|
17777
|
-
const ArrayFieldDescriptionTemplate = (0,
|
|
17964
|
+
const options = (0, import_utils15.getUiOptions)(uiSchema);
|
|
17965
|
+
const ArrayFieldTitleTemplate = (0, import_utils15.getTemplate)("ArrayFieldTitleTemplate", registry, options);
|
|
17966
|
+
const ArrayFieldDescriptionTemplate = (0, import_utils15.getTemplate)("ArrayFieldDescriptionTemplate", registry, options);
|
|
17778
17967
|
return /* @__PURE__ */ jsx4(import_developer_studio_ui_react17.Row, { noWrap: true, notPadded: true, spaceBetween: true, children: /* @__PURE__ */ jsxs2(
|
|
17779
17968
|
import_developer_studio_ui_react17.Row,
|
|
17780
17969
|
{
|
|
@@ -17836,8 +18025,8 @@ function CustomArrayFieldTemplate(props) {
|
|
|
17836
18025
|
schema,
|
|
17837
18026
|
title
|
|
17838
18027
|
} = props;
|
|
17839
|
-
const uiOptions = (0,
|
|
17840
|
-
const ArrayFieldItemTemplate = (0,
|
|
18028
|
+
const uiOptions = (0, import_utils16.getUiOptions)(uiSchema);
|
|
18029
|
+
const ArrayFieldItemTemplate = (0, import_utils16.getTemplate)(
|
|
17841
18030
|
"ArrayFieldItemTemplate",
|
|
17842
18031
|
registry,
|
|
17843
18032
|
uiOptions
|
|
@@ -17858,11 +18047,11 @@ function CustomArrayFieldTemplate(props) {
|
|
|
17858
18047
|
uiSchema
|
|
17859
18048
|
}
|
|
17860
18049
|
),
|
|
17861
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "row array-item-list", children: items
|
|
18050
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "row array-item-list", children: items.map((_a) => {
|
|
17862
18051
|
var _b = _a, { key } = _b, itemProps = __objRest(_b, ["key"]);
|
|
17863
18052
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ArrayFieldItemTemplate, __spreadValues({}, itemProps), key);
|
|
17864
18053
|
}) }),
|
|
17865
|
-
canAdd
|
|
18054
|
+
canAdd ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
17866
18055
|
AddButton,
|
|
17867
18056
|
{
|
|
17868
18057
|
className: "array-item-add",
|
|
@@ -17871,7 +18060,7 @@ function CustomArrayFieldTemplate(props) {
|
|
|
17871
18060
|
registry,
|
|
17872
18061
|
uiSchema
|
|
17873
18062
|
}
|
|
17874
|
-
)
|
|
18063
|
+
) : null
|
|
17875
18064
|
] });
|
|
17876
18065
|
}
|
|
17877
18066
|
|
|
@@ -17915,11 +18104,11 @@ function CustomDescriptionFieldTemplate(props) {
|
|
|
17915
18104
|
}
|
|
17916
18105
|
|
|
17917
18106
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomField.tsx
|
|
17918
|
-
var
|
|
18107
|
+
var import_utils18 = require("@rjsf/utils");
|
|
17919
18108
|
var import_design_system_react_components25 = require("@livechat/design-system-react-components");
|
|
17920
18109
|
|
|
17921
18110
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/Other/CustomFieldHeader.tsx
|
|
17922
|
-
var
|
|
18111
|
+
var import_utils17 = require("@rjsf/utils");
|
|
17923
18112
|
var import_design_system_react_components24 = require("@livechat/design-system-react-components");
|
|
17924
18113
|
var import_developer_studio_ui_react18 = require("@livechat/developer-studio-ui-react");
|
|
17925
18114
|
var OptionalWrapper = newStyled.div`
|
|
@@ -17939,13 +18128,13 @@ function CustomFieldHeader(props) {
|
|
|
17939
18128
|
uiSchema,
|
|
17940
18129
|
hideOptionalBadge
|
|
17941
18130
|
} = props;
|
|
17942
|
-
const options = (0,
|
|
17943
|
-
const TitleFieldTemplate = (0,
|
|
18131
|
+
const options = (0, import_utils17.getUiOptions)(uiSchema);
|
|
18132
|
+
const TitleFieldTemplate = (0, import_utils17.getTemplate)(
|
|
17944
18133
|
"TitleFieldTemplate",
|
|
17945
18134
|
registry,
|
|
17946
18135
|
options
|
|
17947
18136
|
);
|
|
17948
|
-
const DescriptionFieldTemplate = (0,
|
|
18137
|
+
const DescriptionFieldTemplate = (0, import_utils17.getTemplate)("DescriptionFieldTemplate", registry, options);
|
|
17949
18138
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react18.Row, { noWrap: true, notPadded: true, spaceBetween: true, children: [
|
|
17950
18139
|
/* @__PURE__ */ jsxs2(
|
|
17951
18140
|
import_developer_studio_ui_react18.Row,
|
|
@@ -17957,7 +18146,7 @@ function CustomFieldHeader(props) {
|
|
|
17957
18146
|
label ? /* @__PURE__ */ jsx4(
|
|
17958
18147
|
TitleFieldTemplate,
|
|
17959
18148
|
{
|
|
17960
|
-
id: (0,
|
|
18149
|
+
id: (0, import_utils17.titleId)(id),
|
|
17961
18150
|
registry,
|
|
17962
18151
|
required,
|
|
17963
18152
|
schema,
|
|
@@ -17969,7 +18158,7 @@ function CustomFieldHeader(props) {
|
|
|
17969
18158
|
DescriptionFieldTemplate,
|
|
17970
18159
|
{
|
|
17971
18160
|
description,
|
|
17972
|
-
id: (0,
|
|
18161
|
+
id: (0, import_utils17.descriptionId)(id),
|
|
17973
18162
|
registry,
|
|
17974
18163
|
schema,
|
|
17975
18164
|
uiSchema
|
|
@@ -18019,9 +18208,9 @@ function CustomFieldTemplate(props) {
|
|
|
18019
18208
|
"schema",
|
|
18020
18209
|
"uiSchema"
|
|
18021
18210
|
]);
|
|
18022
|
-
const options = (0,
|
|
18023
|
-
const additional =
|
|
18024
|
-
const WrapIfAdditionalTemplate = (0,
|
|
18211
|
+
const options = (0, import_utils18.getUiOptions)(uiSchema);
|
|
18212
|
+
const additional = import_utils18.ADDITIONAL_PROPERTY_FLAG in props.schema;
|
|
18213
|
+
const WrapIfAdditionalTemplate = (0, import_utils18.getTemplate)(
|
|
18025
18214
|
"WrapIfAdditionalTemplate",
|
|
18026
18215
|
registry,
|
|
18027
18216
|
options
|
|
@@ -18072,7 +18261,7 @@ function CustomFieldTemplate(props) {
|
|
|
18072
18261
|
}
|
|
18073
18262
|
|
|
18074
18263
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomFieldWrapper.tsx
|
|
18075
|
-
var
|
|
18264
|
+
var import_utils19 = require("@rjsf/utils");
|
|
18076
18265
|
var import_design_system_react_components26 = require("@livechat/design-system-react-components");
|
|
18077
18266
|
function CustomWrapIfAdditionalTemplate(props) {
|
|
18078
18267
|
const {
|
|
@@ -18087,7 +18276,7 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18087
18276
|
classNames,
|
|
18088
18277
|
style
|
|
18089
18278
|
} = props;
|
|
18090
|
-
const additional =
|
|
18279
|
+
const additional = import_utils19.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
18091
18280
|
if (!additional) {
|
|
18092
18281
|
return /* @__PURE__ */ jsx4("div", { className: classNames, style, children });
|
|
18093
18282
|
}
|
|
@@ -18118,8 +18307,8 @@ function CustomWrapIfAdditionalTemplate(props) {
|
|
|
18118
18307
|
}
|
|
18119
18308
|
|
|
18120
18309
|
// src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Templates/CustomObjectField.tsx
|
|
18121
|
-
var
|
|
18122
|
-
var
|
|
18310
|
+
var import_react43 = require("react");
|
|
18311
|
+
var import_utils20 = require("@rjsf/utils");
|
|
18123
18312
|
var import_design_system_react_components27 = require("@livechat/design-system-react-components");
|
|
18124
18313
|
function CustomObjectFieldTemplate(props) {
|
|
18125
18314
|
const {
|
|
@@ -18139,11 +18328,11 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18139
18328
|
const {
|
|
18140
18329
|
ButtonTemplates: { AddButton }
|
|
18141
18330
|
} = registry.templates;
|
|
18142
|
-
const [optionalVisible, setOptionalVisible] = (0,
|
|
18143
|
-
const [touched, setTouched] = (0,
|
|
18331
|
+
const [optionalVisible, setOptionalVisible] = (0, import_react43.useState)(false);
|
|
18332
|
+
const [touched, setTouched] = (0, import_react43.useState)({});
|
|
18144
18333
|
const newProperties = properties.map((prop) => {
|
|
18145
18334
|
return __spreadProps(__spreadValues({}, prop), {
|
|
18146
|
-
hidden: !(prop.content.props.required ||
|
|
18335
|
+
hidden: !(touched[prop.name] || prop.content.props.required || prop.content.props.schema.visible || 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
18336
|
content: __spreadProps(__spreadValues({}, prop.content), {
|
|
18148
18337
|
props: __spreadProps(__spreadValues({}, prop.content.props), {
|
|
18149
18338
|
onChange: (value, newErrorSchema, id) => {
|
|
@@ -18199,7 +18388,7 @@ function CustomObjectFieldTemplate(props) {
|
|
|
18199
18388
|
)
|
|
18200
18389
|
}
|
|
18201
18390
|
) : null,
|
|
18202
|
-
(0,
|
|
18391
|
+
(0, import_utils20.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ jsx4(
|
|
18203
18392
|
"div",
|
|
18204
18393
|
{
|
|
18205
18394
|
style: {
|
|
@@ -18416,7 +18605,7 @@ function ForkJoinNodeForm({
|
|
|
18416
18605
|
var Form_default2 = ForkJoinNodeForm;
|
|
18417
18606
|
|
|
18418
18607
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Node.tsx
|
|
18419
|
-
var
|
|
18608
|
+
var import_react47 = require("react");
|
|
18420
18609
|
var import_reactflow6 = require("reactflow");
|
|
18421
18610
|
|
|
18422
18611
|
// src/views/Workflows/Creator/Builder/Handles/CustomAdd/Handle.tsx
|
|
@@ -18533,7 +18722,7 @@ function CustomNodeWrapper({
|
|
|
18533
18722
|
|
|
18534
18723
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/ForkJoinNode/Node.tsx
|
|
18535
18724
|
function ForkJoinNode(node2) {
|
|
18536
|
-
const [isHovered, setIsHovered] = (0,
|
|
18725
|
+
const [isHovered, setIsHovered] = (0, import_react47.useState)(false);
|
|
18537
18726
|
const {
|
|
18538
18727
|
updateTask,
|
|
18539
18728
|
removeTask,
|
|
@@ -18600,7 +18789,7 @@ function ForkJoinNode(node2) {
|
|
|
18600
18789
|
}
|
|
18601
18790
|
);
|
|
18602
18791
|
}
|
|
18603
|
-
var Node_default = (0,
|
|
18792
|
+
var Node_default = (0, import_react47.memo)(ForkJoinNode);
|
|
18604
18793
|
|
|
18605
18794
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Base.tsx
|
|
18606
18795
|
var import_design_system_icons15 = require("@livechat/design-system-icons");
|
|
@@ -18730,20 +18919,20 @@ function HttpNodeBase({
|
|
|
18730
18919
|
var Base_default2 = HttpNodeBase;
|
|
18731
18920
|
|
|
18732
18921
|
// src/views/Workflows/Creator/Builder/Forms/Schema/Wrapper.tsx
|
|
18733
|
-
var
|
|
18922
|
+
var import_react50 = require("react");
|
|
18734
18923
|
var import_design_system_icons16 = require("@livechat/design-system-icons");
|
|
18735
18924
|
var import_design_system_react_components36 = require("@livechat/design-system-react-components");
|
|
18736
18925
|
var import_developer_studio_api24 = require("@livechat/developer-studio-api");
|
|
18737
18926
|
var import_platform_integrations5 = require("@livechat/platform-integrations");
|
|
18738
18927
|
|
|
18739
18928
|
// src/views/Workflows/Creator/Builder/Forms/Schema/integrations/Text/index.tsx
|
|
18740
|
-
var
|
|
18741
|
-
var
|
|
18929
|
+
var import_react49 = require("react");
|
|
18930
|
+
var import_react_router_dom7 = require("react-router-dom");
|
|
18742
18931
|
var import_design_system_react_components35 = require("@livechat/design-system-react-components");
|
|
18743
18932
|
var import_developer_studio_ui_react20 = require("@livechat/developer-studio-ui-react");
|
|
18744
18933
|
var import_platform_integrations4 = require("@livechat/platform-integrations");
|
|
18745
18934
|
function GlobalAccounts(props) {
|
|
18746
|
-
const { pathname } = (0,
|
|
18935
|
+
const { pathname } = (0, import_react_router_dom7.useLocation)();
|
|
18747
18936
|
const notifications = (0, import_developer_studio_ui_react20.useNotificationContext)();
|
|
18748
18937
|
const { user } = (0, import_developer_studio_ui_react20.useUserContext)();
|
|
18749
18938
|
const organizationProductsQuery = useFetchOrganizationProducts();
|
|
@@ -18754,7 +18943,7 @@ function GlobalAccounts(props) {
|
|
|
18754
18943
|
const needToBeActivated = organizationProductsQuery.data ? !organizationProductsQuery.data.find(
|
|
18755
18944
|
(product) => product.product === props.product
|
|
18756
18945
|
) : void 0;
|
|
18757
|
-
const refetch = (0,
|
|
18946
|
+
const refetch = (0, import_react49.useCallback)(() => {
|
|
18758
18947
|
void organizationProductsQuery.refetch();
|
|
18759
18948
|
}, [organizationProductsQuery]);
|
|
18760
18949
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react20.Column, { gap: `var(${import_design_system_react_components35.SpacingToken.Spacing3})`, notPadded: true, children: [
|
|
@@ -18830,11 +19019,11 @@ function CustomSchemaFormWrapper({
|
|
|
18830
19019
|
preselectedTab,
|
|
18831
19020
|
tabsMetadata
|
|
18832
19021
|
}) {
|
|
18833
|
-
const spec = (0,
|
|
18834
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
19022
|
+
const spec = (0, import_react50.useMemo)(() => WorkflowSpecification.getItemConfig(data), [data]);
|
|
19023
|
+
const [selectedTab, setSelectedTab] = (0, import_react50.useState)(
|
|
18835
19024
|
preselectedTab != null ? preselectedTab : !spec || spec.specification.input ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
|
|
18836
19025
|
);
|
|
18837
|
-
const tabItems = (0,
|
|
19026
|
+
const tabItems = (0, import_react50.useMemo)(
|
|
18838
19027
|
() => [
|
|
18839
19028
|
!spec || spec.specification.input ? { id: "parameters", title: "Parameters" } : void 0,
|
|
18840
19029
|
spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? {
|
|
@@ -18953,15 +19142,7 @@ function HttpNodeForm({
|
|
|
18953
19142
|
data
|
|
18954
19143
|
}),
|
|
18955
19144
|
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,
|
|
19145
|
+
formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ? metadata.errors.inputParameters.http_request.uri : void 0,
|
|
18965
19146
|
onChange: (formData) => {
|
|
18966
19147
|
onChange(__spreadProps(__spreadValues({}, data), {
|
|
18967
19148
|
inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
|
|
@@ -19003,10 +19184,10 @@ function HttpNodeForm({
|
|
|
19003
19184
|
var Form_default3 = HttpNodeForm;
|
|
19004
19185
|
|
|
19005
19186
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/HttpNode/Node.tsx
|
|
19006
|
-
var
|
|
19187
|
+
var import_react52 = require("react");
|
|
19007
19188
|
var import_reactflow7 = require("reactflow");
|
|
19008
19189
|
function HttpNode(node2) {
|
|
19009
|
-
const [isHovered, setIsHovered] = (0,
|
|
19190
|
+
const [isHovered, setIsHovered] = (0, import_react52.useState)(false);
|
|
19010
19191
|
const {
|
|
19011
19192
|
removeTask,
|
|
19012
19193
|
goToAddTask,
|
|
@@ -19075,7 +19256,7 @@ function HttpNode(node2) {
|
|
|
19075
19256
|
}
|
|
19076
19257
|
);
|
|
19077
19258
|
}
|
|
19078
|
-
var Node_default2 = (0,
|
|
19259
|
+
var Node_default2 = (0, import_react52.memo)(HttpNode);
|
|
19079
19260
|
|
|
19080
19261
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Base.tsx
|
|
19081
19262
|
var import_design_system_icons17 = require("@livechat/design-system-icons");
|
|
@@ -19186,7 +19367,7 @@ function JoinNodeForm({
|
|
|
19186
19367
|
var Form_default4 = JoinNodeForm;
|
|
19187
19368
|
|
|
19188
19369
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/JoinNode/Node.tsx
|
|
19189
|
-
var
|
|
19370
|
+
var import_react54 = require("react");
|
|
19190
19371
|
var import_reactflow8 = require("reactflow");
|
|
19191
19372
|
function JoinNode(node2) {
|
|
19192
19373
|
const {
|
|
@@ -19229,7 +19410,7 @@ function JoinNode(node2) {
|
|
|
19229
19410
|
}
|
|
19230
19411
|
) });
|
|
19231
19412
|
}
|
|
19232
|
-
var Node_default3 = (0,
|
|
19413
|
+
var Node_default3 = (0, import_react54.memo)(JoinNode);
|
|
19233
19414
|
|
|
19234
19415
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Base.tsx
|
|
19235
19416
|
var import_design_system_icons18 = require("@livechat/design-system-icons");
|
|
@@ -19366,7 +19547,7 @@ function SwitchNodeForm({
|
|
|
19366
19547
|
var Form_default5 = SwitchNodeForm;
|
|
19367
19548
|
|
|
19368
19549
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/SwitchNode/Node.tsx
|
|
19369
|
-
var
|
|
19550
|
+
var import_react56 = require("react");
|
|
19370
19551
|
var import_reactflow9 = require("reactflow");
|
|
19371
19552
|
var import_design_system_react_components39 = require("@livechat/design-system-react-components");
|
|
19372
19553
|
var handlerWrapperCss = css`
|
|
@@ -19386,7 +19567,7 @@ var handlerWrapperCss = css`
|
|
|
19386
19567
|
}
|
|
19387
19568
|
`;
|
|
19388
19569
|
function SwitchNode(node2) {
|
|
19389
|
-
const [isHovered, setIsHovered] = (0,
|
|
19570
|
+
const [isHovered, setIsHovered] = (0, import_react56.useState)(false);
|
|
19390
19571
|
const {
|
|
19391
19572
|
removeTask,
|
|
19392
19573
|
goToAddTask,
|
|
@@ -19473,7 +19654,7 @@ function SwitchNode(node2) {
|
|
|
19473
19654
|
}
|
|
19474
19655
|
);
|
|
19475
19656
|
}
|
|
19476
|
-
var Node_default4 = (0,
|
|
19657
|
+
var Node_default4 = (0, import_react56.memo)(SwitchNode);
|
|
19477
19658
|
|
|
19478
19659
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Base.tsx
|
|
19479
19660
|
var import_design_system_icons19 = require("@livechat/design-system-icons");
|
|
@@ -19575,10 +19756,10 @@ function TerminateNodeForm({
|
|
|
19575
19756
|
var Form_default6 = TerminateNodeForm;
|
|
19576
19757
|
|
|
19577
19758
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TerminateNode/Node.tsx
|
|
19578
|
-
var
|
|
19759
|
+
var import_react58 = require("react");
|
|
19579
19760
|
var import_reactflow10 = require("reactflow");
|
|
19580
19761
|
function TerminateNode(node2) {
|
|
19581
|
-
const [isHovered, setIsHovered] = (0,
|
|
19762
|
+
const [isHovered, setIsHovered] = (0, import_react58.useState)(false);
|
|
19582
19763
|
const {
|
|
19583
19764
|
removeTask,
|
|
19584
19765
|
goToAddTask,
|
|
@@ -19630,7 +19811,7 @@ function TerminateNode(node2) {
|
|
|
19630
19811
|
}
|
|
19631
19812
|
);
|
|
19632
19813
|
}
|
|
19633
|
-
var Node_default5 = (0,
|
|
19814
|
+
var Node_default5 = (0, import_react58.memo)(TerminateNode);
|
|
19634
19815
|
|
|
19635
19816
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Base.tsx
|
|
19636
19817
|
var import_design_system_react_components41 = require("@livechat/design-system-react-components");
|
|
@@ -19744,7 +19925,7 @@ function TriggerNodeBase({
|
|
|
19744
19925
|
var Base_default6 = TriggerNodeBase;
|
|
19745
19926
|
|
|
19746
19927
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Form.tsx
|
|
19747
|
-
var
|
|
19928
|
+
var import_react60 = require("react");
|
|
19748
19929
|
var import_react_js_cron = require("react-js-cron");
|
|
19749
19930
|
var import_design_system_react_components42 = require("@livechat/design-system-react-components");
|
|
19750
19931
|
var cronCss = css`
|
|
@@ -19781,7 +19962,7 @@ var cronCss = css`
|
|
|
19781
19962
|
}
|
|
19782
19963
|
`;
|
|
19783
19964
|
function CronWrapper(props) {
|
|
19784
|
-
const [state, setState] = (0,
|
|
19965
|
+
const [state, setState] = (0, import_react60.useState)(props.value);
|
|
19785
19966
|
return /* @__PURE__ */ jsx4(
|
|
19786
19967
|
import_react_js_cron.Cron,
|
|
19787
19968
|
{
|
|
@@ -19854,10 +20035,10 @@ function TriggerNodeForm({
|
|
|
19854
20035
|
var Form_default7 = TriggerNodeForm;
|
|
19855
20036
|
|
|
19856
20037
|
// src/views/Workflows/Creator/Builder/Nodes/CustomNodes/TriggerNode/Node.tsx
|
|
19857
|
-
var
|
|
20038
|
+
var import_react62 = require("react");
|
|
19858
20039
|
var import_reactflow11 = require("reactflow");
|
|
19859
20040
|
function TriggerNode(node2) {
|
|
19860
|
-
const [isHovered, setIsHovered] = (0,
|
|
20041
|
+
const [isHovered, setIsHovered] = (0, import_react62.useState)(false);
|
|
19861
20042
|
const {
|
|
19862
20043
|
goToAddTask,
|
|
19863
20044
|
removeTrigger,
|
|
@@ -19912,11 +20093,11 @@ function TriggerNode(node2) {
|
|
|
19912
20093
|
}
|
|
19913
20094
|
);
|
|
19914
20095
|
}
|
|
19915
|
-
var Node_default6 = (0,
|
|
20096
|
+
var Node_default6 = (0, import_react62.memo)(TriggerNode);
|
|
19916
20097
|
|
|
19917
20098
|
// src/views/Workflows/Creator/Builder/Controls/CustomControls.tsx
|
|
19918
|
-
var
|
|
19919
|
-
var
|
|
20099
|
+
var import_react82 = require("react");
|
|
20100
|
+
var import_react_router_dom10 = require("react-router-dom");
|
|
19920
20101
|
var import_reactflow12 = require("reactflow");
|
|
19921
20102
|
var import_design_system_icons26 = require("@livechat/design-system-icons");
|
|
19922
20103
|
var import_design_system_react_components58 = require("@livechat/design-system-react-components");
|
|
@@ -20048,12 +20229,12 @@ function StopGenerateButton() {
|
|
|
20048
20229
|
}
|
|
20049
20230
|
|
|
20050
20231
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20051
|
-
var
|
|
20232
|
+
var import_react66 = require("react");
|
|
20052
20233
|
var import_LexicalComposerContext3 = require("@lexical/react/LexicalComposerContext");
|
|
20053
20234
|
var import_design_system_react_components45 = require("@livechat/design-system-react-components");
|
|
20054
20235
|
|
|
20055
20236
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20056
|
-
var
|
|
20237
|
+
var import_react64 = require("react");
|
|
20057
20238
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
20058
20239
|
|
|
20059
20240
|
// src/views/Workflows/Common/One/widget/message-box/constants.ts
|
|
@@ -20062,8 +20243,8 @@ var ONE_CHARACTER_LIMIT = 1e4;
|
|
|
20062
20243
|
// src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
|
|
20063
20244
|
var useAboveCharacterLimit = () => {
|
|
20064
20245
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
20065
|
-
const [aboveLimit, setAboveLimit] = (0,
|
|
20066
|
-
(0,
|
|
20246
|
+
const [aboveLimit, setAboveLimit] = (0, import_react64.useState)(0);
|
|
20247
|
+
(0, import_react64.useEffect)(() => {
|
|
20067
20248
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20068
20249
|
(textContent) => {
|
|
20069
20250
|
setAboveLimit(textContent.length - ONE_CHARACTER_LIMIT);
|
|
@@ -20080,13 +20261,13 @@ var useAboveCharacterLimit = () => {
|
|
|
20080
20261
|
};
|
|
20081
20262
|
|
|
20082
20263
|
// src/views/Workflows/Common/One/hooks/useSendOneMessage.ts
|
|
20083
|
-
var
|
|
20264
|
+
var import_react65 = require("react");
|
|
20084
20265
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
20085
20266
|
var import_lexical = require("lexical");
|
|
20086
20267
|
var useSendOneMessage = () => {
|
|
20087
20268
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
20088
|
-
const { sendMessage: sendMessage2 } = (0,
|
|
20089
|
-
const onSend = (0,
|
|
20269
|
+
const { sendMessage: sendMessage2 } = (0, import_react65.useContext)(OneMessagesContext);
|
|
20270
|
+
const onSend = (0, import_react65.useCallback)(() => {
|
|
20090
20271
|
var _a;
|
|
20091
20272
|
const messageToSend = (_a = editor.getRootElement()) == null ? void 0 : _a.innerText.trim();
|
|
20092
20273
|
if (!messageToSend) {
|
|
@@ -20100,12 +20281,12 @@ var useSendOneMessage = () => {
|
|
|
20100
20281
|
|
|
20101
20282
|
// src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
|
|
20102
20283
|
function AskButton() {
|
|
20103
|
-
const [isDisabled, setIsDisabled] = (0,
|
|
20284
|
+
const [isDisabled, setIsDisabled] = (0, import_react66.useState)(true);
|
|
20104
20285
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
20105
20286
|
const isLoading = false;
|
|
20106
20287
|
const { isAboveLimit } = useAboveCharacterLimit();
|
|
20107
20288
|
const handleSend = useSendOneMessage();
|
|
20108
|
-
(0,
|
|
20289
|
+
(0, import_react66.useEffect)(() => {
|
|
20109
20290
|
const registerTextContentListener = editor.registerTextContentListener(
|
|
20110
20291
|
(textContent) => {
|
|
20111
20292
|
setIsDisabled(!textContent);
|
|
@@ -20179,34 +20360,34 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
20179
20360
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
20180
20361
|
|
|
20181
20362
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/AutoFocusPlugin.tsx
|
|
20182
|
-
var
|
|
20363
|
+
var import_react67 = require("react");
|
|
20183
20364
|
var import_LexicalComposerContext4 = require("@lexical/react/LexicalComposerContext");
|
|
20184
20365
|
function AutoFocusPlugin() {
|
|
20185
20366
|
const [editor] = (0, import_LexicalComposerContext4.useLexicalComposerContext)();
|
|
20186
|
-
const handleFocus = (0,
|
|
20367
|
+
const handleFocus = (0, import_react67.useCallback)(() => {
|
|
20187
20368
|
editor.focus();
|
|
20188
20369
|
}, [editor]);
|
|
20189
|
-
(0,
|
|
20370
|
+
(0, import_react67.useEffect)(() => {
|
|
20190
20371
|
handleFocus();
|
|
20191
20372
|
}, []);
|
|
20192
20373
|
return null;
|
|
20193
20374
|
}
|
|
20194
20375
|
|
|
20195
20376
|
// src/views/Workflows/Common/One/widget/message-box/custom-plugins/EnterDownPlugin.tsx
|
|
20196
|
-
var
|
|
20377
|
+
var import_react68 = require("react");
|
|
20197
20378
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
20198
20379
|
var import_lexical2 = require("lexical");
|
|
20199
20380
|
function EnterDownPlugin({ isCommandMenuVisibleRef }) {
|
|
20200
20381
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
20201
20382
|
const isLoading = false;
|
|
20202
20383
|
const handleSendMessage = useSendOneMessage();
|
|
20203
|
-
const onEnterDown = (0,
|
|
20384
|
+
const onEnterDown = (0, import_react68.useCallback)(() => {
|
|
20204
20385
|
if (isLoading || (isCommandMenuVisibleRef == null ? void 0 : isCommandMenuVisibleRef.current)) {
|
|
20205
20386
|
return;
|
|
20206
20387
|
}
|
|
20207
20388
|
handleSendMessage({ enter: true, messageBox: true });
|
|
20208
20389
|
}, [handleSendMessage, isLoading, isCommandMenuVisibleRef]);
|
|
20209
|
-
(0,
|
|
20390
|
+
(0, import_react68.useEffect)(
|
|
20210
20391
|
() => editor.registerCommand(
|
|
20211
20392
|
import_lexical2.KEY_ENTER_COMMAND,
|
|
20212
20393
|
(event) => {
|
|
@@ -20267,10 +20448,10 @@ function OneMessageBox() {
|
|
|
20267
20448
|
}
|
|
20268
20449
|
|
|
20269
20450
|
// src/views/Workflows/Common/One/widget/OneChatFeedContent.tsx
|
|
20270
|
-
var
|
|
20451
|
+
var import_react81 = require("react");
|
|
20271
20452
|
|
|
20272
20453
|
// src/views/Workflows/Common/One/hooks/useScroll.ts
|
|
20273
|
-
var
|
|
20454
|
+
var import_react69 = require("react");
|
|
20274
20455
|
var import_lodash4 = __toESM(require("lodash.debounce"));
|
|
20275
20456
|
var useScroll = ({
|
|
20276
20457
|
oneChatFeedRef,
|
|
@@ -20278,10 +20459,10 @@ var useScroll = ({
|
|
|
20278
20459
|
additionalEvents
|
|
20279
20460
|
}) => {
|
|
20280
20461
|
const oneScrollPosition = 0;
|
|
20281
|
-
const currentScrollPosition = (0,
|
|
20282
|
-
const isScrolledToBottom = (0,
|
|
20283
|
-
const timeoutRef = (0,
|
|
20284
|
-
const scrollToBottom = (0,
|
|
20462
|
+
const currentScrollPosition = (0, import_react69.useRef)(null);
|
|
20463
|
+
const isScrolledToBottom = (0, import_react69.useRef)(true);
|
|
20464
|
+
const timeoutRef = (0, import_react69.useRef)(null);
|
|
20465
|
+
const scrollToBottom = (0, import_react69.useCallback)(() => {
|
|
20285
20466
|
if (timeoutRef.current) {
|
|
20286
20467
|
clearTimeout(timeoutRef.current);
|
|
20287
20468
|
}
|
|
@@ -20297,7 +20478,7 @@ var useScroll = ({
|
|
|
20297
20478
|
}
|
|
20298
20479
|
};
|
|
20299
20480
|
}, []);
|
|
20300
|
-
(0,
|
|
20481
|
+
(0, import_react69.useEffect)(() => {
|
|
20301
20482
|
var _a;
|
|
20302
20483
|
if (!oneScrollPosition) {
|
|
20303
20484
|
scrollToBottom();
|
|
@@ -20306,12 +20487,12 @@ var useScroll = ({
|
|
|
20306
20487
|
(_a = oneChatFeedRef.current) == null ? void 0 : _a.scrollTo({ top: oneScrollPosition });
|
|
20307
20488
|
currentScrollPosition.current = oneScrollPosition;
|
|
20308
20489
|
}, []);
|
|
20309
|
-
(0,
|
|
20490
|
+
(0, import_react69.useEffect)(() => {
|
|
20310
20491
|
if (additionalEvents && isScrolledToBottom.current) {
|
|
20311
20492
|
scrollToBottom();
|
|
20312
20493
|
}
|
|
20313
20494
|
}, [scrollToBottom, additionalEvents]);
|
|
20314
|
-
(0,
|
|
20495
|
+
(0, import_react69.useEffect)(() => {
|
|
20315
20496
|
const [lastGroupEvent] = groupedEvents.slice(-1)[0];
|
|
20316
20497
|
const isLastMessageFromAgent = lastGroupEvent.authorType === "agent" /* Agent */;
|
|
20317
20498
|
if (isLastMessageFromAgent || isScrolledToBottom.current) {
|
|
@@ -20871,7 +21052,7 @@ function OneErrorEvent({ eventId }) {
|
|
|
20871
21052
|
}
|
|
20872
21053
|
|
|
20873
21054
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
20874
|
-
var
|
|
21055
|
+
var import_react73 = require("react");
|
|
20875
21056
|
|
|
20876
21057
|
// src/views/Workflows/Common/One/components/SkeletonLine.tsx
|
|
20877
21058
|
var import_design_system_react_components49 = require("@livechat/design-system-react-components");
|
|
@@ -20934,8 +21115,8 @@ function SkeletonLine({
|
|
|
20934
21115
|
|
|
20935
21116
|
// src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
|
|
20936
21117
|
function OneImageEvent({ imageUrl }) {
|
|
20937
|
-
const [isLoaded, setIsLoaded] = (0,
|
|
20938
|
-
(0,
|
|
21118
|
+
const [isLoaded, setIsLoaded] = (0, import_react73.useState)(false);
|
|
21119
|
+
(0, import_react73.useEffect)(() => {
|
|
20939
21120
|
const image = new Image();
|
|
20940
21121
|
image.src = imageUrl;
|
|
20941
21122
|
image.onload = () => {
|
|
@@ -20957,7 +21138,7 @@ function OneImageEvent({ imageUrl }) {
|
|
|
20957
21138
|
}
|
|
20958
21139
|
|
|
20959
21140
|
// src/views/Workflows/Common/One/components/TypingIndicator.tsx
|
|
20960
|
-
var
|
|
21141
|
+
var import_react74 = require("react");
|
|
20961
21142
|
var import_design_system_react_components50 = require("@livechat/design-system-react-components");
|
|
20962
21143
|
var typingAnimation = keyframes`
|
|
20963
21144
|
0% {
|
|
@@ -20998,7 +21179,7 @@ var typingIndicator2 = css`
|
|
|
20998
21179
|
}
|
|
20999
21180
|
}
|
|
21000
21181
|
`;
|
|
21001
|
-
var TypingIndicator = (0,
|
|
21182
|
+
var TypingIndicator = (0, import_react74.memo)(function TypingIndicatorInner() {
|
|
21002
21183
|
return /* @__PURE__ */ jsxs2("div", { css: typingIndicator2, "data-test": "typing-indicator", children: [
|
|
21003
21184
|
/* @__PURE__ */ jsx4("span", {}),
|
|
21004
21185
|
/* @__PURE__ */ jsx4("span", {}),
|
|
@@ -21018,10 +21199,10 @@ var import_design_system_react_components55 = require("@livechat/design-system-r
|
|
|
21018
21199
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
21019
21200
|
|
|
21020
21201
|
// src/views/Workflows/Common/One/widget/events/OneLinkWithTooltip.tsx
|
|
21021
|
-
var
|
|
21202
|
+
var import_react_router_dom8 = require("react-router-dom");
|
|
21022
21203
|
var import_design_system_react_components51 = require("@livechat/design-system-react-components");
|
|
21023
21204
|
function OneLinkWithTooltip({ children, href }) {
|
|
21024
|
-
const trigger = href ? /* @__PURE__ */ jsx4(
|
|
21205
|
+
const trigger = href ? /* @__PURE__ */ jsx4(import_react_router_dom8.Link, { css: linkTrigger, to: href, children }) : /* @__PURE__ */ jsx4("span", { css: linkTrigger, children });
|
|
21025
21206
|
return /* @__PURE__ */ jsx4(
|
|
21026
21207
|
import_design_system_react_components51.Tooltip,
|
|
21027
21208
|
{
|
|
@@ -21086,7 +21267,7 @@ var MarkdownEventRenderer = ({ children }) => /* @__PURE__ */ jsx4(
|
|
|
21086
21267
|
);
|
|
21087
21268
|
|
|
21088
21269
|
// src/views/Workflows/Common/One/components/NavigateButton.tsx
|
|
21089
|
-
var
|
|
21270
|
+
var import_react_router_dom9 = require("react-router-dom");
|
|
21090
21271
|
var import_design_system_icons22 = require("@livechat/design-system-icons");
|
|
21091
21272
|
var import_design_system_react_components52 = require("@livechat/design-system-react-components");
|
|
21092
21273
|
var navigateButtonCss = css`
|
|
@@ -21104,7 +21285,7 @@ function NavigateButton({
|
|
|
21104
21285
|
kind,
|
|
21105
21286
|
iconPosition
|
|
21106
21287
|
}) {
|
|
21107
|
-
const navigate = (0,
|
|
21288
|
+
const navigate = (0, import_react_router_dom9.useNavigate)();
|
|
21108
21289
|
const handleButtonClick = () => {
|
|
21109
21290
|
if (isExternal) {
|
|
21110
21291
|
window.open(url, "_blank");
|
|
@@ -21129,13 +21310,13 @@ function NavigateButton({
|
|
|
21129
21310
|
}
|
|
21130
21311
|
|
|
21131
21312
|
// src/views/Workflows/Common/One/widget/events/OneAssistantMessageBottomBar.tsx
|
|
21132
|
-
var
|
|
21313
|
+
var import_react80 = require("react");
|
|
21133
21314
|
var import_design_system_icons24 = require("@livechat/design-system-icons");
|
|
21134
21315
|
var import_design_system_react_components54 = require("@livechat/design-system-react-components");
|
|
21135
21316
|
var import_developer_studio_ui_react24 = require("@livechat/developer-studio-ui-react");
|
|
21136
21317
|
|
|
21137
21318
|
// src/views/Workflows/Common/One/components/ApplyWorkflowButton.tsx
|
|
21138
|
-
var
|
|
21319
|
+
var import_react78 = require("react");
|
|
21139
21320
|
var import_design_system_icons23 = require("@livechat/design-system-icons");
|
|
21140
21321
|
var import_design_system_react_components53 = require("@livechat/design-system-react-components");
|
|
21141
21322
|
var buttonCss = css`
|
|
@@ -21147,7 +21328,7 @@ function ApplyWorkflowButton({
|
|
|
21147
21328
|
updateWorkflow,
|
|
21148
21329
|
previewWorkflow
|
|
21149
21330
|
}) {
|
|
21150
|
-
const [isApplied, setIsApplied] = (0,
|
|
21331
|
+
const [isApplied, setIsApplied] = (0, import_react78.useState)(false);
|
|
21151
21332
|
const workflowExtraction = extractWorkflowFromEvent(event);
|
|
21152
21333
|
const isEditingWorkflow = false;
|
|
21153
21334
|
const applyWorkflow = () => {
|
|
@@ -21217,7 +21398,7 @@ function OneAssistantMessageBottomBar({
|
|
|
21217
21398
|
previewWorkflow
|
|
21218
21399
|
}) {
|
|
21219
21400
|
var _a, _b, _c;
|
|
21220
|
-
const [isSourcesVisible, setIsSourcesVisible] = (0,
|
|
21401
|
+
const [isSourcesVisible, setIsSourcesVisible] = (0, import_react80.useState)(false);
|
|
21221
21402
|
const toggleIsSourcesVisible = () => {
|
|
21222
21403
|
setIsSourcesVisible((prev2) => !prev2);
|
|
21223
21404
|
};
|
|
@@ -21517,7 +21698,7 @@ function OneChatFeedContent({
|
|
|
21517
21698
|
updateWorkflow,
|
|
21518
21699
|
previewWorkflow
|
|
21519
21700
|
}) {
|
|
21520
|
-
const oneChatFeedRef = (0,
|
|
21701
|
+
const oneChatFeedRef = (0, import_react81.useRef)(null);
|
|
21521
21702
|
const { groupedEvents, hasAdditionalEvents } = useOneMessagesContext();
|
|
21522
21703
|
const { handleScroll } = useScroll({
|
|
21523
21704
|
oneChatFeedRef,
|
|
@@ -21612,15 +21793,15 @@ function CustomControls({
|
|
|
21612
21793
|
previewWorkflow
|
|
21613
21794
|
}) {
|
|
21614
21795
|
var _a;
|
|
21615
|
-
const navigate = (0,
|
|
21796
|
+
const navigate = (0, import_react_router_dom10.useNavigate)();
|
|
21616
21797
|
const { fitView, zoomIn, zoomOut } = (0, import_reactflow12.useReactFlow)();
|
|
21617
21798
|
const { toggleOneWidget, isOpen } = useOneWidgetContext();
|
|
21618
21799
|
const {
|
|
21619
21800
|
state: { visibility },
|
|
21620
21801
|
focus
|
|
21621
21802
|
} = useWorkflowCreator();
|
|
21622
|
-
const location = (0,
|
|
21623
|
-
(0,
|
|
21803
|
+
const location = (0, import_react_router_dom10.useLocation)();
|
|
21804
|
+
(0, import_react82.useEffect)(() => {
|
|
21624
21805
|
var _a2;
|
|
21625
21806
|
if ((_a2 = location.state) == null ? void 0 : _a2.openOne) {
|
|
21626
21807
|
if (!isOpen) {
|
|
@@ -21725,8 +21906,8 @@ function CustomControls({
|
|
|
21725
21906
|
var CustomControls_default = CustomControls;
|
|
21726
21907
|
|
|
21727
21908
|
// src/views/Workflows/Creator/Builder/Controls/SwitcherControls.tsx
|
|
21728
|
-
var
|
|
21729
|
-
var
|
|
21909
|
+
var import_react84 = require("react");
|
|
21910
|
+
var import_react_router_dom11 = require("react-router-dom");
|
|
21730
21911
|
var import_reactflow13 = require("reactflow");
|
|
21731
21912
|
var import_design_system_react_components59 = require("@livechat/design-system-react-components");
|
|
21732
21913
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
@@ -21735,10 +21916,10 @@ function SwitcherControls({
|
|
|
21735
21916
|
hasRelatedWorkflow,
|
|
21736
21917
|
relatedWorkflowId
|
|
21737
21918
|
}) {
|
|
21738
|
-
const [currentView, setCurrentView] = (0,
|
|
21919
|
+
const [currentView, setCurrentView] = (0, import_react84.useState)(
|
|
21739
21920
|
isDraft ? "draft" : "published"
|
|
21740
21921
|
);
|
|
21741
|
-
const navigate = (0,
|
|
21922
|
+
const navigate = (0, import_react_router_dom11.useNavigate)();
|
|
21742
21923
|
const {
|
|
21743
21924
|
focus,
|
|
21744
21925
|
state: { visibility }
|
|
@@ -22260,13 +22441,13 @@ function WorkflowBuilder() {
|
|
|
22260
22441
|
[]
|
|
22261
22442
|
);
|
|
22262
22443
|
const [edges, setEdges, onEdgesChange] = (0, import_reactflow16.useEdgesState)([]);
|
|
22263
|
-
const onConnect = (0,
|
|
22444
|
+
const onConnect = (0, import_react86.useCallback)(
|
|
22264
22445
|
(params) => {
|
|
22265
22446
|
setEdges((eds) => (0, import_reactflow16.addEdge)(params, eds));
|
|
22266
22447
|
},
|
|
22267
22448
|
[setEdges]
|
|
22268
22449
|
);
|
|
22269
|
-
(0,
|
|
22450
|
+
(0, import_react86.useEffect)(() => {
|
|
22270
22451
|
void (() => __async(this, null, function* () {
|
|
22271
22452
|
const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(
|
|
22272
22453
|
workflow
|
|
@@ -22398,8 +22579,8 @@ function PreviewWorkflowModal({
|
|
|
22398
22579
|
onApply,
|
|
22399
22580
|
onClose
|
|
22400
22581
|
}) {
|
|
22401
|
-
const navigate = (0,
|
|
22402
|
-
const handleClose = (0,
|
|
22582
|
+
const navigate = (0, import_react_router_dom12.useNavigate)();
|
|
22583
|
+
const handleClose = (0, import_react87.useCallback)(
|
|
22403
22584
|
(target) => {
|
|
22404
22585
|
if (onClose) {
|
|
22405
22586
|
onClose();
|
|
@@ -22413,7 +22594,7 @@ function PreviewWorkflowModal({
|
|
|
22413
22594
|
},
|
|
22414
22595
|
[onClose, navigate]
|
|
22415
22596
|
);
|
|
22416
|
-
const handleApply = (0,
|
|
22597
|
+
const handleApply = (0, import_react87.useCallback)(() => {
|
|
22417
22598
|
if (onApply) {
|
|
22418
22599
|
onApply();
|
|
22419
22600
|
}
|
|
@@ -22499,40 +22680,57 @@ function PublishWorkflowModal({
|
|
|
22499
22680
|
},
|
|
22500
22681
|
publishDraft
|
|
22501
22682
|
} = useWorkflowCreator();
|
|
22502
|
-
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22503
|
-
|
|
22683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22684
|
+
import_design_system_react_components64.Modal,
|
|
22504
22685
|
{
|
|
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,
|
|
22686
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.wrapper,
|
|
22687
|
+
heading: true,
|
|
22688
|
+
onClose,
|
|
22689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22690
|
+
import_developer_studio_ui_react28.ActionModalContent,
|
|
22522
22691
|
{
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22692
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
|
|
22693
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22694
|
+
import_design_system_react_components64.Button,
|
|
22695
|
+
{
|
|
22696
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.cancelButton,
|
|
22697
|
+
kind: "secondary",
|
|
22698
|
+
onClick: onClose,
|
|
22699
|
+
children: "Cancel"
|
|
22700
|
+
}
|
|
22701
|
+
),
|
|
22702
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22703
|
+
import_design_system_react_components64.Button,
|
|
22704
|
+
{
|
|
22705
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.saveButton,
|
|
22706
|
+
kind: "primary",
|
|
22707
|
+
loading: isPublishing,
|
|
22708
|
+
onClick: () => void publishDraft({
|
|
22709
|
+
confirmed: true
|
|
22710
|
+
}),
|
|
22711
|
+
children: "Publish workflow"
|
|
22712
|
+
}
|
|
22713
|
+
)
|
|
22714
|
+
] }),
|
|
22715
|
+
heading: "You are publishing a workflow",
|
|
22716
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22717
|
+
import_design_system_react_components64.Icon,
|
|
22718
|
+
{
|
|
22719
|
+
customColor: `var(${import_design_system_react_components64.DesignToken.ContentBasicDisabled})`,
|
|
22720
|
+
size: "xxlarge",
|
|
22721
|
+
source: import_design_system_icons27.Error
|
|
22722
|
+
}
|
|
22723
|
+
),
|
|
22724
|
+
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22526
22725
|
}
|
|
22527
|
-
)
|
|
22528
|
-
children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
|
|
22726
|
+
)
|
|
22529
22727
|
}
|
|
22530
|
-
)
|
|
22728
|
+
);
|
|
22531
22729
|
}
|
|
22532
22730
|
|
|
22533
22731
|
// src/views/Workflows/Creator/View.tsx
|
|
22534
|
-
var
|
|
22535
|
-
var
|
|
22732
|
+
var import_react95 = require("react");
|
|
22733
|
+
var import_react_router_dom17 = require("react-router-dom");
|
|
22536
22734
|
var import_reactflow17 = require("reactflow");
|
|
22537
22735
|
var import_design_system_react_components71 = require("@livechat/design-system-react-components");
|
|
22538
22736
|
|
|
@@ -22542,10 +22740,10 @@ var sendMessage = (type) => {
|
|
|
22542
22740
|
};
|
|
22543
22741
|
|
|
22544
22742
|
// src/views/Workflows/Creator/Panels/Details/index.tsx
|
|
22545
|
-
var
|
|
22743
|
+
var import_react_router_dom14 = require("react-router-dom");
|
|
22546
22744
|
|
|
22547
22745
|
// src/views/Workflows/Creator/Panels/Details/Panel.tsx
|
|
22548
|
-
var
|
|
22746
|
+
var import_react_router_dom13 = require("react-router-dom");
|
|
22549
22747
|
var import_design_system_icons29 = require("@livechat/design-system-icons");
|
|
22550
22748
|
var import_design_system_react_components67 = require("@livechat/design-system-react-components");
|
|
22551
22749
|
var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22553,6 +22751,7 @@ var import_developer_studio_ui_react31 = require("@livechat/developer-studio-ui-
|
|
|
22553
22751
|
// src/views/Workflows/Creator/Panels/Details/Executions/List.tsx
|
|
22554
22752
|
var import_design_system_icons28 = require("@livechat/design-system-icons");
|
|
22555
22753
|
var import_design_system_react_components65 = require("@livechat/design-system-react-components");
|
|
22754
|
+
var import_developer_studio_api27 = require("@livechat/developer-studio-api");
|
|
22556
22755
|
var import_developer_studio_ui_react29 = require("@livechat/developer-studio-ui-react");
|
|
22557
22756
|
var tableCss = css`
|
|
22558
22757
|
font-size: 13px;
|
|
@@ -22586,22 +22785,18 @@ function WorkflowExecutionList({
|
|
|
22586
22785
|
/* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react29.formatUSADate)(execution.started_at) }),
|
|
22587
22786
|
/* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react29.formatUSADate)(execution.ended_at) }),
|
|
22588
22787
|
/* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
|
|
22589
|
-
import_design_system_react_components65.
|
|
22788
|
+
import_design_system_react_components65.Tag,
|
|
22590
22789
|
{
|
|
22591
|
-
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
|
|
22596
|
-
|
|
22597
|
-
|
|
22598
|
-
|
|
22599
|
-
|
|
22600
|
-
|
|
22601
|
-
}
|
|
22602
|
-
),
|
|
22603
|
-
execution.status
|
|
22604
|
-
] })
|
|
22790
|
+
kind: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? "success" : "error",
|
|
22791
|
+
leftNode: /* @__PURE__ */ jsx4(
|
|
22792
|
+
import_design_system_react_components65.Icon,
|
|
22793
|
+
{
|
|
22794
|
+
size: "small",
|
|
22795
|
+
source: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? import_design_system_icons28.CheckCircle : import_design_system_icons28.CloseCircle
|
|
22796
|
+
}
|
|
22797
|
+
),
|
|
22798
|
+
size: "small",
|
|
22799
|
+
children: execution.status
|
|
22605
22800
|
}
|
|
22606
22801
|
) })
|
|
22607
22802
|
] }, execution.id)) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
|
|
@@ -22699,8 +22894,8 @@ function WorkflowDetailsPanel({
|
|
|
22699
22894
|
onClose
|
|
22700
22895
|
}) {
|
|
22701
22896
|
var _a, _b, _c, _d, _e;
|
|
22702
|
-
const navigate = (0,
|
|
22703
|
-
const { id, tab } = (0,
|
|
22897
|
+
const navigate = (0, import_react_router_dom13.useNavigate)();
|
|
22898
|
+
const { id, tab } = (0, import_react_router_dom13.useParams)();
|
|
22704
22899
|
const workflowQuery = useFetchWorkflow(id);
|
|
22705
22900
|
const workflowExecutionsQuery = useFetchWorkflowExecutionList(id);
|
|
22706
22901
|
const relatedWorkflowQuery = useFetchWorkflow(
|
|
@@ -22801,10 +22996,10 @@ function WorkflowDetails({
|
|
|
22801
22996
|
onClose,
|
|
22802
22997
|
headerType
|
|
22803
22998
|
}) {
|
|
22804
|
-
return /* @__PURE__ */ jsxs2(
|
|
22805
|
-
/* @__PURE__ */ jsx4(
|
|
22999
|
+
return /* @__PURE__ */ jsxs2(import_react_router_dom14.Routes, { children: [
|
|
23000
|
+
/* @__PURE__ */ jsx4(import_react_router_dom14.Route, { element: /* @__PURE__ */ jsx4(import_react_router_dom14.Navigate, { replace: true, to: "info" }), path: "" }),
|
|
22806
23001
|
/* @__PURE__ */ jsx4(
|
|
22807
|
-
|
|
23002
|
+
import_react_router_dom14.Route,
|
|
22808
23003
|
{
|
|
22809
23004
|
element: /* @__PURE__ */ jsx4(Panel_default, { headerType, onClose }),
|
|
22810
23005
|
path: ":tab/*"
|
|
@@ -22814,9 +23009,9 @@ function WorkflowDetails({
|
|
|
22814
23009
|
}
|
|
22815
23010
|
|
|
22816
23011
|
// src/views/Workflows/Creator/Panels/Editor/Panel.tsx
|
|
22817
|
-
var
|
|
22818
|
-
var
|
|
22819
|
-
var
|
|
23012
|
+
var import_react90 = require("react");
|
|
23013
|
+
var import_react_router_dom15 = require("react-router-dom");
|
|
23014
|
+
var import_react91 = require("@monaco-editor/react");
|
|
22820
23015
|
var import_design_system_icons30 = require("@livechat/design-system-icons");
|
|
22821
23016
|
var import_design_system_react_components68 = require("@livechat/design-system-react-components");
|
|
22822
23017
|
var import_developer_studio_ui_react32 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22842,15 +23037,15 @@ function configureMonaco(monaco) {
|
|
|
22842
23037
|
});
|
|
22843
23038
|
}
|
|
22844
23039
|
function WorkflowEditorPanel({ onClose }) {
|
|
22845
|
-
const navigate = (0,
|
|
23040
|
+
const navigate = (0, import_react_router_dom15.useNavigate)();
|
|
22846
23041
|
const {
|
|
22847
23042
|
state: { workflow },
|
|
22848
23043
|
replaceWorkflow,
|
|
22849
23044
|
focus
|
|
22850
23045
|
} = useWorkflowCreator();
|
|
22851
|
-
const editorRef = (0,
|
|
22852
|
-
const [, setIsModified] = (0,
|
|
22853
|
-
const [, setJsonErrors] = (0,
|
|
23046
|
+
const editorRef = (0, import_react90.useRef)();
|
|
23047
|
+
const [, setIsModified] = (0, import_react90.useState)(false);
|
|
23048
|
+
const [, setJsonErrors] = (0, import_react90.useState)([]);
|
|
22854
23049
|
const filteredWorkflow = {
|
|
22855
23050
|
definition: workflow.definition,
|
|
22856
23051
|
trigger: workflow.trigger
|
|
@@ -22875,7 +23070,7 @@ function WorkflowEditorPanel({ onClose }) {
|
|
|
22875
23070
|
)
|
|
22876
23071
|
] }),
|
|
22877
23072
|
/* @__PURE__ */ jsx4(WorkflowSidebarContent, { children: /* @__PURE__ */ jsx4(
|
|
22878
|
-
|
|
23073
|
+
import_react91.Editor,
|
|
22879
23074
|
{
|
|
22880
23075
|
height: "100%",
|
|
22881
23076
|
language: "json",
|
|
@@ -22918,7 +23113,7 @@ var Panel_default2 = WorkflowEditorPanel;
|
|
|
22918
23113
|
// src/views/Workflows/Creator/Panels/Element/Panel.tsx
|
|
22919
23114
|
var import_design_system_icons31 = require("@livechat/design-system-icons");
|
|
22920
23115
|
var import_design_system_react_components69 = require("@livechat/design-system-react-components");
|
|
22921
|
-
var
|
|
23116
|
+
var import_developer_studio_api28 = require("@livechat/developer-studio-api");
|
|
22922
23117
|
var import_developer_studio_ui_react33 = require("@livechat/developer-studio-ui-react");
|
|
22923
23118
|
var import_styles4 = require("react-js-cron/dist/styles.css");
|
|
22924
23119
|
var formCss = () => css`
|
|
@@ -23076,71 +23271,78 @@ function WorkflowElementPanel() {
|
|
|
23076
23271
|
default:
|
|
23077
23272
|
}
|
|
23078
23273
|
};
|
|
23079
|
-
const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.provider) ===
|
|
23080
|
-
return /* @__PURE__ */ jsxs2(
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23274
|
+
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);
|
|
23275
|
+
return /* @__PURE__ */ jsxs2(
|
|
23276
|
+
Wrapper4,
|
|
23277
|
+
{
|
|
23278
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.element.wrapper,
|
|
23279
|
+
children: [
|
|
23280
|
+
" ",
|
|
23281
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react33.Row, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
|
|
23282
|
+
/* @__PURE__ */ jsx4(
|
|
23283
|
+
Header7,
|
|
23284
|
+
{
|
|
23285
|
+
css: css`
|
|
23086
23286
|
max-width: 85%;
|
|
23087
23287
|
`,
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23288
|
+
children: /* @__PURE__ */ jsxs2(Title7, { children: [
|
|
23289
|
+
(config2 == null ? void 0 : config2.customization.product) ? /* @__PURE__ */ jsx4(
|
|
23290
|
+
ProductIcon_default,
|
|
23291
|
+
{
|
|
23292
|
+
center: true,
|
|
23293
|
+
disabled: false,
|
|
23294
|
+
height: 10,
|
|
23295
|
+
product: config2.customization.provider,
|
|
23296
|
+
revertColors: revertIconColor,
|
|
23297
|
+
width: 10
|
|
23298
|
+
}
|
|
23299
|
+
) : /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
|
|
23300
|
+
import_design_system_react_components69.Icon,
|
|
23301
|
+
{
|
|
23302
|
+
css: css`
|
|
23103
23303
|
width: var(${import_design_system_react_components69.SpacingToken.Spacing6});
|
|
23104
23304
|
`,
|
|
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
|
-
|
|
23305
|
+
size: "xlarge",
|
|
23306
|
+
source: import_design_system_icons31.Automation
|
|
23307
|
+
}
|
|
23308
|
+
) }),
|
|
23309
|
+
/* @__PURE__ */ jsxs2(import_developer_studio_ui_react33.Column, { noFlexBasis: true, notPadded: true, children: [
|
|
23310
|
+
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
23311
|
+
((_d = frame == null ? void 0 : frame.__meta) == null ? void 0 : _d.index) !== void 0 ? `${frame.__meta.index}. ` : "",
|
|
23312
|
+
(_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" : ""
|
|
23313
|
+
] }),
|
|
23314
|
+
(_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" : ""
|
|
23315
|
+
] })
|
|
23316
|
+
] })
|
|
23317
|
+
}
|
|
23318
|
+
),
|
|
23319
|
+
/* @__PURE__ */ jsx4(
|
|
23320
|
+
import_design_system_react_components69.Button,
|
|
23321
|
+
{
|
|
23322
|
+
kind: "plain",
|
|
23323
|
+
onClick: () => {
|
|
23324
|
+
toggle();
|
|
23325
|
+
},
|
|
23326
|
+
children: /* @__PURE__ */ jsx4(import_design_system_react_components69.Icon, { source: import_design_system_icons31.Close })
|
|
23327
|
+
}
|
|
23328
|
+
)
|
|
23329
|
+
] }),
|
|
23330
|
+
/* @__PURE__ */ jsx4(import_developer_studio_ui_react33.Row, { css: formCss, children: contentHandler() })
|
|
23331
|
+
]
|
|
23332
|
+
}
|
|
23333
|
+
);
|
|
23132
23334
|
}
|
|
23133
23335
|
var Panel_default3 = WorkflowElementPanel;
|
|
23134
23336
|
|
|
23135
23337
|
// src/views/Workflows/Creator/Navbar.tsx
|
|
23136
|
-
var
|
|
23137
|
-
var
|
|
23338
|
+
var import_react93 = require("react");
|
|
23339
|
+
var import_react_router_dom16 = require("react-router-dom");
|
|
23138
23340
|
var import_design_system_icons32 = require("@livechat/design-system-icons");
|
|
23139
23341
|
var import_design_system_react_components70 = require("@livechat/design-system-react-components");
|
|
23140
23342
|
var import_developer_studio_ui_react34 = require("@livechat/developer-studio-ui-react");
|
|
23141
23343
|
function WorkflowCreatorNavbar() {
|
|
23142
23344
|
var _a, _b, _c, _d, _e;
|
|
23143
|
-
const navigate = (0,
|
|
23345
|
+
const navigate = (0, import_react_router_dom16.useNavigate)();
|
|
23144
23346
|
const {
|
|
23145
23347
|
state: {
|
|
23146
23348
|
workflow,
|
|
@@ -23153,14 +23355,14 @@ function WorkflowCreatorNavbar() {
|
|
|
23153
23355
|
publishDraft,
|
|
23154
23356
|
toggle
|
|
23155
23357
|
} = useWorkflowCreator();
|
|
23156
|
-
const inputRef = (0,
|
|
23157
|
-
const [isNameChanging, setIsNameChanging] = (0,
|
|
23158
|
-
const [workflowName, setWorkflowName] = (0,
|
|
23358
|
+
const inputRef = (0, import_react93.useRef)(null);
|
|
23359
|
+
const [isNameChanging, setIsNameChanging] = (0, import_react93.useState)(false);
|
|
23360
|
+
const [workflowName, setWorkflowName] = (0, import_react93.useState)(workflow.name);
|
|
23159
23361
|
const { user } = (0, import_developer_studio_ui_react34.useUserContext)();
|
|
23160
23362
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23161
23363
|
user == null ? void 0 : user.meta.email
|
|
23162
23364
|
);
|
|
23163
|
-
(0,
|
|
23365
|
+
(0, import_react93.useEffect)(() => {
|
|
23164
23366
|
setWorkflowName(workflow.name);
|
|
23165
23367
|
}, [workflow.name]);
|
|
23166
23368
|
(0, import_developer_studio_ui_react34.useOnClickOutside)(inputRef, () => {
|
|
@@ -23332,6 +23534,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23332
23534
|
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23333
23535
|
import_design_system_react_components70.Switch,
|
|
23334
23536
|
{
|
|
23537
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.activateSwitch,
|
|
23335
23538
|
on: workflow.active,
|
|
23336
23539
|
onChange: () => void activate(),
|
|
23337
23540
|
size: "medium",
|
|
@@ -23354,7 +23557,15 @@ function WorkflowCreatorNavbar() {
|
|
|
23354
23557
|
workflow.draft ? !workflow.trigger.type || !workflow.definition.tasks.length ? /* @__PURE__ */ jsxs2(
|
|
23355
23558
|
import_design_system_react_components70.Tooltip,
|
|
23356
23559
|
{
|
|
23357
|
-
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23560
|
+
triggerRenderer: /* @__PURE__ */ jsx4(
|
|
23561
|
+
import_design_system_react_components70.Button,
|
|
23562
|
+
{
|
|
23563
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23564
|
+
disabled: true,
|
|
23565
|
+
kind: "primary",
|
|
23566
|
+
children: "Publish"
|
|
23567
|
+
}
|
|
23568
|
+
),
|
|
23358
23569
|
children: [
|
|
23359
23570
|
!workflow.trigger.type && "To publish a workflow, add a trigger.",
|
|
23360
23571
|
!workflow.definition.tasks.length && "To publish a workflow, add at least one task."
|
|
@@ -23363,6 +23574,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23363
23574
|
) : /* @__PURE__ */ jsx4(
|
|
23364
23575
|
import_design_system_react_components70.Button,
|
|
23365
23576
|
{
|
|
23577
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
|
|
23366
23578
|
disabled: !workflow.definition.tasks.length,
|
|
23367
23579
|
kind: "primary",
|
|
23368
23580
|
loading: isPublishing,
|
|
@@ -23377,6 +23589,7 @@ function WorkflowCreatorNavbar() {
|
|
|
23377
23589
|
) : /* @__PURE__ */ jsx4(
|
|
23378
23590
|
import_design_system_react_components70.Button,
|
|
23379
23591
|
{
|
|
23592
|
+
"data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.editButton,
|
|
23380
23593
|
kind: "primary",
|
|
23381
23594
|
loading: isCreating,
|
|
23382
23595
|
onClick: () => {
|
|
@@ -23420,7 +23633,7 @@ function WorkflowCreatorView() {
|
|
|
23420
23633
|
focus
|
|
23421
23634
|
} = useWorkflowCreator();
|
|
23422
23635
|
const { fitView } = (0, import_reactflow17.useReactFlow)();
|
|
23423
|
-
(0,
|
|
23636
|
+
(0, import_react95.useEffect)(() => {
|
|
23424
23637
|
if (getWorkflowsEnv("isLiveChatMode")) {
|
|
23425
23638
|
sendMessage("closeSideNav" /* CloseSideNav */);
|
|
23426
23639
|
const timeoutId = setTimeout(() => {
|
|
@@ -23439,10 +23652,10 @@ function WorkflowCreatorView() {
|
|
|
23439
23652
|
/* @__PURE__ */ jsx4(Navbar_default, {}),
|
|
23440
23653
|
/* @__PURE__ */ jsxs2(WorkflowCreatorContent, { grayBackground: getWorkflowsEnv("isHeadless"), children: [
|
|
23441
23654
|
/* @__PURE__ */ jsx4(Diagram_default, {}),
|
|
23442
|
-
(selection == null ? void 0 : selection.isEditable) ? /* @__PURE__ */ jsx4(Panel_default3, {}) : /* @__PURE__ */ jsxs2(
|
|
23443
|
-
/* @__PURE__ */ jsx4(
|
|
23655
|
+
(selection == null ? void 0 : selection.isEditable) ? /* @__PURE__ */ jsx4(Panel_default3, {}) : /* @__PURE__ */ jsxs2(import_react_router_dom17.Routes, { children: [
|
|
23656
|
+
/* @__PURE__ */ jsx4(import_react_router_dom17.Route, { element: /* @__PURE__ */ jsx4(Panel_default2, {}), path: "editor" }),
|
|
23444
23657
|
/* @__PURE__ */ jsx4(
|
|
23445
|
-
|
|
23658
|
+
import_react_router_dom17.Route,
|
|
23446
23659
|
{
|
|
23447
23660
|
element: /* @__PURE__ */ jsx4(
|
|
23448
23661
|
WorkflowDetails,
|
|
@@ -23464,9 +23677,9 @@ var View_default = WorkflowCreatorView;
|
|
|
23464
23677
|
// src/views/Workflows/Creator/index.tsx
|
|
23465
23678
|
function WorkflowCreator() {
|
|
23466
23679
|
var _a, _b, _c;
|
|
23467
|
-
const location = (0,
|
|
23468
|
-
const { id } = (0,
|
|
23469
|
-
const navigate = (0,
|
|
23680
|
+
const location = (0, import_react_router_dom18.useLocation)();
|
|
23681
|
+
const { id } = (0, import_react_router_dom18.useParams)();
|
|
23682
|
+
const navigate = (0, import_react_router_dom18.useNavigate)();
|
|
23470
23683
|
const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
|
|
23471
23684
|
const credentialsQuery = (0, import_platform_integrations6.useFetchIntegrationCredentialsQuery)();
|
|
23472
23685
|
const organizationProducts = (0, import_developer_studio_ui_react35.useFetchOrganizationProducts)();
|
|
@@ -23488,9 +23701,9 @@ function WorkflowCreator() {
|
|
|
23488
23701
|
}
|
|
23489
23702
|
return /* @__PURE__ */ jsxs2(WorkflowCreatorProvider, { basePath, workflow, children: [
|
|
23490
23703
|
/* @__PURE__ */ jsx4(View_default, {}),
|
|
23491
|
-
/* @__PURE__ */ jsxs2(
|
|
23704
|
+
/* @__PURE__ */ jsxs2(import_react_router_dom18.Routes, { children: [
|
|
23492
23705
|
/* @__PURE__ */ jsx4(
|
|
23493
|
-
|
|
23706
|
+
import_react_router_dom18.Route,
|
|
23494
23707
|
{
|
|
23495
23708
|
element: /* @__PURE__ */ jsx4(
|
|
23496
23709
|
Modal_default2,
|
|
@@ -23505,7 +23718,7 @@ function WorkflowCreator() {
|
|
|
23505
23718
|
}
|
|
23506
23719
|
),
|
|
23507
23720
|
/* @__PURE__ */ jsx4(
|
|
23508
|
-
|
|
23721
|
+
import_react_router_dom18.Route,
|
|
23509
23722
|
{
|
|
23510
23723
|
element: /* @__PURE__ */ jsx4(
|
|
23511
23724
|
Modal_default,
|
|
@@ -23520,7 +23733,7 @@ function WorkflowCreator() {
|
|
|
23520
23733
|
}
|
|
23521
23734
|
),
|
|
23522
23735
|
/* @__PURE__ */ jsx4(
|
|
23523
|
-
|
|
23736
|
+
import_react_router_dom18.Route,
|
|
23524
23737
|
{
|
|
23525
23738
|
element: /* @__PURE__ */ jsx4(
|
|
23526
23739
|
Modal_default3,
|
|
@@ -23535,7 +23748,7 @@ function WorkflowCreator() {
|
|
|
23535
23748
|
}
|
|
23536
23749
|
),
|
|
23537
23750
|
/* @__PURE__ */ jsx4(
|
|
23538
|
-
|
|
23751
|
+
import_react_router_dom18.Route,
|
|
23539
23752
|
{
|
|
23540
23753
|
element: /* @__PURE__ */ jsx4(
|
|
23541
23754
|
PublishWorkflowModal,
|
|
@@ -23549,7 +23762,7 @@ function WorkflowCreator() {
|
|
|
23549
23762
|
}
|
|
23550
23763
|
),
|
|
23551
23764
|
/* @__PURE__ */ jsx4(
|
|
23552
|
-
|
|
23765
|
+
import_react_router_dom18.Route,
|
|
23553
23766
|
{
|
|
23554
23767
|
element: /* @__PURE__ */ jsx4(
|
|
23555
23768
|
EditWorkflowModal,
|
|
@@ -23563,7 +23776,7 @@ function WorkflowCreator() {
|
|
|
23563
23776
|
}
|
|
23564
23777
|
),
|
|
23565
23778
|
/* @__PURE__ */ jsx4(
|
|
23566
|
-
|
|
23779
|
+
import_react_router_dom18.Route,
|
|
23567
23780
|
{
|
|
23568
23781
|
element: /* @__PURE__ */ jsx4(
|
|
23569
23782
|
DeleteWorkflowModal,
|
|
@@ -23578,7 +23791,7 @@ function WorkflowCreator() {
|
|
|
23578
23791
|
}
|
|
23579
23792
|
),
|
|
23580
23793
|
/* @__PURE__ */ jsx4(
|
|
23581
|
-
|
|
23794
|
+
import_react_router_dom18.Route,
|
|
23582
23795
|
{
|
|
23583
23796
|
element: /* @__PURE__ */ jsx4(
|
|
23584
23797
|
DeleteWorkflowModal,
|
|
@@ -23598,19 +23811,19 @@ function WorkflowCreator() {
|
|
|
23598
23811
|
var Creator_default = WorkflowCreator;
|
|
23599
23812
|
|
|
23600
23813
|
// src/views/Workflows/List/index.tsx
|
|
23601
|
-
var
|
|
23814
|
+
var import_react_router_dom28 = require("react-router-dom");
|
|
23602
23815
|
var import_developer_studio_ui_react46 = require("@livechat/developer-studio-ui-react");
|
|
23603
23816
|
|
|
23604
23817
|
// src/views/Workflows/List/Modals/Create/index.tsx
|
|
23605
|
-
var
|
|
23818
|
+
var import_react_router_dom24 = require("react-router-dom");
|
|
23606
23819
|
|
|
23607
23820
|
// src/views/Workflows/List/Modals/PreviewTemplate/index.tsx
|
|
23608
|
-
var
|
|
23609
|
-
var
|
|
23821
|
+
var import_react98 = require("react");
|
|
23822
|
+
var import_react_router_dom20 = require("react-router-dom");
|
|
23610
23823
|
|
|
23611
23824
|
// src/views/Workflows/List/Modals/PreviewTemplate/Modal.tsx
|
|
23612
|
-
var
|
|
23613
|
-
var
|
|
23825
|
+
var import_react96 = require("react");
|
|
23826
|
+
var import_react_router_dom19 = require("react-router-dom");
|
|
23614
23827
|
var import_design_system_icons34 = require("@livechat/design-system-icons");
|
|
23615
23828
|
var import_design_system_react_components73 = require("@livechat/design-system-react-components");
|
|
23616
23829
|
var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-react");
|
|
@@ -23618,15 +23831,15 @@ var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-
|
|
|
23618
23831
|
// src/views/Workflows/Common/Icons/TemplateCategoryIcon.tsx
|
|
23619
23832
|
var import_design_system_icons33 = require("@livechat/design-system-icons");
|
|
23620
23833
|
var import_design_system_react_components72 = require("@livechat/design-system-react-components");
|
|
23621
|
-
var
|
|
23834
|
+
var import_developer_studio_api29 = require("@livechat/developer-studio-api");
|
|
23622
23835
|
var import_developer_studio_ui_react36 = require("@livechat/developer-studio-ui-react");
|
|
23623
23836
|
function WorkflowTemplateCategoryIcon(props) {
|
|
23624
23837
|
const icons = {
|
|
23625
|
-
[
|
|
23626
|
-
[
|
|
23627
|
-
[
|
|
23628
|
-
[
|
|
23629
|
-
[
|
|
23838
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.NotificationAndAlerts]: import_design_system_icons33.Notifications,
|
|
23839
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.SalesManagement]: import_design_system_icons33.CurrencyDollar,
|
|
23840
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.LeadCollection]: import_design_system_icons33.TargetArrow,
|
|
23841
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.ChatManagement]: import_design_system_icons33.ChatDots,
|
|
23842
|
+
[import_developer_studio_api29.WorkflowTemplateCategory.CustomerExperience]: import_design_system_icons33.Smiles
|
|
23630
23843
|
};
|
|
23631
23844
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react36.Row, { gap: `var(${import_design_system_react_components72.SpacingToken.Spacing1})`, noWrap: true, notPadded: true, children: [
|
|
23632
23845
|
/* @__PURE__ */ jsx4(
|
|
@@ -23691,7 +23904,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
23691
23904
|
template,
|
|
23692
23905
|
onClose
|
|
23693
23906
|
}) {
|
|
23694
|
-
const navigate = (0,
|
|
23907
|
+
const navigate = (0, import_react_router_dom19.useNavigate)();
|
|
23695
23908
|
const {
|
|
23696
23909
|
save,
|
|
23697
23910
|
state: {
|
|
@@ -23702,7 +23915,7 @@ function WorkflowTemplatePreviewModal({
|
|
|
23702
23915
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
23703
23916
|
user == null ? void 0 : user.meta.email
|
|
23704
23917
|
);
|
|
23705
|
-
const handleClose = (0,
|
|
23918
|
+
const handleClose = (0, import_react96.useCallback)(
|
|
23706
23919
|
(target) => {
|
|
23707
23920
|
if (onClose) {
|
|
23708
23921
|
onClose();
|
|
@@ -23848,8 +24061,8 @@ function WorkflowTemplatePreview({
|
|
|
23848
24061
|
workflow,
|
|
23849
24062
|
onClose
|
|
23850
24063
|
}) {
|
|
23851
|
-
const flowTemplates = (0,
|
|
23852
|
-
const params = (0,
|
|
24064
|
+
const flowTemplates = (0, import_react98.useMemo)(() => getWorkflowTemplates(), []);
|
|
24065
|
+
const params = (0, import_react_router_dom20.useParams)();
|
|
23853
24066
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
23854
24067
|
const targetWorkflow = workflow || (template == null ? void 0 : template.workflow);
|
|
23855
24068
|
if (!template) {
|
|
@@ -23880,29 +24093,29 @@ function WorkflowTemplatePreview({
|
|
|
23880
24093
|
var PreviewTemplate_default = WorkflowTemplatePreview;
|
|
23881
24094
|
|
|
23882
24095
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
23883
|
-
var
|
|
23884
|
-
var
|
|
24096
|
+
var import_react103 = require("react");
|
|
24097
|
+
var import_react_router_dom23 = require("react-router-dom");
|
|
23885
24098
|
var import_design_system_react_components79 = require("@livechat/design-system-react-components");
|
|
23886
24099
|
|
|
23887
24100
|
// src/views/Workflows/List/Home/Home.tsx
|
|
23888
|
-
var
|
|
24101
|
+
var import_react102 = require("react");
|
|
23889
24102
|
var import_design_system_icons37 = require("@livechat/design-system-icons");
|
|
23890
24103
|
var import_design_system_react_components78 = require("@livechat/design-system-react-components");
|
|
23891
24104
|
var import_developer_studio_ui_react42 = require("@livechat/developer-studio-ui-react");
|
|
23892
24105
|
|
|
23893
24106
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Category.tsx
|
|
23894
|
-
var
|
|
24107
|
+
var import_react99 = require("react");
|
|
23895
24108
|
var import_design_system_icons35 = require("@livechat/design-system-icons");
|
|
23896
24109
|
var import_design_system_react_components74 = require("@livechat/design-system-react-components");
|
|
23897
|
-
var
|
|
24110
|
+
var import_developer_studio_api30 = require("@livechat/developer-studio-api");
|
|
23898
24111
|
var import_developer_studio_ui_react38 = require("@livechat/developer-studio-ui-react");
|
|
23899
24112
|
function WorkflowTemplatesCategoryFilter({
|
|
23900
24113
|
handleStatus,
|
|
23901
24114
|
status
|
|
23902
24115
|
}) {
|
|
23903
24116
|
var _a;
|
|
23904
|
-
const [isVisible, setIsVisible] = (0,
|
|
23905
|
-
const getItem = (0,
|
|
24117
|
+
const [isVisible, setIsVisible] = (0, import_react99.useState)(false);
|
|
24118
|
+
const getItem = (0, import_react99.useCallback)(
|
|
23906
24119
|
(key, category, icon2) => ({
|
|
23907
24120
|
key,
|
|
23908
24121
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react38.Row, { gap: `var(${import_design_system_react_components74.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -23918,11 +24131,11 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
23918
24131
|
);
|
|
23919
24132
|
const options = [
|
|
23920
24133
|
getItem("0", "All"),
|
|
23921
|
-
getItem("1",
|
|
23922
|
-
getItem("2",
|
|
23923
|
-
getItem("3",
|
|
23924
|
-
getItem("4",
|
|
23925
|
-
getItem("5",
|
|
24134
|
+
getItem("1", import_developer_studio_api30.WorkflowTemplateCategory.NotificationAndAlerts, import_design_system_icons35.Notifications),
|
|
24135
|
+
getItem("2", import_developer_studio_api30.WorkflowTemplateCategory.SalesManagement, import_design_system_icons35.CurrencyDollar),
|
|
24136
|
+
getItem("3", import_developer_studio_api30.WorkflowTemplateCategory.LeadCollection, import_design_system_icons35.TargetArrow),
|
|
24137
|
+
getItem("4", import_developer_studio_api30.WorkflowTemplateCategory.ChatManagement, import_design_system_icons35.ChatDots),
|
|
24138
|
+
getItem("5", import_developer_studio_api30.WorkflowTemplateCategory.CustomerExperience, import_design_system_icons35.Smiles)
|
|
23926
24139
|
];
|
|
23927
24140
|
const selectedKey = (_a = options.find(
|
|
23928
24141
|
(option) => option.element.props.children[1] === status
|
|
@@ -23957,18 +24170,18 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
23957
24170
|
var Category_default = WorkflowTemplatesCategoryFilter;
|
|
23958
24171
|
|
|
23959
24172
|
// src/views/Workflows/List/Modals/TemplateList/Filters/Product.tsx
|
|
23960
|
-
var
|
|
24173
|
+
var import_react100 = require("react");
|
|
23961
24174
|
var import_design_system_icons36 = require("@livechat/design-system-icons");
|
|
23962
24175
|
var import_design_system_react_components75 = require("@livechat/design-system-react-components");
|
|
23963
|
-
var
|
|
24176
|
+
var import_developer_studio_api31 = require("@livechat/developer-studio-api");
|
|
23964
24177
|
var import_developer_studio_ui_react39 = require("@livechat/developer-studio-ui-react");
|
|
23965
24178
|
function WorkflowTemplatesProductFilter({
|
|
23966
24179
|
handleStatus,
|
|
23967
24180
|
status
|
|
23968
24181
|
}) {
|
|
23969
24182
|
var _a;
|
|
23970
|
-
const [isVisible, setIsVisible] = (0,
|
|
23971
|
-
const getItem = (0,
|
|
24183
|
+
const [isVisible, setIsVisible] = (0, import_react100.useState)(false);
|
|
24184
|
+
const getItem = (0, import_react100.useCallback)(
|
|
23972
24185
|
(key, product, icon2) => ({
|
|
23973
24186
|
key,
|
|
23974
24187
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react39.Row, { gap: `var(${import_design_system_react_components75.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -23984,11 +24197,11 @@ function WorkflowTemplatesProductFilter({
|
|
|
23984
24197
|
);
|
|
23985
24198
|
const options = [
|
|
23986
24199
|
getItem("0", "All"),
|
|
23987
|
-
getItem("1",
|
|
23988
|
-
getItem("2",
|
|
23989
|
-
getItem("3",
|
|
23990
|
-
getItem("4",
|
|
23991
|
-
getItem("5",
|
|
24200
|
+
getItem("1", import_developer_studio_api31.IntegrationDisplayNames.LiveChat, import_design_system_icons36.LiveChatColored),
|
|
24201
|
+
getItem("2", import_developer_studio_api31.IntegrationDisplayNames.HelpDesk, import_design_system_icons36.HelpDeskColored),
|
|
24202
|
+
getItem("3", import_developer_studio_api31.IntegrationDisplayNames.OpenAI, import_design_system_icons36.Chatgpt),
|
|
24203
|
+
getItem("4", import_developer_studio_api31.IntegrationDisplayNames.Shopify, import_design_system_icons36.ShopifyColored),
|
|
24204
|
+
getItem("5", import_developer_studio_api31.IntegrationDisplayNames.Mailchimp, import_design_system_icons36.Mailchimp)
|
|
23992
24205
|
// getItem('6', IntegrationDisplayNames.Stripe, Stripe),
|
|
23993
24206
|
// getItem('7', IntegrationDisplayNames.GoogleSheets, GoogleSheets),
|
|
23994
24207
|
];
|
|
@@ -24025,7 +24238,7 @@ function WorkflowTemplatesProductFilter({
|
|
|
24025
24238
|
var Product_default = WorkflowTemplatesProductFilter;
|
|
24026
24239
|
|
|
24027
24240
|
// src/views/Workflows/List/Home/Cards/Scratch.tsx
|
|
24028
|
-
var
|
|
24241
|
+
var import_react_router_dom21 = require("react-router-dom");
|
|
24029
24242
|
var import_design_system_react_components76 = require("@livechat/design-system-react-components");
|
|
24030
24243
|
var import_developer_studio_ui_react40 = require("@livechat/developer-studio-ui-react");
|
|
24031
24244
|
function WorkflowScratchCard({
|
|
@@ -24033,7 +24246,7 @@ function WorkflowScratchCard({
|
|
|
24033
24246
|
icon: icon2,
|
|
24034
24247
|
openOne
|
|
24035
24248
|
}) {
|
|
24036
|
-
const navigate = (0,
|
|
24249
|
+
const navigate = (0, import_react_router_dom21.useNavigate)();
|
|
24037
24250
|
const { user } = (0, import_developer_studio_ui_react40.useUserContext)();
|
|
24038
24251
|
const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
|
|
24039
24252
|
user == null ? void 0 : user.meta.email
|
|
@@ -24065,7 +24278,7 @@ function WorkflowScratchCard({
|
|
|
24065
24278
|
var Scratch_default = WorkflowScratchCard;
|
|
24066
24279
|
|
|
24067
24280
|
// src/views/Workflows/List/Home/Cards/Template.tsx
|
|
24068
|
-
var
|
|
24281
|
+
var import_react_router_dom22 = require("react-router-dom");
|
|
24069
24282
|
var import_design_system_react_components77 = require("@livechat/design-system-react-components");
|
|
24070
24283
|
var import_developer_studio_ui_react41 = require("@livechat/developer-studio-ui-react");
|
|
24071
24284
|
var IconWrapper2 = newStyled.div`
|
|
@@ -24083,7 +24296,7 @@ function WorkflowTemplateCard({
|
|
|
24083
24296
|
icons,
|
|
24084
24297
|
category
|
|
24085
24298
|
}) {
|
|
24086
|
-
const navigate = (0,
|
|
24299
|
+
const navigate = (0, import_react_router_dom22.useNavigate)();
|
|
24087
24300
|
return /* @__PURE__ */ jsx4(
|
|
24088
24301
|
import_developer_studio_ui_react41.Card,
|
|
24089
24302
|
{
|
|
@@ -24127,9 +24340,9 @@ var Grid = newStyled.div`
|
|
|
24127
24340
|
gap: var(${import_design_system_react_components78.SpacingToken.Spacing3});
|
|
24128
24341
|
`;
|
|
24129
24342
|
function WorkflowsHome({ isOnModal }) {
|
|
24130
|
-
const [product, setProduct] = (0,
|
|
24131
|
-
const [category, setCategory] = (0,
|
|
24132
|
-
const flowTemplates = (0,
|
|
24343
|
+
const [product, setProduct] = (0, import_react102.useState)("All");
|
|
24344
|
+
const [category, setCategory] = (0, import_react102.useState)("All");
|
|
24345
|
+
const flowTemplates = (0, import_react102.useMemo)(() => getWorkflowTemplates(), []);
|
|
24133
24346
|
const filters = [
|
|
24134
24347
|
(template) => product === "All" || template.products.includes(product),
|
|
24135
24348
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -24231,8 +24444,8 @@ var Home_default = WorkflowsHome;
|
|
|
24231
24444
|
|
|
24232
24445
|
// src/views/Workflows/List/Modals/Create/Modal.tsx
|
|
24233
24446
|
function WorkflowCreateModal({ onClose }) {
|
|
24234
|
-
const navigate = (0,
|
|
24235
|
-
const handleClose = (0,
|
|
24447
|
+
const navigate = (0, import_react_router_dom23.useNavigate)();
|
|
24448
|
+
const handleClose = (0, import_react103.useCallback)(() => {
|
|
24236
24449
|
if (onClose) {
|
|
24237
24450
|
onClose();
|
|
24238
24451
|
return;
|
|
@@ -24259,21 +24472,21 @@ var Modal_default6 = WorkflowCreateModal;
|
|
|
24259
24472
|
function WorkflowCreate() {
|
|
24260
24473
|
return /* @__PURE__ */ jsxs2(Fragment4, { children: [
|
|
24261
24474
|
/* @__PURE__ */ jsx4(Modal_default6, {}),
|
|
24262
|
-
/* @__PURE__ */ jsx4(
|
|
24475
|
+
/* @__PURE__ */ jsx4(import_react_router_dom24.Routes, { children: /* @__PURE__ */ jsx4(import_react_router_dom24.Route, { element: /* @__PURE__ */ jsx4(PreviewTemplate_default, {}), path: "preview/:template" }) })
|
|
24263
24476
|
] });
|
|
24264
24477
|
}
|
|
24265
24478
|
var Create_default = WorkflowCreate;
|
|
24266
24479
|
|
|
24267
24480
|
// src/views/Workflows/List/View.tsx
|
|
24268
|
-
var
|
|
24269
|
-
var
|
|
24481
|
+
var import_react110 = require("react");
|
|
24482
|
+
var import_react_router_dom27 = require("react-router-dom");
|
|
24270
24483
|
var import_design_system_react_components84 = require("@livechat/design-system-react-components");
|
|
24271
|
-
var
|
|
24484
|
+
var import_developer_studio_api33 = require("@livechat/developer-studio-api");
|
|
24272
24485
|
var import_developer_studio_ui_react45 = require("@livechat/developer-studio-ui-react");
|
|
24273
24486
|
|
|
24274
24487
|
// src/views/Workflows/Creator/LiveChatNavbar.tsx
|
|
24275
|
-
var
|
|
24276
|
-
var
|
|
24488
|
+
var import_react105 = require("react");
|
|
24489
|
+
var import_react_router_dom25 = require("react-router-dom");
|
|
24277
24490
|
var import_design_system_icons38 = require("@livechat/design-system-icons");
|
|
24278
24491
|
var import_design_system_react_components80 = require("@livechat/design-system-react-components");
|
|
24279
24492
|
var wrapperCss = (hasData) => css`
|
|
@@ -24291,12 +24504,12 @@ var wrapperCss = (hasData) => css`
|
|
|
24291
24504
|
}`}
|
|
24292
24505
|
`;
|
|
24293
24506
|
function LiveChatNavbar() {
|
|
24294
|
-
const navigate = (0,
|
|
24507
|
+
const navigate = (0, import_react_router_dom25.useNavigate)();
|
|
24295
24508
|
const workflows = useFetchWorkflows({});
|
|
24296
24509
|
const isLoading = workflows.isLoading;
|
|
24297
24510
|
const hasNoData = workflows.isSuccess && workflows.data.length === 0;
|
|
24298
24511
|
const hasData = !isLoading && !hasNoData;
|
|
24299
|
-
const handleClick = (0,
|
|
24512
|
+
const handleClick = (0, import_react105.useCallback)(() => {
|
|
24300
24513
|
sendMessage("toggleSideNav" /* ToggleSideNav */);
|
|
24301
24514
|
}, []);
|
|
24302
24515
|
return /* @__PURE__ */ jsxs2("div", { css: wrapperCss(hasData), children: [
|
|
@@ -24328,7 +24541,7 @@ var import_design_system_react_components83 = require("@livechat/design-system-r
|
|
|
24328
24541
|
var import_developer_studio_ui_react44 = require("@livechat/developer-studio-ui-react");
|
|
24329
24542
|
|
|
24330
24543
|
// src/views/Workflows/List/Grid/Filters/StatusFilter.tsx
|
|
24331
|
-
var
|
|
24544
|
+
var import_react107 = require("react");
|
|
24332
24545
|
var import_design_system_icons39 = require("@livechat/design-system-icons");
|
|
24333
24546
|
var import_design_system_react_components81 = require("@livechat/design-system-react-components");
|
|
24334
24547
|
function WorkflowStatusFilter({
|
|
@@ -24336,7 +24549,7 @@ function WorkflowStatusFilter({
|
|
|
24336
24549
|
status
|
|
24337
24550
|
}) {
|
|
24338
24551
|
var _a;
|
|
24339
|
-
const [isVisible, setIsVisible] = (0,
|
|
24552
|
+
const [isVisible, setIsVisible] = (0, import_react107.useState)(false);
|
|
24340
24553
|
const items = [
|
|
24341
24554
|
{
|
|
24342
24555
|
key: "0",
|
|
@@ -24394,14 +24607,14 @@ function WorkflowStatusFilter({
|
|
|
24394
24607
|
var StatusFilter_default = WorkflowStatusFilter;
|
|
24395
24608
|
|
|
24396
24609
|
// src/views/Workflows/List/Grid/Table.tsx
|
|
24397
|
-
var
|
|
24610
|
+
var import_react_router_dom26 = require("react-router-dom");
|
|
24398
24611
|
var import_design_system_icons40 = require("@livechat/design-system-icons");
|
|
24399
24612
|
var import_design_system_react_components82 = require("@livechat/design-system-react-components");
|
|
24400
|
-
var
|
|
24613
|
+
var import_developer_studio_api32 = require("@livechat/developer-studio-api");
|
|
24401
24614
|
var import_developer_studio_ui_react43 = require("@livechat/developer-studio-ui-react");
|
|
24402
24615
|
function WorkflowsTable({ workflowsQuery, state }) {
|
|
24403
24616
|
var _a, _b, _c;
|
|
24404
|
-
const navigate = (0,
|
|
24617
|
+
const navigate = (0, import_react_router_dom26.useNavigate)();
|
|
24405
24618
|
const notifications = (0, import_developer_studio_ui_react43.useNotificationContext)();
|
|
24406
24619
|
const deleteAction = useDeleteWorkflow();
|
|
24407
24620
|
const activateWorkflowAction = useActivateWorkflow();
|
|
@@ -24462,7 +24675,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
|
|
|
24462
24675
|
) : null
|
|
24463
24676
|
] }) }),
|
|
24464
24677
|
/* @__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() ===
|
|
24678
|
+
const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === import_developer_studio_api32.IntegrationNames.BigCommerce.toLowerCase());
|
|
24466
24679
|
return /* @__PURE__ */ jsx4(
|
|
24467
24680
|
ProductIcon_default,
|
|
24468
24681
|
{
|
|
@@ -24645,8 +24858,8 @@ var markedStyles = css`
|
|
|
24645
24858
|
`;
|
|
24646
24859
|
function WorkflowListView() {
|
|
24647
24860
|
var _a;
|
|
24648
|
-
const navigate = (0,
|
|
24649
|
-
const [state, setState] = (0,
|
|
24861
|
+
const navigate = (0, import_react_router_dom27.useNavigate)();
|
|
24862
|
+
const [state, setState] = (0, import_react110.useState)({
|
|
24650
24863
|
filters: {
|
|
24651
24864
|
status: "All",
|
|
24652
24865
|
tasks: "All"
|
|
@@ -24707,7 +24920,7 @@ function WorkflowListView() {
|
|
|
24707
24920
|
Grid_default,
|
|
24708
24921
|
{
|
|
24709
24922
|
onStateChange: (change) => {
|
|
24710
|
-
setState((prevState) => (0,
|
|
24923
|
+
setState((prevState) => (0, import_developer_studio_api33.mergeDeep)(prevState, change));
|
|
24711
24924
|
},
|
|
24712
24925
|
state,
|
|
24713
24926
|
workflowQuery: workflows
|
|
@@ -24723,10 +24936,10 @@ var View_default2 = WorkflowListView;
|
|
|
24723
24936
|
function WorkflowList() {
|
|
24724
24937
|
return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react46.Row, { noMaxWidth: true, noWrap: true, notPadded: true, stretch: true, children: [
|
|
24725
24938
|
/* @__PURE__ */ jsx4(View_default2, {}),
|
|
24726
|
-
/* @__PURE__ */ jsxs2(
|
|
24727
|
-
/* @__PURE__ */ jsx4(
|
|
24728
|
-
/* @__PURE__ */ jsx4(
|
|
24729
|
-
/* @__PURE__ */ jsx4(
|
|
24939
|
+
/* @__PURE__ */ jsxs2(import_react_router_dom28.Routes, { children: [
|
|
24940
|
+
/* @__PURE__ */ jsx4(import_react_router_dom28.Route, { element: /* @__PURE__ */ jsx4(PreviewTemplate_default, {}), path: "preview/:template" }),
|
|
24941
|
+
/* @__PURE__ */ jsx4(import_react_router_dom28.Route, { element: /* @__PURE__ */ jsx4(Create_default, {}), path: "create/*" }),
|
|
24942
|
+
/* @__PURE__ */ jsx4(import_react_router_dom28.Route, { element: /* @__PURE__ */ jsx4(WorkflowDetails, { headerType: "name" }), path: ":id/*" })
|
|
24730
24943
|
] })
|
|
24731
24944
|
] });
|
|
24732
24945
|
}
|
|
@@ -24735,9 +24948,9 @@ var List_default2 = WorkflowList;
|
|
|
24735
24948
|
// src/views/Workflows/index.tsx
|
|
24736
24949
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
24737
24950
|
function Workflows() {
|
|
24738
|
-
const navigate = (0,
|
|
24951
|
+
const navigate = (0, import_react_router_dom29.useNavigate)();
|
|
24739
24952
|
const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
|
|
24740
|
-
(0,
|
|
24953
|
+
(0, import_react112.useEffect)(() => {
|
|
24741
24954
|
if (isWorkflowAppLoading) {
|
|
24742
24955
|
return;
|
|
24743
24956
|
}
|
|
@@ -24748,10 +24961,10 @@ function Workflows() {
|
|
|
24748
24961
|
if (isWorkflowAppLoading) {
|
|
24749
24962
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_developer_studio_ui_react47.Loader, { stretch: true });
|
|
24750
24963
|
}
|
|
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)(
|
|
24964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_react_router_dom29.Routes, { children: [
|
|
24965
|
+
/* @__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: "" }),
|
|
24966
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_router_dom29.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(List_default2, {}), path: "list/*" }),
|
|
24967
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_react_router_dom29.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Creator_default, {}), path: ":id/*" })
|
|
24755
24968
|
] });
|
|
24756
24969
|
}
|
|
24757
24970
|
var Workflows_default = Workflows;
|
|
@@ -24800,14 +25013,15 @@ var LoginError_default = LoginErrorPage;
|
|
|
24800
25013
|
// src/views/index.tsx
|
|
24801
25014
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
24802
25015
|
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)(
|
|
25016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_react_router_dom30.Routes, { children: [
|
|
25017
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_react_router_dom30.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Workflows_default, {}), path: "*" }),
|
|
25018
|
+
/* @__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
25019
|
] });
|
|
24807
25020
|
}
|
|
24808
25021
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24809
25022
|
0 && (module.exports = {
|
|
24810
25023
|
LoginError,
|
|
25024
|
+
WORKFLOWS_TEST_SELECTORS,
|
|
24811
25025
|
WorkflowsModule,
|
|
24812
25026
|
config,
|
|
24813
25027
|
getWorkflowsEnv,
|