@flozy/editor 1.6.6 → 1.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/Editor/CommonEditor.js +2 -1
  2. package/dist/Editor/Editor.css +12 -16
  3. package/dist/Editor/Elements/AppHeader/AppHeader.js +10 -3
  4. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +12 -9
  5. package/dist/Editor/Elements/Carousel/Carousel.js +1 -1
  6. package/dist/Editor/Elements/Color Picker/Styles.js +2 -2
  7. package/dist/Editor/Elements/Embed/Image.js +15 -18
  8. package/dist/Editor/Elements/Embed/Video.js +11 -11
  9. package/dist/Editor/Elements/Form/Form.js +23 -1
  10. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +178 -0
  11. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +139 -0
  12. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +64 -0
  13. package/dist/Editor/Elements/Form/Workflow/Styles.js +207 -0
  14. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +207 -0
  15. package/dist/Editor/Elements/Form/Workflow/constant.js +3 -0
  16. package/dist/Editor/Elements/Form/Workflow/index.js +179 -0
  17. package/dist/Editor/Elements/Grid/Grid.js +0 -78
  18. package/dist/Editor/Elements/Grid/GridItem.js +8 -6
  19. package/dist/Editor/Elements/InlineIcon/InlineIcon.js +1 -2
  20. package/dist/Editor/Elements/Signature/Signed.js +11 -1
  21. package/dist/Editor/Elements/SimpleText.js +1 -3
  22. package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -2
  23. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +0 -1
  24. package/dist/Editor/Styles/EditorStyles.js +2 -2
  25. package/dist/Editor/Toolbar/Mini/Styles.js +4 -2
  26. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +1 -1
  27. package/dist/Editor/Toolbar/Toolbar.js +2 -1
  28. package/dist/Editor/Toolbar/toolbarGroups.js +2 -1
  29. package/dist/Editor/common/Icon.js +6 -6
  30. package/dist/Editor/common/ImageList.js +4 -8
  31. package/dist/Editor/common/ImageSelector/ImageSelector.js +18 -31
  32. package/dist/Editor/common/ImageSelector/Options/AddLink.js +4 -1
  33. package/dist/Editor/common/ImageSelector/Options/Upload.js +5 -0
  34. package/dist/Editor/common/ImageSelector/Styles.js +67 -8
  35. package/dist/Editor/common/ImageSelector/UploadStyles.js +27 -0
  36. package/dist/Editor/common/MentionsPopup/Styles.js +6 -3
  37. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +23 -13
  38. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +36 -35
  39. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +29 -0
  40. package/dist/Editor/common/StyleBuilder/index.js +1 -1
  41. package/dist/Editor/common/Uploader.js +14 -23
  42. package/dist/Editor/common/iconslist.js +79 -1
  43. package/dist/Editor/hooks/useMentions.js +0 -26
  44. package/dist/Editor/utils/customHooks/useResize.js +12 -3
  45. package/dist/Editor/utils/embed.js +16 -12
  46. package/dist/Editor/utils/emoji.js +0 -1
  47. package/dist/Editor/utils/form.js +1 -0
  48. package/dist/Editor/utils/insertAppHeader.js +66 -12
  49. package/package.json +2 -1
@@ -25,6 +25,7 @@ import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
25
25
  import { EditorProvider } from "./hooks/useMouseMove";
26
26
  import TopBanner from "./Elements/TopBanner/TopBanner";
27
27
  import editorStyles from "./Styles/EditorStyles";
28
+ import "animate.css";
28
29
  import { jsx as _jsx } from "react/jsx-runtime";
29
30
  import { jsxs as _jsxs } from "react/jsx-runtime";
30
31
  const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar"];
@@ -124,7 +125,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
124
125
  }));
125
126
  }, [id, content]);
126
127
  useEffect(() => {
127
- if (editorWrapper && editorWrapper?.current && loadedValue !== deboundedValue && isInteracted && onSave) {
128
+ if (editorWrapper && editorWrapper?.current && JSON.stringify(loadedValue) !== JSON.stringify(deboundedValue) && isInteracted && onSave) {
128
129
  const {
129
130
  value: strVal,
130
131
  ...restVal
@@ -176,14 +176,14 @@ blockquote {
176
176
 
177
177
  .accordion-title {
178
178
  position: relative;
179
- background-color: #FFF;
179
+ background-color: transparent;
180
180
  display: flex;
181
181
  align-items: center;
182
182
  }
183
183
 
184
184
  .accordion-content {
185
185
  padding-left: 13px;
186
- background-color: #FFF;
186
+ background-color: transparent;
187
187
  border-left: 1px solid #ccc;
188
188
  margin-left: 14px;
189
189
  }
@@ -473,10 +473,6 @@ blockquote {
473
473
  width: 100% !important;
474
474
  }
475
475
 
476
- .grid-item > div {
477
- text-align: center;
478
- }
479
-
480
476
  .page-builder .editor-wrapper {
481
477
  max-width: 100% !important;
482
478
  margin-top: 0px !important;
@@ -484,7 +480,7 @@ blockquote {
484
480
  }
485
481
 
486
482
  .embed {
487
- justify-content: center;
483
+ justify-content: center;
488
484
  }
489
485
 
490
486
  .embed img {
@@ -807,25 +803,25 @@ blockquote {
807
803
  visibility: hidden;
808
804
  opacity: 0;
809
805
  transition: all 0.5s;
806
+ text-align: center;
810
807
  }
811
808
 
812
809
  .uploadImageSection:hover .removeImageText {
813
810
  visibility: visible;
814
811
  opacity: 1;
812
+ text-align: center;
815
813
  }
816
814
 
817
815
  .uploadImageText,
818
816
  .removeImageText {
819
- border: 2px dashed #fff;
820
- border-radius: 8px;
821
- color: #fff;
822
- padding: 2px 8px;
823
- background-color: #00000090;
824
- font-size: 13px;
825
- font-weight: 600;
817
+ font-size: 16px;
818
+ font-weight: 400;
819
+ width: 200px;
826
820
  cursor: pointer;
827
- display: flex;
828
- align-items: center;
821
+ color:#464646;
822
+ span {
823
+ text-transform: capitalize;
824
+ }
829
825
  }
830
826
 
831
827
  .textFontArrows {
@@ -74,7 +74,8 @@ function AppHeader(props) {
74
74
  contentEditable: false,
75
75
  style: {
76
76
  top: "0px",
77
- right: "0px"
77
+ right: "0px",
78
+ zIndex: 1000
78
79
  },
79
80
  children: [/*#__PURE__*/_jsx(Tooltip, {
80
81
  title: "App Header Settings",
@@ -204,11 +205,14 @@ function AppHeader(props) {
204
205
  paddingLeft: `${left}px`,
205
206
  paddingRight: `${right}px`,
206
207
  paddingTop: `${top}px`,
207
- paddingBottom: `${bottom}px`
208
+ paddingBottom: `${bottom}px`,
209
+ zIndex: 999
208
210
  },
209
211
  children: /*#__PURE__*/_jsxs(Toolbar, {
210
212
  style: {
211
- flexDirection: isLogoRight ? "row-reverse" : "row"
213
+ flexDirection: isLogoRight ? "row-reverse" : "row",
214
+ paddingLeft: "0px",
215
+ paddingRight: "0px"
212
216
  },
213
217
  children: [/*#__PURE__*/_jsx(IconButton, {
214
218
  color: "inherit",
@@ -322,6 +326,9 @@ function AppHeader(props) {
322
326
  }), /*#__PURE__*/_jsx(ToolBar, {})]
323
327
  }), /*#__PURE__*/_jsx("div", {
324
328
  contentEditable: false,
329
+ style: {
330
+ display: "none"
331
+ },
325
332
  children: children
326
333
  })]
327
334
  }), openSetttings ? /*#__PURE__*/_jsx(AppHeaderPopup, {
@@ -1,22 +1,25 @@
1
1
  import React from "react";
2
- import { IconButton, Tooltip } from "@mui/material";
3
2
  import { insertAppHeader } from "../../utils/insertAppHeader";
4
- import { AppHeader } from "../../common/iconslist";
3
+ import ToolbarIcon from "../../common/ToolbarIcon";
4
+ import Icon from "../../common/Icon";
5
+ import insertNewLine from "../../utils/insertNewLine";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  const AppHeaderButton = props => {
7
8
  const {
8
- editor
9
+ editor,
10
+ icoBtnType
9
11
  } = props;
10
12
  const handleClick = () => {
11
13
  insertAppHeader(editor, {});
14
+ insertNewLine(editor);
12
15
  };
13
- return /*#__PURE__*/_jsx(Tooltip, {
16
+ return /*#__PURE__*/_jsx(ToolbarIcon, {
14
17
  title: "App Header",
15
- arrow: true,
16
- children: /*#__PURE__*/_jsx(IconButton, {
17
- onClick: handleClick,
18
- children: /*#__PURE__*/_jsx(AppHeader, {})
19
- })
18
+ onClick: handleClick,
19
+ icon: /*#__PURE__*/_jsx(Icon, {
20
+ icon: "appHeader"
21
+ }),
22
+ icoBtnType: icoBtnType
20
23
  });
21
24
  };
22
25
  export default AppHeaderButton;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { Transforms, Editor } from "slate";
3
- import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
3
+ import { ReactEditor, useSlateStatic } from "slate-react";
4
4
  import Slider from "react-slick";
5
5
  import "./slick-theme.min.css";
6
6
  import "./slick.min.css";
@@ -29,12 +29,12 @@ const ColorPickerStyles = () => ({
29
29
  width: "100%",
30
30
  padding: "4px",
31
31
  display: "flex",
32
- justifyCotnent: "center",
32
+ justifyContent: "center",
33
33
  alignItems: "center",
34
34
  flexDirection: "column",
35
35
  "& .buttonsWrpr": {
36
36
  display: "flex",
37
- justifyCotnent: "center",
37
+ justifyContent: "center",
38
38
  alignItems: "center"
39
39
  },
40
40
  ".more-btn-cbs": {
@@ -26,7 +26,8 @@ const Image = ({
26
26
  borderColor,
27
27
  borderRadius,
28
28
  cols,
29
- rowHeight
29
+ rowHeight,
30
+ boxShadow
30
31
  } = element;
31
32
  const {
32
33
  readOnly
@@ -48,16 +49,22 @@ const Image = ({
48
49
  horizantal
49
50
  } = alignment || {};
50
51
  const editor = useSlateStatic();
51
- // const selected = useSelected();
52
52
  const [parentDOM, setParentDOM] = useState(null);
53
53
  const [openSetttings, setOpenSettings] = useState(false);
54
+ const path = ReactEditor.findPath(editor, element);
54
55
  const [size, onMouseDown, resizing, onLoad] = useResize({
55
56
  parentDOM,
56
- size: element?.size
57
+ size: element?.size,
58
+ onChange: uSize => {
59
+ Transforms.setNodes(editor, {
60
+ size: uSize
61
+ }, {
62
+ at: path
63
+ });
64
+ }
57
65
  });
58
66
  const arr = Array.from(Node.elements(editor));
59
67
  const ele = arr.find(([elem]) => element === elem);
60
- const path = ReactEditor.findPath(editor, element);
61
68
  const {
62
69
  hoverPath
63
70
  } = useEditorContext();
@@ -69,18 +76,6 @@ const Image = ({
69
76
  onLoad(element?.size || {});
70
77
  }
71
78
  }, []);
72
- useEffect(() => {
73
- if (!resizing) {
74
- onLoad(element?.size || {});
75
- }
76
- }, [element?.size]);
77
- useEffect(() => {
78
- if (!resizing) {
79
- Transforms.setNodes(editor, {
80
- size: size
81
- });
82
- }
83
- }, [resizing]);
84
79
  const handleImageClick = () => {
85
80
  Transforms.select(editor, {
86
81
  anchor: Editor.start(editor, path),
@@ -121,7 +116,7 @@ const Image = ({
121
116
 
122
117
  const ToolBar = () => {
123
118
  return selected ? /*#__PURE__*/_jsx("div", {
124
- className: "element-toolbar",
119
+ className: "element-toolbar visible-on-hover",
125
120
  contentEditable: false,
126
121
  children: /*#__PURE__*/_jsx(Tooltip, {
127
122
  title: "Image Settings",
@@ -174,7 +169,9 @@ const Image = ({
174
169
  cols: cols
175
170
  }) : /*#__PURE__*/_jsx("img", {
176
171
  style: {
177
- borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`
172
+ borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
173
+ objectFit: "cover",
174
+ boxShadow: boxShadow || "none"
178
175
  },
179
176
  alt: alt,
180
177
  src: url,
@@ -38,27 +38,27 @@ const Video = ({
38
38
  left,
39
39
  right
40
40
  } = bannerSpacing || {};
41
+ const path = ReactEditor.findPath(editor, element);
41
42
  const [size, onMouseDown, resizing, onLoad] = useResize({
42
43
  parentDOM,
43
- size: element?.size
44
+ size: element?.size,
45
+ onChange: uSize => {
46
+ Transforms.setNodes(editor, {
47
+ size: uSize
48
+ }, {
49
+ at: path
50
+ });
51
+ }
44
52
  });
45
53
  const arr = Array.from(Node.elements(editor));
46
54
  const ele = arr.find(([elem]) => element === elem);
47
- const path = ReactEditor.findPath(editor, element);
48
55
  useEffect(() => {
49
56
  if (editor && ele[1] !== undefined) {
50
57
  const dom = ReactEditor.toDOMNode(editor, Node.get(editor, ele[1]));
51
58
  setParentDOM(dom);
52
- onLoad(dom);
59
+ onLoad(element?.size || {});
53
60
  }
54
61
  }, []);
55
- useEffect(() => {
56
- if (!resizing) {
57
- Transforms.setNodes(editor, {
58
- size: size
59
- });
60
- }
61
- }, [resizing]);
62
62
  const ToolBar = () => {
63
63
  return /*#__PURE__*/_jsxs("div", {
64
64
  className: "element-toolbar visible-on-hover",
@@ -104,7 +104,7 @@ const Video = ({
104
104
  });
105
105
  };
106
106
  const totalMinus = parseInt(left || 0) + parseInt(right || 0);
107
- const width = resizing ? `${size.width}px` : `${size.widthInPercent}%`;
107
+ const width = resizing ? `${size.width}px` : `${size.widthInPercent || 100}%`;
108
108
  return /*#__PURE__*/_jsxs("div", {
109
109
  ...attributes,
110
110
  className: "embed has-hover",
@@ -5,11 +5,13 @@ import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress } from "@mu
5
5
  import DeleteIcon from "@mui/icons-material/Delete";
6
6
  import BackupIcon from "@mui/icons-material/Backup";
7
7
  import { GridSettingsIcon, GridAddSectionIcon } from "../../common/iconslist";
8
+ import SendTimeExtensionIcon from '@mui/icons-material/SendTimeExtension';
8
9
  import FormPopup from "./FormPopup";
9
10
  import ButtonPopup from "../Button/ButtonPopup";
10
11
  import { formField } from "../../utils/formfield";
11
12
  import { formSubmit } from "../../service/formSubmit";
12
13
  import formButtonStyle from "../../common/StyleBuilder/formButtonStyle";
14
+ import Workflow from "./Workflow";
13
15
  import { jsx as _jsx } from "react/jsx-runtime";
14
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
17
  const Form = props => {
@@ -57,6 +59,7 @@ const Form = props => {
57
59
  const editor = useSlateStatic();
58
60
  const formEle = useRef();
59
61
  const [openSetttings, setOpenSettings] = useState(false);
62
+ const [openWorkflow, setOpenWorkflow] = useState(false);
60
63
  const [editButton, setEditButton] = useState(false);
61
64
  const [anchorEl, setAnchorEl] = useState(null);
62
65
  const [loading, setLoading] = useState(false);
@@ -88,6 +91,7 @@ const Form = props => {
88
91
  response,
89
92
  form_data: {
90
93
  email: element?.email,
94
+ form_workflow: element?.workflow,
91
95
  save_response: element?.saveResponse
92
96
  }
93
97
  };
@@ -132,6 +136,12 @@ const Form = props => {
132
136
  });
133
137
  }
134
138
  };
139
+ const onWorkflow = () => {
140
+ setOpenWorkflow(true);
141
+ };
142
+ const closeWorkflow = () => {
143
+ setOpenWorkflow(false);
144
+ };
135
145
  const onSaveButtonSettings = data => {
136
146
  onSave({
137
147
  buttonProps: {
@@ -208,6 +218,13 @@ const Form = props => {
208
218
  className: "mr",
209
219
  children: /*#__PURE__*/_jsx(DeleteIcon, {})
210
220
  })
221
+ }), /*#__PURE__*/_jsx(Tooltip, {
222
+ title: "Workflow",
223
+ arrow: true,
224
+ children: /*#__PURE__*/_jsx(IconButton, {
225
+ onClick: onWorkflow,
226
+ children: /*#__PURE__*/_jsx(SendTimeExtensionIcon, {})
227
+ })
211
228
  })]
212
229
  });
213
230
  };
@@ -314,7 +331,12 @@ const Form = props => {
314
331
  onSave: onSave,
315
332
  onClose: onClose,
316
333
  customProps: customProps
317
- }) : null, !readOnly ? /*#__PURE__*/_jsxs(Menu, {
334
+ }) : null, /*#__PURE__*/_jsx(Workflow, {
335
+ openWorkflow: openWorkflow,
336
+ element: element,
337
+ closeWorkflow: closeWorkflow,
338
+ onSave: onSave
339
+ }), !readOnly ? /*#__PURE__*/_jsxs(Menu, {
318
340
  className: "editor-btn-options",
319
341
  open: anchorEl !== null,
320
342
  anchorEl: anchorEl,
@@ -0,0 +1,178 @@
1
+ import React from "react";
2
+ import { Grid, Radio, RadioGroup, Typography, FormControlLabel, Select, MenuItem, FormControl, TextField } from "@mui/material";
3
+ import FormStyles from "./Styles";
4
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
5
+ import UserInputs from "./UserInputs";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ const FormWorkflow = props => {
9
+ const {
10
+ schedule,
11
+ element,
12
+ setSchedule,
13
+ scheduleEvery,
14
+ setScheduleEvery,
15
+ currentInstant,
16
+ scheduleOn,
17
+ setScheduleOn,
18
+ subject,
19
+ setSubject,
20
+ bodyData,
21
+ setBodyData,
22
+ handleSelectedVariables,
23
+ handleInputReset
24
+ } = props;
25
+ const classes = FormStyles();
26
+ const handleBodyField = event => {
27
+ setBodyData(event.target.value);
28
+ };
29
+ const handleScheduleInstant = event => {
30
+ setScheduleEvery(event.target.value);
31
+ };
32
+ const onHandleChange = event => {
33
+ setScheduleOn(event.target.value);
34
+ };
35
+ const onSubjectChange = event => {
36
+ setSubject(event.target.value);
37
+ };
38
+ return /*#__PURE__*/_jsxs(Grid, {
39
+ container: true,
40
+ children: [/*#__PURE__*/_jsxs(Grid, {
41
+ item: true,
42
+ xs: 12,
43
+ children: [/*#__PURE__*/_jsx(Typography, {
44
+ sx: classes.subHeadings,
45
+ children: "Set Timings *"
46
+ }), /*#__PURE__*/_jsx(Typography, {
47
+ sx: classes.infoText,
48
+ children: "Invitees will receive reminder emails at specified times before scheduled events"
49
+ })]
50
+ }), /*#__PURE__*/_jsx(Grid, {
51
+ item: true,
52
+ children: /*#__PURE__*/_jsxs(Grid, {
53
+ container: true,
54
+ direction: "row",
55
+ alignItems: "flex-end",
56
+ children: [/*#__PURE__*/_jsx(Grid, {
57
+ item: true,
58
+ sx: classes.radioBtn,
59
+ children: /*#__PURE__*/_jsxs(RadioGroup, {
60
+ name: "set timing",
61
+ value: schedule,
62
+ defaultValue: 1,
63
+ children: [/*#__PURE__*/_jsx(FormControlLabel, {
64
+ value: 'immediately',
65
+ label: "Immediately",
66
+ onChange: () => {
67
+ setSchedule('immediately');
68
+ },
69
+ control: /*#__PURE__*/_jsx(Radio, {
70
+ size: "small"
71
+ })
72
+ }), /*#__PURE__*/_jsx(FormControlLabel, {
73
+ value: 'after',
74
+ label: "After",
75
+ onChange: () => {
76
+ setSchedule('after');
77
+ },
78
+ control: /*#__PURE__*/_jsx(Radio, {
79
+ size: "small"
80
+ })
81
+ })]
82
+ })
83
+ }), schedule === 'after' && /*#__PURE__*/_jsx(Grid, {
84
+ item: true,
85
+ children: /*#__PURE__*/_jsxs(Grid, {
86
+ container: true,
87
+ gap: 2,
88
+ children: [/*#__PURE__*/_jsx(Grid, {
89
+ item: true,
90
+ children: /*#__PURE__*/_jsx(FormControl, {
91
+ fullWidth: true,
92
+ size: "small",
93
+ children: /*#__PURE__*/_jsx(Select, {
94
+ value: scheduleOn,
95
+ onChange: onHandleChange,
96
+ sx: classes.select,
97
+ IconComponent: KeyboardArrowDownIcon,
98
+ children: currentInstant.map((ele, index) => /*#__PURE__*/_jsx(MenuItem, {
99
+ sx: classes.selectList,
100
+ value: ele,
101
+ children: ele
102
+ }, `${ele}_${index}`))
103
+ })
104
+ })
105
+ }), /*#__PURE__*/_jsx(Grid, {
106
+ item: true,
107
+ children: /*#__PURE__*/_jsx(FormControl, {
108
+ fullWidth: true,
109
+ size: "small",
110
+ children: /*#__PURE__*/_jsxs(Select, {
111
+ value: scheduleEvery,
112
+ onChange: handleScheduleInstant,
113
+ sx: classes.select,
114
+ IconComponent: KeyboardArrowDownIcon,
115
+ style: {
116
+ minWidth: '160px'
117
+ },
118
+ children: [/*#__PURE__*/_jsx(MenuItem, {
119
+ sx: classes.selectList,
120
+ value: 'min',
121
+ children: "Minutes"
122
+ }), /*#__PURE__*/_jsx(MenuItem, {
123
+ sx: classes.selectList,
124
+ value: 'hr',
125
+ children: "Hours"
126
+ }), /*#__PURE__*/_jsx(MenuItem, {
127
+ sx: classes.selectList,
128
+ value: 'day',
129
+ children: "Day"
130
+ })]
131
+ })
132
+ })
133
+ })]
134
+ })
135
+ })]
136
+ })
137
+ }), /*#__PURE__*/_jsxs(Grid, {
138
+ item: true,
139
+ xs: 12,
140
+ children: [/*#__PURE__*/_jsx(Typography, {
141
+ sx: classes.formHeadings,
142
+ children: "Subject *"
143
+ }), /*#__PURE__*/_jsx(TextField, {
144
+ multiline: true,
145
+ margin: "none",
146
+ value: subject,
147
+ onChange: onSubjectChange,
148
+ fullWidth: true,
149
+ maxRows: 5,
150
+ sx: {
151
+ "& fieldset": {
152
+ border: '1px solid #6F6F6F33',
153
+ borderRadius: "8px"
154
+ },
155
+ "& textarea": {
156
+ fontSize: '16px',
157
+ fontWeight: 500
158
+ }
159
+ }
160
+ })]
161
+ }), /*#__PURE__*/_jsxs(Grid, {
162
+ item: true,
163
+ xs: 12,
164
+ children: [/*#__PURE__*/_jsx(Typography, {
165
+ sx: classes.formHeadings,
166
+ children: "Body *"
167
+ }), /*#__PURE__*/_jsx(UserInputs, {
168
+ element: element,
169
+ type: 2,
170
+ subject: bodyData,
171
+ handleField: handleBodyField,
172
+ handleSelectedVariables: handleSelectedVariables,
173
+ handleInputReset: handleInputReset
174
+ })]
175
+ })]
176
+ });
177
+ };
178
+ export default FormWorkflow;
@@ -0,0 +1,139 @@
1
+ import React from "react";
2
+ import { Grid, Typography } from "@mui/material";
3
+ import FormStyles from "./Styles";
4
+ import MoreOptions from "./MoreOptions";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ const ListWorkflow = props => {
8
+ const {
9
+ workflow,
10
+ handleEditFormWorkflow,
11
+ handleDeleteFormWorkflow
12
+ } = props;
13
+ const classes = FormStyles();
14
+ const optionsList = ["Edit", "Delete"];
15
+ const onMenuClick = (selectedMenu, selectedFlow) => () => {
16
+ if (selectedMenu === "Edit") {
17
+ handleEditFormWorkflow(selectedFlow);
18
+ } else if (selectedMenu === "Delete") {
19
+ handleDeleteFormWorkflow(selectedFlow);
20
+ }
21
+ };
22
+ return /*#__PURE__*/_jsx(Grid, {
23
+ container: true,
24
+ gap: 2,
25
+ children: workflow?.map((flow, index) => /*#__PURE__*/_jsx(Grid, {
26
+ item: true,
27
+ xs: 12,
28
+ children: /*#__PURE__*/_jsxs(Grid, {
29
+ container: true,
30
+ sx: classes.flowListCard,
31
+ alignItems: "center",
32
+ justifyContent: "space-between",
33
+ children: [/*#__PURE__*/_jsx(Grid, {
34
+ item: true,
35
+ xs: 11,
36
+ children: /*#__PURE__*/_jsxs(Grid, {
37
+ container: true,
38
+ gap: 1,
39
+ children: [/*#__PURE__*/_jsx(Grid, {
40
+ item: true,
41
+ xs: 12,
42
+ children: /*#__PURE__*/_jsxs(Grid, {
43
+ container: true,
44
+ alignItems: "center",
45
+ children: [/*#__PURE__*/_jsx(Grid, {
46
+ item: true,
47
+ children: /*#__PURE__*/_jsx(Typography, {
48
+ sx: classes.listHeading,
49
+ children: "Subject:"
50
+ })
51
+ }), /*#__PURE__*/_jsx(Grid, {
52
+ item: true,
53
+ children: /*#__PURE__*/_jsx(Typography, {
54
+ sx: classes.listSubHeading,
55
+ style: {
56
+ paddingLeft: '24px'
57
+ },
58
+ children: flow.subject_data
59
+ })
60
+ })]
61
+ })
62
+ }), /*#__PURE__*/_jsx(Grid, {
63
+ item: true,
64
+ xs: 12,
65
+ children: /*#__PURE__*/_jsxs(Grid, {
66
+ container: true,
67
+ alignItems: "center",
68
+ children: [/*#__PURE__*/_jsx(Grid, {
69
+ item: true,
70
+ children: /*#__PURE__*/_jsx(Typography, {
71
+ sx: classes.listHeading,
72
+ children: "Body:"
73
+ })
74
+ }), /*#__PURE__*/_jsx(Grid, {
75
+ item: true,
76
+ children: /*#__PURE__*/_jsx(Typography, {
77
+ sx: classes.listSubHeading,
78
+ style: {
79
+ paddingLeft: '40px'
80
+ },
81
+ children: flow.body_data
82
+ })
83
+ })]
84
+ })
85
+ }), /*#__PURE__*/_jsx(Grid, {
86
+ item: true,
87
+ xs: 12,
88
+ children: /*#__PURE__*/_jsxs(Grid, {
89
+ container: true,
90
+ alignItems: "center",
91
+ children: [/*#__PURE__*/_jsx(Grid, {
92
+ item: true,
93
+ children: /*#__PURE__*/_jsx(Typography, {
94
+ sx: classes.listHeading,
95
+ children: "Scheduled:"
96
+ })
97
+ }), /*#__PURE__*/_jsx(Grid, {
98
+ item: true,
99
+ children: /*#__PURE__*/_jsxs(Grid, {
100
+ container: true,
101
+ children: [/*#__PURE__*/_jsx(Grid, {
102
+ item: true,
103
+ children: /*#__PURE__*/_jsx(Typography, {
104
+ sx: classes.listSubHeading,
105
+ style: {
106
+ paddingLeft: '5px'
107
+ },
108
+ children: flow.schedule_type
109
+ })
110
+ }), flow.schedule_type === 'after' && /*#__PURE__*/_jsx(Grid, {
111
+ item: true,
112
+ children: /*#__PURE__*/_jsxs(Typography, {
113
+ sx: classes.listSubHeading,
114
+ style: {
115
+ paddingLeft: '5px'
116
+ },
117
+ children: [flow.schedule_on, flow.schedule_every]
118
+ })
119
+ })]
120
+ })
121
+ })]
122
+ })
123
+ })]
124
+ })
125
+ }), /*#__PURE__*/_jsx(Grid, {
126
+ item: true,
127
+ xs: 1,
128
+ children: /*#__PURE__*/_jsx(MoreOptions, {
129
+ classes: classes,
130
+ menus: optionsList,
131
+ selectedFlow: index,
132
+ onMenuClick: onMenuClick
133
+ })
134
+ })]
135
+ })
136
+ }, `workflow_list_${index}`))
137
+ });
138
+ };
139
+ export default ListWorkflow;