@flozy/editor 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/dist/Editor/CommonEditor.js +85 -13
  2. package/dist/Editor/DialogWrapper.js +4 -3
  3. package/dist/Editor/Editor.css +28 -2
  4. package/dist/Editor/Elements/AI/AIInput.js +31 -33
  5. package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +119 -132
  7. package/dist/Editor/Elements/AI/Styles.js +2 -2
  8. package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
  9. package/dist/Editor/Elements/AI/VoiceToText/index.js +184 -0
  10. package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
  11. package/dist/Editor/Elements/AI/helper.js +5 -3
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +36 -23
  13. package/dist/Editor/Elements/Button/EditorButton.js +23 -16
  14. package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -2
  15. package/dist/Editor/Elements/Color Picker/ColorButtons.js +1 -1
  16. package/dist/Editor/Elements/Color Picker/Styles.js +1 -0
  17. package/dist/Editor/Elements/Embed/Image.js +15 -14
  18. package/dist/Editor/Elements/Embed/Video.js +12 -8
  19. package/dist/Editor/Elements/Emoji/EmojiButton.js +11 -7
  20. package/dist/Editor/Elements/Form/Form.js +43 -27
  21. package/dist/Editor/Elements/Form/FormField.js +21 -10
  22. package/dist/Editor/Elements/Form/Workflow/index.js +5 -2
  23. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +437 -0
  24. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +206 -0
  25. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +23 -0
  26. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +236 -0
  27. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +44 -0
  28. package/dist/Editor/Elements/FreeGrid/Options/More.js +24 -0
  29. package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +47 -0
  30. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +19 -0
  31. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +75 -0
  32. package/dist/Editor/Elements/FreeGrid/styles.js +214 -0
  33. package/dist/Editor/Elements/Grid/Grid.js +12 -8
  34. package/dist/Editor/Elements/Grid/GridItem.js +31 -21
  35. package/dist/Editor/Elements/Link/LinkPopup.js +69 -13
  36. package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
  37. package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -2
  38. package/dist/Editor/Elements/Signature/Signature.css +13 -6
  39. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +2 -1
  40. package/dist/Editor/Elements/Signature/SignaturePopup.js +186 -31
  41. package/dist/Editor/Elements/SimpleText/index.js +19 -7
  42. package/dist/Editor/Elements/SimpleText/style.js +44 -1
  43. package/dist/Editor/ErrorBoundary.js +30 -0
  44. package/dist/Editor/Styles/EditorStyles.js +28 -0
  45. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +1 -1
  46. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -2
  47. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +33 -5
  48. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +12 -13
  49. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +12 -13
  50. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +3 -0
  51. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +59 -0
  52. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  53. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +107 -40
  54. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +57 -61
  55. package/dist/Editor/Toolbar/PopupTool/index.js +13 -3
  56. package/dist/Editor/Toolbar/Toolbar.js +7 -0
  57. package/dist/Editor/Toolbar/toolbarGroups.js +15 -5
  58. package/dist/Editor/assets/svg/AIIcons.js +153 -1
  59. package/dist/Editor/common/EditorCmds.js +0 -3
  60. package/dist/Editor/common/EditorIcons.js +7 -7
  61. package/dist/Editor/common/Icon.js +39 -30
  62. package/dist/Editor/common/ImageList.js +16 -3
  63. package/dist/Editor/common/ImageSelector/ImageSelector.js +30 -9
  64. package/dist/Editor/common/ImageSelector/Styles.js +2 -1
  65. package/dist/Editor/common/LinkSettings/index.js +2 -1
  66. package/dist/Editor/common/LinkSettings/style.js +11 -8
  67. package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
  68. package/dist/Editor/common/MentionsPopup/index.js +12 -8
  69. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +142 -0
  70. package/dist/Editor/common/RnD/ContextMenu/index.js +38 -0
  71. package/dist/Editor/common/RnD/ContextMenu/styles.js +21 -0
  72. package/dist/Editor/common/RnD/DragInfo/index.js +31 -0
  73. package/dist/Editor/common/RnD/DragInfo/styles.js +15 -0
  74. package/dist/Editor/common/RnD/DragOver/index.js +55 -0
  75. package/dist/Editor/common/RnD/DragOver/styles.js +23 -0
  76. package/dist/Editor/common/RnD/ElementOptions/Actions.js +102 -0
  77. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +26 -0
  78. package/dist/Editor/common/RnD/ElementOptions/index.js +95 -0
  79. package/dist/Editor/common/RnD/ElementOptions/styles.js +41 -0
  80. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +153 -0
  81. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +36 -0
  82. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +60 -0
  83. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +9 -0
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +47 -0
  85. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +47 -0
  86. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +47 -0
  87. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +48 -0
  88. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +47 -0
  89. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +30 -0
  90. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +47 -0
  91. package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +17 -0
  92. package/dist/Editor/common/RnD/ElementSettings/index.js +17 -0
  93. package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +18 -0
  94. package/dist/Editor/common/RnD/ElementSettings/styles.js +94 -0
  95. package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +52 -0
  96. package/dist/Editor/common/RnD/GuideLines/index.js +33 -0
  97. package/dist/Editor/common/RnD/GuideLines/styles.js +62 -0
  98. package/dist/Editor/common/RnD/OptionsPopup/index.js +50 -0
  99. package/dist/Editor/common/RnD/OptionsPopup/style.js +36 -0
  100. package/dist/Editor/common/RnD/RnDCopy.js +23 -0
  101. package/dist/Editor/common/RnD/ShadowElement.js +34 -0
  102. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +40 -0
  103. package/dist/Editor/common/RnD/SwitchViewport/styles.js +24 -0
  104. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +63 -0
  105. package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +19 -0
  106. package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +13 -0
  107. package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +20 -0
  108. package/dist/Editor/common/RnD/TransformHandles/index.js +67 -0
  109. package/dist/Editor/common/RnD/Utils/alignmentDetection.js +26 -0
  110. package/dist/Editor/common/RnD/Utils/calculateDropItem.js +98 -0
  111. package/dist/Editor/common/RnD/Utils/collisionDetection.js +52 -0
  112. package/dist/Editor/common/RnD/Utils/gridDropItem.js +181 -0
  113. package/dist/Editor/common/RnD/Utils/index.js +251 -0
  114. package/dist/Editor/common/RnD/VirtualElement/index.js +77 -0
  115. package/dist/Editor/common/RnD/VirtualElement/styles.js +27 -0
  116. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +28 -0
  117. package/dist/Editor/common/RnD/index.js +567 -0
  118. package/dist/Editor/common/RnD/styles.js +4 -0
  119. package/dist/Editor/common/Section/index.js +21 -12
  120. package/dist/Editor/common/Section/styles.js +7 -4
  121. package/dist/Editor/common/Shorthands/elements.js +21 -9
  122. package/dist/Editor/common/StyleBuilder/boxStyle.js +30 -0
  123. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +18 -10
  124. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +18 -5
  125. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -2
  126. package/dist/Editor/common/StyleBuilder/index.js +6 -4
  127. package/dist/Editor/common/StyleBuilder/sectionStyle.js +13 -2
  128. package/dist/Editor/common/iconListV2.js +843 -0
  129. package/dist/Editor/commonStyle.js +6 -0
  130. package/dist/Editor/helper/RnD/focusOnNewItem.js +39 -0
  131. package/dist/Editor/helper/RnD/scrollToNewSection.js +24 -0
  132. package/dist/Editor/helper/breakpoint.js +5 -0
  133. package/dist/Editor/helper/index.js +139 -0
  134. package/dist/Editor/helper/theme.js +50 -1
  135. package/dist/Editor/hooks/useBreakpoints.js +34 -0
  136. package/dist/Editor/hooks/useMouseMove.js +36 -8
  137. package/dist/Editor/hooks/useWindowMessage.js +10 -7
  138. package/dist/Editor/hooks/withCommon.js +2 -1
  139. package/dist/Editor/hooks/withErrorHandling.js +14 -0
  140. package/dist/Editor/utils/RnD/RnDCtrlCmds.js +197 -0
  141. package/dist/Editor/utils/SlateUtilityFunctions.js +36 -4
  142. package/dist/Editor/utils/events.js +5 -0
  143. package/dist/Editor/utils/form.js +7 -2
  144. package/dist/Editor/utils/formfield.js +1 -1
  145. package/dist/Editor/utils/freegrid.js +91 -0
  146. package/dist/Editor/utils/helper.js +43 -0
  147. package/dist/Editor/utils/insertAppHeader.js +47 -40
  148. package/package.json +6 -2
@@ -10,6 +10,7 @@ import { TableUtil } from "../../utils/table";
10
10
  import Icon from "../Icon";
11
11
  import EmojiButton from "../../Elements/Emoji/EmojiButton";
12
12
  import { insertDivider } from "../../utils/divider";
13
+ import { insertFreeGrid } from "../../utils/freegrid";
13
14
  import { Transforms } from "slate";
14
15
  import { insertInfinityAI } from "../../utils/infinityAI";
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -125,15 +126,6 @@ const ELEMENTS_LIST = [{
125
126
  icon: "calenderNewIcon"
126
127
  }),
127
128
  onInsert: editor => insertDefaultEmbed(editor, "calendly", "")
128
- }, {
129
- name: "Emoji",
130
- group: "Elements",
131
- desc: "",
132
- type: "emoji",
133
- renderComponent: rest => /*#__PURE__*/_jsx(EmojiButton, {
134
- ...rest,
135
- icoBtnType: "cmd"
136
- })
137
129
  }, {
138
130
  name: "Table",
139
131
  group: "Elements",
@@ -146,6 +138,15 @@ const ELEMENTS_LIST = [{
146
138
  const table = new TableUtil(editor);
147
139
  table.insertTable(3, 3);
148
140
  }
141
+ }, {
142
+ name: "Emoji",
143
+ group: "Elements",
144
+ desc: "",
145
+ type: "emoji",
146
+ renderComponent: rest => /*#__PURE__*/_jsx(EmojiButton, {
147
+ ...rest,
148
+ icoBtnType: "cmd"
149
+ })
149
150
  }, {
150
151
  name: "Divider",
151
152
  group: "Elements",
@@ -168,6 +169,17 @@ const ELEMENTS_LIST = [{
168
169
  onInsert: editor => {
169
170
  insertGrid(editor);
170
171
  }
172
+ }, {
173
+ name: "Free Grid",
174
+ group: "Elements",
175
+ desc: "",
176
+ type: "freegrid",
177
+ icon: /*#__PURE__*/_jsx(Icon, {
178
+ icon: "freegrid"
179
+ }),
180
+ onInsert: editor => {
181
+ insertFreeGrid(editor);
182
+ }
171
183
  }, {
172
184
  name: "Accordion",
173
185
  group: "Elements",
@@ -0,0 +1,30 @@
1
+ const boxStyle = [{
2
+ tab: "Colors",
3
+ value: "sectionColors",
4
+ fields: [{
5
+ label: "Background Color",
6
+ key: "sectionBgColor",
7
+ type: "color"
8
+ }]
9
+ }, {
10
+ tab: "Background",
11
+ value: "sectionBackgroundImage",
12
+ fields: [{
13
+ label: "Background Image URL",
14
+ key: "sectionBackgroundImage",
15
+ type: "text"
16
+ }, {
17
+ label: "Background Image",
18
+ key: "sectionBackgroundImage",
19
+ type: "backgroundImage"
20
+ }]
21
+ }, {
22
+ tab: "Border",
23
+ value: "sectionBorderRadius",
24
+ fields: [{
25
+ label: "Border",
26
+ key: "sectionBorderRadius",
27
+ type: "borderRadius"
28
+ }]
29
+ }];
30
+ export default boxStyle;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import { Checkbox, FormControlLabel, Grid, Slider, Typography, Box } from "@mui/material";
3
3
  import { squreStyle } from "./radiusStyle";
4
4
  import { getBreakPointsValue } from "../../../helper/theme";
@@ -23,7 +23,11 @@ const BannerSpacing = props => {
23
23
  lockSpacing = true;
24
24
  }
25
25
  const [size] = useWindowResize();
26
- const value = getBreakPointsValue(val, size?.device);
26
+ const pro_value = getBreakPointsValue(val, size?.device);
27
+ const [value, setValue] = useState(pro_value);
28
+ useState(() => {
29
+ setValue(pro_value);
30
+ }, [pro_value]);
27
31
  const handleChange = e => {
28
32
  let changeAll = {};
29
33
  if (lockSpacing) {
@@ -31,13 +35,17 @@ const BannerSpacing = props => {
31
35
  changeAll[m] = e.target.value;
32
36
  });
33
37
  }
38
+ const up_value = {
39
+ ...value,
40
+ ...changeAll,
41
+ [e.target.name]: e.target.value
42
+ };
43
+ console.log(e.target.value, lockSpacing, changeAll, up_value, size?.device, getBreakPointsValue(val, null));
34
44
  onChange({
35
45
  [key]: {
36
46
  ...getBreakPointsValue(val, null),
37
47
  [size?.device]: {
38
- ...value,
39
- ...changeAll,
40
- [e.target.name]: e.target.value
48
+ ...up_value
41
49
  }
42
50
  }
43
51
  });
@@ -78,7 +86,7 @@ const BannerSpacing = props => {
78
86
  component: "input",
79
87
  sx: classes.sapcingInput,
80
88
  name: "top",
81
- value: !lockSpacing ? "" : value?.top || 0,
89
+ value: !lockSpacing ? "" : pro_value?.top,
82
90
  className: "sliderInput",
83
91
  disabled: !lockSpacing,
84
92
  onChange: handleChange
@@ -125,7 +133,7 @@ const BannerSpacing = props => {
125
133
  children: /*#__PURE__*/_jsx("input", {
126
134
  type: "text",
127
135
  name: "top",
128
- value: value?.top,
136
+ value: pro_value?.top,
129
137
  className: "borderInput",
130
138
  style: {
131
139
  ...squreStyle.topRight
@@ -137,7 +145,7 @@ const BannerSpacing = props => {
137
145
  children: /*#__PURE__*/_jsx("input", {
138
146
  type: "text",
139
147
  name: "right",
140
- value: value?.right,
148
+ value: pro_value?.right,
141
149
  className: "borderInput",
142
150
  style: {
143
151
  ...squreStyle.bottomLeft
@@ -149,7 +157,7 @@ const BannerSpacing = props => {
149
157
  children: /*#__PURE__*/_jsx("input", {
150
158
  type: "text",
151
159
  name: "bottom",
152
- value: value?.bottom,
160
+ value: pro_value?.bottom,
153
161
  className: "borderInput",
154
162
  style: {
155
163
  ...squreStyle.bottomRight
@@ -162,7 +170,7 @@ const BannerSpacing = props => {
162
170
  type: "text",
163
171
  name: "left",
164
172
  className: "borderInput",
165
- value: value?.left,
173
+ value: pro_value?.left,
166
174
  style: {
167
175
  ...squreStyle.topLeft
168
176
  },
@@ -12,7 +12,9 @@ const SaveAsTemplate = props => {
12
12
  data,
13
13
  customProps,
14
14
  elementProps,
15
- handleClose
15
+ handleClose,
16
+ saveText = "Save As Template",
17
+ closeText = ""
16
18
  } = props;
17
19
  const {
18
20
  onSaveTemplate
@@ -183,20 +185,31 @@ const SaveAsTemplate = props => {
183
185
  backgroundSize: "contain",
184
186
  backgroundRepeat: "no-repeat"
185
187
  }
186
- }), /*#__PURE__*/_jsx(Grid, {
188
+ }), /*#__PURE__*/_jsxs(Grid, {
187
189
  item: true,
188
190
  xs: 12,
189
191
  style: {
190
192
  display: "flex",
191
193
  justifyContent: "center"
192
194
  },
193
- children: /*#__PURE__*/_jsx(Button, {
195
+ className: "action-btn-wrpr",
196
+ children: [/*#__PURE__*/_jsx(Button, {
197
+ className: "savebtn",
194
198
  onClick: handleSave,
195
199
  sx: {
196
200
  fontWeight: 700
197
201
  },
198
- children: "Save As Template"
199
- })
202
+ variant: "contained",
203
+ children: saveText
204
+ }), closeText ? /*#__PURE__*/_jsx(Button, {
205
+ className: "closebtn",
206
+ onClick: handleSave,
207
+ sx: {
208
+ fontWeight: 700
209
+ },
210
+ variant: "contained",
211
+ children: closeText
212
+ }) : null]
200
213
  })]
201
214
  });
202
215
  };
@@ -1,10 +1,10 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import { Grid, TextField, Typography } from "@mui/material";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
5
  const Text = props => {
6
6
  const {
7
- value,
7
+ value: pro_value,
8
8
  data,
9
9
  onChange
10
10
  } = props;
@@ -13,7 +13,9 @@ const Text = props => {
13
13
  placeholder,
14
14
  width
15
15
  } = data;
16
+ const [value, setValue] = useState(pro_value);
16
17
  const handleChange = e => {
18
+ setValue(e.target.value);
17
19
  onChange({
18
20
  [key]: e.target.value
19
21
  });
@@ -7,15 +7,17 @@ import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  import { Fragment as _Fragment } from "react/jsx-runtime";
10
- const StyleContent = props => {
10
+ export const StyleContent = props => {
11
11
  const {
12
12
  value,
13
13
  renderTabs,
14
14
  onChange,
15
- element,
15
+ element: propsElement,
16
16
  customProps,
17
- handleClose
17
+ handleClose,
18
+ customElement
18
19
  } = props;
20
+ const element = customElement ? customElement : propsElement;
19
21
  const {
20
22
  hideTools
21
23
  } = customProps || {};
@@ -87,7 +89,7 @@ const StyleBuilder = props => {
87
89
  ...data,
88
90
  field_type: data?.element
89
91
  });
90
- if (data?.hasOwnProperty('name')) {
92
+ if (data?.hasOwnProperty("name")) {
91
93
  setElementProps({
92
94
  ...elementProps,
93
95
  ...data,
@@ -1,4 +1,12 @@
1
- const gridStyle = [{
1
+ const sectionStyle = [{
2
+ tab: "General",
3
+ value: "sectionName",
4
+ fields: [{
5
+ label: "Section Name",
6
+ key: "sectionName",
7
+ type: "text"
8
+ }]
9
+ }, {
2
10
  tab: "Colors",
3
11
  value: "sectionColors",
4
12
  fields: [{
@@ -21,6 +29,7 @@ const gridStyle = [{
21
29
  }, {
22
30
  tab: "Padding",
23
31
  value: "sectionBannerSpacing",
32
+ hideOnFGS: true,
24
33
  fields: [{
25
34
  label: "Padding",
26
35
  key: "sectionBannerSpacing",
@@ -37,6 +46,7 @@ const gridStyle = [{
37
46
  }, {
38
47
  tab: "Position",
39
48
  value: "position",
49
+ hideOnFGS: true,
40
50
  fields: [{
41
51
  label: "Set Postion (Vertical & Horizantal)",
42
52
  key: "sectionAlignment",
@@ -45,10 +55,11 @@ const gridStyle = [{
45
55
  }, {
46
56
  tab: "Size",
47
57
  value: "gridSize",
58
+ hideOnFGS: true,
48
59
  fields: [{
49
60
  label: "Width Size",
50
61
  key: "sectionGridSize",
51
62
  type: "gridSize"
52
63
  }]
53
64
  }];
54
- export default gridStyle;
65
+ export default sectionStyle;