@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
@@ -28,20 +28,16 @@ export const toolbarGroups = [[{
28
28
  type: "dropdown",
29
29
  options: [{
30
30
  text: "Normal",
31
- value: "normal",
32
- numVal: "400"
31
+ value: "normal"
33
32
  }, {
34
33
  text: "Bold",
35
- value: "bold",
36
- numVal: "700"
34
+ value: "bold"
37
35
  }, {
38
36
  text: "Bolder",
39
- value: "bolder",
40
- numVal: "700"
37
+ value: "bolder"
41
38
  }, {
42
39
  text: "Lighter",
43
- value: "lighter",
44
- numVal: "100"
40
+ value: "lighter"
45
41
  }],
46
42
  icon: FormatBoldIcon,
47
43
  width: "100px"
@@ -50,8 +46,7 @@ export const toolbarGroups = [[{
50
46
  format: "bold",
51
47
  type: "mark",
52
48
  title: "Bold",
53
- basic: true,
54
- themeEnabled: true
49
+ basic: true
55
50
  }, {
56
51
  id: 5,
57
52
  format: "underline",
@@ -62,8 +57,7 @@ export const toolbarGroups = [[{
62
57
  format: "italic",
63
58
  type: "mark",
64
59
  title: "Italic",
65
- basic: true,
66
- themeEnabled: true
60
+ basic: true
67
61
  }, {
68
62
  id: 6,
69
63
  format: "strikethrough",
@@ -107,42 +101,6 @@ export const toolbarGroups = [[{
107
101
  type: "block",
108
102
  title: "H3",
109
103
  group: "typography"
110
- }, {
111
- id: 39,
112
- format: "headingFour",
113
- type: "block",
114
- title: "H4",
115
- group: "typography"
116
- }, {
117
- id: 40,
118
- format: "headingFive",
119
- type: "block",
120
- title: "H5",
121
- group: "typography"
122
- }, {
123
- id: 41,
124
- format: "headingSix",
125
- type: "block",
126
- title: "H6",
127
- group: "typography"
128
- }, {
129
- id: 42,
130
- format: "paragraphOne",
131
- type: "block",
132
- title: "Paragraph 1",
133
- group: "typography"
134
- }, {
135
- id: 43,
136
- format: "paragraphTwo",
137
- type: "block",
138
- title: "Paragraph 2",
139
- group: "typography"
140
- }, {
141
- id: 44,
142
- format: "paragraphThree",
143
- type: "block",
144
- title: "Paragraph 3",
145
- group: "typography"
146
104
  }, {
147
105
  id: 14,
148
106
  format: "doublequote",
@@ -182,6 +140,11 @@ export const toolbarGroups = [[{
182
140
  format: "alignRight",
183
141
  type: "block",
184
142
  title: "Right Align"
143
+ }, {
144
+ id: 39,
145
+ format: "alignJustify",
146
+ type: "block",
147
+ title: "Justify"
185
148
  }], [{
186
149
  id: 20,
187
150
  format: "link",
@@ -238,6 +201,11 @@ export const toolbarGroups = [[{
238
201
  format: "grid",
239
202
  type: "grid",
240
203
  group: "elements"
204
+ }, {
205
+ id: 50,
206
+ format: "freegrid",
207
+ type: "freegrid",
208
+ group: "elements"
241
209
  }, {
242
210
  id: 41,
243
211
  format: "emoji",
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { Grid, Button, Popover } from "@mui/material";
3
+ import ColorPickerTool from "react-gcolor-picker";
3
4
  import { colors } from "../Elements/Color Picker/defaultColors";
4
- import CustomColorPicker from "./CustomColorPicker";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -9,12 +9,9 @@ const ColorPickerButton = props => {
9
9
  const {
10
10
  value,
11
11
  onSave,
12
+ defaultColors = [],
12
13
  classes = {},
13
- recentColors = [],
14
- children,
15
- handleClose: closeDrawer,
16
- hideThemeColors,
17
- disableEditTheme
14
+ recentColors = []
18
15
  } = props;
19
16
  const [anchorEl, setAnchorEl] = useState(null);
20
17
  const [color, setColor] = useState(value);
@@ -33,13 +30,7 @@ const ColorPickerButton = props => {
33
30
  setColor(color);
34
31
  };
35
32
  return /*#__PURE__*/_jsxs(_Fragment, {
36
- children: [children ? /*#__PURE__*/_jsx("div", {
37
- onClick: handleColorPicker,
38
- style: {
39
- cursor: "pointer"
40
- },
41
- children: children
42
- }) : /*#__PURE__*/_jsx(Button, {
33
+ children: [/*#__PURE__*/_jsx(Button, {
43
34
  style: {
44
35
  background: value,
45
36
  height: "22px",
@@ -69,24 +60,17 @@ const ColorPickerButton = props => {
69
60
  item: true,
70
61
  xs: 12,
71
62
  children: [/*#__PURE__*/_jsx("div", {
72
- children: /*#__PURE__*/_jsx(CustomColorPicker, {
63
+ children: /*#__PURE__*/_jsx(ColorPickerTool, {
73
64
  gradient: true,
74
- color: color,
65
+ value: color,
75
66
  onChange: handleColorChange,
76
- recentColors: recentColors,
77
- closeDrawer: closeDrawer,
78
- hideThemeColors: hideThemeColors,
79
- disableEditTheme: disableEditTheme
67
+ defaultColors: [...recentColors, ...defaultColors] || []
80
68
  })
81
69
  }), /*#__PURE__*/_jsxs("div", {
82
70
  style: {
83
71
  display: "flex",
84
- justifyContent: "flex-end",
85
- padding: "8px",
86
- background: "white",
87
- position: "sticky",
88
- bottom: 0,
89
- boxShadow: "0 -1px 5px rgba(0,0,0,0.1)"
72
+ justifyContent: "end",
73
+ margin: "8px"
90
74
  },
91
75
  children: [/*#__PURE__*/_jsx(Button, {
92
76
  onClick: handleClose,
@@ -7,7 +7,7 @@ import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { Transforms } from "slate";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree", "grid"];
10
+ const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "grid"];
11
11
  const DragHandleStyle = fromPopper => {
12
12
  const handleDragStyle = fromPopper ? {
13
13
  position: "absolute",
@@ -7,9 +7,6 @@ const selectAll = (event, {
7
7
  if (needLayout) {
8
8
  event.preventDefault();
9
9
  // Select the entire document
10
- const {
11
- selection
12
- } = editor;
13
10
  const [firstNode] = Editor.nodes(editor, {
14
11
  at: [0]
15
12
  }); // First node
@@ -1,17 +1,17 @@
1
1
  import React from "react";
2
- import { MdFormatQuote, MdFormatAlignLeft, MdFormatAlignCenter, MdFormatAlignRight, MdFormatListNumbered, MdFormatListBulleted, MdAdd, MdArrowForward, MdEmojiEmotions, MdOutlinePermMedia } from "react-icons/md";
3
- import { BsTypeH1, BsTypeH2, BsTypeH3, BsCameraVideoFill, BsArrowBarRight, BsArrowBarLeft, BsFillMenuButtonWideFill, BsCodeSlash } from "react-icons/bs";
2
+ import { MdFormatQuote, MdFormatAlignLeft, MdFormatAlignCenter, MdFormatAlignRight, MdAdd, MdArrowForward, MdOutlinePermMedia, MdFormatAlignJustify } from "react-icons/md";
3
+ import { BsTypeH1, BsTypeH2, BsTypeH3, BsCameraVideoFill, BsArrowBarRight, BsArrowBarLeft, BsCodeSlash } from "react-icons/bs";
4
4
  import { FaSuperscript, FaSubscript } from "react-icons/fa";
5
5
  import { FcAddRow, FcAddColumn } from "react-icons/fc";
6
6
  import { AiFillEdit, AiOutlineInsertRowBelow, AiOutlineInsertRowRight, AiOutlineDelete, AiFillTag, AiOutlineUpload, AiOutlineArrowsAlt, AiOutlineInsertRowAbove, AiOutlineInsertRowLeft, AiFillHtml5 } from "react-icons/ai";
7
7
  import { SiLatex } from "react-icons/si";
8
8
  import { RiDeleteColumn, RiDeleteRow } from "react-icons/ri";
9
- import { IoIosImage } from "react-icons/io";
10
- 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";
9
+ import { CiGrid32 } from "react-icons/ci";
10
+ import { FontFamilyIcon, FontSizeIcon, StrikethroughIcon, AppHeader, MoreHorizontal, UploadImage, LeftArrow, RightArrow, CheckListButton, CheckListButtonActive, ExcelIcon, CsvIcon, CloseIcon, SearchIcon, ExpandIcon, CalendarIconNew, Text, TextAreaIcon, Phone, BriefCase, Bank, CalendarTick, DollarSquare, Checkbox, Description, RadioButtonIcon, CheckedIcon, UncheckedIcon, InfinityIcon, ResetIcon } from "./iconslist";
11
11
  import ArrowRightIcon from "@mui/icons-material/ArrowRight";
12
12
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
13
- import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
14
- import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
13
+ import EmailRoundedIcon from "@mui/icons-material/EmailRounded";
14
+ import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
15
15
  import { AccordionTextFormatIcon, BoldTextFormatIcon, BulletedListTextFormatIcon, ButtonElementIcon, CarouselElementIcon, CheckListTextFormatIcon, ColorBoxElementIcon, DividerElementIcon, DocUploadElementIcon, EmbedElementIcon, EmojiElementIcon, FormElementIcon, GridElementIcon, ImageElementIcon, ItalicTextFormatIcon, LinkIconV2, OrderedListTextFormatIcon, SignatureElementIcon, TableElementIcon, TopBannerElementIcon, UnderlineTextFormatIcon, VideoElementIcon } from "./iconListV2";
16
16
  import SettingsIcon from "../assets/svg/SettingsIcon";
17
17
  import UndoIcon from "../assets/svg/UndoIcon";
@@ -21,16 +21,6 @@ import AddElementIcon from "../assets/svg/AddElementIcon";
21
21
  import AddTemplateIcon from "../assets/svg/AddTemplateIcon";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
- const HeadingIcon = ({
25
- variant
26
- }) => {
27
- return /*#__PURE__*/_jsx("div", {
28
- style: {
29
- color: "#64748B"
30
- },
31
- children: variant
32
- });
33
- };
34
24
  const iconList = {
35
25
  fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
36
26
  size: 20
@@ -66,24 +56,6 @@ const iconList = {
66
56
  size: 18,
67
57
  fill: "#64748B"
68
58
  }),
69
- headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
70
- variant: "H4"
71
- }),
72
- headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
73
- variant: "H5"
74
- }),
75
- headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
76
- variant: "H6"
77
- }),
78
- paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
79
- variant: "P1"
80
- }),
81
- paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
82
- variant: "P2"
83
- }),
84
- paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
85
- variant: "P3"
86
- }),
87
59
  blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
88
60
  size: 20,
89
61
  fill: "#64748B"
@@ -112,6 +84,10 @@ const iconList = {
112
84
  size: 18,
113
85
  fill: "#64748B"
114
86
  }),
87
+ alignJustify: /*#__PURE__*/_jsx(MdFormatAlignJustify, {
88
+ size: 18,
89
+ fill: "#64748B"
90
+ }),
115
91
  orderedList: /*#__PURE__*/_jsx(OrderedListTextFormatIcon, {
116
92
  size: 18,
117
93
  fill: "#64748B"
@@ -248,6 +224,12 @@ const iconList = {
248
224
  }
249
225
  }),
250
226
  calenderNewIcon: /*#__PURE__*/_jsx(CalendarIconNew, {}),
227
+ freegrid: /*#__PURE__*/_jsx(CiGrid32, {
228
+ size: 20,
229
+ style: {
230
+ fill: "#64748B"
231
+ }
232
+ }),
251
233
  text: /*#__PURE__*/_jsx(Text, {}),
252
234
  textArea: /*#__PURE__*/_jsx(TextAreaIcon, {}),
253
235
  phone: /*#__PURE__*/_jsx(Phone, {}),
@@ -134,13 +134,10 @@ export const SelectPage = props => {
134
134
  });
135
135
  };
136
136
  export const Trigger = props => {
137
- const {
138
- nav
139
- } = props;
140
- return /*#__PURE__*/_jsxs(Typography, {
137
+ return /*#__PURE__*/_jsx(Typography, {
141
138
  variant: "subtitle1",
142
139
  gutterBottom: true,
143
- children: ["Choosing this will trigger the ", nav.type, " step"]
140
+ children: "Choosing this will trigger the next step"
144
141
  });
145
142
  };
146
143
  const scrollToOptions = [{
@@ -18,8 +18,7 @@ const MAP_COMPONENT = {
18
18
  webAddress: TextInput,
19
19
  email: TextInput,
20
20
  phone: TextInput,
21
- nextTrigger: Trigger,
22
- prevTrigger: Trigger,
21
+ actionTrigger: Trigger,
23
22
  scrollTopOrBottom: ScrollTopBottom,
24
23
  page: SelectPage
25
24
  };
@@ -3,13 +3,8 @@ export const getNavOptions = (hideTools = []) => {
3
3
  label: "None",
4
4
  value: ""
5
5
  }, {
6
- label: "Next Trigger",
7
- value: "nextTrigger",
8
- type: "next"
9
- }, {
10
- label: "Previous Trigger",
11
- value: "prevTrigger",
12
- type: "previous"
6
+ label: "Trigger",
7
+ value: "actionTrigger"
13
8
  }, {
14
9
  label: "Web Address",
15
10
  value: "webAddress",
@@ -35,14 +35,18 @@ const MentionsPopup = /*#__PURE__*/forwardRef((props, ref) => {
35
35
  setOpenAI
36
36
  } = useEditorContext();
37
37
  useEffect(() => {
38
- if (target && chars.length > 0) {
39
- const domRange = ReactEditor.toDOMRange(editor, target);
40
- const rect = domRange.getBoundingClientRect();
41
- setAnchorEl({
42
- clientWidth: rect.width,
43
- clientHeight: rect.height,
44
- getBoundingClientRect: () => rect
45
- });
38
+ try {
39
+ if (target && chars.length > 0) {
40
+ const domRange = ReactEditor.toDOMRange(editor, target);
41
+ const rect = domRange?.getBoundingClientRect();
42
+ setAnchorEl({
43
+ clientWidth: rect.width,
44
+ clientHeight: rect.height,
45
+ getBoundingClientRect: () => rect
46
+ });
47
+ }
48
+ } catch (err) {
49
+ console.log(err);
46
50
  }
47
51
  }, [chars.length, editor, index, target]);
48
52
  useEffect(() => {
@@ -0,0 +1,142 @@
1
+ import CMDIcon from "@mui/icons-material/KeyboardCommandKey";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
+ const CMenus = {
6
+ child: [{
7
+ name: "bringForward",
8
+ label: "Move to Front",
9
+ autoClose: false,
10
+ render: () => {
11
+ return /*#__PURE__*/_jsxs(_Fragment, {
12
+ children: ["Move to Front", " ", /*#__PURE__*/_jsxs("span", {
13
+ className: "shortcut-help-info",
14
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " \u2191"]
15
+ })]
16
+ });
17
+ }
18
+ }, {
19
+ name: "bringBackward",
20
+ label: "Move to Back",
21
+ autoClose: false,
22
+ render: () => {
23
+ return /*#__PURE__*/_jsxs(_Fragment, {
24
+ children: ["Move to Back", " ", /*#__PURE__*/_jsxs("span", {
25
+ className: "shortcut-help-info",
26
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " \u2193"]
27
+ })]
28
+ });
29
+ }
30
+ }, {
31
+ name: "cut",
32
+ label: "Cut",
33
+ render: () => {
34
+ return /*#__PURE__*/_jsxs(_Fragment, {
35
+ children: ["Cut", " ", /*#__PURE__*/_jsxs("span", {
36
+ className: "shortcut-help-info",
37
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " X"]
38
+ })]
39
+ });
40
+ }
41
+ }, {
42
+ name: "copy",
43
+ label: "Copy",
44
+ render: () => {
45
+ return /*#__PURE__*/_jsxs(_Fragment, {
46
+ children: ["Copy", " ", /*#__PURE__*/_jsxs("span", {
47
+ className: "shortcut-help-info",
48
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " C"]
49
+ })]
50
+ });
51
+ }
52
+ }, {
53
+ name: "paste",
54
+ label: "Paste",
55
+ render: () => {
56
+ return /*#__PURE__*/_jsxs(_Fragment, {
57
+ children: ["Paste", " ", /*#__PURE__*/_jsxs("span", {
58
+ className: "shortcut-help-info",
59
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " V"]
60
+ })]
61
+ });
62
+ }
63
+ }, {
64
+ name: "delete",
65
+ label: "Delete"
66
+ }],
67
+ parent: [{
68
+ name: "cut",
69
+ label: "Cut",
70
+ render: () => {
71
+ return /*#__PURE__*/_jsxs(_Fragment, {
72
+ children: ["Cut", " ", /*#__PURE__*/_jsxs("span", {
73
+ className: "shortcut-help-info",
74
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " X"]
75
+ })]
76
+ });
77
+ }
78
+ }, {
79
+ name: "copy",
80
+ label: "Copy",
81
+ render: () => {
82
+ return /*#__PURE__*/_jsxs(_Fragment, {
83
+ children: ["Copy", " ", /*#__PURE__*/_jsxs("span", {
84
+ className: "shortcut-help-info",
85
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " C"]
86
+ })]
87
+ });
88
+ }
89
+ }, {
90
+ name: "paste",
91
+ label: "Paste",
92
+ render: () => {
93
+ return /*#__PURE__*/_jsxs(_Fragment, {
94
+ children: ["Paste", " ", /*#__PURE__*/_jsxs("span", {
95
+ className: "shortcut-help-info",
96
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " V"]
97
+ })]
98
+ });
99
+ }
100
+ }, {
101
+ name: "delete",
102
+ label: "Delete"
103
+ }],
104
+ "parent-container": [{
105
+ name: "cut",
106
+ label: "Cut",
107
+ render: () => {
108
+ return /*#__PURE__*/_jsxs(_Fragment, {
109
+ children: ["Cut", " ", /*#__PURE__*/_jsxs("span", {
110
+ className: "shortcut-help-info",
111
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " X"]
112
+ })]
113
+ });
114
+ }
115
+ }, {
116
+ name: "copy",
117
+ label: "Copy",
118
+ render: () => {
119
+ return /*#__PURE__*/_jsxs(_Fragment, {
120
+ children: ["Copy", " ", /*#__PURE__*/_jsxs("span", {
121
+ className: "shortcut-help-info",
122
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " C"]
123
+ })]
124
+ });
125
+ }
126
+ }, {
127
+ name: "paste",
128
+ label: "Paste",
129
+ render: () => {
130
+ return /*#__PURE__*/_jsxs(_Fragment, {
131
+ children: ["Paste", " ", /*#__PURE__*/_jsxs("span", {
132
+ className: "shortcut-help-info",
133
+ children: [/*#__PURE__*/_jsx(CMDIcon, {}), " V"]
134
+ })]
135
+ });
136
+ }
137
+ }, {
138
+ name: "delete",
139
+ label: "Delete"
140
+ }]
141
+ };
142
+ export default CMenus;
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { Popover, MenuItem } from "@mui/material";
3
+ import CMenus from "./CMenus";
4
+ import useContextMenuStyle from "./styles";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const ContextMenu = props => {
7
+ const classes = useContextMenuStyle();
8
+ const {
9
+ open,
10
+ type,
11
+ contextMenu,
12
+ handleClose
13
+ } = props;
14
+ const {
15
+ path,
16
+ x,
17
+ y
18
+ } = contextMenu;
19
+ const menus = CMenus[type] || [];
20
+ return open && path ? /*#__PURE__*/_jsx(Popover, {
21
+ open: contextMenu !== null,
22
+ sx: classes.root,
23
+ onClose: handleClose(null),
24
+ anchorReference: "anchorPosition",
25
+ anchorPosition: contextMenu !== null ? {
26
+ top: y,
27
+ left: x
28
+ } : undefined,
29
+ children: menus.map((m, i) => {
30
+ return /*#__PURE__*/_jsx(MenuItem, {
31
+ className: "cm-menu-item",
32
+ onClick: handleClose(m),
33
+ children: m?.render ? m.render() : m.label
34
+ }, `cm_${i}`);
35
+ })
36
+ }) : null;
37
+ };
38
+ export default ContextMenu;
@@ -0,0 +1,21 @@
1
+ const useContextMenuStyle = () => ({
2
+ root: {
3
+ zIndex: 1200,
4
+ "& .cm-menu-item": {
5
+ width: "190px",
6
+ justifyContent: "space-between",
7
+ "& .shortcut-help-info": {
8
+ display: "flex",
9
+ justifyContent: "center",
10
+ alignItems: "center",
11
+ fontSize: "12px",
12
+ color: "#bbb",
13
+ "& svg": {
14
+ width: "12px",
15
+ marginRight: "4px"
16
+ }
17
+ }
18
+ }
19
+ }
20
+ });
21
+ export default useContextMenuStyle;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { Paper, Popper } from "@mui/material";
3
+ import useDragInfoStyle from "./styles";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const DragInfo = props => {
7
+ const {
8
+ open,
9
+ dragging,
10
+ anchorEl
11
+ } = props;
12
+ const {
13
+ position
14
+ } = dragging;
15
+ const {
16
+ diffX
17
+ } = position || {};
18
+ const classes = useDragInfoStyle();
19
+ const x = parseInt(position?.x - window.innerWidth / 2 + 490 - diffX);
20
+ return open ? /*#__PURE__*/_jsx(Popper, {
21
+ open: open,
22
+ anchorEl: anchorEl,
23
+ placement: "top-start",
24
+ sx: classes.root,
25
+ children: /*#__PURE__*/_jsxs(Paper, {
26
+ className: "papper-root",
27
+ children: ["x: ", x, ", y: ", position?.y]
28
+ })
29
+ }) : null;
30
+ };
31
+ export default DragInfo;
@@ -0,0 +1,15 @@
1
+ const useDragInfoStyle = () => ({
2
+ root: {
3
+ zIndex: 1200,
4
+ "& .papper-root": {
5
+ padding: "4px 6px",
6
+ background: "#2563EB",
7
+ color: "#FFF",
8
+ fontSize: "12px",
9
+ left: "12px",
10
+ marginLeft: "6px",
11
+ borderRadius: "2px"
12
+ }
13
+ }
14
+ });
15
+ export default useDragInfoStyle;
@@ -0,0 +1,55 @@
1
+ import React, { useEffect, useRef, useState } from "react";
2
+ import { Box, Paper, Popover } from "@mui/material";
3
+ import useDragOverStyle from "./styles";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { Fragment as _Fragment } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ const DragOver = props => {
8
+ const ref = useRef();
9
+ const classes = useDragOverStyle();
10
+ const {
11
+ status,
12
+ hover_on,
13
+ path,
14
+ type
15
+ } = props;
16
+ const [anchorEl, setAnchorEl] = useState(null);
17
+ const open = Boolean(anchorEl);
18
+ const isSectionHover = status && type === "parent";
19
+ const isContainerHover = hover_on.has(path) && type === "parent-container";
20
+ useEffect(() => {
21
+ if (ref?.current) {
22
+ const getBoundingClientRect = () => ref?.current?.getBoundingClientRect();
23
+ setAnchorEl({
24
+ getBoundingClientRect,
25
+ nodeType: 1
26
+ });
27
+ }
28
+ }, [ref?.current]);
29
+ const handleClose = () => {};
30
+ return isSectionHover || isContainerHover ? /*#__PURE__*/_jsxs(_Fragment, {
31
+ children: [/*#__PURE__*/_jsx(Box, {
32
+ component: "div",
33
+ sx: classes.root,
34
+ ref: ref
35
+ }), /*#__PURE__*/_jsx(Popover, {
36
+ sx: classes.popper,
37
+ open: open,
38
+ anchorEl: anchorEl,
39
+ onClose: handleClose,
40
+ anchorOrigin: {
41
+ vertical: "top",
42
+ horizontal: "center"
43
+ },
44
+ transformOrigin: {
45
+ vertical: "top",
46
+ horizontal: "center"
47
+ },
48
+ children: /*#__PURE__*/_jsx(Paper, {
49
+ className: "papper-root",
50
+ children: isSectionHover ? "Attach to this Section" : "Attach to this Container"
51
+ })
52
+ })]
53
+ }) : null;
54
+ };
55
+ export default DragOver;