@flozy/editor 4.0.2 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. package/dist/Editor/ChatEditor.js +14 -9
  2. package/dist/Editor/CommonEditor.js +185 -170
  3. package/dist/Editor/DialogWrapper.js +4 -3
  4. package/dist/Editor/Editor.css +5 -19
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +52 -41
  6. package/dist/Editor/Elements/Accordion/AccordionSummary.js +4 -15
  7. package/dist/Editor/Elements/AppHeader/AppHeader.js +39 -26
  8. package/dist/Editor/Elements/Button/EditorButton.js +33 -38
  9. package/dist/Editor/Elements/Carousel/CarouselButton.js +0 -1
  10. package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -59
  11. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  12. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  13. package/dist/Editor/Elements/Color Picker/Styles.js +1 -2
  14. package/dist/Editor/Elements/Embed/Image.js +15 -14
  15. package/dist/Editor/Elements/Embed/Video.js +12 -8
  16. package/dist/Editor/Elements/Emoji/EmojiButton.js +11 -7
  17. package/dist/Editor/Elements/Form/Form.js +43 -27
  18. package/dist/Editor/Elements/Form/FormField.js +21 -10
  19. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +3 -12
  20. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +1 -2
  21. package/dist/Editor/Elements/Form/Workflow/index.js +5 -2
  22. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +437 -0
  23. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +206 -0
  24. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +23 -0
  25. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +236 -0
  26. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +44 -0
  27. package/dist/Editor/Elements/FreeGrid/Options/More.js +24 -0
  28. package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +47 -0
  29. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +19 -0
  30. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +75 -0
  31. package/dist/Editor/Elements/FreeGrid/styles.js +214 -0
  32. package/dist/Editor/Elements/Grid/Grid.js +11 -9
  33. package/dist/Editor/Elements/Grid/GridItem.js +31 -23
  34. package/dist/Editor/Elements/Link/Link.js +1 -6
  35. package/dist/Editor/Elements/Link/LinkButton.js +2 -4
  36. package/dist/Editor/Elements/Link/LinkPopup.js +15 -18
  37. package/dist/Editor/Elements/NewLine/NewLineButton.js +0 -1
  38. package/dist/Editor/Elements/Signature/SignaturePopup.js +1 -1
  39. package/dist/Editor/Elements/SimpleText/index.js +18 -16
  40. package/dist/Editor/Elements/SimpleText/style.js +43 -0
  41. package/dist/Editor/ErrorBoundary.js +30 -0
  42. package/dist/Editor/MiniEditor.js +1 -3
  43. package/dist/Editor/Styles/EditorStyles.js +28 -0
  44. package/dist/Editor/Toolbar/Basic/index.js +2 -4
  45. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +2 -26
  46. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  47. package/dist/Editor/Toolbar/FormatTools/TextSize.js +11 -5
  48. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -3
  49. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +11 -4
  50. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +86 -213
  51. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
  52. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +14 -26
  53. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +2 -68
  54. package/dist/Editor/Toolbar/PopupTool/index.js +8 -0
  55. package/dist/Editor/Toolbar/Toolbar.js +7 -0
  56. package/dist/Editor/Toolbar/toolbarGroups.js +16 -48
  57. package/dist/Editor/common/ColorPickerButton.js +9 -25
  58. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  59. package/dist/Editor/common/EditorCmds.js +0 -3
  60. package/dist/Editor/common/Icon.js +16 -34
  61. package/dist/Editor/common/LinkSettings/NavComponents.js +2 -5
  62. package/dist/Editor/common/LinkSettings/index.js +1 -2
  63. package/dist/Editor/common/LinkSettings/navOptions.js +2 -7
  64. package/dist/Editor/common/MentionsPopup/index.js +12 -8
  65. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +142 -0
  66. package/dist/Editor/common/RnD/ContextMenu/index.js +38 -0
  67. package/dist/Editor/common/RnD/ContextMenu/styles.js +21 -0
  68. package/dist/Editor/common/RnD/DragInfo/index.js +31 -0
  69. package/dist/Editor/common/RnD/DragInfo/styles.js +15 -0
  70. package/dist/Editor/common/RnD/DragOver/index.js +55 -0
  71. package/dist/Editor/common/RnD/DragOver/styles.js +23 -0
  72. package/dist/Editor/common/RnD/ElementOptions/Actions.js +102 -0
  73. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +26 -0
  74. package/dist/Editor/common/RnD/ElementOptions/index.js +95 -0
  75. package/dist/Editor/common/RnD/ElementOptions/styles.js +41 -0
  76. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +153 -0
  77. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +36 -0
  78. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +60 -0
  79. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +9 -0
  80. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +47 -0
  81. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +47 -0
  82. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +47 -0
  83. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +48 -0
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +47 -0
  85. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +30 -0
  86. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +47 -0
  87. package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +17 -0
  88. package/dist/Editor/common/RnD/ElementSettings/index.js +17 -0
  89. package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +18 -0
  90. package/dist/Editor/common/RnD/ElementSettings/styles.js +94 -0
  91. package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +52 -0
  92. package/dist/Editor/common/RnD/GuideLines/index.js +33 -0
  93. package/dist/Editor/common/RnD/GuideLines/styles.js +62 -0
  94. package/dist/Editor/common/RnD/OptionsPopup/index.js +50 -0
  95. package/dist/Editor/common/RnD/OptionsPopup/style.js +36 -0
  96. package/dist/Editor/common/RnD/RnDCopy.js +23 -0
  97. package/dist/Editor/common/RnD/ShadowElement.js +34 -0
  98. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +40 -0
  99. package/dist/Editor/common/RnD/SwitchViewport/styles.js +24 -0
  100. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +63 -0
  101. package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +19 -0
  102. package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +13 -0
  103. package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +20 -0
  104. package/dist/Editor/common/RnD/TransformHandles/index.js +67 -0
  105. package/dist/Editor/common/RnD/Utils/alignmentDetection.js +26 -0
  106. package/dist/Editor/common/RnD/Utils/calculateDropItem.js +98 -0
  107. package/dist/Editor/common/RnD/Utils/collisionDetection.js +52 -0
  108. package/dist/Editor/common/RnD/Utils/gridDropItem.js +181 -0
  109. package/dist/Editor/common/RnD/Utils/index.js +251 -0
  110. package/dist/Editor/common/RnD/VirtualElement/index.js +77 -0
  111. package/dist/Editor/common/RnD/VirtualElement/styles.js +27 -0
  112. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +28 -0
  113. package/dist/Editor/common/RnD/index.js +567 -0
  114. package/dist/Editor/common/RnD/styles.js +4 -0
  115. package/dist/Editor/common/Section/index.js +21 -12
  116. package/dist/Editor/common/Section/styles.js +7 -4
  117. package/dist/Editor/common/Shorthands/elements.js +12 -54
  118. package/dist/Editor/common/StyleBuilder/boxStyle.js +30 -0
  119. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  120. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +36 -44
  121. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +23 -33
  122. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
  123. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -31
  124. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  125. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +18 -5
  126. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -2
  127. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +4 -14
  128. package/dist/Editor/common/StyleBuilder/index.js +5 -3
  129. package/dist/Editor/common/StyleBuilder/sectionStyle.js +13 -2
  130. package/dist/Editor/helper/RnD/focusOnNewItem.js +39 -0
  131. package/dist/Editor/helper/RnD/scrollToNewSection.js +24 -0
  132. package/dist/Editor/helper/breakpoint.js +5 -0
  133. package/dist/Editor/helper/index.js +139 -0
  134. package/dist/Editor/helper/theme.js +48 -186
  135. package/dist/Editor/hooks/useBreakpoints.js +34 -0
  136. package/dist/Editor/hooks/useMouseMove.js +37 -12
  137. package/dist/Editor/hooks/withCommon.js +2 -1
  138. package/dist/Editor/hooks/withErrorHandling.js +14 -0
  139. package/dist/Editor/plugins/withEmbeds.js +1 -1
  140. package/dist/Editor/plugins/withHTML.js +1 -1
  141. package/dist/Editor/plugins/withTable.js +1 -1
  142. package/dist/Editor/theme/ThemeList.js +173 -50
  143. package/dist/Editor/utils/RnD/RnDCtrlCmds.js +197 -0
  144. package/dist/Editor/utils/SlateUtilityFunctions.js +60 -164
  145. package/dist/Editor/utils/button.js +17 -1
  146. package/dist/Editor/utils/events.js +5 -0
  147. package/dist/Editor/utils/font.js +37 -40
  148. package/dist/Editor/utils/form.js +7 -2
  149. package/dist/Editor/utils/formfield.js +1 -1
  150. package/dist/Editor/utils/freegrid.js +91 -0
  151. package/dist/Editor/utils/helper.js +44 -30
  152. package/dist/Editor/utils/insertAppHeader.js +47 -40
  153. package/package.json +5 -2
  154. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  155. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  156. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  157. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  158. package/dist/Editor/common/CustomDialog/index.js +0 -94
  159. package/dist/Editor/common/CustomDialog/style.js +0 -67
  160. package/dist/Editor/common/CustomSelect.js +0 -33
  161. package/dist/Editor/hooks/useEditorTheme.js +0 -139
  162. package/dist/Editor/theme/index.js +0 -144
  163. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  164. package/dist/Editor/themeSettings/buttons/index.js +0 -290
  165. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  166. package/dist/Editor/themeSettings/colorTheme/index.js +0 -290
  167. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  168. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -123
  169. package/dist/Editor/themeSettings/fonts/index.js +0 -213
  170. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  171. package/dist/Editor/themeSettings/icons.js +0 -60
  172. package/dist/Editor/themeSettings/index.js +0 -320
  173. package/dist/Editor/themeSettings/style.js +0 -152
  174. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  175. package/dist/Editor/themeSettingsAI/index.js +0 -356
  176. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -190
  177. package/dist/Editor/themeSettingsAI/style.js +0 -247
@@ -4,15 +4,16 @@ import { Node, Transforms, Editor } from "slate";
4
4
  import AspectRatioIcon from "@mui/icons-material/AspectRatio";
5
5
  import useResize from "../../utils/customHooks/useResize";
6
6
  import EmbedPopup from "./EmbedPopup";
7
- import { IconButton, Tooltip, Box } from "@mui/material";
7
+ import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
8
8
  import { GridSettingsIcon, LinkIcon } from "../../common/iconslist";
9
9
  import { useEditorContext } from "../../hooks/useMouseMove";
10
- import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
10
+ import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
11
11
  import Icon from "../../common/Icon";
12
12
  import frames from "./Frames";
13
13
  import ImageFrame from "./Frames/ImageFrame";
14
14
  import LinkSettings from "../../common/LinkSettings";
15
15
  import { handleLinkType } from "../../utils/helper";
16
+ import { wrapThemeBreakpoints } from "../FreeGrid/breakpointConstants";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
19
  const ToolBar = ({
@@ -65,6 +66,7 @@ const ImageContent = ({
65
66
  objectFit,
66
67
  webAddress
67
68
  } = element;
69
+ const theme = useTheme();
68
70
  return !url && !readOnly ? /*#__PURE__*/_jsxs(Box, {
69
71
  component: "button",
70
72
  className: "element-empty-btn",
@@ -79,9 +81,7 @@ const ImageContent = ({
79
81
  component: "img",
80
82
  className: "emb-img",
81
83
  sx: {
82
- borderRadius: {
83
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
84
- },
84
+ ...wrapThemeBreakpoints(getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true), "borderRadius", theme),
85
85
  objectFit: "cover",
86
86
  boxShadow: boxShadow || "none",
87
87
  height: objectFit ? "100%" : "auto",
@@ -105,6 +105,7 @@ const Image = ({
105
105
  children,
106
106
  customProps
107
107
  }) => {
108
+ const theme = useTheme();
108
109
  const {
109
110
  url,
110
111
  bannerSpacing,
@@ -227,12 +228,14 @@ const Image = ({
227
228
  };
228
229
  } else {
229
230
  return {
230
- width: url ? {
231
- ...getBreakPointsValue(getSize(), null, "overrideReSize", true)
232
- } : "100%",
233
- height: objectFit && url ? {
234
- ...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
235
- } : "auto"
231
+ ...groupByBreakpoint({
232
+ width: url ? {
233
+ ...getBreakPointsValue(getSize(), null, "overrideReSize", true)
234
+ } : "100%",
235
+ height: objectFit && url ? {
236
+ ...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
237
+ } : "auto"
238
+ }, theme)
236
239
  };
237
240
  }
238
241
  };
@@ -247,9 +250,7 @@ const Image = ({
247
250
  },
248
251
  width: `100%`,
249
252
  maxWidth: "100%",
250
- padding: {
251
- ...getTRBLBreakPoints(bannerSpacing)
252
- },
253
+ ...wrapThemeBreakpoints(getTRBLBreakPoints(bannerSpacing), "padding", theme),
253
254
  backgroundColor: bgColor,
254
255
  justifyContent: horizantal,
255
256
  alignContent: vertical
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from "react";
2
2
  import { useSlateStatic, ReactEditor } from "slate-react";
3
3
  import { Node, Transforms } from "slate";
4
- import { IconButton, Tooltip, Box } from "@mui/material";
4
+ import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
5
5
  import DeleteIcon from "@mui/icons-material/Delete";
6
6
  import AspectRatioIcon from "@mui/icons-material/AspectRatio";
7
7
  import Icon from "../../common/Icon";
@@ -10,7 +10,7 @@ import EmbedPopup from "./EmbedPopup";
10
10
  import { GridSettingsIcon } from "../../common/iconslist";
11
11
  import { gradientBorder } from "../../utils/helper";
12
12
  import { getEmbedURL } from "../../helper";
13
- import { getBreakPointsValue } from "../../helper/theme";
13
+ import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  const Video = ({
@@ -19,6 +19,7 @@ const Video = ({
19
19
  children,
20
20
  customProps
21
21
  }) => {
22
+ const theme = useTheme();
22
23
  const {
23
24
  alt,
24
25
  alignment,
@@ -126,12 +127,14 @@ const Video = ({
126
127
  };
127
128
  } else {
128
129
  return {
129
- width: {
130
- ...getBreakPointsValue(getSize(), null, "overrideReSize", true)
131
- },
132
- height: url ? {
133
- ...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
134
- } : "auto"
130
+ ...groupByBreakpoint({
131
+ width: {
132
+ ...getBreakPointsValue(getSize(), null, "overrideReSize", true)
133
+ },
134
+ height: url ? {
135
+ ...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
136
+ } : "auto"
137
+ }, theme)
135
138
  };
136
139
  }
137
140
  };
@@ -205,6 +208,7 @@ const Video = ({
205
208
  onDelete: onDelete
206
209
  }) : null, /*#__PURE__*/_jsxs(Box, {
207
210
  component: "div",
211
+ className: "embed-video-wrpr-in",
208
212
  contentEditable: false,
209
213
  sx: {
210
214
  position: "relative",
@@ -25,13 +25,17 @@ const EmojiButton = /*#__PURE__*/forwardRef((props, ref) => {
25
25
  }
26
26
  }));
27
27
  const onClick = () => {
28
- if (editor.selection) {
29
- const domRange = ReactEditor.toDOMRange(editor, editor.selection);
30
- const rect = domRange.getBoundingClientRect();
31
- setAnchorEl({
32
- getBoundingClientRect: () => rect,
33
- nodeType: 1
34
- });
28
+ try {
29
+ if (editor.selection) {
30
+ const domRange = ReactEditor.toDOMRange(editor, editor.selection);
31
+ const rect = domRange.getBoundingClientRect();
32
+ setAnchorEl({
33
+ getBoundingClientRect: () => rect,
34
+ nodeType: 1
35
+ });
36
+ }
37
+ } catch (err) {
38
+ console.log(err);
35
39
  }
36
40
  };
37
41
  const onEmojiSelect = emoji => {
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useRef, useEffect } from "react";
2
2
  import { Transforms } from "slate";
3
3
  import { useSlateStatic, ReactEditor } from "slate-react";
4
- import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography } from "@mui/material";
4
+ import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography, useTheme } from "@mui/material";
5
5
  import DeleteIcon from "@mui/icons-material/Delete";
6
6
  import BackupIcon from "@mui/icons-material/Backup";
7
7
  import { GridSettingsIcon, GridAddSectionIcon, WorkflowIcon } from "../../common/iconslist";
@@ -11,12 +11,13 @@ import { formField } from "../../utils/formfield";
11
11
  import { formSubmit } from "../../service/formSubmit";
12
12
  import formButtonStyle from "../../common/StyleBuilder/formButtonStyle";
13
13
  import Workflow from "./Workflow";
14
- import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
14
+ import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
15
15
  import { validation } from "./FormElements/validations";
16
16
  import Icon from "../../common/Icon";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
19
  const Form = props => {
20
+ const theme = useTheme();
20
21
  const {
21
22
  attributes,
22
23
  children,
@@ -309,6 +310,39 @@ const Form = props => {
309
310
  })]
310
311
  });
311
312
  };
313
+ const formSX = {
314
+ ...groupByBreakpoint({
315
+ borderRadius: {
316
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
317
+ },
318
+ padding: {
319
+ ...getTRBLBreakPoints(bannerSpacing)
320
+ }
321
+ }, theme)
322
+ };
323
+ const buttonSX = {
324
+ ...groupByBreakpoint({
325
+ borderRadius: {
326
+ ...getBreakPointsValue(btnR || {}, null, "overrideBorderRadius", true)
327
+ },
328
+ padding: {
329
+ ...getTRBLBreakPoints(btnSpacing)
330
+ },
331
+ margin: {
332
+ ...getTRBLBreakPoints(btnM)
333
+ }
334
+ }, theme)
335
+ };
336
+ const formTypoSX = {
337
+ ...groupByBreakpoint({
338
+ borderRadius: {
339
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
340
+ },
341
+ padding: {
342
+ ...getTRBLBreakPoints(bannerSpacing)
343
+ }
344
+ }, theme)
345
+ };
312
346
  return /*#__PURE__*/_jsxs("div", {
313
347
  ...attributes,
314
348
  className: "form-wrapper element-root",
@@ -327,16 +361,11 @@ const Form = props => {
327
361
  color: textColor || "#FFF",
328
362
  borderColor: borderColor || "transparent",
329
363
  borderWidth: borderWidth || "1px",
330
- display: submittedSuccessfully ? 'none' : 'block',
331
- borderRadius: {
332
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
333
- },
364
+ display: submittedSuccessfully ? "none" : "block",
334
365
  borderStyle: borderStyle || "solid",
335
366
  background: bgColor || "transparent",
336
- padding: {
337
- ...getTRBLBreakPoints(bannerSpacing)
338
- },
339
- position: "relative"
367
+ position: "relative",
368
+ ...formSX
340
369
  },
341
370
  ref: formEle,
342
371
  children: [/*#__PURE__*/_jsx(Grid, {
@@ -376,15 +405,7 @@ const Form = props => {
376
405
  borderWidth: "1px",
377
406
  borderBlockStyle: "solid",
378
407
  ...btnBorderStyle,
379
- borderRadius: {
380
- ...getBreakPointsValue(btnR || {}, null, "overrideBorderRadius", true)
381
- },
382
- padding: {
383
- ...getTRBLBreakPoints(btnSpacing)
384
- },
385
- margin: {
386
- ...getTRBLBreakPoints(btnM)
387
- },
408
+ ...buttonSX,
388
409
  color: `${buttonProps?.textColor || "#FFFFFF"}`,
389
410
  fontSize: buttonProps?.textSize || "inherit",
390
411
  height: "fit-content",
@@ -418,7 +439,7 @@ const Form = props => {
418
439
  }), /*#__PURE__*/_jsx(Grid, {
419
440
  item: true,
420
441
  sx: {
421
- display: submittedSuccessfully ? 'flex' : 'none'
442
+ display: submittedSuccessfully ? "flex" : "none"
422
443
  },
423
444
  contentEditable: false,
424
445
  children: /*#__PURE__*/_jsx(Grid, {
@@ -433,21 +454,16 @@ const Form = props => {
433
454
  color: textColor || "#A2A9B4",
434
455
  borderColor: borderColor || "transparent",
435
456
  borderWidth: borderWidth || "1px",
436
- borderRadius: {
437
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
438
- },
439
457
  borderStyle: borderStyle || "solid",
440
458
  background: bgColor || "transparent",
441
- padding: {
442
- ...getTRBLBreakPoints(bannerSpacing)
443
- },
444
459
  minHeight: `${formHeight}px`,
445
460
  minWidth: `${formWidth}px`,
446
461
  display: "flex",
447
462
  alignItems: "center",
448
463
  justifyContent: "center",
449
464
  textAlign: "center",
450
- position: "relative"
465
+ position: "relative",
466
+ ...formTypoSX
451
467
  },
452
468
  children: ["Form Submitted Successfully...!", /*#__PURE__*/_jsx("span", {
453
469
  style: {
@@ -1,15 +1,16 @@
1
1
  import React, { useState } from "react";
2
2
  import { Transforms, Node } from "slate";
3
3
  import { useSlateStatic, ReactEditor } from "slate-react";
4
- import { IconButton, Tooltip, Grid } from "@mui/material";
4
+ import { IconButton, Tooltip, Grid, useTheme } from "@mui/material";
5
5
  import DeleteIcon from "@mui/icons-material/Delete";
6
6
  import SettingsIcon from "@mui/icons-material/Settings";
7
7
  import FormElements from "./FormElements";
8
8
  import FieldPopup from "./FieldPopup";
9
- import { getBreakPointsValue } from "../../helper/theme";
9
+ import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
12
  const FormField = props => {
13
+ const theme = useTheme();
13
14
  const {
14
15
  attributes,
15
16
  element,
@@ -25,7 +26,7 @@ const FormField = props => {
25
26
  children,
26
27
  ...elementProps
27
28
  } = element;
28
- const et = elementType?.split(':');
29
+ const et = elementType?.split(":");
29
30
  const FormElement = FormElements[et[0]];
30
31
  const editor = useSlateStatic();
31
32
  const path = ReactEditor.findPath(editor, element);
@@ -54,16 +55,21 @@ const FormField = props => {
54
55
  onClose();
55
56
  };
56
57
  const onDelete = () => {
57
- Transforms.removeNodes(editor, {
58
- at: path
59
- });
58
+ try {
59
+ const deletePath = ReactEditor.findPath(editor, element);
60
+ Transforms.removeNodes(editor, {
61
+ at: deletePath
62
+ });
63
+ } catch (err) {
64
+ console.log(err);
65
+ }
60
66
  };
61
67
  const onClose = () => {
62
68
  setOpenSettings(false);
63
69
  };
64
70
  const FieldToolbar = () => {
65
71
  return /*#__PURE__*/_jsxs("div", {
66
- className: "element-toolbar hr",
72
+ className: "element-toolbar hr default-toolbar",
67
73
  contentEditable: false,
68
74
  style: {
69
75
  position: "absolute",
@@ -91,15 +97,20 @@ const FormField = props => {
91
97
  })]
92
98
  });
93
99
  };
100
+ const fieldSX = {
101
+ ...groupByBreakpoint({
102
+ width: {
103
+ ...getBreakPointsValue(grid, null, "overrideGridSize", true)
104
+ }
105
+ }, theme)
106
+ };
94
107
  return /*#__PURE__*/_jsxs(Grid, {
95
108
  item: true,
96
109
  ...attributes,
97
110
  className: "form-field",
98
111
  sx: {
99
112
  position: "relative",
100
- width: {
101
- ...getBreakPointsValue(grid, null, "overrideGridSize", true)
102
- }
113
+ ...fieldSX
103
114
  },
104
115
  children: [!readOnly && /*#__PURE__*/_jsx(FieldToolbar, {}), /*#__PURE__*/_jsx(FormElement, {
105
116
  fieldProps: elementProps
@@ -71,11 +71,11 @@ const FormWorkflow = props => {
71
71
  children: [/*#__PURE__*/_jsx(Grid, {
72
72
  item: true,
73
73
  sx: classes.radioBtn,
74
- children: /*#__PURE__*/_jsxs(RadioGroup, {
74
+ children: /*#__PURE__*/_jsx(RadioGroup, {
75
75
  name: "set timing",
76
76
  value: schedule,
77
77
  defaultValue: 1,
78
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
78
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
79
79
  value: "immediately",
80
80
  label: "Immediately",
81
81
  onChange: () => {
@@ -84,16 +84,7 @@ const FormWorkflow = props => {
84
84
  control: /*#__PURE__*/_jsx(Radio, {
85
85
  size: "small"
86
86
  })
87
- }), /*#__PURE__*/_jsx(FormControlLabel, {
88
- value: "after",
89
- label: "After",
90
- onChange: () => {
91
- setSchedule("after");
92
- },
93
- control: /*#__PURE__*/_jsx(Radio, {
94
- size: "small"
95
- })
96
- })]
87
+ })
97
88
  })
98
89
  }), schedule === "after" && /*#__PURE__*/_jsx(Grid, {
99
90
  item: true,
@@ -39,8 +39,7 @@ const UserInputs = props => {
39
39
  fontStyleOptions: ['underline'],
40
40
  hideLink: true,
41
41
  hideTextColor: true
42
- },
43
- theme: theme
42
+ }
44
43
  })
45
44
  })
46
45
  });
@@ -14,10 +14,13 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const Workflow = props => {
15
15
  const {
16
16
  openWorkflow,
17
- element,
17
+ element: propElement,
18
18
  closeWorkflow,
19
- onSave
19
+ onSave,
20
+ customWorkflowElement = null
20
21
  } = props;
22
+ // replacing element for forms in DND
23
+ const element = customWorkflowElement ? customWorkflowElement : propElement;
21
24
  const {
22
25
  workflow
23
26
  } = element;