@flozy/editor 3.8.8 → 3.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. package/dist/Editor/ChatEditor.js +31 -57
  2. package/dist/Editor/CommonEditor.js +69 -8
  3. package/dist/Editor/DialogWrapper.js +4 -3
  4. package/dist/Editor/Editor.css +5 -12
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +47 -36
  6. package/dist/Editor/Elements/Accordion/Accordion.js +1 -1
  7. package/dist/Editor/Elements/Accordion/AccordionSummary.js +6 -20
  8. package/dist/Editor/Elements/AppHeader/AppHeader.js +36 -23
  9. package/dist/Editor/Elements/Button/EditorButton.js +23 -16
  10. package/dist/Editor/Elements/Embed/Image.js +15 -14
  11. package/dist/Editor/Elements/Embed/Video.js +12 -8
  12. package/dist/Editor/Elements/Emoji/EmojiButton.js +11 -7
  13. package/dist/Editor/Elements/Emoji/EmojiPicker.js +2 -4
  14. package/dist/Editor/Elements/Form/Form.js +1 -1
  15. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +391 -0
  16. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +193 -0
  17. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +23 -0
  18. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +184 -0
  19. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +36 -0
  20. package/dist/Editor/Elements/FreeGrid/Options/More.js +24 -0
  21. package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +47 -0
  22. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +11 -0
  23. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +75 -0
  24. package/dist/Editor/Elements/FreeGrid/styles.js +159 -0
  25. package/dist/Editor/Elements/Grid/Grid.js +12 -8
  26. package/dist/Editor/Elements/Grid/GridItem.js +31 -21
  27. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -5
  28. package/dist/Editor/Elements/SimpleText/index.js +9 -8
  29. package/dist/Editor/Elements/SimpleText/style.js +37 -0
  30. package/dist/Editor/ErrorBoundary.js +30 -0
  31. package/dist/Editor/Styles/EditorStyles.js +23 -0
  32. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -25
  33. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +1 -0
  34. package/dist/Editor/Toolbar/PopupTool/index.js +8 -0
  35. package/dist/Editor/Toolbar/Toolbar.js +7 -0
  36. package/dist/Editor/Toolbar/toolbarGroups.js +5 -0
  37. package/dist/Editor/common/Icon.js +9 -2
  38. package/dist/Editor/common/MentionsPopup/MentionsListCard.js +1 -6
  39. package/dist/Editor/common/MentionsPopup/index.js +12 -8
  40. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +105 -0
  41. package/dist/Editor/common/RnD/ContextMenu/index.js +38 -0
  42. package/dist/Editor/common/RnD/ContextMenu/styles.js +21 -0
  43. package/dist/Editor/common/RnD/DragInfo/index.js +31 -0
  44. package/dist/Editor/common/RnD/DragInfo/styles.js +15 -0
  45. package/dist/Editor/common/RnD/DragOver/index.js +46 -0
  46. package/dist/Editor/common/RnD/DragOver/styles.js +23 -0
  47. package/dist/Editor/common/RnD/ElementOptions/Actions.js +82 -0
  48. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +26 -0
  49. package/dist/Editor/common/RnD/ElementOptions/index.js +93 -0
  50. package/dist/Editor/common/RnD/ElementOptions/styles.js +41 -0
  51. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +153 -0
  52. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +58 -0
  53. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +7 -0
  54. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +46 -0
  55. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +46 -0
  56. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +46 -0
  57. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +30 -0
  58. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +46 -0
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +13 -0
  60. package/dist/Editor/common/RnD/ElementSettings/index.js +17 -0
  61. package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +14 -0
  62. package/dist/Editor/common/RnD/ElementSettings/styles.js +76 -0
  63. package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +52 -0
  64. package/dist/Editor/common/RnD/GuideLines/index.js +33 -0
  65. package/dist/Editor/common/RnD/GuideLines/styles.js +60 -0
  66. package/dist/Editor/common/RnD/OptionsPopup/index.js +50 -0
  67. package/dist/Editor/common/RnD/OptionsPopup/style.js +36 -0
  68. package/dist/Editor/common/RnD/RnDCopy.js +23 -0
  69. package/dist/Editor/common/RnD/ShadowElement.js +34 -0
  70. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +40 -0
  71. package/dist/Editor/common/RnD/SwitchViewport/styles.js +24 -0
  72. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +63 -0
  73. package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +19 -0
  74. package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +13 -0
  75. package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +18 -0
  76. package/dist/Editor/common/RnD/TransformHandles/index.js +62 -0
  77. package/dist/Editor/common/RnD/Utils/alignmentDetection.js +26 -0
  78. package/dist/Editor/common/RnD/Utils/calculateDropItem.js +98 -0
  79. package/dist/Editor/common/RnD/Utils/collisionDetection.js +52 -0
  80. package/dist/Editor/common/RnD/Utils/gridDropItem.js +148 -0
  81. package/dist/Editor/common/RnD/Utils/index.js +251 -0
  82. package/dist/Editor/common/RnD/VirtualElement/index.js +76 -0
  83. package/dist/Editor/common/RnD/VirtualElement/styles.js +27 -0
  84. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +28 -0
  85. package/dist/Editor/common/RnD/index.js +503 -0
  86. package/dist/Editor/common/RnD/styles.js +4 -0
  87. package/dist/Editor/common/Section/index.js +21 -12
  88. package/dist/Editor/common/Section/styles.js +6 -1
  89. package/dist/Editor/common/Shorthands/elements.js +12 -0
  90. package/dist/Editor/common/StyleBuilder/boxStyle.js +30 -0
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +32 -31
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +16 -18
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +3 -14
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -2
  95. package/dist/Editor/common/StyleBuilder/index.js +2 -2
  96. package/dist/Editor/common/StyleBuilder/sectionStyle.js +13 -2
  97. package/dist/Editor/helper/RnD/focusOnNewItem.js +39 -0
  98. package/dist/Editor/helper/RnD/scrollToNewSection.js +24 -0
  99. package/dist/Editor/helper/breakpoint.js +5 -0
  100. package/dist/Editor/helper/index.js +139 -22
  101. package/dist/Editor/helper/theme.js +50 -2
  102. package/dist/Editor/hooks/useBreakpoints.js +34 -0
  103. package/dist/Editor/hooks/useMouseMove.js +36 -8
  104. package/dist/Editor/hooks/withCommon.js +2 -1
  105. package/dist/Editor/hooks/withErrorHandling.js +14 -0
  106. package/dist/Editor/utils/RnD/RnDCtrlCmds.js +168 -0
  107. package/dist/Editor/utils/SlateUtilityFunctions.js +31 -5
  108. package/dist/Editor/utils/draftToSlate.js +1 -1
  109. package/dist/Editor/utils/events.js +5 -0
  110. package/dist/Editor/utils/freegrid.js +49 -0
  111. package/dist/Editor/utils/helper.js +29 -0
  112. package/package.json +5 -2
@@ -0,0 +1,159 @@
1
+ const useFreeGridStyles = ({
2
+ theme,
3
+ MAX_DEVICE_WIDTH
4
+ }) => ({
5
+ root: {
6
+ "&.freegrid-container": {
7
+ display: "grid",
8
+ gridTemplateColumns: "var(--cols)",
9
+ gridTemplateRows: "var(--rows)",
10
+ gridGap: "0px",
11
+ backgroundColor: "#FFF",
12
+ padding: "0px",
13
+ height: "100%",
14
+ position: "static",
15
+ overflow: "hidden",
16
+ "& .freegrid-item, & .freegrid-box-item": {
17
+ gridArea: "var(--gridArea)",
18
+ left: "var(--left)",
19
+ marginTop: "var(--marginTop)",
20
+ marginLeft: `calc((100% - ${MAX_DEVICE_WIDTH}px) * 0.5)`,
21
+ zIndex: "var(--zIndex) !important",
22
+ "&.active-drag": {},
23
+ "&.inactive-drag": {},
24
+ "& .editor-blocker": {
25
+ position: "absolute",
26
+ left: 0,
27
+ top: 0,
28
+ width: "100%",
29
+ height: "100%",
30
+ background: "rgba(0,0,0,0)",
31
+ border: 0,
32
+ outline: 0
33
+ },
34
+ "&.enable-1, &.enable-2": {
35
+ "&.type_text": {
36
+ // height: "fit-content !important",
37
+ }
38
+ },
39
+ "&.enable-1:before, &.enable-2:before": {
40
+ position: "absolute",
41
+ content: "attr(placeholder)",
42
+ top: "-22px",
43
+ left: "-2px",
44
+ padding: "2px 4px",
45
+ backgroundColor: "#2563EB",
46
+ color: "#FFF",
47
+ fontSize: "12px",
48
+ borderTopLeftRadius: "2px",
49
+ borderTopRightRadius: "2px",
50
+ width: "auto",
51
+ height: "16px"
52
+ },
53
+ "&:hover": {
54
+ "& .debug-info": {
55
+ opacity: 1
56
+ }
57
+ },
58
+ "& .debug-info": {
59
+ position: "absolute",
60
+ top: "calc(100% + 8px)",
61
+ pointerEvents: "none",
62
+ left: 0,
63
+ background: "rgba(0,0,0,0.2)",
64
+ color: "red",
65
+ width: "100%",
66
+ padding: "6px",
67
+ opacity: 0
68
+ },
69
+ "&.enable-1": {
70
+ "&.type_text": {
71
+ "*": {
72
+ "::selection": {
73
+ backgroundColor: "transparent !important",
74
+ color: "inherit !important"
75
+ }
76
+ }
77
+ }
78
+ },
79
+ /** for element items */
80
+ "& .fgi_type_image, & .fgi_type_video": {
81
+ height: "100%",
82
+ "& .embed": {
83
+ height: "100%",
84
+ "& .embed-image-wrpr, & .embed-video-wrpr-in, & .element-empty-btn": {
85
+ height: "100%"
86
+ }
87
+ }
88
+ },
89
+ "& .fgi_type_button": {
90
+ height: "100%",
91
+ "& .editor-btn-wrapper": {
92
+ height: "100%",
93
+ "& .editor-btn-wrapper-inner": {
94
+ width: "100%",
95
+ height: "100%",
96
+ "& span": {
97
+ width: "100%",
98
+ height: "100%"
99
+ },
100
+ "& .btn": {
101
+ width: "100%",
102
+ height: "100%",
103
+ "&.textAlign-left": {
104
+ justifyContent: "start"
105
+ },
106
+ "&.textAlign-right": {
107
+ justifyContent: "end"
108
+ },
109
+ "&.textAlign-center": {
110
+ justifyContent: "center"
111
+ }
112
+ }
113
+ }
114
+ }
115
+ },
116
+ "& .fgi_type_box": {
117
+ width: "100%",
118
+ height: "100%"
119
+ },
120
+ /** element toolbar hide */
121
+ "& .element-toolbar": {
122
+ display: "none"
123
+ },
124
+ [theme.breakpoints.between("xs", "md")]: {
125
+ marginLeft: `calc((100% - 320px) * 0.5)`
126
+ }
127
+ }
128
+ }
129
+ },
130
+ sectionPopper: {
131
+ zIndex: 1200,
132
+ width: "40px",
133
+ left: "-40px !important",
134
+ "& .papper-root": {
135
+ fontFamily: "sans-serif",
136
+ background: "#FFF",
137
+ "& .MuiIconButton-root": {
138
+ padding: "10px",
139
+ color: "#000",
140
+ background: "#FFF",
141
+ "& svg": {
142
+ width: "20px",
143
+ height: "20px"
144
+ },
145
+ "&.active,&:hover ": {}
146
+ }
147
+ }
148
+ },
149
+ sectionSettingsPopper: {
150
+ "&.style-settings-wrpr": {
151
+ height: "300px",
152
+ overflowY: "auto",
153
+ overflowX: "hidden",
154
+ padding: "8px 8px 12px 12px",
155
+ marginBotton: "12px"
156
+ }
157
+ }
158
+ });
159
+ export default useFreeGridStyles;
@@ -2,7 +2,7 @@
2
2
  import React, { useState } from "react";
3
3
  import { Transforms, Path } from "slate";
4
4
  import { useSlateStatic, ReactEditor } from "slate-react";
5
- import { IconButton, Tooltip, Grid as GridContainer } from "@mui/material";
5
+ import { IconButton, Tooltip, Grid as GridContainer, useTheme } from "@mui/material";
6
6
  import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
7
7
  import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
8
8
  import KeyboardReturnIcon from "@mui/icons-material/KeyboardReturn";
@@ -13,7 +13,7 @@ import GridPopup from "./GridPopup";
13
13
  import SectionPopup from "./SectionPopup";
14
14
  import { gridItem } from "../../utils/gridItem";
15
15
  import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
16
- import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
16
+ import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
17
17
  import useWindowResize from "../../hooks/useWindowResize";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -75,6 +75,7 @@ const GridToolBar = ({
75
75
  }) : null;
76
76
  };
77
77
  const Grid = props => {
78
+ const theme = useTheme();
78
79
  const {
79
80
  attributes,
80
81
  children,
@@ -275,6 +276,14 @@ const Grid = props => {
275
276
  bottomLeft,
276
277
  bottomRight
277
278
  } = getBreakPointsValue(borderRadius, size?.device) || {};
279
+ const gridcwrprProps = groupByBreakpoint({
280
+ padding: {
281
+ ...getTRBLBreakPoints(bannerSpacing)
282
+ },
283
+ flexWrap: {
284
+ ...getBreakPointsValue(flexWrap || "wrap")
285
+ }
286
+ }, theme);
278
287
  return /*#__PURE__*/_jsxs(GridContainer, {
279
288
  container: true,
280
289
  className: `grid-container ${grid} has-hover element-root dpath`,
@@ -340,16 +349,11 @@ const Grid = props => {
340
349
  className: "grid-c-wrpr",
341
350
  sx: {
342
351
  display: "flex",
343
- padding: {
344
- ...getTRBLBreakPoints(bannerSpacing)
345
- },
352
+ ...gridcwrprProps,
346
353
  alignItems: vertical || "start",
347
354
  justifyContent: horizantal || "start",
348
355
  flexDirection: flexDirection || "row",
349
356
  width: "100%",
350
- flexWrap: {
351
- ...getBreakPointsValue(flexWrap || "wrap")
352
- },
353
357
  height: "auto"
354
358
  },
355
359
  "data-path": path.join(","),
@@ -1,13 +1,15 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  import React, { useState } from "react";
3
- import { Transforms, Node } from "slate";
3
+ import { useTheme } from "@mui/material";
4
+ import { Transforms } from "slate";
4
5
  import { useSlateStatic, ReactEditor } from "slate-react";
5
6
  import GridItemPopup from "./GridItemPopup";
6
7
  import { IconButton, Tooltip, Box, Grid as Item } from "@mui/material";
7
8
  import { GridSettingsIcon } from "../../common/iconslist";
8
9
  import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
9
- import { getBreakPointsValue, getTRBLBreakPoints } from "../../helper/theme";
10
+ import { groupByBreakpoint, getBreakPointsValue, getBRValue, getTRBLBreakPoints } from "../../helper/theme";
10
11
  import { isEmptyNode } from "../../utils/helper";
12
+ import { wrapThemeBreakpoints } from "../FreeGrid/breakpointConstants";
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
12
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
15
  const GridItemToolbar = ({
@@ -34,6 +36,7 @@ const GridItemToolbar = ({
34
36
  }) : null;
35
37
  };
36
38
  const GridItem = props => {
39
+ const theme = useTheme();
37
40
  const {
38
41
  attributes,
39
42
  children,
@@ -102,35 +105,44 @@ const GridItem = props => {
102
105
  const getBorderColor = () => {
103
106
  return borderColor || "transparent";
104
107
  };
108
+ const getBRProps = groupByBreakpoint({
109
+ display: {
110
+ xs: xsHidden ? "none" : "inline-block",
111
+ lg: "inline-block"
112
+ },
113
+ width: {
114
+ ...getBreakPointsValue(grid, null, "overrideGridSize", true)
115
+ },
116
+ height: {
117
+ ...getBreakPointsValue(cellGHeight || "auto")
118
+ },
119
+ borderRadius: {
120
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
121
+ },
122
+ margin: {
123
+ ...getTRBLBreakPoints(margin)
124
+ }
125
+ }, theme);
126
+ const giInProps = groupByBreakpoint({
127
+ padding: {
128
+ ...getTRBLBreakPoints(bannerSpacing)
129
+ }
130
+ }, theme);
105
131
  return /*#__PURE__*/_jsxs(Item, {
106
132
  item: true,
107
133
  component: "div",
108
134
  className: `grid-item element-root gi-top-wrpr dpath`,
109
135
  ...attributes,
110
136
  sx: {
111
- width: {
112
- ...getBreakPointsValue(grid, null, "overrideGridSize", true)
113
- },
114
- height: {
115
- ...getBreakPointsValue(cellGHeight || "auto")
116
- },
117
- display: {
118
- lg: "flex",
119
- xs: xsHidden ? "none" : "flex"
120
- },
137
+ ...getBRProps,
138
+ display: "flex",
121
139
  flexDirection: flexDirection || "column",
122
140
  background: bgColor || "transparent",
123
141
  borderColor: getBorderColor(),
124
142
  borderWidth: borderWidth || "1px",
125
- borderRadius: {
126
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
127
- },
128
143
  borderStyle: borderStyle || "solid",
129
144
  alignItems: horizantal,
130
145
  justifyContent: vertical,
131
- margin: {
132
- ...getTRBLBreakPoints(margin)
133
- },
134
146
  "&:hover": {
135
147
  background: `${bgColorHover || bgColor || "transparent"}`
136
148
  }
@@ -169,9 +181,7 @@ const GridItem = props => {
169
181
  sx: {
170
182
  display: "flex",
171
183
  flexDirection: flexDirection || "column",
172
- padding: {
173
- ...getTRBLBreakPoints(bannerSpacing)
174
- },
184
+ ...giInProps,
175
185
  width: "100%",
176
186
  height: "100%",
177
187
  color: textColor || "#000",
@@ -11,9 +11,7 @@ const PageSettingsButton = props => {
11
11
  const {
12
12
  customProps,
13
13
  icoBtnType,
14
- from,
15
- closePopper,
16
- setToolTip
14
+ from
17
15
  } = props;
18
16
  const [openSetttings, setOpenSettings] = useState(false);
19
17
  const editor = useSlateStatic();
@@ -40,8 +38,6 @@ const PageSettingsButton = props => {
40
38
  }
41
39
  };
42
40
  const onClose = () => {
43
- closePopper(true);
44
- setToolTip(false);
45
41
  setOpenSettings(false);
46
42
  };
47
43
  return /*#__PURE__*/_jsxs(_Fragment, {
@@ -6,7 +6,7 @@ import { isTextSelected } from "../../utils/helper";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import SimpleTextStyle from "./style";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { createElement as _createElement } from "react";
10
10
  const SimpleText = props => {
11
11
  const {
12
12
  theme,
@@ -38,15 +38,16 @@ const SimpleText = props => {
38
38
  const showPlaceHolder = !readOnly && path.length === 1 && isEmpty;
39
39
  const isEmptyEditor = !readOnly && isEmpty && editor.children.length === 1 && !selected;
40
40
  const opacity = !isTextSelected(editor?.selection);
41
- return /*#__PURE__*/_jsxs(Box, {
41
+ const nextType = element?.children[0]?.type;
42
+ return /*#__PURE__*/_createElement(Box, {
42
43
  ...element.attr,
43
44
  ...attributes,
44
- className: `simple-text`,
45
+ className: `simple-text ${nextType}`,
45
46
  sx: classes.root,
46
- children: [children, openAI ? null : /*#__PURE__*/_jsx("span", {
47
- className: "placeholder-simple-text",
48
- children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? "Type / to browse elements" : "" : ""
49
- })]
50
- });
47
+ key: `para_${path.join("|")}`
48
+ }, children, openAI ? null : /*#__PURE__*/_jsx("span", {
49
+ className: "placeholder-simple-text",
50
+ children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? "Type / to browse elements" : "" : ""
51
+ }));
51
52
  };
52
53
  export default SimpleText;
@@ -23,6 +23,43 @@ const SimpleTextStyle = ({
23
23
  background: "transparent",
24
24
  color: invertColor(pageColor)
25
25
  }
26
+ },
27
+ "& .freegrid-section": {
28
+ "&.enable-1:before": {
29
+ content: "' '",
30
+ pointerEvents: "none",
31
+ position: "absolute",
32
+ left: "2px",
33
+ top: "2px",
34
+ width: "calc(100% - 4px)",
35
+ height: "calc(100% - 4px)",
36
+ outline: "2px solid #2563EB",
37
+ zIndex: 1
38
+ },
39
+ "&:hover, &.enable-1": {
40
+ "& .freegrid-section-infos": {
41
+ pointerEvents: "none",
42
+ position: "absolute",
43
+ top: 0,
44
+ left: 0,
45
+ width: "100%",
46
+ zIndex: 1,
47
+ ":before": {
48
+ position: "absolute",
49
+ content: "attr(placeholder)",
50
+ left: "0px",
51
+ top: "0px",
52
+ width: "auto",
53
+ height: "auto",
54
+ backgroundColor: "#8360FD",
55
+ padding: "4px 6px",
56
+ fontSize: "12px",
57
+ fontWeight: "500",
58
+ color: "#FFF",
59
+ lineHeight: "12px"
60
+ }
61
+ }
62
+ }
26
63
  }
27
64
  },
28
65
  section: {
@@ -0,0 +1,30 @@
1
+ import React, { Component } from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ class ErrorBoundary extends Component {
4
+ constructor(props) {
5
+ super(props);
6
+ this.state = {
7
+ hasError: false
8
+ };
9
+ }
10
+ static getDerivedStateFromError(error) {
11
+ // Update state so the next render will show the fallback UI.
12
+ return {
13
+ hasError: true
14
+ };
15
+ }
16
+ componentDidCatch(error, errorInfo) {
17
+ // You can also log the error to an error reporting service
18
+ console.error("Error caught in Error Boundary: ", error, errorInfo);
19
+ }
20
+ render() {
21
+ if (this.state.hasError) {
22
+ // You can render any custom fallback UI
23
+ return /*#__PURE__*/_jsx("h1", {
24
+ children: "Something went wrong."
25
+ });
26
+ }
27
+ return this.props.children;
28
+ }
29
+ }
30
+ export default ErrorBoundary;
@@ -29,6 +29,28 @@ const editorStyles = ({
29
29
  "& .MuiOutlinedInput-input": {
30
30
  color: theme?.palette?.editor?.textColor || "black"
31
31
  }
32
+ },
33
+ "&.stimulate-xs": {
34
+ ":before": {
35
+ content: '" "',
36
+ position: "absolute",
37
+ top: 0,
38
+ left: 0,
39
+ width: "calc(50% - 162px)",
40
+ height: "100%",
41
+ pointerEvents: "none",
42
+ backgroundColor: "#FFF"
43
+ },
44
+ ":after": {
45
+ content: '" "',
46
+ position: "absolute",
47
+ top: 0,
48
+ right: 0,
49
+ width: "calc(50% - 160px)",
50
+ height: "100%",
51
+ pointerEvents: "none",
52
+ backgroundColor: "#FFF"
53
+ }
32
54
  }
33
55
  },
34
56
  slateWrapper: {
@@ -243,6 +265,7 @@ const editorStyles = ({
243
265
  }
244
266
  },
245
267
  "&.hideScroll": {
268
+ overflowAnchor: "none",
246
269
  "&::-webkit-scrollbar-track": {
247
270
  background: "none !important"
248
271
  },
@@ -9,7 +9,6 @@ import miniToolbarStyles from "./Styles";
9
9
  import usePopupStyle from "../PopupTool/PopupToolStyle";
10
10
  import PopperHeader from "../PopupTool/PopperHeader";
11
11
  import { useEditorContext } from "../../hooks/useMouseMove";
12
- import PageSettingsButton from "../../Elements/PageSettings/PageSettingsButton";
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
14
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -48,23 +47,12 @@ const MiniToolbar = props => {
48
47
  const {
49
48
  popupType
50
49
  } = useEditorContext();
51
- const [toolTip, setToolTip] = useState(false);
52
- const [data, setData] = useState(null);
53
- useEffect(() => {
54
- if (data) {
55
- setToolTip(false);
56
- setData(null);
57
- }
58
- }, [data]);
59
50
  useEffect(() => {
60
51
  if (popper) {
61
52
  setPopper(null);
62
53
  }
63
54
  }, [editor.selection]);
64
55
  const handleClick = type => e => {
65
- if (type === "page-settings") {
66
- setToolTip(true);
67
- }
68
56
  setPopper(type);
69
57
  setAnchorEl(e.currentTarget);
70
58
  };
@@ -78,10 +66,6 @@ const MiniToolbar = props => {
78
66
  const onSearch = e => {
79
67
  setSearch(e?.target?.value || "");
80
68
  };
81
- const closePopper = data => {
82
- setData(data);
83
- setToolTip("false");
84
- };
85
69
  return /*#__PURE__*/_jsxs(_Fragment, {
86
70
  children: [/*#__PURE__*/_jsx(Box, {
87
71
  component: "div",
@@ -97,19 +81,11 @@ const MiniToolbar = props => {
97
81
  return /*#__PURE__*/_jsx(Tooltip, {
98
82
  arrow: true,
99
83
  title: label,
100
- disableHoverListener: toolTip,
101
84
  children: /*#__PURE__*/_jsx(IconButton, {
102
85
  className: type === popper ? "active" : "",
103
86
  onClick: handleClick(type),
104
87
  disabled: isDisabled,
105
- children: type === "page-settings" ? /*#__PURE__*/_jsx(PageSettingsButton, {
106
- from: "miniToolBar",
107
- icoBtnType: "mini",
108
- customProps: customProps,
109
- editor: editor,
110
- closePopper: closePopper,
111
- setToolTip: setToolTip
112
- }) : /*#__PURE__*/_jsx(Icon, {
88
+ children: /*#__PURE__*/_jsx(Icon, {
113
89
  from: "miniToolBar",
114
90
  icoBtnType: "mini",
115
91
  customProps: customProps,
@@ -100,6 +100,7 @@ const TextFormat = props => {
100
100
  return /*#__PURE__*/_jsxs(Grid, {
101
101
  container: true,
102
102
  sx: classes.textFormatWrapper,
103
+ className: "text-formatter-popup",
103
104
  children: [/*#__PURE__*/_jsxs(Grid, {
104
105
  item: true,
105
106
  xs: 12,
@@ -31,6 +31,9 @@ const PopupTool = props => {
31
31
  const id = open ? "popup-edit-tool" : "";
32
32
  const table = new TableUtil(editor);
33
33
  const [size] = useWindowResize();
34
+ const {
35
+ selectedElement
36
+ } = useEditorContext();
34
37
  useEffect(() => {
35
38
  if (event === "end" && anchorEl && !open) {
36
39
  // for table cell selection
@@ -53,6 +56,11 @@ const PopupTool = props => {
53
56
  updateAnchorEl();
54
57
  }
55
58
  }, [selection]);
59
+ useEffect(() => {
60
+ if (selectedElement?.enable === 1) {
61
+ setAnchorEl(null);
62
+ }
63
+ }, [selection, selectedElement?.path, selectedElement?.enable]);
56
64
  const updateAnchorEl = () => {
57
65
  try {
58
66
  const domSelection = window.getSelection();
@@ -31,6 +31,7 @@ import AttachmentsButton from "../Elements/Attachments/AttachmentsButton";
31
31
  import ColorboxButton from "../Elements/Colorbox/ColorboxButton.js";
32
32
  import DividerButton from "../Elements/Divider/DividerButton.js";
33
33
  import EmbedScript from "../Elements/EmbedScript/EmbedScript.js";
34
+ import FreeGridButton from "../Elements/FreeGrid/FreeGridButton.js";
34
35
  import { jsx as _jsx } from "react/jsx-runtime";
35
36
  import { jsxs as _jsxs } from "react/jsx-runtime";
36
37
  export const RenderToolbarIcon = props => {
@@ -133,6 +134,12 @@ export const RenderToolbarIcon = props => {
133
134
  customProps: customProps,
134
135
  icoBtnType: icoBtnType
135
136
  }, element.id);
137
+ case "freegrid":
138
+ return /*#__PURE__*/_jsx(FreeGridButton, {
139
+ editor: editor,
140
+ customProps: customProps,
141
+ icoBtnType: icoBtnType
142
+ }, element.id);
136
143
  case "newLine":
137
144
  return /*#__PURE__*/_jsx(NewLineButton, {
138
145
  editor: editor,
@@ -196,6 +196,11 @@ export const toolbarGroups = [[{
196
196
  format: "grid",
197
197
  type: "grid",
198
198
  group: "elements"
199
+ }, {
200
+ id: 50,
201
+ format: "freegrid",
202
+ type: "freegrid",
203
+ group: "elements"
199
204
  }, {
200
205
  id: 41,
201
206
  format: "emoji",
@@ -7,11 +7,12 @@ import { AiFillEdit, AiOutlineInsertRowBelow, AiOutlineInsertRowRight, AiOutline
7
7
  import { SiLatex } from "react-icons/si";
8
8
  import { RiDeleteColumn, RiDeleteRow } from "react-icons/ri";
9
9
  import { IoIosImage } from "react-icons/io";
10
+ import { CiGrid32 } from "react-icons/ci";
10
11
  import { GridIcon, AccordionIcon, SignatureIcon, ButtonIcon, Carousal, FormIcon, BoldIcon, FontFamilyIcon, FontSizeIcon, ImageIcon, ItalicIcon, LinkIcon, StrikethroughIcon, TableIcon, UnderLineIcon, VideoIcon, CheckboxIcon, AppHeader, MoreHorizontal, UploadImage, DocsUpload, LeftArrow, RightArrow, CheckListButton, CheckListButtonActive, ExcelIcon, CsvIcon, DividerIcon, CloseIcon, SearchIcon, ExpandIcon, CalendarIconNew, Text, TextAreaIcon, Phone, BriefCase, Bank, CalendarTick, DollarSquare, Checkbox, Description, RadioButtonIcon, CheckedIcon, UncheckedIcon, InfinityIcon, ResetIcon } from "./iconslist";
11
12
  import ArrowRightIcon from "@mui/icons-material/ArrowRight";
12
13
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
13
- import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
14
- import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
14
+ import EmailRoundedIcon from "@mui/icons-material/EmailRounded";
15
+ import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
18
  const iconList = {
@@ -215,6 +216,12 @@ const iconList = {
215
216
  }
216
217
  }),
217
218
  calenderNewIcon: /*#__PURE__*/_jsx(CalendarIconNew, {}),
219
+ freegrid: /*#__PURE__*/_jsx(CiGrid32, {
220
+ size: 20,
221
+ style: {
222
+ fill: "#64748B"
223
+ }
224
+ }),
218
225
  text: /*#__PURE__*/_jsx(Text, {}),
219
226
  textArea: /*#__PURE__*/_jsx(TextAreaIcon, {}),
220
227
  phone: /*#__PURE__*/_jsx(Phone, {}),
@@ -39,12 +39,7 @@ const MentionsListCard = props => {
39
39
  },
40
40
  alt: name,
41
41
  children: /*#__PURE__*/_jsx(Avatar, {
42
- sx: {
43
- background: 'linear-gradient(90deg, #5351FC 0%, #19A9FC 100%)'
44
- },
45
- alt: name,
46
- src: avatar_filename,
47
- children: !avatar_filename && name && name.charAt(0).toUpperCase()
42
+ src: avatar_filename
48
43
  })
49
44
  }), /*#__PURE__*/_jsx(Box, {
50
45
  sx: {