@livechat/platform-workflows 0.0.51 → 0.0.53
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/config/index.d.mts +17 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.js +58 -0
- package/dist/config/index.mjs +34 -0
- package/dist/index.d.mts +9 -10
- package/dist/index.d.ts +9 -10
- package/dist/index.js +33 -56
- package/dist/index.mjs +15 -41
- package/package.json +4 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Config } from '@livechat/developer-studio-ui-react';
|
|
2
|
+
|
|
3
|
+
type WorkflowsConfig = Config & {
|
|
4
|
+
isHeadless: boolean;
|
|
5
|
+
workflowsAppId: string;
|
|
6
|
+
workflowsWebhooksAppId: string;
|
|
7
|
+
aiAgentId: string;
|
|
8
|
+
pusherKey: string;
|
|
9
|
+
amplitudeKey: string;
|
|
10
|
+
};
|
|
11
|
+
declare const config: {
|
|
12
|
+
config: WorkflowsConfig;
|
|
13
|
+
};
|
|
14
|
+
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfig>): void;
|
|
15
|
+
declare const getWorkflowsEnv: <T extends keyof Config | "isHeadless" | "workflowsAppId" | "workflowsWebhooksAppId" | "aiAgentId" | "pusherKey" | "amplitudeKey">(key: T) => WorkflowsConfig[T];
|
|
16
|
+
|
|
17
|
+
export { type WorkflowsConfig, config, getWorkflowsEnv, setWorkflowsConfig };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Config } from '@livechat/developer-studio-ui-react';
|
|
2
|
+
|
|
3
|
+
type WorkflowsConfig = Config & {
|
|
4
|
+
isHeadless: boolean;
|
|
5
|
+
workflowsAppId: string;
|
|
6
|
+
workflowsWebhooksAppId: string;
|
|
7
|
+
aiAgentId: string;
|
|
8
|
+
pusherKey: string;
|
|
9
|
+
amplitudeKey: string;
|
|
10
|
+
};
|
|
11
|
+
declare const config: {
|
|
12
|
+
config: WorkflowsConfig;
|
|
13
|
+
};
|
|
14
|
+
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfig>): void;
|
|
15
|
+
declare const getWorkflowsEnv: <T extends keyof Config | "isHeadless" | "workflowsAppId" | "workflowsWebhooksAppId" | "aiAgentId" | "pusherKey" | "amplitudeKey">(key: T) => WorkflowsConfig[T];
|
|
16
|
+
|
|
17
|
+
export { type WorkflowsConfig, config, getWorkflowsEnv, setWorkflowsConfig };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
|
|
34
|
+
// src/config.ts
|
|
35
|
+
var config_exports = {};
|
|
36
|
+
__export(config_exports, {
|
|
37
|
+
config: () => config,
|
|
38
|
+
getWorkflowsEnv: () => getWorkflowsEnv,
|
|
39
|
+
setWorkflowsConfig: () => setWorkflowsConfig
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(config_exports);
|
|
42
|
+
var import_developer_studio_ui_react = require("@livechat/developer-studio-ui-react");
|
|
43
|
+
var config = {
|
|
44
|
+
config: void 0
|
|
45
|
+
};
|
|
46
|
+
function setWorkflowsConfig(newConfig) {
|
|
47
|
+
config.config = __spreadValues(__spreadValues({}, config.config), newConfig);
|
|
48
|
+
(0, import_developer_studio_ui_react.setConfig)(newConfig);
|
|
49
|
+
}
|
|
50
|
+
var getWorkflowsEnv = (key) => {
|
|
51
|
+
return config.config[key];
|
|
52
|
+
};
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
config,
|
|
56
|
+
getWorkflowsEnv,
|
|
57
|
+
setWorkflowsConfig
|
|
58
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/config.ts
|
|
19
|
+
import { setConfig } from "@livechat/developer-studio-ui-react";
|
|
20
|
+
var config = {
|
|
21
|
+
config: void 0
|
|
22
|
+
};
|
|
23
|
+
function setWorkflowsConfig(newConfig) {
|
|
24
|
+
config.config = __spreadValues(__spreadValues({}, config.config), newConfig);
|
|
25
|
+
setConfig(newConfig);
|
|
26
|
+
}
|
|
27
|
+
var getWorkflowsEnv = (key) => {
|
|
28
|
+
return config.config[key];
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
config,
|
|
32
|
+
getWorkflowsEnv,
|
|
33
|
+
setWorkflowsConfig
|
|
34
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config } from '@livechat/developer-studio-ui-react';
|
|
2
2
|
import React$1 from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
isHeadless
|
|
6
|
-
}
|
|
7
|
-
type WorkflowsConfig = WorkflowsConfigBase & Config & {
|
|
8
|
-
accountsClientId: string;
|
|
4
|
+
type WorkflowsConfig = Config & {
|
|
5
|
+
isHeadless: boolean;
|
|
9
6
|
workflowsAppId: string;
|
|
10
7
|
workflowsWebhooksAppId: string;
|
|
11
8
|
aiAgentId: string;
|
|
12
9
|
pusherKey: string;
|
|
13
10
|
amplitudeKey: string;
|
|
14
11
|
};
|
|
15
|
-
declare
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
declare const config: {
|
|
13
|
+
config: WorkflowsConfig;
|
|
14
|
+
};
|
|
15
|
+
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfig>): void;
|
|
16
|
+
declare const getWorkflowsEnv: <T extends keyof Config | "isHeadless" | "workflowsAppId" | "workflowsWebhooksAppId" | "aiAgentId" | "pusherKey" | "amplitudeKey">(key: T) => WorkflowsConfig[T];
|
|
18
17
|
|
|
19
18
|
interface LoginErrorPageProps {
|
|
20
19
|
errorImage: React.ReactNode;
|
|
@@ -28,4 +27,4 @@ interface FlowsProps {
|
|
|
28
27
|
declare function FlowsRoute({ waitlistImage }: FlowsProps): JSX.Element;
|
|
29
28
|
declare function Flows({ waitlistImage }: FlowsProps): JSX.Element;
|
|
30
29
|
|
|
31
|
-
export { Flows, FlowsRoute, LoginErrorPage as LoginError, type WorkflowsConfig,
|
|
30
|
+
export { Flows, FlowsRoute, LoginErrorPage as LoginError, type WorkflowsConfig, config, getWorkflowsEnv, setWorkflowsConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config } from '@livechat/developer-studio-ui-react';
|
|
2
2
|
import React$1 from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
isHeadless
|
|
6
|
-
}
|
|
7
|
-
type WorkflowsConfig = WorkflowsConfigBase & Config & {
|
|
8
|
-
accountsClientId: string;
|
|
4
|
+
type WorkflowsConfig = Config & {
|
|
5
|
+
isHeadless: boolean;
|
|
9
6
|
workflowsAppId: string;
|
|
10
7
|
workflowsWebhooksAppId: string;
|
|
11
8
|
aiAgentId: string;
|
|
12
9
|
pusherKey: string;
|
|
13
10
|
amplitudeKey: string;
|
|
14
11
|
};
|
|
15
|
-
declare
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
declare const config: {
|
|
13
|
+
config: WorkflowsConfig;
|
|
14
|
+
};
|
|
15
|
+
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfig>): void;
|
|
16
|
+
declare const getWorkflowsEnv: <T extends keyof Config | "isHeadless" | "workflowsAppId" | "workflowsWebhooksAppId" | "aiAgentId" | "pusherKey" | "amplitudeKey">(key: T) => WorkflowsConfig[T];
|
|
18
17
|
|
|
19
18
|
interface LoginErrorPageProps {
|
|
20
19
|
errorImage: React.ReactNode;
|
|
@@ -28,4 +27,4 @@ interface FlowsProps {
|
|
|
28
27
|
declare function FlowsRoute({ waitlistImage }: FlowsProps): JSX.Element;
|
|
29
28
|
declare function Flows({ waitlistImage }: FlowsProps): JSX.Element;
|
|
30
29
|
|
|
31
|
-
export { Flows, FlowsRoute, LoginErrorPage as LoginError, type WorkflowsConfig,
|
|
30
|
+
export { Flows, FlowsRoute, LoginErrorPage as LoginError, type WorkflowsConfig, config, getWorkflowsEnv, setWorkflowsConfig };
|
package/dist/index.js
CHANGED
|
@@ -262,7 +262,7 @@ var require_react_is_development = __commonJS({
|
|
|
262
262
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
263
263
|
var Element = REACT_ELEMENT_TYPE;
|
|
264
264
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
265
|
-
var
|
|
265
|
+
var Fragment18 = REACT_FRAGMENT_TYPE;
|
|
266
266
|
var Lazy = REACT_LAZY_TYPE;
|
|
267
267
|
var Memo = REACT_MEMO_TYPE;
|
|
268
268
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -321,7 +321,7 @@ var require_react_is_development = __commonJS({
|
|
|
321
321
|
exports2.ContextProvider = ContextProvider;
|
|
322
322
|
exports2.Element = Element;
|
|
323
323
|
exports2.ForwardRef = ForwardRef;
|
|
324
|
-
exports2.Fragment =
|
|
324
|
+
exports2.Fragment = Fragment18;
|
|
325
325
|
exports2.Lazy = Lazy;
|
|
326
326
|
exports2.Memo = Memo;
|
|
327
327
|
exports2.Portal = Portal;
|
|
@@ -476,7 +476,7 @@ __export(src_exports, {
|
|
|
476
476
|
Flows: () => Flows,
|
|
477
477
|
FlowsRoute: () => FlowsRoute,
|
|
478
478
|
LoginError: () => LoginError_default,
|
|
479
|
-
|
|
479
|
+
config: () => config,
|
|
480
480
|
getWorkflowsEnv: () => getWorkflowsEnv,
|
|
481
481
|
setWorkflowsConfig: () => setWorkflowsConfig
|
|
482
482
|
});
|
|
@@ -484,35 +484,15 @@ module.exports = __toCommonJS(src_exports);
|
|
|
484
484
|
|
|
485
485
|
// src/config.ts
|
|
486
486
|
var import_developer_studio_ui_react = require("@livechat/developer-studio-ui-react");
|
|
487
|
-
var
|
|
488
|
-
|
|
487
|
+
var config = {
|
|
488
|
+
config: void 0
|
|
489
489
|
};
|
|
490
|
-
var config = getWorkflowsConfig(configBase);
|
|
491
490
|
function setWorkflowsConfig(newConfig) {
|
|
492
|
-
|
|
493
|
-
(0, import_developer_studio_ui_react.setConfig)(
|
|
494
|
-
env: configBase.env,
|
|
495
|
-
basePath: configBase.basePath
|
|
496
|
-
});
|
|
497
|
-
config = getWorkflowsConfig(configBase);
|
|
498
|
-
}
|
|
499
|
-
function getWorkflowsConfig(base) {
|
|
500
|
-
const isProd = base.env === "prod";
|
|
501
|
-
const coreConfig = (0, import_developer_studio_ui_react.getConfig)(base);
|
|
502
|
-
return __spreadProps(__spreadValues(__spreadValues({}, coreConfig), configBase), {
|
|
503
|
-
// Authorization
|
|
504
|
-
accountsClientId: isProd ? "381b682538d896b6a25f54caf1805650" : "bc52b2c51dc4a5c2491ca49eaa7354d0",
|
|
505
|
-
// Workflows
|
|
506
|
-
workflowsAppId: isProd ? "fKMEPiXSg" : "YI9NaLKIR",
|
|
507
|
-
workflowsWebhooksAppId: isProd ? "uHfsxN8IR" : "z0SVbHUIR",
|
|
508
|
-
// Misc
|
|
509
|
-
aiAgentId: isProd ? "5d0c4625-02da-43fd-8ec2-17740148d17c" : "ab493dfd-474a-4668-8403-01b1e122a364",
|
|
510
|
-
pusherKey: "2f168917af74e67b5b2e",
|
|
511
|
-
amplitudeKey: isProd ? "656f6573a88e63d3dc2ce32e33ef8284" : "40994eff4abf463415296829984fcf44"
|
|
512
|
-
});
|
|
491
|
+
config.config = __spreadValues(__spreadValues({}, config.config), newConfig);
|
|
492
|
+
(0, import_developer_studio_ui_react.setConfig)(newConfig);
|
|
513
493
|
}
|
|
514
494
|
var getWorkflowsEnv = (key) => {
|
|
515
|
-
return config[key];
|
|
495
|
+
return config.config[key];
|
|
516
496
|
};
|
|
517
497
|
|
|
518
498
|
// ../../../node_modules/.pnpm/@emotion+react@11.13.3_@types+react@18.2.5_react@18.2.0/node_modules/@emotion/react/dist/emotion-element-b4c8b265.esm.js
|
|
@@ -1860,7 +1840,7 @@ var LoginError_default = LoginErrorPage;
|
|
|
1860
1840
|
var import_react_router_dom27 = require("react-router-dom");
|
|
1861
1841
|
|
|
1862
1842
|
// src/views/Flows/Definitions/index.tsx
|
|
1863
|
-
var
|
|
1843
|
+
var import_react108 = require("react");
|
|
1864
1844
|
var import_react_router_dom25 = require("react-router-dom");
|
|
1865
1845
|
var import_developer_studio_ui_react44 = require("@livechat/developer-studio-ui-react");
|
|
1866
1846
|
|
|
@@ -20131,12 +20111,13 @@ var Edit_default2 = EditWorkflow;
|
|
|
20131
20111
|
var import_react_router_dom24 = require("react-router-dom");
|
|
20132
20112
|
|
|
20133
20113
|
// src/views/Flows/Templates/Common/Modals/Preview/index.tsx
|
|
20114
|
+
var import_react96 = require("react");
|
|
20134
20115
|
var import_react_router_dom17 = require("react-router-dom");
|
|
20135
20116
|
|
|
20136
20117
|
// src/views/Flows/Templates/api.mocks.tsx
|
|
20137
20118
|
var import_design_system_icons32 = require("@livechat/design-system-icons");
|
|
20138
20119
|
var import_developer_studio_api27 = require("@livechat/developer-studio-api");
|
|
20139
|
-
var
|
|
20120
|
+
var getFlowTemplates = () => [
|
|
20140
20121
|
{
|
|
20141
20122
|
id: "1",
|
|
20142
20123
|
name: "Create HelpDesk tickets with chat summaries when a chat ends",
|
|
@@ -21983,6 +21964,7 @@ function WorkflowTemplatePreview({
|
|
|
21983
21964
|
workflow,
|
|
21984
21965
|
onClose
|
|
21985
21966
|
}) {
|
|
21967
|
+
const flowTemplates = (0, import_react96.useMemo)(() => getFlowTemplates(), []);
|
|
21986
21968
|
const params = (0, import_react_router_dom17.useParams)();
|
|
21987
21969
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
21988
21970
|
if (!workflow) {
|
|
@@ -22019,18 +22001,18 @@ var Preview_default2 = WorkflowTemplatePreview;
|
|
|
22019
22001
|
var import_react_router_dom21 = require("react-router-dom");
|
|
22020
22002
|
|
|
22021
22003
|
// src/views/Flows/Definitions/List/Modals/Create/Modal.tsx
|
|
22022
|
-
var
|
|
22004
|
+
var import_react101 = require("react");
|
|
22023
22005
|
var import_react_router_dom20 = require("react-router-dom");
|
|
22024
22006
|
var import_design_system_react_components77 = require("@livechat/design-system-react-components");
|
|
22025
22007
|
|
|
22026
22008
|
// src/views/Flows/Definitions/List/Home/Home.tsx
|
|
22027
|
-
var
|
|
22009
|
+
var import_react100 = require("react");
|
|
22028
22010
|
var import_design_system_icons37 = require("@livechat/design-system-icons");
|
|
22029
22011
|
var import_design_system_react_components76 = require("@livechat/design-system-react-components");
|
|
22030
22012
|
var import_developer_studio_ui_react40 = require("@livechat/developer-studio-ui-react");
|
|
22031
22013
|
|
|
22032
22014
|
// src/views/Flows/Templates/Common/Modals/List/Filters/Category.tsx
|
|
22033
|
-
var
|
|
22015
|
+
var import_react97 = require("react");
|
|
22034
22016
|
var import_design_system_icons35 = require("@livechat/design-system-icons");
|
|
22035
22017
|
var import_design_system_react_components72 = require("@livechat/design-system-react-components");
|
|
22036
22018
|
var import_developer_studio_ui_react36 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22038,8 +22020,8 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
22038
22020
|
handleStatus,
|
|
22039
22021
|
status
|
|
22040
22022
|
}) {
|
|
22041
|
-
const [isVisible, setIsVisible] = (0,
|
|
22042
|
-
const getItem = (0,
|
|
22023
|
+
const [isVisible, setIsVisible] = (0, import_react97.useState)(false);
|
|
22024
|
+
const getItem = (0, import_react97.useCallback)(
|
|
22043
22025
|
(key, category, icon2) => ({
|
|
22044
22026
|
key,
|
|
22045
22027
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react36.Row, { gap: `var(${import_design_system_react_components72.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -22093,7 +22075,7 @@ function WorkflowTemplatesCategoryFilter({
|
|
|
22093
22075
|
var Category_default = WorkflowTemplatesCategoryFilter;
|
|
22094
22076
|
|
|
22095
22077
|
// src/views/Flows/Templates/Common/Modals/List/Filters/Product.tsx
|
|
22096
|
-
var
|
|
22078
|
+
var import_react98 = require("react");
|
|
22097
22079
|
var import_design_system_icons36 = require("@livechat/design-system-icons");
|
|
22098
22080
|
var import_design_system_react_components73 = require("@livechat/design-system-react-components");
|
|
22099
22081
|
var import_developer_studio_ui_react37 = require("@livechat/developer-studio-ui-react");
|
|
@@ -22101,8 +22083,8 @@ function WorkflowTemplatesProductFilter({
|
|
|
22101
22083
|
handleStatus,
|
|
22102
22084
|
status
|
|
22103
22085
|
}) {
|
|
22104
|
-
const [isVisible, setIsVisible] = (0,
|
|
22105
|
-
const getItem = (0,
|
|
22086
|
+
const [isVisible, setIsVisible] = (0, import_react98.useState)(false);
|
|
22087
|
+
const getItem = (0, import_react98.useCallback)(
|
|
22106
22088
|
(key, product, icon2) => ({
|
|
22107
22089
|
key,
|
|
22108
22090
|
element: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react37.Row, { gap: `var(${import_design_system_react_components73.SpacingToken.Spacing1});`, notPadded: true, children: [
|
|
@@ -22256,8 +22238,9 @@ var Grid = newStyled.div`
|
|
|
22256
22238
|
gap: var(${import_design_system_react_components76.SpacingToken.Spacing3});
|
|
22257
22239
|
`;
|
|
22258
22240
|
function WorkflowsHome({ isOnModal, basePath }) {
|
|
22259
|
-
const [product, setProduct] = (0,
|
|
22260
|
-
const [category, setCategory] = (0,
|
|
22241
|
+
const [product, setProduct] = (0, import_react100.useState)("All");
|
|
22242
|
+
const [category, setCategory] = (0, import_react100.useState)("All");
|
|
22243
|
+
const flowTemplates = (0, import_react100.useMemo)(() => getFlowTemplates(), []);
|
|
22261
22244
|
const filters = [
|
|
22262
22245
|
(template) => product === "All" || template.products.includes(product),
|
|
22263
22246
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -22295,13 +22278,7 @@ function WorkflowsHome({ isOnModal, basePath }) {
|
|
|
22295
22278
|
notPadded: true,
|
|
22296
22279
|
notPaddedOnMobile: true,
|
|
22297
22280
|
children: [
|
|
22298
|
-
/* @__PURE__ */ jsx2(
|
|
22299
|
-
Scratch_default,
|
|
22300
|
-
{
|
|
22301
|
-
icon: import_design_system_icons37.FiletypeOther,
|
|
22302
|
-
title: "Empty workflow"
|
|
22303
|
-
}
|
|
22304
|
-
),
|
|
22281
|
+
/* @__PURE__ */ jsx2(Scratch_default, { icon: import_design_system_icons37.FiletypeOther, title: "Empty workflow" }),
|
|
22305
22282
|
/* @__PURE__ */ jsx2(
|
|
22306
22283
|
Scratch_default,
|
|
22307
22284
|
{
|
|
@@ -22366,7 +22343,7 @@ var Home_default = WorkflowsHome;
|
|
|
22366
22343
|
// src/views/Flows/Definitions/List/Modals/Create/Modal.tsx
|
|
22367
22344
|
function WorkflowCreateModal({ onClose }) {
|
|
22368
22345
|
const navigate = (0, import_react_router_dom20.useNavigate)();
|
|
22369
|
-
const handleClose = (0,
|
|
22346
|
+
const handleClose = (0, import_react101.useCallback)(() => {
|
|
22370
22347
|
if (onClose) {
|
|
22371
22348
|
onClose();
|
|
22372
22349
|
return;
|
|
@@ -22399,7 +22376,7 @@ function WorkflowCreate() {
|
|
|
22399
22376
|
var Create_default = WorkflowCreate;
|
|
22400
22377
|
|
|
22401
22378
|
// src/views/Flows/Definitions/List/View.tsx
|
|
22402
|
-
var
|
|
22379
|
+
var import_react106 = require("react");
|
|
22403
22380
|
var import_react_router_dom23 = require("react-router-dom");
|
|
22404
22381
|
var import_design_system_react_components81 = require("@livechat/design-system-react-components");
|
|
22405
22382
|
var import_developer_studio_api29 = require("@livechat/developer-studio-api");
|
|
@@ -22410,7 +22387,7 @@ var import_design_system_react_components80 = require("@livechat/design-system-r
|
|
|
22410
22387
|
var import_developer_studio_ui_react42 = require("@livechat/developer-studio-ui-react");
|
|
22411
22388
|
|
|
22412
22389
|
// src/views/Flows/Definitions/List/Grid/Filters/StatusFilter.tsx
|
|
22413
|
-
var
|
|
22390
|
+
var import_react103 = require("react");
|
|
22414
22391
|
var import_design_system_icons38 = require("@livechat/design-system-icons");
|
|
22415
22392
|
var import_design_system_react_components78 = require("@livechat/design-system-react-components");
|
|
22416
22393
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
@@ -22418,7 +22395,7 @@ function WorkflowStatusFilter({
|
|
|
22418
22395
|
handleStatus,
|
|
22419
22396
|
status
|
|
22420
22397
|
}) {
|
|
22421
|
-
const [isVisible, setIsVisible] = (0,
|
|
22398
|
+
const [isVisible, setIsVisible] = (0, import_react103.useState)(false);
|
|
22422
22399
|
const items = [
|
|
22423
22400
|
{
|
|
22424
22401
|
key: "0",
|
|
@@ -22746,7 +22723,7 @@ var markedStyles = css`
|
|
|
22746
22723
|
function WorkflowListView() {
|
|
22747
22724
|
var _a;
|
|
22748
22725
|
const navigate = (0, import_react_router_dom23.useNavigate)();
|
|
22749
|
-
const [state, setState] = (0,
|
|
22726
|
+
const [state, setState] = (0, import_react106.useState)({
|
|
22750
22727
|
filters: {
|
|
22751
22728
|
status: "All",
|
|
22752
22729
|
tasks: "All"
|
|
@@ -22843,7 +22820,7 @@ function Workflows() {
|
|
|
22843
22820
|
const navigate = (0, import_react_router_dom25.useNavigate)();
|
|
22844
22821
|
const { user, isUserFetching } = (0, import_developer_studio_ui_react44.useUserContext)();
|
|
22845
22822
|
const { data: userHasInstalledWorkflows, isLoading: isWorkflowAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
22846
|
-
(0,
|
|
22823
|
+
(0, import_react108.useEffect)(() => {
|
|
22847
22824
|
if (isUserFetching || isWorkflowAppLoading) {
|
|
22848
22825
|
return;
|
|
22849
22826
|
}
|
|
@@ -22868,7 +22845,7 @@ function Workflows() {
|
|
|
22868
22845
|
var Definitions_default = Workflows;
|
|
22869
22846
|
|
|
22870
22847
|
// src/views/Flows/Waitlist/index.tsx
|
|
22871
|
-
var
|
|
22848
|
+
var import_react109 = require("react");
|
|
22872
22849
|
var import_react_router_dom26 = require("react-router-dom");
|
|
22873
22850
|
var import_design_system_icons40 = require("@livechat/design-system-icons");
|
|
22874
22851
|
var import_design_system_react_components82 = require("@livechat/design-system-react-components");
|
|
@@ -22901,7 +22878,7 @@ function Waitlist({ image }) {
|
|
|
22901
22878
|
const { user, isUserFetching } = (0, import_developer_studio_ui_react45.useUserContext)();
|
|
22902
22879
|
const { data: userHasInstalledWorkflows, isLoading: isWorkflowsAppLoading } = useFetchUserInstalledWorkflows(user);
|
|
22903
22880
|
const navigate = (0, import_react_router_dom26.useNavigate)();
|
|
22904
|
-
(0,
|
|
22881
|
+
(0, import_react109.useEffect)(() => {
|
|
22905
22882
|
if (userHasInstalledWorkflows) {
|
|
22906
22883
|
navigate("/workflow/list");
|
|
22907
22884
|
}
|
|
@@ -22996,7 +22973,7 @@ function Flows({ waitlistImage }) {
|
|
|
22996
22973
|
Flows,
|
|
22997
22974
|
FlowsRoute,
|
|
22998
22975
|
LoginError,
|
|
22999
|
-
|
|
22976
|
+
config,
|
|
23000
22977
|
getWorkflowsEnv,
|
|
23001
22978
|
setWorkflowsConfig
|
|
23002
22979
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -256,7 +256,7 @@ var require_react_is_development = __commonJS({
|
|
|
256
256
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
257
257
|
var Element = REACT_ELEMENT_TYPE;
|
|
258
258
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
259
|
-
var
|
|
259
|
+
var Fragment18 = REACT_FRAGMENT_TYPE;
|
|
260
260
|
var Lazy = REACT_LAZY_TYPE;
|
|
261
261
|
var Memo = REACT_MEMO_TYPE;
|
|
262
262
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -315,7 +315,7 @@ var require_react_is_development = __commonJS({
|
|
|
315
315
|
exports.ContextProvider = ContextProvider;
|
|
316
316
|
exports.Element = Element;
|
|
317
317
|
exports.ForwardRef = ForwardRef;
|
|
318
|
-
exports.Fragment =
|
|
318
|
+
exports.Fragment = Fragment18;
|
|
319
319
|
exports.Lazy = Lazy;
|
|
320
320
|
exports.Memo = Memo;
|
|
321
321
|
exports.Portal = Portal;
|
|
@@ -465,39 +465,16 @@ var require_extends = __commonJS({
|
|
|
465
465
|
});
|
|
466
466
|
|
|
467
467
|
// src/config.ts
|
|
468
|
-
import {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
} from "@livechat/developer-studio-ui-react";
|
|
472
|
-
var configBase = {
|
|
473
|
-
env: "labs"
|
|
468
|
+
import { setConfig } from "@livechat/developer-studio-ui-react";
|
|
469
|
+
var config = {
|
|
470
|
+
config: void 0
|
|
474
471
|
};
|
|
475
|
-
var config = getWorkflowsConfig(configBase);
|
|
476
472
|
function setWorkflowsConfig(newConfig) {
|
|
477
|
-
|
|
478
|
-
setConfig(
|
|
479
|
-
env: configBase.env,
|
|
480
|
-
basePath: configBase.basePath
|
|
481
|
-
});
|
|
482
|
-
config = getWorkflowsConfig(configBase);
|
|
483
|
-
}
|
|
484
|
-
function getWorkflowsConfig(base) {
|
|
485
|
-
const isProd = base.env === "prod";
|
|
486
|
-
const coreConfig = getConfig(base);
|
|
487
|
-
return __spreadProps(__spreadValues(__spreadValues({}, coreConfig), configBase), {
|
|
488
|
-
// Authorization
|
|
489
|
-
accountsClientId: isProd ? "381b682538d896b6a25f54caf1805650" : "bc52b2c51dc4a5c2491ca49eaa7354d0",
|
|
490
|
-
// Workflows
|
|
491
|
-
workflowsAppId: isProd ? "fKMEPiXSg" : "YI9NaLKIR",
|
|
492
|
-
workflowsWebhooksAppId: isProd ? "uHfsxN8IR" : "z0SVbHUIR",
|
|
493
|
-
// Misc
|
|
494
|
-
aiAgentId: isProd ? "5d0c4625-02da-43fd-8ec2-17740148d17c" : "ab493dfd-474a-4668-8403-01b1e122a364",
|
|
495
|
-
pusherKey: "2f168917af74e67b5b2e",
|
|
496
|
-
amplitudeKey: isProd ? "656f6573a88e63d3dc2ce32e33ef8284" : "40994eff4abf463415296829984fcf44"
|
|
497
|
-
});
|
|
473
|
+
config.config = __spreadValues(__spreadValues({}, config.config), newConfig);
|
|
474
|
+
setConfig(newConfig);
|
|
498
475
|
}
|
|
499
476
|
var getWorkflowsEnv = (key) => {
|
|
500
|
-
return config[key];
|
|
477
|
+
return config.config[key];
|
|
501
478
|
};
|
|
502
479
|
|
|
503
480
|
// ../../../node_modules/.pnpm/@emotion+react@11.13.3_@types+react@18.2.5_react@18.2.0/node_modules/@emotion/react/dist/emotion-element-b4c8b265.esm.js
|
|
@@ -20512,6 +20489,7 @@ var Edit_default2 = EditWorkflow;
|
|
|
20512
20489
|
import { Route as Route4, Routes as Routes4 } from "react-router-dom";
|
|
20513
20490
|
|
|
20514
20491
|
// src/views/Flows/Templates/Common/Modals/Preview/index.tsx
|
|
20492
|
+
import { useMemo as useMemo7 } from "react";
|
|
20515
20493
|
import { useParams as useParams5 } from "react-router-dom";
|
|
20516
20494
|
|
|
20517
20495
|
// src/views/Flows/Templates/api.mocks.tsx
|
|
@@ -20527,7 +20505,7 @@ import {
|
|
|
20527
20505
|
IntegrationNames as IntegrationNames17,
|
|
20528
20506
|
TextLivechatEventNames as TextLivechatEventNames2
|
|
20529
20507
|
} from "@livechat/developer-studio-api";
|
|
20530
|
-
var
|
|
20508
|
+
var getFlowTemplates = () => [
|
|
20531
20509
|
{
|
|
20532
20510
|
id: "1",
|
|
20533
20511
|
name: "Create HelpDesk tickets with chat summaries when a chat ends",
|
|
@@ -22399,6 +22377,7 @@ function WorkflowTemplatePreview({
|
|
|
22399
22377
|
workflow,
|
|
22400
22378
|
onClose
|
|
22401
22379
|
}) {
|
|
22380
|
+
const flowTemplates = useMemo7(() => getFlowTemplates(), []);
|
|
22402
22381
|
const params = useParams5();
|
|
22403
22382
|
const template = flowTemplates.find((t) => t.id === params.template);
|
|
22404
22383
|
if (!workflow) {
|
|
@@ -22440,7 +22419,7 @@ import { useNavigate as useNavigate15 } from "react-router-dom";
|
|
|
22440
22419
|
import { Modal as Modal9, ModalHeader as ModalHeader4 } from "@livechat/design-system-react-components";
|
|
22441
22420
|
|
|
22442
22421
|
// src/views/Flows/Definitions/List/Home/Home.tsx
|
|
22443
|
-
import { useState as useState31 } from "react";
|
|
22422
|
+
import { useMemo as useMemo8, useState as useState31 } from "react";
|
|
22444
22423
|
import { FiletypeOther, OneColored } from "@livechat/design-system-icons";
|
|
22445
22424
|
import {
|
|
22446
22425
|
DesignToken as DesignToken41,
|
|
@@ -22716,6 +22695,7 @@ var Grid = newStyled.div`
|
|
|
22716
22695
|
function WorkflowsHome({ isOnModal, basePath }) {
|
|
22717
22696
|
const [product, setProduct] = useState31("All");
|
|
22718
22697
|
const [category, setCategory] = useState31("All");
|
|
22698
|
+
const flowTemplates = useMemo8(() => getFlowTemplates(), []);
|
|
22719
22699
|
const filters = [
|
|
22720
22700
|
(template) => product === "All" || template.products.includes(product),
|
|
22721
22701
|
(template) => category === "All" || template.category.includes(category)
|
|
@@ -22753,13 +22733,7 @@ function WorkflowsHome({ isOnModal, basePath }) {
|
|
|
22753
22733
|
notPadded: true,
|
|
22754
22734
|
notPaddedOnMobile: true,
|
|
22755
22735
|
children: [
|
|
22756
|
-
/* @__PURE__ */ jsx2(
|
|
22757
|
-
Scratch_default,
|
|
22758
|
-
{
|
|
22759
|
-
icon: FiletypeOther,
|
|
22760
|
-
title: "Empty workflow"
|
|
22761
|
-
}
|
|
22762
|
-
),
|
|
22736
|
+
/* @__PURE__ */ jsx2(Scratch_default, { icon: FiletypeOther, title: "Empty workflow" }),
|
|
22763
22737
|
/* @__PURE__ */ jsx2(
|
|
22764
22738
|
Scratch_default,
|
|
22765
22739
|
{
|
|
@@ -23504,7 +23478,7 @@ export {
|
|
|
23504
23478
|
Flows,
|
|
23505
23479
|
FlowsRoute,
|
|
23506
23480
|
LoginError_default as LoginError,
|
|
23507
|
-
|
|
23481
|
+
config,
|
|
23508
23482
|
getWorkflowsEnv,
|
|
23509
23483
|
setWorkflowsConfig
|
|
23510
23484
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livechat/platform-workflows",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"description": "Text Platform | Workflows",
|
|
5
5
|
"author": "Wojciech Dudek",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"uuid": "^9.0.1",
|
|
82
82
|
"validator": "^13.12.0",
|
|
83
83
|
"web-worker": "^1.3.0",
|
|
84
|
-
"@livechat/
|
|
85
|
-
"@livechat/
|
|
86
|
-
"@livechat/developer-studio-api": "3.3.
|
|
84
|
+
"@livechat/developer-studio-ui-react": "0.0.76",
|
|
85
|
+
"@livechat/platform-integrations": "0.0.26",
|
|
86
|
+
"@livechat/developer-studio-api": "3.3.10"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@tanstack/react-query": "4.36.1",
|