@livechat/platform-workflows 0.0.81 → 0.0.82

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.mjs CHANGED
@@ -2300,15 +2300,15 @@ function Waitlist({ image }) {
2300
2300
  var Waitlist_default = Waitlist;
2301
2301
 
2302
2302
  // src/views/Workflows/index.tsx
2303
- import { useEffect as useEffect18 } from "react";
2304
- import { Navigate as Navigate2, Route as Route6, Routes as Routes6, useNavigate as useNavigate20 } from "react-router-dom";
2303
+ import { useEffect as useEffect19 } from "react";
2304
+ import { Navigate as Navigate2, Route as Route6, Routes as Routes6, useNavigate as useNavigate21 } from "react-router-dom";
2305
2305
  import { Loader as Loader6 } from "@livechat/developer-studio-ui-react";
2306
2306
 
2307
2307
  // src/views/Workflows/Creator/index.tsx
2308
2308
  import {
2309
2309
  Route as Route3,
2310
2310
  Routes as Routes3,
2311
- useLocation as useLocation6,
2311
+ useLocation as useLocation5,
2312
2312
  useNavigate as useNavigate13,
2313
2313
  useParams as useParams4
2314
2314
  } from "react-router-dom";
@@ -12000,7 +12000,7 @@ function OneMessagesProvider({ children }) {
12000
12000
  const generateAiResponseMutation = useGenerateAIResponse();
12001
12001
  const { user } = useUserContext2();
12002
12002
  const isLoading = generateAiResponseMutation.isLoading;
12003
- const sendMessage = (message) => __async(this, null, function* () {
12003
+ const sendMessage2 = (message) => __async(this, null, function* () {
12004
12004
  setIsError(null);
12005
12005
  setEvents((prevEvents) => [
12006
12006
  ...prevEvents,
@@ -12062,7 +12062,7 @@ function OneMessagesProvider({ children }) {
12062
12062
  isError,
12063
12063
  groupedEvents: eventsGroup,
12064
12064
  hasAdditionalEvents,
12065
- sendMessage
12065
+ sendMessage: sendMessage2
12066
12066
  },
12067
12067
  children
12068
12068
  }
@@ -16359,7 +16359,7 @@ function CustomTagsField({
16359
16359
  error,
16360
16360
  trim: trim2,
16361
16361
  disabled,
16362
- wrapperCss: wrapperCss2,
16362
+ wrapperCss: wrapperCss3,
16363
16363
  onChange
16364
16364
  }) {
16365
16365
  const wrapperRef = useRef5(null);
@@ -16367,7 +16367,7 @@ function CustomTagsField({
16367
16367
  useOnClickOutside(wrapperRef, () => {
16368
16368
  setIsPickerVisible(false);
16369
16369
  });
16370
- return /* @__PURE__ */ jsx4("div", { css: wrapperCss2, ref: wrapperRef, children: /* @__PURE__ */ jsx4(
16370
+ return /* @__PURE__ */ jsx4("div", { css: wrapperCss3, ref: wrapperRef, children: /* @__PURE__ */ jsx4(
16371
16371
  CustomTagsInput,
16372
16372
  {
16373
16373
  context,
@@ -18919,16 +18919,16 @@ import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexica
18919
18919
  import { CLEAR_EDITOR_COMMAND } from "lexical";
18920
18920
  var useSendOneMessage = () => {
18921
18921
  const [editor] = useLexicalComposerContext2();
18922
- const { sendMessage } = useContext8(OneMessagesContext);
18922
+ const { sendMessage: sendMessage2 } = useContext8(OneMessagesContext);
18923
18923
  const onSend = useCallback8(() => {
18924
18924
  var _a;
18925
18925
  const messageToSend = (_a = editor.getRootElement()) == null ? void 0 : _a.innerText.trim();
18926
18926
  if (!messageToSend) {
18927
18927
  return;
18928
18928
  }
18929
- sendMessage(messageToSend);
18929
+ sendMessage2(messageToSend);
18930
18930
  editor.dispatchCommand(CLEAR_EDITOR_COMMAND, void 0);
18931
- }, [editor, sendMessage]);
18931
+ }, [editor, sendMessage2]);
18932
18932
  return onSend;
18933
18933
  };
18934
18934
 
@@ -21411,13 +21411,20 @@ function PublishWorkflowModal({
21411
21411
  }
21412
21412
 
21413
21413
  // src/views/Workflows/Creator/View.tsx
21414
+ import { useEffect as useEffect18 } from "react";
21414
21415
  import { Route as Route2, Routes as Routes2 } from "react-router-dom";
21416
+ import { useReactFlow as useReactFlow3 } from "reactflow";
21415
21417
  import {
21416
21418
  DesignToken as DesignToken37,
21417
21419
  RadiusToken as RadiusToken18,
21418
21420
  SpacingToken as SpacingToken34
21419
21421
  } from "@livechat/design-system-react-components";
21420
21422
 
21423
+ // src/utils/sendMessage.ts
21424
+ var sendMessage = (type) => {
21425
+ window.parent.postMessage({ type }, "*");
21426
+ };
21427
+
21421
21428
  // src/views/Workflows/Creator/Panels/Details/index.tsx
21422
21429
  import { Navigate, Route, Routes } from "react-router-dom";
21423
21430
 
@@ -22049,7 +22056,7 @@ var Panel_default3 = WorkflowElementPanel;
22049
22056
  // src/views/Workflows/Creator/Navbar.tsx
22050
22057
  import { useEffect as useEffect17, useRef as useRef9, useState as useState27 } from "react";
22051
22058
  import { useNavigate as useNavigate12 } from "react-router-dom";
22052
- import { ArrowBarLeft, ChevronDown as ChevronDown3 } from "@livechat/design-system-icons";
22059
+ import { ChevronDown as ChevronDown3, Close as Close6 } from "@livechat/design-system-icons";
22053
22060
  import {
22054
22061
  ActionMenu as ActionMenu2,
22055
22062
  Button as Button28,
@@ -22144,42 +22151,25 @@ function WorkflowCreatorNavbar() {
22144
22151
  borderBottom: true,
22145
22152
  center: true,
22146
22153
  css: css`
22147
- min-height: 70px;
22154
+ min-height: var(${SpacingToken33.Spacing14});
22155
+ padding-left: var(${SpacingToken33.Spacing4});
22148
22156
  `,
22149
22157
  flexEnd: true,
22150
22158
  lowMargin: true,
22151
- lowPadding: true,
22152
22159
  noMaxWidth: true,
22153
22160
  noWrap: true,
22154
22161
  notPadded: true,
22155
- paddingLeft: true,
22156
22162
  spaceBetween: true,
22157
22163
  children: [
22158
- getWorkflowsEnv("isHeadless") && /* @__PURE__ */ jsx4(
22164
+ getWorkflowsEnv("isLiveChatMode") && /* @__PURE__ */ jsx4(
22159
22165
  Button28,
22160
22166
  {
22161
- css: css`
22162
- font-size: var(${SpacingToken33.Spacing4});
22163
- text-decoration: none;
22164
- `,
22165
- kind: "text",
22167
+ icon: /* @__PURE__ */ jsx4(Icon31, { source: Close6 }),
22168
+ kind: "plain",
22166
22169
  onClick: () => {
22167
22170
  navigate("/workflow/list");
22168
- },
22169
- children: /* @__PURE__ */ jsxs2(Row16, { center: true, noWrap: true, notPadded: true, children: [
22170
- /* @__PURE__ */ jsx4(
22171
- Icon31,
22172
- {
22173
- css: css`
22174
- min-height: var(${SpacingToken33.Spacing8});
22175
- min-width: var(${SpacingToken33.Spacing8});
22176
- `,
22177
- size: "large",
22178
- source: ArrowBarLeft
22179
- }
22180
- ),
22181
- "Workflows"
22182
- ] })
22171
+ sendMessage("openSideNav" /* OpenSideNav */);
22172
+ }
22183
22173
  }
22184
22174
  ),
22185
22175
  /* @__PURE__ */ jsxs2(Row16, { center: true, noMaxWidth: true, setRowPadding: "4px 16px", spaceBetween: true, children: [
@@ -22365,6 +22355,22 @@ function WorkflowCreatorView() {
22365
22355
  state: { selection },
22366
22356
  focus
22367
22357
  } = useWorkflowCreator();
22358
+ const { fitView } = useReactFlow3();
22359
+ useEffect18(() => {
22360
+ if (getWorkflowsEnv("isLiveChatMode")) {
22361
+ sendMessage("closeSideNav" /* CloseSideNav */);
22362
+ const timeoutId = setTimeout(() => {
22363
+ fitView({
22364
+ duration: 400,
22365
+ maxZoom: 1.15,
22366
+ minZoom: 1.15
22367
+ });
22368
+ }, 200);
22369
+ return () => {
22370
+ clearTimeout(timeoutId);
22371
+ };
22372
+ }
22373
+ }, [fitView]);
22368
22374
  return /* @__PURE__ */ jsxs2(View2, { children: [
22369
22375
  /* @__PURE__ */ jsx4(Navbar_default, {}),
22370
22376
  /* @__PURE__ */ jsxs2(WorkflowCreatorContent, { grayBackground: getWorkflowsEnv("isHeadless"), children: [
@@ -22394,7 +22400,7 @@ var View_default = WorkflowCreatorView;
22394
22400
  // src/views/Workflows/Creator/index.tsx
22395
22401
  function WorkflowCreator() {
22396
22402
  var _a, _b, _c;
22397
- const location = useLocation6();
22403
+ const location = useLocation5();
22398
22404
  const { id } = useParams4();
22399
22405
  const navigate = useNavigate13();
22400
22406
  const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
@@ -22869,6 +22875,7 @@ function WorkflowTemplatesCategoryFilter({
22869
22875
  handleStatus,
22870
22876
  status
22871
22877
  }) {
22878
+ var _a;
22872
22879
  const [isVisible, setIsVisible] = useState28(false);
22873
22880
  const getItem = useCallback15(
22874
22881
  (key, category, icon2) => ({
@@ -22884,25 +22891,26 @@ function WorkflowTemplatesCategoryFilter({
22884
22891
  }),
22885
22892
  [handleStatus]
22886
22893
  );
22894
+ const options = [
22895
+ getItem("0", "All"),
22896
+ getItem("1", WorkflowTemplateCategory3.NotificationAndAlerts, Notifications2),
22897
+ getItem("2", WorkflowTemplateCategory3.SalesManagement, CurrencyDollar2),
22898
+ getItem("3", WorkflowTemplateCategory3.LeadCollection, TargetArrow2),
22899
+ getItem("4", WorkflowTemplateCategory3.ChatManagement, ChatDots2),
22900
+ getItem("5", WorkflowTemplateCategory3.CustomerExperience, Smiles2)
22901
+ ];
22902
+ const selectedKey = (_a = options.find(
22903
+ (option) => option.element.props.children[1] === status
22904
+ )) == null ? void 0 : _a.key;
22887
22905
  return /* @__PURE__ */ jsx4(
22888
22906
  ActionMenu3,
22889
22907
  {
22890
22908
  onClose: () => {
22891
22909
  setIsVisible(false);
22892
22910
  },
22893
- options: [
22894
- getItem("0", "All"),
22895
- getItem(
22896
- "1",
22897
- WorkflowTemplateCategory3.NotificationAndAlerts,
22898
- Notifications2
22899
- ),
22900
- getItem("2", WorkflowTemplateCategory3.SalesManagement, CurrencyDollar2),
22901
- getItem("3", WorkflowTemplateCategory3.LeadCollection, TargetArrow2),
22902
- getItem("4", WorkflowTemplateCategory3.ChatManagement, ChatDots2),
22903
- getItem("5", WorkflowTemplateCategory3.CustomerExperience, Smiles2)
22904
- ],
22911
+ options,
22905
22912
  placement: "bottom",
22913
+ selectedOptions: selectedKey ? [selectedKey] : [],
22906
22914
  triggerRenderer: /* @__PURE__ */ jsxs2(
22907
22915
  Button30,
22908
22916
  {
@@ -22945,6 +22953,7 @@ function WorkflowTemplatesProductFilter({
22945
22953
  handleStatus,
22946
22954
  status
22947
22955
  }) {
22956
+ var _a;
22948
22957
  const [isVisible, setIsVisible] = useState29(false);
22949
22958
  const getItem = useCallback16(
22950
22959
  (key, product, icon2) => ({
@@ -22960,23 +22969,28 @@ function WorkflowTemplatesProductFilter({
22960
22969
  }),
22961
22970
  [handleStatus]
22962
22971
  );
22972
+ const options = [
22973
+ getItem("0", "All"),
22974
+ getItem("1", IntegrationDisplayNames11.LiveChat, LiveChatColored),
22975
+ getItem("2", IntegrationDisplayNames11.HelpDesk, HelpDeskColored),
22976
+ getItem("3", IntegrationDisplayNames11.OpenAI, Chatgpt),
22977
+ getItem("4", IntegrationDisplayNames11.Shopify, ShopifyColored),
22978
+ getItem("5", IntegrationDisplayNames11.Mailchimp, Mailchimp)
22979
+ // getItem('6', IntegrationDisplayNames.Stripe, Stripe),
22980
+ // getItem('7', IntegrationDisplayNames.GoogleSheets, GoogleSheets),
22981
+ ];
22982
+ const selectedKey = (_a = options.find(
22983
+ (option) => option.element.props.children[1] === status
22984
+ )) == null ? void 0 : _a.key;
22963
22985
  return /* @__PURE__ */ jsx4(
22964
22986
  ActionMenu4,
22965
22987
  {
22966
22988
  onClose: () => {
22967
22989
  setIsVisible(false);
22968
22990
  },
22969
- options: [
22970
- getItem("0", "All"),
22971
- getItem("1", IntegrationDisplayNames11.LiveChat, LiveChatColored),
22972
- getItem("2", IntegrationDisplayNames11.HelpDesk, HelpDeskColored),
22973
- getItem("3", IntegrationDisplayNames11.OpenAI, Chatgpt),
22974
- getItem("4", IntegrationDisplayNames11.Shopify, ShopifyColored),
22975
- getItem("5", IntegrationDisplayNames11.Mailchimp, Mailchimp)
22976
- // getItem('6', IntegrationDisplayNames.Stripe, Stripe),
22977
- // getItem('7', IntegrationDisplayNames.GoogleSheets, GoogleSheets),
22978
- ],
22991
+ options,
22979
22992
  placement: "bottom",
22993
+ selectedOptions: selectedKey ? [selectedKey] : [],
22980
22994
  triggerRenderer: /* @__PURE__ */ jsxs2(
22981
22995
  Button31,
22982
22996
  {
@@ -23252,11 +23266,11 @@ var Create_default = WorkflowCreate;
23252
23266
 
23253
23267
  // src/views/Workflows/List/View.tsx
23254
23268
  import { useState as useState32 } from "react";
23255
- import { useNavigate as useNavigate19 } from "react-router-dom";
23269
+ import { useNavigate as useNavigate20 } from "react-router-dom";
23256
23270
  import {
23257
- Button as Button34,
23258
- DesignToken as DesignToken43,
23259
- SpacingToken as SpacingToken43
23271
+ Button as Button35,
23272
+ DesignToken as DesignToken44,
23273
+ SpacingToken as SpacingToken44
23260
23274
  } from "@livechat/design-system-react-components";
23261
23275
  import { mergeDeep as mergeDeep2 } from "@livechat/developer-studio-api";
23262
23276
  import {
@@ -23267,6 +23281,64 @@ import {
23267
23281
  View as View3
23268
23282
  } from "@livechat/developer-studio-ui-react";
23269
23283
 
23284
+ // src/views/Workflows/Creator/LiveChatNavbar.tsx
23285
+ import { useCallback as useCallback18 } from "react";
23286
+ import { useNavigate as useNavigate18 } from "react-router-dom";
23287
+ import { LayoutSidebarLeft } from "@livechat/design-system-icons";
23288
+ import {
23289
+ Button as Button32,
23290
+ DesignToken as DesignToken42,
23291
+ Heading as Heading8,
23292
+ Icon as Icon37,
23293
+ SpacingToken as SpacingToken42
23294
+ } from "@livechat/design-system-react-components";
23295
+ var wrapperCss = (hasData) => css`
23296
+ flex-shrink: 0;
23297
+ height: var(${SpacingToken42.Spacing14});
23298
+ width: 100%;
23299
+ display: flex;
23300
+ padding: 0 var(${SpacingToken42.Spacing6}) 0 var(${SpacingToken42.Spacing4});
23301
+ align-items: center;
23302
+ gap: var(${SpacingToken42.Spacing2});
23303
+ border-bottom: 1px solid var(${DesignToken42.BorderBasicSecondary});
23304
+
23305
+ ${hasData && `> button:last-of-type {
23306
+ margin-left: auto;
23307
+ }`}
23308
+ `;
23309
+ function LiveChatNavbar() {
23310
+ const navigate = useNavigate18();
23311
+ const workflows = useFetchWorkflows({});
23312
+ const isLoading = workflows.isLoading;
23313
+ const hasNoData = workflows.isSuccess && workflows.data.length === 0;
23314
+ const hasData = !isLoading && !hasNoData;
23315
+ const handleClick = useCallback18(() => {
23316
+ sendMessage("toggleSideNav" /* ToggleSideNav */);
23317
+ }, []);
23318
+ return /* @__PURE__ */ jsxs2("div", { css: wrapperCss(hasData), children: [
23319
+ /* @__PURE__ */ jsx4(
23320
+ Button32,
23321
+ {
23322
+ icon: /* @__PURE__ */ jsx4(Icon37, { source: LayoutSidebarLeft }),
23323
+ kind: "plain",
23324
+ onClick: handleClick
23325
+ }
23326
+ ),
23327
+ /* @__PURE__ */ jsx4(Heading8, { size: "sm", children: "Workflows" }),
23328
+ hasData ? /* @__PURE__ */ jsx4(
23329
+ Button32,
23330
+ {
23331
+ kind: "primary",
23332
+ onClick: () => {
23333
+ navigate("create");
23334
+ },
23335
+ children: "Create workflow"
23336
+ }
23337
+ ) : null
23338
+ ] });
23339
+ }
23340
+ var LiveChatNavbar_default = LiveChatNavbar;
23341
+
23270
23342
  // src/views/Workflows/List/Grid/Grid.tsx
23271
23343
  import { SearchInput as SearchInput4 } from "@livechat/design-system-react-components";
23272
23344
  import { Grid as Grid2 } from "@livechat/developer-studio-ui-react";
@@ -23276,13 +23348,14 @@ import { useState as useState31 } from "react";
23276
23348
  import { ToggleLeft } from "@livechat/design-system-icons";
23277
23349
  import {
23278
23350
  ActionMenu as ActionMenu5,
23279
- Button as Button32,
23280
- Icon as Icon37
23351
+ Button as Button33,
23352
+ Icon as Icon38
23281
23353
  } from "@livechat/design-system-react-components";
23282
23354
  function WorkflowStatusFilter({
23283
23355
  handleStatus,
23284
23356
  status
23285
23357
  }) {
23358
+ var _a;
23286
23359
  const [isVisible, setIsVisible] = useState31(false);
23287
23360
  const items = [
23288
23361
  {
@@ -23310,6 +23383,7 @@ function WorkflowStatusFilter({
23310
23383
  }
23311
23384
  }
23312
23385
  ];
23386
+ const selectedKey = (_a = items.find((item) => item.element === status)) == null ? void 0 : _a.key;
23313
23387
  return /* @__PURE__ */ jsx4(
23314
23388
  ActionMenu5,
23315
23389
  {
@@ -23318,10 +23392,11 @@ function WorkflowStatusFilter({
23318
23392
  },
23319
23393
  options: items,
23320
23394
  placement: "bottom",
23395
+ selectedOptions: selectedKey ? [selectedKey] : [],
23321
23396
  triggerRenderer: /* @__PURE__ */ jsxs2(
23322
- Button32,
23397
+ Button33,
23323
23398
  {
23324
- icon: /* @__PURE__ */ jsx4(Icon37, { source: ToggleLeft }),
23399
+ icon: /* @__PURE__ */ jsx4(Icon38, { source: ToggleLeft }),
23325
23400
  kind: "secondary",
23326
23401
  onClick: () => {
23327
23402
  setIsVisible(!isVisible);
@@ -23339,7 +23414,7 @@ function WorkflowStatusFilter({
23339
23414
  var StatusFilter_default = WorkflowStatusFilter;
23340
23415
 
23341
23416
  // src/views/Workflows/List/Grid/Table.tsx
23342
- import { useNavigate as useNavigate18 } from "react-router-dom";
23417
+ import { useNavigate as useNavigate19 } from "react-router-dom";
23343
23418
  import {
23344
23419
  Delete as Delete3,
23345
23420
  Info as Info2,
@@ -23349,10 +23424,10 @@ import {
23349
23424
  import {
23350
23425
  ActionMenu as ActionMenu6,
23351
23426
  ActionMenuItem as ActionMenuItem2,
23352
- Button as Button33,
23353
- DesignToken as DesignToken42,
23354
- Icon as Icon38,
23355
- SpacingToken as SpacingToken42,
23427
+ Button as Button34,
23428
+ DesignToken as DesignToken43,
23429
+ Icon as Icon39,
23430
+ SpacingToken as SpacingToken43,
23356
23431
  Switch as Switch2,
23357
23432
  Tag as Tag3,
23358
23433
  Text as Text21,
@@ -23369,7 +23444,7 @@ import {
23369
23444
  } from "@livechat/developer-studio-ui-react";
23370
23445
  function WorkflowsTable({ workflowsQuery, state }) {
23371
23446
  var _a, _b, _c;
23372
- const navigate = useNavigate18();
23447
+ const navigate = useNavigate19();
23373
23448
  const notifications = useNotificationContext5();
23374
23449
  const deleteAction = useDeleteWorkflow();
23375
23450
  const activateWorkflowAction = useActivateWorkflow();
@@ -23406,7 +23481,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
23406
23481
  cursor: pointer;
23407
23482
 
23408
23483
  &:hover {
23409
- background: var(${DesignToken42.SurfacePrimaryHover});
23484
+ background: var(${DesignToken43.SurfacePrimaryHover});
23410
23485
  }
23411
23486
  `,
23412
23487
  onClick: () => {
@@ -23414,7 +23489,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
23414
23489
  navigate(`/workflow/${workflow.id}`);
23415
23490
  },
23416
23491
  children: [
23417
- /* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(Row24, { gap: `var(${SpacingToken42.Spacing2})`, noWrap: true, notPadded: true, children: [
23492
+ /* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(Row24, { gap: `var(${SpacingToken43.Spacing2})`, noWrap: true, notPadded: true, children: [
23418
23493
  /* @__PURE__ */ jsx4(Text21, { noMargin: true, size: "sm", children: workflow.name }),
23419
23494
  workflow.related_workflow_id ? /* @__PURE__ */ jsx4(
23420
23495
  Tag3,
@@ -23469,9 +23544,9 @@ function WorkflowsTable({ workflowsQuery, state }) {
23469
23544
  }
23470
23545
  ) }),
23471
23546
  /* @__PURE__ */ jsx4("td", { children: !workflow.draft && /* @__PURE__ */ jsx4(
23472
- Button33,
23547
+ Button34,
23473
23548
  {
23474
- icon: /* @__PURE__ */ jsx4(Icon38, { source: Info2 }),
23549
+ icon: /* @__PURE__ */ jsx4(Icon39, { source: Info2 }),
23475
23550
  kind: "plain",
23476
23551
  onClick: (e) => {
23477
23552
  e.stopPropagation();
@@ -23488,7 +23563,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
23488
23563
  element: /* @__PURE__ */ jsx4(
23489
23564
  ActionMenuItem2,
23490
23565
  {
23491
- leftNode: /* @__PURE__ */ jsx4(Icon38, { source: PlayArrow }),
23566
+ leftNode: /* @__PURE__ */ jsx4(Icon39, { source: PlayArrow }),
23492
23567
  children: "Trigger manually"
23493
23568
  }
23494
23569
  ),
@@ -23501,7 +23576,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
23501
23576
  element: /* @__PURE__ */ jsx4(
23502
23577
  ActionMenuItem2,
23503
23578
  {
23504
- leftNode: /* @__PURE__ */ jsx4(Icon38, { source: Delete3 }),
23579
+ leftNode: /* @__PURE__ */ jsx4(Icon39, { source: Delete3 }),
23505
23580
  children: "Delete"
23506
23581
  }
23507
23582
  ),
@@ -23517,9 +23592,9 @@ function WorkflowsTable({ workflowsQuery, state }) {
23517
23592
  }
23518
23593
  ],
23519
23594
  triggerRenderer: /* @__PURE__ */ jsx4(
23520
- Button33,
23595
+ Button34,
23521
23596
  {
23522
- icon: /* @__PURE__ */ jsx4(Icon38, { source: MoreHoriz2 }),
23597
+ icon: /* @__PURE__ */ jsx4(Icon39, { source: MoreHoriz2 }),
23523
23598
  kind: "text",
23524
23599
  loading: deleteAction.isLoading ? ((_g = deleteAction.variables) == null ? void 0 : _g.id) === workflow.id : void 0,
23525
23600
  size: "compact"
@@ -23538,7 +23613,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
23538
23613
  {
23539
23614
  css: css`
23540
23615
  background: transparent !important;
23541
- color: var(${DesignToken42.ContentBasicSecondary});
23616
+ color: var(${DesignToken43.ContentBasicSecondary});
23542
23617
  `,
23543
23618
  children: /* @__PURE__ */ jsx4("td", { align: "left", colSpan: 6, children: /* @__PURE__ */ jsxs2(Text21, { as: "div", size: "md", children: [
23544
23619
  "There are no",
@@ -23609,11 +23684,11 @@ var Grid_default = WorkflowsGrid;
23609
23684
 
23610
23685
  // src/views/Workflows/List/View.tsx
23611
23686
  var markedStyles = css`
23612
- color: var(${DesignToken43.ActionPrimaryDefault});
23687
+ color: var(${DesignToken44.ActionPrimaryDefault});
23613
23688
  `;
23614
23689
  function WorkflowListView() {
23615
23690
  var _a;
23616
- const navigate = useNavigate19();
23691
+ const navigate = useNavigate20();
23617
23692
  const [state, setState] = useState32({
23618
23693
  filters: {
23619
23694
  status: "All",
@@ -23628,6 +23703,7 @@ function WorkflowListView() {
23628
23703
  return /* @__PURE__ */ jsx4(Loader5, { stretch: true });
23629
23704
  }
23630
23705
  return /* @__PURE__ */ jsxs2(View3, { center: hasNoData, noWrap: true, stretch: isLoading, children: [
23706
+ getWorkflowsEnv("isLiveChatMode") ? /* @__PURE__ */ jsx4(Row25, { noMaxWidth: true, notPadded: true, children: /* @__PURE__ */ jsx4(LiveChatNavbar_default, {}) }) : null,
23631
23707
  /* @__PURE__ */ jsxs2(Row25, { topMargin: true, verticalCenter: hasNoData, children: [
23632
23708
  /* @__PURE__ */ jsx4(Column18, { width: hasNoData ? 10 : 8, children: hasNoData ? /* @__PURE__ */ jsx4(Row25, { notPadded: true, children: /* @__PURE__ */ jsx4(
23633
23709
  Intro4,
@@ -23638,7 +23714,7 @@ function WorkflowListView() {
23638
23714
  Row25,
23639
23715
  {
23640
23716
  center: true,
23641
- gap: `var(${SpacingToken43.Spacing2})`,
23717
+ gap: `var(${SpacingToken44.Spacing2})`,
23642
23718
  notPadded: true,
23643
23719
  verticalCenter: true,
23644
23720
  children: [
@@ -23658,8 +23734,8 @@ function WorkflowListView() {
23658
23734
  header: "Your workflows"
23659
23735
  }
23660
23736
  ) }),
23661
- hasData ? /* @__PURE__ */ jsx4(Column18, { pullRight: true, children: /* @__PURE__ */ jsx4(
23662
- Button34,
23737
+ hasData && !getWorkflowsEnv("isHeadless") ? /* @__PURE__ */ jsx4(Column18, { pullRight: true, children: /* @__PURE__ */ jsx4(
23738
+ Button35,
23663
23739
  {
23664
23740
  kind: "primary",
23665
23741
  onClick: () => {
@@ -23669,7 +23745,7 @@ function WorkflowListView() {
23669
23745
  }
23670
23746
  ) }) : null
23671
23747
  ] }),
23672
- /* @__PURE__ */ jsx4(Row25, { children: /* @__PURE__ */ jsxs2(Column18, { gap: `var(${SpacingToken43.Spacing10})`, noMaxWidth: true, width: 12, children: [
23748
+ /* @__PURE__ */ jsx4(Row25, { children: /* @__PURE__ */ jsxs2(Column18, { gap: `var(${SpacingToken44.Spacing10})`, noMaxWidth: true, width: 12, children: [
23673
23749
  hasData ? /* @__PURE__ */ jsx4(
23674
23750
  Grid_default,
23675
23751
  {
@@ -23702,9 +23778,9 @@ var List_default2 = WorkflowList;
23702
23778
  // src/views/Workflows/index.tsx
23703
23779
  import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
23704
23780
  function Workflows() {
23705
- const navigate = useNavigate20();
23781
+ const navigate = useNavigate21();
23706
23782
  const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
23707
- useEffect18(() => {
23783
+ useEffect19(() => {
23708
23784
  if (isWorkflowAppLoading) {
23709
23785
  return;
23710
23786
  }
@@ -23724,7 +23800,7 @@ function Workflows() {
23724
23800
  var Workflows_default = Workflows;
23725
23801
 
23726
23802
  // src/views/Common/LoginError.tsx
23727
- import { Button as Button35, SpacingToken as SpacingToken44 } from "@livechat/design-system-react-components";
23803
+ import { Button as Button36, SpacingToken as SpacingToken45 } from "@livechat/design-system-react-components";
23728
23804
  import {
23729
23805
  Column as Column19,
23730
23806
  Intro as Intro5,
@@ -23736,14 +23812,14 @@ var imgContainerCss2 = css`
23736
23812
  img {
23737
23813
  height: auto;
23738
23814
  max-width: 100%;
23739
- margin-bottom: var(${SpacingToken44.Spacing10});
23815
+ margin-bottom: var(${SpacingToken45.Spacing10});
23740
23816
  }
23741
23817
  `;
23742
23818
  var paragraphCss = (heading) => css`
23743
23819
  ${heading ? theme.typography.heading.xs : theme.typography.paragraph.s}
23744
- margin-top: var(${heading ? SpacingToken44.Spacing10 : SpacingToken44.Spacing2});
23820
+ margin-top: var(${heading ? SpacingToken45.Spacing10 : SpacingToken45.Spacing2});
23745
23821
  `;
23746
- var wrapperCss = css`
23822
+ var wrapperCss2 = css`
23747
23823
  display: flex;
23748
23824
  flex-direction: column;
23749
23825
  align-items: center;
@@ -23757,12 +23833,12 @@ function LoginErrorPage({
23757
23833
  onAuthorize
23758
23834
  }) {
23759
23835
  if (getWorkflowsEnv("isHeadless")) {
23760
- return /* @__PURE__ */ jsxs2("div", { css: wrapperCss, children: [
23836
+ return /* @__PURE__ */ jsxs2("div", { css: wrapperCss2, children: [
23761
23837
  /* @__PURE__ */ jsx4(Row27, { center: true, noMaxWidth: true, verticalCenter: true, children: /* @__PURE__ */ jsx4(Column19, { center: true, width: 10, children: /* @__PURE__ */ jsx4("div", { css: imgContainerCss2, children: welcomeImage }) }) }),
23762
23838
  /* @__PURE__ */ jsx4(Row27, { center: true, noMaxWidth: true, verticalCenter: true, children: /* @__PURE__ */ jsxs2(Column19, { center: true, width: 10, children: [
23763
23839
  /* @__PURE__ */ jsx4(Intro5, { center: true, header: "Welcome to Workflows!", headerSize: "m" }),
23764
23840
  /* @__PURE__ */ jsx4("p", { css: paragraphCss(false), children: "You're using a browser that required additional login to access Workflows" }),
23765
- /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(Button35, { kind: "primary", onClick: onAuthorize, children: "Login with Text" }) })
23841
+ /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(Button36, { kind: "primary", onClick: onAuthorize, children: "Login with Text" }) })
23766
23842
  ] }) })
23767
23843
  ] });
23768
23844
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/platform-workflows",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
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/developer-studio-api": "3.4.10",
84
85
  "@livechat/developer-studio-ui-react": "1.1.1",
85
- "@livechat/platform-integrations": "0.0.47",
86
- "@livechat/developer-studio-api": "3.4.10"
86
+ "@livechat/platform-integrations": "0.0.47"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@tanstack/react-query": "4.36.1",