@flozy/editor 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/dist/Editor/CommonEditor.js +85 -13
  2. package/dist/Editor/DialogWrapper.js +4 -3
  3. package/dist/Editor/Editor.css +28 -2
  4. package/dist/Editor/Elements/AI/AIInput.js +31 -33
  5. package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +119 -132
  7. package/dist/Editor/Elements/AI/Styles.js +2 -2
  8. package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
  9. package/dist/Editor/Elements/AI/VoiceToText/index.js +184 -0
  10. package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
  11. package/dist/Editor/Elements/AI/helper.js +5 -3
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +36 -23
  13. package/dist/Editor/Elements/Button/EditorButton.js +23 -16
  14. package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -2
  15. package/dist/Editor/Elements/Color Picker/ColorButtons.js +1 -1
  16. package/dist/Editor/Elements/Color Picker/Styles.js +1 -0
  17. package/dist/Editor/Elements/Embed/Image.js +15 -14
  18. package/dist/Editor/Elements/Embed/Video.js +12 -8
  19. package/dist/Editor/Elements/Emoji/EmojiButton.js +11 -7
  20. package/dist/Editor/Elements/Form/Form.js +43 -27
  21. package/dist/Editor/Elements/Form/FormField.js +21 -10
  22. package/dist/Editor/Elements/Form/Workflow/index.js +5 -2
  23. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +437 -0
  24. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +206 -0
  25. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +23 -0
  26. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +236 -0
  27. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +44 -0
  28. package/dist/Editor/Elements/FreeGrid/Options/More.js +24 -0
  29. package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +47 -0
  30. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +19 -0
  31. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +75 -0
  32. package/dist/Editor/Elements/FreeGrid/styles.js +214 -0
  33. package/dist/Editor/Elements/Grid/Grid.js +12 -8
  34. package/dist/Editor/Elements/Grid/GridItem.js +31 -21
  35. package/dist/Editor/Elements/Link/LinkPopup.js +69 -13
  36. package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
  37. package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -2
  38. package/dist/Editor/Elements/Signature/Signature.css +13 -6
  39. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +2 -1
  40. package/dist/Editor/Elements/Signature/SignaturePopup.js +186 -31
  41. package/dist/Editor/Elements/SimpleText/index.js +19 -7
  42. package/dist/Editor/Elements/SimpleText/style.js +44 -1
  43. package/dist/Editor/ErrorBoundary.js +30 -0
  44. package/dist/Editor/Styles/EditorStyles.js +28 -0
  45. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +1 -1
  46. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -2
  47. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +33 -5
  48. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +12 -13
  49. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +12 -13
  50. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +3 -0
  51. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +59 -0
  52. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  53. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +107 -40
  54. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +57 -61
  55. package/dist/Editor/Toolbar/PopupTool/index.js +13 -3
  56. package/dist/Editor/Toolbar/Toolbar.js +7 -0
  57. package/dist/Editor/Toolbar/toolbarGroups.js +15 -5
  58. package/dist/Editor/assets/svg/AIIcons.js +153 -1
  59. package/dist/Editor/common/EditorCmds.js +0 -3
  60. package/dist/Editor/common/EditorIcons.js +7 -7
  61. package/dist/Editor/common/Icon.js +39 -30
  62. package/dist/Editor/common/ImageList.js +16 -3
  63. package/dist/Editor/common/ImageSelector/ImageSelector.js +30 -9
  64. package/dist/Editor/common/ImageSelector/Styles.js +2 -1
  65. package/dist/Editor/common/LinkSettings/index.js +2 -1
  66. package/dist/Editor/common/LinkSettings/style.js +11 -8
  67. package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
  68. package/dist/Editor/common/MentionsPopup/index.js +12 -8
  69. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +142 -0
  70. package/dist/Editor/common/RnD/ContextMenu/index.js +38 -0
  71. package/dist/Editor/common/RnD/ContextMenu/styles.js +21 -0
  72. package/dist/Editor/common/RnD/DragInfo/index.js +31 -0
  73. package/dist/Editor/common/RnD/DragInfo/styles.js +15 -0
  74. package/dist/Editor/common/RnD/DragOver/index.js +55 -0
  75. package/dist/Editor/common/RnD/DragOver/styles.js +23 -0
  76. package/dist/Editor/common/RnD/ElementOptions/Actions.js +102 -0
  77. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +26 -0
  78. package/dist/Editor/common/RnD/ElementOptions/index.js +95 -0
  79. package/dist/Editor/common/RnD/ElementOptions/styles.js +41 -0
  80. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +153 -0
  81. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +36 -0
  82. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +60 -0
  83. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +9 -0
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +47 -0
  85. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +47 -0
  86. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +47 -0
  87. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +48 -0
  88. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +47 -0
  89. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +30 -0
  90. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +47 -0
  91. package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +17 -0
  92. package/dist/Editor/common/RnD/ElementSettings/index.js +17 -0
  93. package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +18 -0
  94. package/dist/Editor/common/RnD/ElementSettings/styles.js +94 -0
  95. package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +52 -0
  96. package/dist/Editor/common/RnD/GuideLines/index.js +33 -0
  97. package/dist/Editor/common/RnD/GuideLines/styles.js +62 -0
  98. package/dist/Editor/common/RnD/OptionsPopup/index.js +50 -0
  99. package/dist/Editor/common/RnD/OptionsPopup/style.js +36 -0
  100. package/dist/Editor/common/RnD/RnDCopy.js +23 -0
  101. package/dist/Editor/common/RnD/ShadowElement.js +34 -0
  102. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +40 -0
  103. package/dist/Editor/common/RnD/SwitchViewport/styles.js +24 -0
  104. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +63 -0
  105. package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +19 -0
  106. package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +13 -0
  107. package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +20 -0
  108. package/dist/Editor/common/RnD/TransformHandles/index.js +67 -0
  109. package/dist/Editor/common/RnD/Utils/alignmentDetection.js +26 -0
  110. package/dist/Editor/common/RnD/Utils/calculateDropItem.js +98 -0
  111. package/dist/Editor/common/RnD/Utils/collisionDetection.js +52 -0
  112. package/dist/Editor/common/RnD/Utils/gridDropItem.js +181 -0
  113. package/dist/Editor/common/RnD/Utils/index.js +251 -0
  114. package/dist/Editor/common/RnD/VirtualElement/index.js +77 -0
  115. package/dist/Editor/common/RnD/VirtualElement/styles.js +27 -0
  116. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +28 -0
  117. package/dist/Editor/common/RnD/index.js +567 -0
  118. package/dist/Editor/common/RnD/styles.js +4 -0
  119. package/dist/Editor/common/Section/index.js +21 -12
  120. package/dist/Editor/common/Section/styles.js +7 -4
  121. package/dist/Editor/common/Shorthands/elements.js +21 -9
  122. package/dist/Editor/common/StyleBuilder/boxStyle.js +30 -0
  123. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +18 -10
  124. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +18 -5
  125. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -2
  126. package/dist/Editor/common/StyleBuilder/index.js +6 -4
  127. package/dist/Editor/common/StyleBuilder/sectionStyle.js +13 -2
  128. package/dist/Editor/common/iconListV2.js +843 -0
  129. package/dist/Editor/commonStyle.js +6 -0
  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 +50 -1
  135. package/dist/Editor/hooks/useBreakpoints.js +34 -0
  136. package/dist/Editor/hooks/useMouseMove.js +36 -8
  137. package/dist/Editor/hooks/useWindowMessage.js +10 -7
  138. package/dist/Editor/hooks/withCommon.js +2 -1
  139. package/dist/Editor/hooks/withErrorHandling.js +14 -0
  140. package/dist/Editor/utils/RnD/RnDCtrlCmds.js +197 -0
  141. package/dist/Editor/utils/SlateUtilityFunctions.js +36 -4
  142. package/dist/Editor/utils/events.js +5 -0
  143. package/dist/Editor/utils/form.js +7 -2
  144. package/dist/Editor/utils/formfield.js +1 -1
  145. package/dist/Editor/utils/freegrid.js +91 -0
  146. package/dist/Editor/utils/helper.js +43 -0
  147. package/dist/Editor/utils/insertAppHeader.js +47 -40
  148. package/package.json +6 -2
@@ -1,6 +1,7 @@
1
1
  import React, { useRef, useState } from "react";
2
2
  import { useSlateStatic, ReactEditor } from "slate-react";
3
3
  import { Transforms, Editor, Element } from "slate";
4
+ import { useTheme } from "@mui/material";
4
5
  import AppBar from "@mui/material/AppBar";
5
6
  import Box from "@mui/material/Box";
6
7
  import CssBaseline from "@mui/material/CssBaseline";
@@ -16,7 +17,7 @@ import Toolbar from "@mui/material/Toolbar";
16
17
  import Typography from "@mui/material/Typography";
17
18
  import Button from "@mui/material/Button";
18
19
  import AppHeaderPopup from "./AppHeaderPopup";
19
- import { getTRBLBreakPoints } from "../../helper/theme";
20
+ import { getTRBLBreakPoints, groupByBreakpoint } from "../../helper/theme";
20
21
  import { handleLinkType } from "../../utils/helper";
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
22
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -24,6 +25,7 @@ import { createElement as _createElement } from "react";
24
25
  import { Fragment as _Fragment } from "react/jsx-runtime";
25
26
  const drawerWidth = 240;
26
27
  function AppHeader(props) {
28
+ const theme = useTheme();
27
29
  const navWrprRef = useRef(null);
28
30
  const [openSetttings, setOpenSettings] = useState(false);
29
31
  const {
@@ -126,11 +128,6 @@ function AppHeader(props) {
126
128
  }
127
129
  }
128
130
  };
129
-
130
- // const onMenuSettings = (menuItem, i) => (event) => {
131
- // event.preventDefault();
132
- // };
133
-
134
131
  const drawer = /*#__PURE__*/_jsxs(Box, {
135
132
  onClick: handleDrawerToggle,
136
133
  sx: {
@@ -186,15 +183,20 @@ function AppHeader(props) {
186
183
  })]
187
184
  });
188
185
  const container = window !== undefined ? () => window().document.body : undefined;
189
- // const elevateStyle = useEleveateScroll({
190
- // ...props,
191
- // parentRef: navWrprRef,
192
- // needElevation: readOnly,
193
- // });
194
-
195
186
  const elevateStyle = {
196
187
  position: "relative"
197
188
  };
189
+ const appbarSp = groupByBreakpoint({
190
+ padding: {
191
+ ...getTRBLBreakPoints(bannerSpacing)
192
+ }
193
+ }, theme);
194
+ const toolbarSp = groupByBreakpoint({
195
+ flexDirection: {
196
+ xs: "row-reverse !important",
197
+ lg: "unset"
198
+ }
199
+ }, theme);
198
200
  return /*#__PURE__*/_jsxs(_Fragment, {
199
201
  children: [/*#__PURE__*/_jsxs(Box, {
200
202
  sx: {
@@ -216,13 +218,14 @@ function AppHeader(props) {
216
218
  ...elevateStyle,
217
219
  background: bgColor,
218
220
  boxShadow: "none",
219
- padding: {
220
- ...getTRBLBreakPoints(bannerSpacing)
221
- },
221
+ ...appbarSp,
222
222
  zIndex: 999
223
223
  },
224
224
  onClick: onSettings,
225
225
  children: /*#__PURE__*/_jsxs(Toolbar, {
226
+ sx: {
227
+ ...toolbarSp
228
+ },
226
229
  style: {
227
230
  flexDirection: isLogoRight ? "row-reverse" : "row",
228
231
  paddingLeft: "0px",
@@ -239,8 +242,11 @@ function AppHeader(props) {
239
242
  },
240
243
  sx: {
241
244
  mr: 2,
242
- display: {
243
- sm: "none"
245
+ [theme.breakpoints.up("sm")]: {
246
+ display: "none"
247
+ },
248
+ [theme.breakpoints.between("xs", "md")]: {
249
+ display: "block"
244
250
  }
245
251
  },
246
252
  children: /*#__PURE__*/_jsx(MenuIcon, {})
@@ -258,9 +264,14 @@ function AppHeader(props) {
258
264
  },
259
265
  sx: {
260
266
  flexGrow: 1,
261
- display: {
262
- xs: "none",
263
- sm: "block"
267
+ [theme.breakpoints.up("sm")]: {
268
+ display: "block"
269
+ },
270
+ [theme.breakpoints.between("xs", "md")]: {
271
+ display: "none"
272
+ },
273
+ "& img": {
274
+ marginRight: "7px"
264
275
  }
265
276
  },
266
277
  className: "app-logo",
@@ -274,9 +285,11 @@ function AppHeader(props) {
274
285
  }) : null, appTitle]
275
286
  }), /*#__PURE__*/_jsxs(Box, {
276
287
  sx: {
277
- display: {
278
- xs: "none",
279
- sm: "block"
288
+ [theme.breakpoints.up("sm")]: {
289
+ display: "block"
290
+ },
291
+ [theme.breakpoints.between("xs", "md")]: {
292
+ display: "none"
280
293
  }
281
294
  },
282
295
  children: [isDrawer ? /*#__PURE__*/_jsx(IconButton, {
@@ -1,8 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { Transforms } from "slate";
3
3
  import { ReactEditor, useSlateStatic } from "slate-react";
4
- import { IconButton, Tooltip, Box } from "@mui/material";
5
- // import * as fIcons from "@mui/icons-material";
4
+ import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
6
5
  import MUIIcon from "../../common/StyleBuilder/fieldTypes/loadIcon";
7
6
  import SettingsIcon from "@mui/icons-material/Settings";
8
7
  import OpenInNewIcon from "@mui/icons-material/OpenInNew";
@@ -10,12 +9,13 @@ import LinkIcon from "@mui/icons-material/Link";
10
9
  import ButtonPopup from "./ButtonPopup";
11
10
  import { actionButtonRedirect } from "../../service/actionTrigger";
12
11
  import { WorkflowIcon } from "../../common/iconslist";
13
- import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
12
+ import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
14
13
  import { handleLinkType, windowVar } from "../../utils/helper";
15
14
  import LinkSettings from "../../common/LinkSettings";
16
15
  import { jsx as _jsx } from "react/jsx-runtime";
17
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
17
  const EditorButton = props => {
18
+ const theme = useTheme();
19
19
  const {
20
20
  attributes,
21
21
  element,
@@ -81,7 +81,6 @@ const EditorButton = props => {
81
81
  }
82
82
  };
83
83
  const buttonProps = handleLinkType(refURl, linkType, readOnly, openInNewTab, handleTrigger);
84
- console.log(openInNewTab);
85
84
  const onMenuClick = val => () => {
86
85
  switch (val) {
87
86
  case "edit":
@@ -154,21 +153,33 @@ const EditorButton = props => {
154
153
  const onClose = () => {
155
154
  setEdit(false);
156
155
  };
156
+ const tAlign = alignment || textAlign || "left";
157
+ const btnSp = groupByBreakpoint({
158
+ borderRadius: {
159
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
160
+ },
161
+ padding: {
162
+ ...getTRBLBreakPoints(bannerSpacing)
163
+ }
164
+ }, theme);
165
+ const pSp = groupByBreakpoint({
166
+ display: {
167
+ xs: xsHidden ? "none" : "inline-block",
168
+ lg: "inline-block"
169
+ }
170
+ }, theme);
157
171
  return /*#__PURE__*/_jsxs("div", {
158
- className: "editor-btn-wrapper",
172
+ className: `editor-btn-wrapper`,
159
173
  ...attributes,
160
174
  style: {
161
- textAlign: alignment || textAlign || "left"
175
+ textAlign: tAlign
162
176
  },
163
177
  contentEditable: false,
164
178
  children: [/*#__PURE__*/_jsx(Box, {
165
179
  component: "div",
166
180
  className: "editor-btn-wrapper-inner",
167
181
  sx: {
168
- display: {
169
- lg: "inline-block",
170
- xs: xsHidden ? "none" : "inline-block"
171
- },
182
+ ...pSp,
172
183
  "& .element-toolbar": {
173
184
  display: "none"
174
185
  },
@@ -184,19 +195,15 @@ const EditorButton = props => {
184
195
  display: "inline-block"
185
196
  },
186
197
  children: [/*#__PURE__*/_jsxs(Box, {
198
+ className: `btn textAlign-${tAlign}`,
187
199
  sx: {
188
200
  textDecoration: "none",
189
201
  background: bgColor || "rgb(30, 75, 122)",
190
202
  borderBlockStyle: "solid",
191
203
  borderColor: borderColor || "transparent",
192
204
  borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
193
- borderRadius: {
194
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
195
- },
205
+ ...btnSp,
196
206
  borderStyle: borderStyle || "solid",
197
- padding: {
198
- ...getTRBLBreakPoints(bannerSpacing)
199
- },
200
207
  color: `${textColor || "#FFFFFF"}`,
201
208
  fontSize: textSize || "inherit",
202
209
  fontFamily: fontFamily || "PoppinsRegular",
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { insertCarousel } from "../../utils/carousel";
3
- import { Carousal } from "../../common/iconslist";
4
3
  import ToolbarIcon from "../../common/ToolbarIcon";
4
+ import { CarouselElementIcon } from "../../common/iconListV2";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  const CarouselButton = props => {
7
7
  const {
@@ -14,7 +14,7 @@ const CarouselButton = props => {
14
14
  return /*#__PURE__*/_jsx(ToolbarIcon, {
15
15
  title: "Carousel",
16
16
  onClick: handleClick,
17
- icon: /*#__PURE__*/_jsx(Carousal, {}),
17
+ icon: /*#__PURE__*/_jsx(CarouselElementIcon, {}),
18
18
  icoBtnType: icoBtnType
19
19
  });
20
20
  };
@@ -32,7 +32,7 @@ const SingleColorButton = ({
32
32
  width: "100%",
33
33
  display: "flex",
34
34
  alignItems: "center",
35
- padding: padding || "8px",
35
+ padding: padding || "8px 0px",
36
36
  justifyContent: "center"
37
37
  },
38
38
  children: [crs.map(m => /*#__PURE__*/_jsx(Button, {
@@ -13,6 +13,7 @@ const ColorPickerStyles = theme => ({
13
13
  }
14
14
  },
15
15
  colorPopper: {
16
+ marginTop: "20px",
16
17
  "& .MuiPaper-root": {
17
18
  backgroundColor: theme?.palette?.editor?.background,
18
19
  '@media only screen and (max-width: 600px)': {
@@ -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
@@ -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;