@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
@@ -51,43 +51,51 @@ const insertAtNextLine = (editor, text) => {
51
51
  });
52
52
  };
53
53
  const getNextLine = editor => {
54
- const {
55
- selection
56
- } = editor;
57
- const {
58
- focus
59
- } = selection;
60
- const {
61
- text = ""
62
- } = Node.get(editor, focus.path);
63
- let nextLineIndex = 0;
64
- let indexOfNextLine = 0;
65
- if (text?.length) {
66
- // split the text based on caret position
67
- const textBeforeCaret = text.substring(0, focus.offset);
68
- const textAfterCaret = text.substring(focus.offset);
54
+ try {
55
+ const {
56
+ selection
57
+ } = editor;
58
+ const {
59
+ focus
60
+ } = selection;
61
+ if (focus?.path?.length > 0) {
62
+ const {
63
+ text = ""
64
+ } = Node.get(editor, focus.path);
65
+ let nextLineIndex = 0;
66
+ let indexOfNextLine = 0;
67
+ if (text?.length) {
68
+ // split the text based on caret position
69
+ const textBeforeCaret = text.substring(0, focus.offset);
70
+ const textAfterCaret = text.substring(focus.offset);
69
71
 
70
- // getting the index of the next line after the caret position
71
- indexOfNextLine = textAfterCaret?.indexOf("\n");
72
- if (indexOfNextLine >= 0) {
73
- // index of next line
74
- nextLineIndex = textBeforeCaret?.length + indexOfNextLine;
75
- } else {
76
- nextLineIndex = text?.length;
72
+ // getting the index of the next line after the caret position
73
+ indexOfNextLine = textAfterCaret?.indexOf("\n");
74
+ if (indexOfNextLine >= 0) {
75
+ // index of next line
76
+ nextLineIndex = textBeforeCaret?.length + indexOfNextLine;
77
+ } else {
78
+ nextLineIndex = text?.length;
79
+ }
80
+ }
81
+ const data = {
82
+ ...focus,
83
+ offset: nextLineIndex
84
+ };
85
+ const at = {
86
+ anchor: data,
87
+ focus: data
88
+ };
89
+ return {
90
+ at,
91
+ indexOfNextLine
92
+ };
77
93
  }
94
+ return null;
95
+ } catch (err) {
96
+ console.log(err);
97
+ return null;
78
98
  }
79
- const data = {
80
- ...focus,
81
- offset: nextLineIndex
82
- };
83
- const at = {
84
- anchor: data,
85
- focus: data
86
- };
87
- return {
88
- at,
89
- indexOfNextLine
90
- };
91
99
  };
92
100
  const updateAnchorEl = (setAnchorEl, editor) => {
93
101
  try {
@@ -95,18 +103,21 @@ const updateAnchorEl = (setAnchorEl, editor) => {
95
103
  return;
96
104
  }
97
105
  const selection = window.getSelection();
98
- if (selection.rangeCount) {
106
+ if (selection.rangeCount && selection.anchorOffset !== selection.focusOffset) {
99
107
  let caret;
100
108
  if (getSelectedText(editor)) {
101
109
  // selected text as caret
102
110
  caret = selection.getRangeAt(0);
103
111
  } else {
104
- const domElement = ReactEditor.toDOMRange(editor, getNextLine(editor).at);
105
- const {
106
- textContent,
107
- parentElement
108
- } = domElement?.commonAncestorContainer || {};
109
- caret = textContent ? domElement : parentElement; // in mobile, if textContent in not available, it is pointing some <br> tag (getBoundingClientRect not working correctly for <br>), to avoid that, we are pointing the parent element as caret
112
+ const sel = getNextLine(editor);
113
+ if (sel) {
114
+ const domElement = ReactEditor.toDOMRange(editor, sel.at);
115
+ const {
116
+ textContent,
117
+ parentElement
118
+ } = domElement?.commonAncestorContainer || {};
119
+ caret = textContent ? domElement : parentElement; // in mobile, if textContent in not available, it is pointing some <br> tag (getBoundingClientRect not working correctly for <br>), to avoid that, we are pointing the parent element as caret
120
+ }
110
121
  }
111
122
 
112
123
  const getBoundingClientRect = () => {
@@ -1,6 +1,4 @@
1
1
  import React from "react";
2
- import { Box } from "@mui/material";
3
- import { getBreakPointsValue, getTRBLBreakPoints } from "../../helper/theme";
4
2
  import { jsx as _jsx } from "react/jsx-runtime";
5
3
  const AccordionSummary = props => {
6
4
  const {
@@ -11,27 +9,18 @@ const AccordionSummary = props => {
11
9
  const {
12
10
  textColor,
13
11
  bgColor,
14
- borderColor,
15
- borderRadius,
16
- bannerSpacing
12
+ borderColor
17
13
  } = element;
18
- return /*#__PURE__*/_jsx(Box, {
14
+ return /*#__PURE__*/_jsx("div", {
19
15
  className: `accordion-summary-container`,
20
16
  ...attributes,
21
- sx: {
17
+ style: {
22
18
  width: "100%",
23
19
  position: "relative",
24
20
  backgroundColor: bgColor,
25
21
  border: `1px solid ${borderColor}`,
26
- color: textColor,
27
- borderRadius: {
28
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
29
- },
30
- padding: {
31
- ...getTRBLBreakPoints(bannerSpacing)
32
- }
22
+ color: textColor
33
23
  },
34
- component: "div",
35
24
  children: children
36
25
  });
37
26
  };
@@ -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, {})
@@ -251,16 +257,21 @@ function AppHeader(props) {
251
257
  style: {
252
258
  display: "inline-flex",
253
259
  alignItems: "center",
254
- color: textColor || "#000000",
260
+ color: textColor,
255
261
  fontSize: logoFontSize,
256
262
  fontFamily: titleFontFamily,
257
263
  justifyContent: isLogoRight ? "end" : "start"
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, {
@@ -299,7 +312,7 @@ function AppHeader(props) {
299
312
  fontFamily: fontFamily,
300
313
  textTransform: "none",
301
314
  fontSize: fontSize || "16px",
302
- color: textColor || "#000",
315
+ color: textColor || "#FFF",
303
316
  background: bgColor || "none",
304
317
  "& .m-settings": {
305
318
  display: "none",
@@ -314,7 +327,7 @@ function AppHeader(props) {
314
327
  background: "#FFF"
315
328
  },
316
329
  "&:hover": {
317
- color: textColorHover || textColor || "#000",
330
+ color: textColorHover || textColor || "#FFF",
318
331
  background: bgColorHover || bgColor || "none",
319
332
  "& .m-settings": {
320
333
  display: "block"
@@ -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,15 +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
- import { useEditorTheme } from "../../hooks/useEditorTheme";
17
- import { getTheme } from "../../theme";
18
- import { fontFamilyMap } from "../../utils/font";
19
15
  import { jsx as _jsx } from "react/jsx-runtime";
20
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
17
  const EditorButton = props => {
18
+ const theme = useTheme();
22
19
  const {
23
20
  attributes,
24
21
  element,
@@ -33,12 +30,6 @@ const EditorButton = props => {
33
30
  const path = ReactEditor.findPath(editor, element);
34
31
  const [edit, setEdit] = useState(false);
35
32
  const [openNav, setOpenNav] = useState(false);
36
- const {
37
- theme
38
- } = useEditorTheme();
39
- const {
40
- buttonTheme
41
- } = getTheme(theme);
42
33
  const {
43
34
  label,
44
35
  bgColor,
@@ -52,7 +43,7 @@ const EditorButton = props => {
52
43
  fontFamily,
53
44
  textColorHover,
54
45
  bgColorHover,
55
- // buttonIcon,
46
+ buttonIcon,
56
47
  iconPosition = "start",
57
48
  borderStyle,
58
49
  borderWidth,
@@ -71,15 +62,13 @@ const EditorButton = props => {
71
62
  } = actionTrigger || {
72
63
  options: []
73
64
  };
74
- const isTrigger = linkType === "nextTrigger" || linkType === "prevTrigger";
65
+ const isTrigger = linkType === "actionTrigger";
75
66
  const refURl = isTrigger ? buttonLink?.url : url;
76
- const buttonIcon = element?.buttonIcon || buttonTheme?.buttonIcon;
77
67
  const BtnIcon = buttonIcon ? buttonIcon : null;
78
68
  windowVar.lastButtonProps = element;
79
69
  const handleTrigger = async () => {
80
70
  if (metadata?.buttonLink?.handler) {
81
- const response = isTrigger ? linkType : "click";
82
- metadata.buttonLink.handler(response);
71
+ metadata.buttonLink.handler("click");
83
72
  } else if (redirectOnURLResult) {
84
73
  // call api and redirect based on api result
85
74
  const apiResult = await actionButtonRedirect({}, {
@@ -92,7 +81,6 @@ const EditorButton = props => {
92
81
  }
93
82
  };
94
83
  const buttonProps = handleLinkType(refURl, linkType, readOnly, openInNewTab, handleTrigger);
95
- console.log(openInNewTab);
96
84
  const onMenuClick = val => () => {
97
85
  switch (val) {
98
86
  case "edit":
@@ -165,21 +153,33 @@ const EditorButton = props => {
165
153
  const onClose = () => {
166
154
  setEdit(false);
167
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);
168
171
  return /*#__PURE__*/_jsxs("div", {
169
- className: "editor-btn-wrapper",
172
+ className: `editor-btn-wrapper`,
170
173
  ...attributes,
171
174
  style: {
172
- textAlign: alignment || textAlign || "left"
175
+ textAlign: tAlign
173
176
  },
174
177
  contentEditable: false,
175
178
  children: [/*#__PURE__*/_jsx(Box, {
176
179
  component: "div",
177
180
  className: "editor-btn-wrapper-inner",
178
181
  sx: {
179
- display: {
180
- lg: "inline-block",
181
- xs: xsHidden ? "none" : "inline-block"
182
- },
182
+ ...pSp,
183
183
  "& .element-toolbar": {
184
184
  display: "none"
185
185
  },
@@ -195,11 +195,18 @@ const EditorButton = props => {
195
195
  display: "inline-block"
196
196
  },
197
197
  children: [/*#__PURE__*/_jsxs(Box, {
198
+ className: `btn textAlign-${tAlign}`,
198
199
  sx: {
199
200
  textDecoration: "none",
201
+ background: bgColor || "rgb(30, 75, 122)",
200
202
  borderBlockStyle: "solid",
203
+ borderColor: borderColor || "transparent",
201
204
  borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
205
+ ...btnSp,
202
206
  borderStyle: borderStyle || "solid",
207
+ color: `${textColor || "#FFFFFF"}`,
208
+ fontSize: textSize || "inherit",
209
+ fontFamily: fontFamily || "PoppinsRegular",
203
210
  display: "inline-flex",
204
211
  alignItems: "center",
205
212
  position: "relative",
@@ -207,26 +214,14 @@ const EditorButton = props => {
207
214
  display: "none"
208
215
  },
209
216
  "&:hover": {
210
- color: `${textColorHover || textColor}`,
211
- background: bgColorHover || bgColor,
217
+ color: `${textColorHover || textColor || "#FFFFFF"}`,
218
+ background: bgColorHover || bgColor || "rgb(30, 75, 122)",
212
219
  "& .element-toolbar": {
213
220
  display: "flex"
214
221
  }
215
- },
216
- color: `${textColor} !important`,
217
- fontSize: `${textSize}px !important`,
218
- fontFamily: `${fontFamilyMap[fontFamily] || ""} !important`,
219
- background: `${bgColor} !important`,
220
- borderColor: `${borderColor} !important`,
221
- borderRadius: {
222
- ...getBreakPointsValue(borderRadius || buttonTheme?.borderRadius || {}, null, "overrideBorderRadius", true)
223
- },
224
- padding: {
225
- ...getTRBLBreakPoints(bannerSpacing || buttonTheme?.bannerSpacing || {})
226
222
  }
227
223
  },
228
224
  ...buttonProps,
229
- className: "button theme-element",
230
225
  children: [BtnIcon && iconPosition === "start" && /*#__PURE__*/_jsx(MUIIcon, {
231
226
  iconName: buttonIcon,
232
227
  style: {
@@ -1,6 +1,5 @@
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";
5
4
  import { CarouselElementIcon } from "../../common/iconListV2";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,15 +1,11 @@
1
- import React, { useContext, useState } from "react";
2
- import { Box, IconButton, Popover, Typography, useTheme } from "@mui/material";
1
+ import React, { useState } from "react";
2
+ import { Box, IconButton, Popover } from "@mui/material";
3
3
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
4
4
  import Button from "../../common/Button";
5
5
  import { colors } from "./defaultColors";
6
6
  import ColorPicker from "./colorPicker.svg";
7
- import { ThemeContext } from "../../CommonEditor";
8
- import { useSlateStatic } from "slate-react";
9
- import { Transforms } from "slate";
10
7
  import { jsx as _jsx } from "react/jsx-runtime";
11
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
- import { Fragment as _Fragment } from "react/jsx-runtime";
13
9
  let c = [];
14
10
  const ColorChunks = (recentColors = []) => [...recentColors, ...colors].reduce((a, b, i) => {
15
11
  if (i % 7 === 0) {
@@ -113,17 +109,11 @@ const ColorButtons = props => {
113
109
  forMiniTool,
114
110
  openColorTool,
115
111
  onClose,
116
- onColorPickerClick,
117
- disableEditTheme
112
+ onColorPickerClick
118
113
  } = props;
119
114
  const [row1, ...restRows] = ColorChunks([]);
120
115
  const [anchorEl, setAnchorEl] = useState(null);
121
116
  const open = Boolean(anchorEl);
122
- const theme = useTheme();
123
- const editor = useSlateStatic();
124
- const {
125
- setOpenTheme
126
- } = useContext(ThemeContext);
127
117
  const handleMore = e => {
128
118
  setAnchorEl(e.currentTarget);
129
119
  };
@@ -136,7 +126,6 @@ const ColorButtons = props => {
136
126
  const handleSelect = color => () => {
137
127
  onSelect(color);
138
128
  };
139
- const colorVars = theme?.vars?.colors || {};
140
129
  return /*#__PURE__*/_jsxs(Box, {
141
130
  component: "span",
142
131
  sx: classes.colorButtons,
@@ -153,7 +142,7 @@ const ColorButtons = props => {
153
142
  activeColor: activeColor
154
143
  }, `si_btn_row1_${m}_${i}`);
155
144
  })
156
- }), /*#__PURE__*/_jsx(Popover, {
145
+ }), /*#__PURE__*/_jsxs(Popover, {
157
146
  open: open || openColorTool,
158
147
  anchorEl: anchorEl || openColorTool,
159
148
  onClose: handleClose,
@@ -167,39 +156,9 @@ const ColorButtons = props => {
167
156
  },
168
157
  sx: classes.colorPopper,
169
158
  className: "colorPopper",
170
- children: /*#__PURE__*/_jsxs(Box, {
159
+ children: [/*#__PURE__*/_jsx(Box, {
171
160
  sx: classes.colorButtonsInner,
172
- children: [Object.values(colorVars)?.length ? /*#__PURE__*/_jsxs(_Fragment, {
173
- children: [/*#__PURE__*/_jsxs(Box, {
174
- component: "div",
175
- className: "singleColorTitleWrapper",
176
- children: [/*#__PURE__*/_jsx(Typography, {
177
- variant: "subtitle2",
178
- children: "Theme colour"
179
- }), disableEditTheme ? null : /*#__PURE__*/_jsx("div", {
180
- className: "editBtn",
181
- onClick: () => {
182
- Transforms.deselect(editor, {
183
- at: editor.selection
184
- });
185
- setOpenTheme("editThemeColor");
186
- },
187
- children: "Edit"
188
- })]
189
- }), /*#__PURE__*/_jsx(SingleColorButton, {
190
- crs: Object.values(colorVars),
191
- handleSelect: handleSelect,
192
- classes: classes,
193
- activeColor: activeColor
194
- })]
195
- }) : null, /*#__PURE__*/_jsx(Box, {
196
- component: "div",
197
- className: "singleColorTitleWrapper",
198
- children: /*#__PURE__*/_jsx(Typography, {
199
- variant: "subtitle2",
200
- children: "Custom colour"
201
- })
202
- }), restRows.map((m, i) => {
161
+ children: restRows.map((m, i) => {
203
162
  return /*#__PURE__*/_jsx(SingleColorButton, {
204
163
  id: `p2_${id}`,
205
164
  crs: m,
@@ -208,18 +167,14 @@ const ColorButtons = props => {
208
167
  classes: classes,
209
168
  activeColor: activeColor
210
169
  }, `si_btn_${m}_${i}`);
211
- }), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
212
- onClick: onColorPickerClick,
213
- style: {
214
- alignSelf: "start",
215
- margin: "6px"
216
- },
217
- children: /*#__PURE__*/_jsx("img", {
218
- src: ColorPicker,
219
- alt: "color wheel"
220
- })
221
- }) : null]
222
- })
170
+ })
171
+ }), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
172
+ onClick: onColorPickerClick,
173
+ children: /*#__PURE__*/_jsx("img", {
174
+ src: ColorPicker,
175
+ alt: "color wheel"
176
+ })
177
+ }) : null]
223
178
  })]
224
179
  });
225
180
  };
@@ -60,28 +60,4 @@
60
60
  padding: 0 15px !important;
61
61
  width: 60px !important;
62
62
  flex-shrink: 0;
63
- }
64
-
65
-
66
- .singleColorTitleWrapper {
67
- display: flex;
68
- justify-content: space-between;
69
- align-items: center;
70
- padding: 10px;
71
- width: 100%;
72
- border-bottom: 1px solid #DCE4EC;
73
- }
74
-
75
- .singleColorTitleWrapper .MuiTypography-root {
76
- font-weight: 600;
77
- }
78
-
79
- .singleColorTitleWrapper .editBtn {
80
- text-transform: none;
81
- color: #2563EB;
82
- text-decoration: underline;
83
- padding: 0px;
84
- min-width: unset;
85
- cursor: pointer;
86
- font-size: 14px;
87
- }
63
+ }
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { ReactEditor } from "slate-react";
3
3
  import { Transforms } from "slate";
4
+ import ColorPickerTool from "react-gcolor-picker";
4
5
  import { IconButton, Tooltip, Box, Popover } from "@mui/material";
5
6
  import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
6
7
  import ColorButtons from "./ColorButtons";
@@ -8,7 +9,6 @@ import ColorPickerStyles from "./Styles";
8
9
  import colorWheel from "./colorWheel.png";
9
10
  import "./ColorPicker.css";
10
11
  import { useEditorContext } from "../../hooks/useMouseMove";
11
- import CustomColorPicker from "../../common/CustomColorPicker";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -95,10 +95,10 @@ const ColorPicker = props => {
95
95
  horizontal: "top"
96
96
  },
97
97
  sx: classes.colorPickerPopup,
98
- children: /*#__PURE__*/_jsx(CustomColorPicker, {
98
+ children: /*#__PURE__*/_jsx(ColorPickerTool, {
99
99
  gradient: true,
100
- onChange: handleFormSubmit,
101
- color: activeColor
100
+ value: activeColor,
101
+ onChange: handleFormSubmit
102
102
  })
103
103
  })]
104
104
  });
@@ -16,8 +16,7 @@ const ColorPickerStyles = theme => ({
16
16
  marginTop: "20px",
17
17
  "& .MuiPaper-root": {
18
18
  backgroundColor: theme?.palette?.editor?.background,
19
- padding: "4px 14px",
20
- "@media only screen and (max-width: 600px)": {
19
+ '@media only screen and (max-width: 600px)': {
21
20
  marginTop: "-40px"
22
21
  }
23
22
  }