@flozy/editor 10.6.5 → 10.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/Editor/CommonEditor.js +17 -1
  2. package/dist/Editor/Editor.css +26 -0
  3. package/dist/Editor/Elements/Accordion/Accordion.js +46 -9
  4. package/dist/Editor/Elements/Accordion/AccordionSummary.js +2 -25
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +7 -2
  6. package/dist/Editor/Elements/Button/EditorButton.js +2 -2
  7. package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -1
  8. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +510 -0
  9. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +10 -10
  10. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +28 -9
  11. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +12 -5
  12. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +44 -18
  13. package/dist/Editor/Elements/Divider/Divider.js +1 -1
  14. package/dist/Editor/Elements/Embed/Embed.css +4 -0
  15. package/dist/Editor/Elements/Form/Form.js +3 -3
  16. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +0 -1
  17. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +4 -1
  18. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
  19. package/dist/Editor/Elements/Grid/Grid.js +14 -2
  20. package/dist/Editor/Elements/Signature/Signature.css +2 -1
  21. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +18 -5
  22. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +16 -3
  23. package/dist/Editor/Elements/Table/AddRowCol.js +8 -2
  24. package/dist/Editor/Elements/Table/DragButton.js +0 -1
  25. package/dist/Editor/Elements/Table/Draggable.js +6 -2
  26. package/dist/Editor/Elements/Table/Styles.js +7 -0
  27. package/dist/Editor/Elements/Table/TableCell.js +24 -5
  28. package/dist/Editor/Elements/Title/title.js +2 -5
  29. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +4 -4
  30. package/dist/Editor/Toolbar/PopupTool/index.js +7 -3
  31. package/dist/Editor/common/Checkbox/index.js +46 -0
  32. package/dist/Editor/common/Checkbox/styles.js +45 -0
  33. package/dist/Editor/common/ColorPickerButton.js +3 -0
  34. package/dist/Editor/common/LinkSettings/NavComponents.js +45 -65
  35. package/dist/Editor/common/LinkSettings/index.js +17 -28
  36. package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
  37. package/dist/Editor/common/LinkSettings/style.js +164 -244
  38. package/dist/Editor/common/RadioGroup/index.js +48 -0
  39. package/dist/Editor/common/RadioGroup/styles.js +29 -0
  40. package/dist/Editor/common/RnD/ElementOptions/Actions.js +4 -5
  41. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +4 -3
  42. package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
  43. package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -1
  44. package/dist/Editor/common/RnD/Utils/gridDropItem.js +0 -1
  45. package/dist/Editor/common/RnD/Utils/index.js +55 -24
  46. package/dist/Editor/common/RnD/VirtualElement/helper.js +3 -2
  47. package/dist/Editor/common/RnD/index.js +30 -27
  48. package/dist/Editor/common/Select/index.js +44 -7
  49. package/dist/Editor/common/Select/styles.js +30 -2
  50. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
  51. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
  52. package/dist/Editor/common/SwipeableDrawer/style.js +14 -12
  53. package/dist/Editor/common/iconListV2.js +76 -0
  54. package/dist/Editor/commonStyle.js +12 -0
  55. package/dist/Editor/helper/deserialize/index.js +6 -4
  56. package/dist/Editor/helper/index.js +4 -0
  57. package/dist/Editor/hooks/useTable.js +5 -4
  58. package/dist/Editor/plugins/withCustomDeleteBackward.js +6 -1
  59. package/dist/Editor/plugins/withHTML.js +11 -4
  60. package/dist/Editor/utils/SlateUtilityFunctions.js +21 -32
  61. package/dist/Editor/utils/accordion.js +129 -39
  62. package/dist/Editor/utils/customHooks/useTableResize.js +49 -9
  63. package/dist/Editor/utils/events.js +17 -5
  64. package/dist/Editor/utils/formfield.js +1 -0
  65. package/dist/Editor/utils/helper.js +53 -9
  66. package/dist/Editor/utils/insertAppHeader.js +1 -1
  67. package/dist/Editor/utils/signature.js +2 -9
  68. package/dist/Editor/utils/updateFormName.js +22 -0
  69. package/package.json +1 -1
@@ -122,14 +122,39 @@ const isOverLapLine = ({
122
122
  export function getClosestDraggable(x, y, className, activeClassName) {
123
123
  const draggables = document.querySelectorAll(className);
124
124
  const activeDragEle = document.querySelectorAll(activeClassName)[0];
125
+ const container = document.querySelector("#slate-wrapper-scroll-container");
126
+ if (!activeDragEle || !container) return [];
127
+ const containerRect = container.getBoundingClientRect();
125
128
  const {
126
129
  left: aLeft,
127
130
  top: aTop,
128
131
  width: aWidth,
129
132
  height: aHeight
130
133
  } = activeDragEle?.getBoundingClientRect() || {};
131
- let lines = [];
134
+ const lines = [];
135
+ const clampLine = ({
136
+ x,
137
+ y,
138
+ width,
139
+ height
140
+ }) => {
141
+ if (width > 1) {
142
+ if (x < containerRect.left) x = containerRect.left;
143
+ if (x + width > containerRect.right) width = containerRect.right - x;
144
+ }
145
+ if (height > 1) {
146
+ if (y < containerRect.top) y = containerRect.top;
147
+ if (y + height > containerRect.bottom) height = containerRect.bottom - y;
148
+ }
149
+ return {
150
+ x,
151
+ y,
152
+ width,
153
+ height
154
+ };
155
+ };
132
156
  draggables.forEach(draggable => {
157
+ if (draggable === activeDragEle) return;
133
158
  const {
134
159
  left,
135
160
  top,
@@ -146,42 +171,45 @@ export function getClosestDraggable(x, y, className, activeClassName) {
146
171
  x: xVal,
147
172
  y: yVal
148
173
  }, lines)) {
149
- lines.push({
150
- y: top,
174
+ const line = {
151
175
  x: xVal,
176
+ y: yVal,
152
177
  width: x > left ? Math.abs(aLeft + aWidth - left) : Math.abs(aLeft - (left + width)),
153
178
  height: 1
154
- });
179
+ };
180
+ lines.push(clampLine(line));
155
181
  }
156
182
 
157
183
  // bottom match
158
184
  xVal = x < left ? aLeft : left;
159
185
  yVal = top + height;
160
- if (Math.abs(top + height - (aTop + aHeight)) <= GUIDE_LINE_THRESHOLD && !isOverLapLine({
186
+ if (Math.abs(yVal - (aTop + aHeight)) <= GUIDE_LINE_THRESHOLD && !isOverLapLine({
161
187
  x: xVal,
162
188
  y: yVal
163
189
  }, lines)) {
164
- lines.push({
165
- y: yVal,
190
+ const line = {
166
191
  x: xVal,
192
+ y: yVal,
167
193
  width: x > left ? Math.abs(aLeft + aWidth - left) : Math.abs(aLeft - (left + width)),
168
194
  height: 1
169
- });
195
+ };
196
+ lines.push(clampLine(line));
170
197
  }
171
198
 
172
- // center match
199
+ // center match (horizontal)
173
200
  xVal = x < left ? aLeft : left;
174
201
  yVal = top + height / 2;
175
- if (Math.abs(top + height / 2 - (aTop + aHeight / 2)) <= GUIDE_LINE_THRESHOLD && !isOverLapLine({
202
+ if (Math.abs(yVal - (aTop + aHeight / 2)) <= GUIDE_LINE_THRESHOLD && !isOverLapLine({
176
203
  x: xVal,
177
204
  y: yVal
178
205
  }, lines, "y")) {
179
- lines.push({
180
- y: yVal,
206
+ const line = {
181
207
  x: xVal,
208
+ y: yVal,
182
209
  width: x > left ? Math.abs(aLeft + aWidth - left) : Math.abs(aLeft - (left + width)),
183
210
  height: 1
184
- });
211
+ };
212
+ lines.push(clampLine(line));
185
213
  }
186
214
 
187
215
  // right match
@@ -191,12 +219,13 @@ export function getClosestDraggable(x, y, className, activeClassName) {
191
219
  x: xVal,
192
220
  y: yVal
193
221
  }, lines)) {
194
- lines.push({
195
- y: yVal,
222
+ const line = {
196
223
  x: xVal,
224
+ y: yVal,
197
225
  width: 1,
198
226
  height: Math.abs(aTop - top)
199
- });
227
+ };
228
+ lines.push(clampLine(line));
200
229
  }
201
230
 
202
231
  // left match
@@ -206,27 +235,29 @@ export function getClosestDraggable(x, y, className, activeClassName) {
206
235
  x: xVal,
207
236
  y: yVal
208
237
  }, lines)) {
209
- lines.push({
210
- y: yVal,
238
+ const line = {
211
239
  x: xVal,
240
+ y: yVal,
212
241
  width: 1,
213
242
  height: Math.abs(aTop - top)
214
- });
243
+ };
244
+ lines.push(clampLine(line));
215
245
  }
216
246
 
217
- // middle match
247
+ // middle match (vertical)
218
248
  xVal = left + width / 2;
219
249
  yVal = top < aTop ? top : aTop;
220
- if (Math.abs(aLeft + aWidth / 2 - (left + width / 2)) <= GUIDE_LINE_THRESHOLD && !isOverLapLine({
250
+ if (Math.abs(aLeft + aWidth / 2 - xVal) <= GUIDE_LINE_THRESHOLD && !isOverLapLine({
221
251
  x: xVal,
222
252
  y: yVal
223
253
  }, lines)) {
224
- lines.push({
225
- y: yVal,
254
+ const line = {
226
255
  x: xVal,
256
+ y: yVal,
227
257
  width: 1,
228
258
  height: Math.abs(aTop - top)
229
- });
259
+ };
260
+ lines.push(clampLine(line));
230
261
  }
231
262
  });
232
263
  return lines;
@@ -295,7 +295,7 @@ export const calculateProps = (curPath, dom, domClass, allData, parentDom, isBox
295
295
  const itemsData = [];
296
296
  const items = dom.querySelectorAll(domClass);
297
297
  const nextItemPathLength = curPath?.split("|").length + 2;
298
- let sectionHeight = 12;
298
+ // let sectionHeight = 12;
299
299
  for (let i = 0; i < items.length; i++) {
300
300
  const itemRect = items[i]?.getBoundingClientRect();
301
301
  if (items[i]?.classList.contains("type_box")) {
@@ -315,9 +315,10 @@ export const calculateProps = (curPath, dom, domClass, allData, parentDom, isBox
315
315
  gridArea: calculateGridArea(y)
316
316
  }
317
317
  });
318
- sectionHeight += itemRect?.height;
318
+ // sectionHeight += itemRect?.height;
319
319
  }
320
320
  }
321
+
321
322
  if (dom?.classList.contains("type_box") && parentDom) {
322
323
  const parentDomRect = parentDom?.getBoundingClientRect();
323
324
  const isAppHeader = isBoxHeader || dom?.classList.contains("appHeaderBox");
@@ -77,7 +77,8 @@ const RnD = props => {
77
77
  autoAlign,
78
78
  setAutoAlign,
79
79
  isBoxHeader,
80
- customProps
80
+ customProps,
81
+ xsHidden
81
82
  } = props;
82
83
  const {
83
84
  isSelectedElement,
@@ -632,32 +633,34 @@ const RnD = props => {
632
633
  "data-dragoverid": str_path,
633
634
  "data-dragovertype": type
634
635
  }) : null]
635
- }, eId), !active && rndRef?.current && open && !isInteracting ? /*#__PURE__*/_jsx(ElementOptions, {
636
- id: `opt_ref_${str_path}`,
637
- open: open,
638
- anchorEl: rndRef?.current,
639
- enable: enable,
640
- handleAction: handleAction,
641
- actions: actions,
642
- actionsMap: actionsMap,
643
- optionsProps: optionsProps,
644
- selectedAction: currentAction,
645
- path: str_path,
646
- theme: theme,
647
- translation: translation,
648
- customProps: customProps
649
- }) : null, /*#__PURE__*/_jsx(ElementSettings, {
650
- open: Boolean(currentAction),
651
- currentAction: currentAction,
652
- anchorEl: rndRef?.current,
653
- placement: "right-start",
654
- onClose: onCloseSettings,
655
- childType: childType,
656
- editor: editor,
657
- path: sp,
658
- ...settingsProps,
659
- elementProps: elementProps,
660
- theme: theme
636
+ }, eId), xsHidden && breakpoint === "xs" ? null : /*#__PURE__*/_jsxs(_Fragment, {
637
+ children: [/*#__PURE__*/_jsx(ElementSettings, {
638
+ open: Boolean(currentAction),
639
+ currentAction: currentAction,
640
+ anchorEl: rndRef?.current,
641
+ placement: "right-start",
642
+ onClose: onCloseSettings,
643
+ childType: childType,
644
+ editor: editor,
645
+ path: sp,
646
+ ...settingsProps,
647
+ elementProps: elementProps,
648
+ theme: theme
649
+ }), !active && rndRef?.current && open && !isInteracting ? /*#__PURE__*/_jsx(ElementOptions, {
650
+ id: `opt_ref_${str_path}`,
651
+ open: open,
652
+ anchorEl: rndRef?.current,
653
+ enable: enable,
654
+ handleAction: handleAction,
655
+ actions: actions,
656
+ actionsMap: actionsMap,
657
+ optionsProps: optionsProps,
658
+ selectedAction: currentAction,
659
+ path: str_path,
660
+ theme: theme,
661
+ translation: translation,
662
+ customProps: customProps
663
+ }) : null]
661
664
  }), dragInfoOpen ? /*#__PURE__*/_jsx(DragInfo, {
662
665
  anchorEl: rndRef?.current,
663
666
  open: dragInfoOpen,
@@ -1,22 +1,59 @@
1
- import { Select as Core } from "@mui/material";
1
+ import { Select as Core, MenuItem, Typography } from "@mui/material";
2
2
  import SelectStyles from "./styles";
3
3
  import { useEditorContext } from "../../hooks/useMouseMove";
4
- import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
4
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { Fragment as _Fragment } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
8
  function Select(props) {
7
9
  const {
8
10
  children,
11
+ value,
12
+ onChange,
13
+ options,
14
+ label,
15
+ labelProps,
16
+ showDefault,
17
+ translation,
9
18
  ...rest
10
19
  } = props;
11
20
  const {
12
21
  theme
13
22
  } = useEditorContext();
14
23
  const classes = SelectStyles(theme);
15
- return /*#__PURE__*/_jsx(Core, {
16
- MenuProps: classes.MenuProps,
17
- IconComponent: KeyboardArrowDownRoundedIcon,
18
- ...rest,
19
- children: children
24
+ const menuOptions = showDefault ? [{
25
+ label: "None",
26
+ value: ""
27
+ }, ...(options || [])] : options;
28
+ return /*#__PURE__*/_jsxs(_Fragment, {
29
+ children: [label ? /*#__PURE__*/_jsx(Typography, {
30
+ variant: "body2",
31
+ sx: {
32
+ paddingBottom: "4px"
33
+ },
34
+ ...(labelProps || {}),
35
+ children: label
36
+ }) : null, /*#__PURE__*/_jsx(Core, {
37
+ size: "small",
38
+ fullWidth: true,
39
+ defaultValue: "",
40
+ value: value || "",
41
+ onChange: onChange,
42
+ sx: classes.select,
43
+ MenuProps: classes.MenuProps,
44
+ IconComponent: KeyboardArrowDownRoundedIcon,
45
+ displayEmpty: true,
46
+ ...rest,
47
+ children: menuOptions?.map((option, i) => {
48
+ return /*#__PURE__*/_jsx(MenuItem, {
49
+ value: option.value,
50
+ children: /*#__PURE__*/_jsx(Typography, {
51
+ variant: "body2",
52
+ children: translation(option.label)
53
+ })
54
+ }, i);
55
+ })
56
+ })]
20
57
  });
21
58
  }
22
59
  export default Select;
@@ -1,16 +1,44 @@
1
1
  const SelectStyles = (theme = {}) => {
2
2
  const {
3
3
  textColor,
4
- background
4
+ textWeightPopUpBackground,
5
+ menuOptionSelectedOption
5
6
  } = theme?.palette?.editor || {};
6
7
  return {
7
8
  MenuProps: {
9
+ sx: {
10
+ zIndex: "1302 !important"
11
+ },
8
12
  PaperProps: {
9
13
  sx: {
14
+ background: textWeightPopUpBackground,
10
15
  color: textColor,
11
- background
16
+ borderRadius: "8px",
17
+ marginTop: "2px",
18
+ "& li": {
19
+ padding: "6px 16px",
20
+ margin: "5px !important",
21
+ borderRadius: "4px !important"
22
+ },
23
+ "& .MuiList-root": {
24
+ padding: "0px"
25
+ },
26
+ "& .MuiTypography-root": {
27
+ fontSize: "12px !important",
28
+ fontWeight: 500,
29
+ fontFamily: "'Inter',sans-serif"
30
+ },
31
+ "& .Mui-selected": {
32
+ background: menuOptionSelectedOption,
33
+ color: textColor
34
+ }
12
35
  }
13
36
  }
37
+ },
38
+ select: {
39
+ "& .MuiSelect-icon": {
40
+ color: "#64748B !important"
41
+ }
14
42
  }
15
43
  };
16
44
  };
@@ -8,11 +8,11 @@ const accordionTitleBtnStyle = [{
8
8
  needPreview: true,
9
9
  hideGradient: true
10
10
  }, {
11
- label: "Accordion Background Color",
11
+ label: "Background Color",
12
12
  key: "accordionBgColor",
13
13
  type: "color"
14
14
  }, {
15
- label: "Accordion Border Color",
15
+ label: "Border Color",
16
16
  key: "accordionBorderColor",
17
17
  type: "color"
18
18
  }]
@@ -6,15 +6,18 @@ const accordionTitleStyle = [{
6
6
  key: "textColor",
7
7
  type: "color",
8
8
  needPreview: true
9
- }, {
10
- label: "Background Color",
11
- key: "bgColor",
12
- type: "color"
13
- }, {
14
- label: "Border Color",
15
- key: "borderColor",
16
- type: "color"
17
- }]
9
+ }
10
+ // {
11
+ // label: "Background Color",
12
+ // key: "bgColor",
13
+ // type: "color",
14
+ // },
15
+ // {
16
+ // label: "Border Color",
17
+ // key: "borderColor",
18
+ // type: "color",
19
+ // },
20
+ ]
18
21
  }, {
19
22
  tab: "Banner Spacing",
20
23
  value: "bannerSpacing",
@@ -6,20 +6,22 @@ const Styles = theme => ({
6
6
  "& .MuiDrawer-paper": {
7
7
  borderTopLeftRadius: 8,
8
8
  borderTopRightRadius: 8,
9
- backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
10
- "& .MuiInputBase-root": {
11
- border: `1px solid ${theme?.palette?.editor?.textColor}`,
12
- color: theme?.palette?.editor?.textColor
13
- },
14
- "& .MuiSvgIcon-root": {
15
- color: theme?.palette?.editor?.textColor
16
- },
17
- "& .MuiFormLabel-root": {
18
- color: theme?.palette?.editor?.textColor,
19
- backgroundColor: theme?.palette?.editor?.background
20
- }
9
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground
10
+
11
+ // "& .MuiInputBase-root": {
12
+ // border: `1px solid ${theme?.palette?.editor?.textColor}`,
13
+ // color: theme?.palette?.editor?.textColor,
14
+ // },
15
+ // "& .MuiSvgIcon-root": {
16
+ // color: theme?.palette?.editor?.textColor,
17
+ // },
18
+ // "& .MuiFormLabel-root": {
19
+ // color: theme?.palette?.editor?.textColor,
20
+ // backgroundColor: theme?.palette?.editor?.background,
21
+ // },
21
22
  }
22
23
  },
24
+
23
25
  childContainer: {
24
26
  padding: "20px",
25
27
  "&.emojiDrawer": {
@@ -962,6 +962,41 @@ export function DragIcon() {
962
962
  })]
963
963
  });
964
964
  }
965
+ export function ResizeIcon() {
966
+ return /*#__PURE__*/_jsxs("svg", {
967
+ width: "16",
968
+ height: "16",
969
+ viewBox: "0 0 16 16",
970
+ fill: "none",
971
+ xmlns: "http://www.w3.org/2000/svg",
972
+ children: [/*#__PURE__*/_jsx("rect", {
973
+ width: "16",
974
+ height: "16",
975
+ rx: "8",
976
+ fill: "#F8FAFC"
977
+ }), /*#__PURE__*/_jsx("rect", {
978
+ x: "0.5",
979
+ y: "0.5",
980
+ width: "15",
981
+ height: "15",
982
+ rx: "7.5",
983
+ stroke: "#2563EB",
984
+ strokeOpacity: "0.32"
985
+ }), /*#__PURE__*/_jsx("path", {
986
+ d: "M5.76758 6.44141L3.99981 8.20917L5.76758 9.97694",
987
+ stroke: "#94A3B8",
988
+ strokeWidth: "0.8",
989
+ strokeLinecap: "round",
990
+ strokeLinejoin: "round"
991
+ }), /*#__PURE__*/_jsx("path", {
992
+ d: "M10.2324 6.44141L12.0002 8.20917L10.2324 9.97694",
993
+ stroke: "#94A3B8",
994
+ strokeWidth: "0.8",
995
+ strokeLinecap: "round",
996
+ strokeLinejoin: "round"
997
+ })]
998
+ });
999
+ }
965
1000
  export function LeftAlignTextFormat() {
966
1001
  return /*#__PURE__*/_jsxs("svg", {
967
1002
  width: "19",
@@ -1323,6 +1358,27 @@ export function CheckedBoxCheckIcon() {
1323
1358
  })
1324
1359
  });
1325
1360
  }
1361
+ export function CheckedRadioIcon() {
1362
+ return /*#__PURE__*/_jsxs("svg", {
1363
+ width: "17",
1364
+ height: "17",
1365
+ viewBox: "0 0 17 17",
1366
+ fill: "none",
1367
+ xmlns: "http://www.w3.org/2000/svg",
1368
+ children: [/*#__PURE__*/_jsx("path", {
1369
+ d: "M16.5 8.42148C16.5 12.792 12.9227 16.343 8.5 16.343C4.07734 16.343 0.5 12.792 0.5 8.42148C0.5 4.05093 4.07734 0.5 8.5 0.5C12.9227 0.5 16.5 4.05093 16.5 8.42148Z",
1370
+ fill: "#DEE8FC",
1371
+ stroke: "#2563EB",
1372
+ className: "radio-icon-path"
1373
+ }), /*#__PURE__*/_jsx("ellipse", {
1374
+ cx: "8.5",
1375
+ cy: "8.42079",
1376
+ rx: "3.5",
1377
+ ry: "3.46767",
1378
+ fill: "#2563EB"
1379
+ })]
1380
+ });
1381
+ }
1326
1382
  export function SectionSettingIcon() {
1327
1383
  return /*#__PURE__*/_jsxs("svg", {
1328
1384
  width: "13",
@@ -1442,6 +1498,26 @@ export function SectionDragIcon() {
1442
1498
  })]
1443
1499
  });
1444
1500
  }
1501
+ export function ResetIcon() {
1502
+ return /*#__PURE__*/_jsxs("svg", {
1503
+ width: "24",
1504
+ height: "24",
1505
+ viewBox: "0 0 24 24",
1506
+ fill: "none",
1507
+ xmlns: "http://www.w3.org/2000/svg",
1508
+ children: [/*#__PURE__*/_jsx("circle", {
1509
+ cx: "11.646",
1510
+ cy: "11.6452",
1511
+ r: "11.5",
1512
+ transform: "rotate(-89.2717 11.646 11.6452)",
1513
+ fill: "#2563EB",
1514
+ fillOpacity: "0.16"
1515
+ }), /*#__PURE__*/_jsx("path", {
1516
+ d: "M18.2814 11.8168V11.8168C18.2813 11.8313 18.2987 11.8387 18.3091 11.8287L19.2379 10.9273C19.6367 10.5404 20.247 10.5482 20.6358 10.9451C21.0245 11.342 21.0168 11.9495 20.6181 12.3364L17.9434 14.9012C17.5478 15.2806 16.9205 15.2708 16.5369 14.8792L13.9636 12.2519C13.7692 12.0534 13.674 11.7974 13.677 11.5622C13.6802 11.3075 13.7819 11.054 13.981 10.8801C14.3797 10.4932 14.9901 10.501 15.3788 10.8979L16.2708 11.8085C16.286 11.824 16.3124 11.8135 16.3126 11.7917V11.7917C16.351 8.77391 13.9017 6.27324 10.8698 6.2347C7.83784 6.19615 5.32577 8.63374 5.28741 11.6516C5.24904 14.6694 7.69833 17.1701 10.7303 17.2086C11.2815 17.2156 11.7092 17.6522 11.7022 18.2009C11.6952 18.7496 11.2566 19.1752 10.7054 19.1682C6.5709 19.1157 3.2663 15.7418 3.31861 11.6265C3.37093 7.51133 6.76023 4.22251 10.8947 4.27507C15.0095 4.32738 18.3338 7.70154 18.2814 11.8168Z",
1517
+ fill: "#2563EB"
1518
+ })]
1519
+ });
1520
+ }
1445
1521
  export function PenIcon() {
1446
1522
  return /*#__PURE__*/_jsxs("svg", {
1447
1523
  width: "17",
@@ -260,6 +260,12 @@ const useCommonStyle = theme => ({
260
260
  "& .signature-canvas": {
261
261
  backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`
262
262
  },
263
+ "& .clear-canvas": {
264
+ position: "absolute",
265
+ top: 6,
266
+ right: 6,
267
+ color: theme?.palette?.editor?.closeButtonSvgStroke
268
+ },
263
269
  "& label": {
264
270
  color: theme?.palette?.editor?.textColor
265
271
  },
@@ -526,6 +532,12 @@ const useCommonStyle = theme => ({
526
532
  padding: "16px 8px 16px 10px!important",
527
533
  height: "100%"
528
534
  },
535
+ buttonMoreIcon: {
536
+ position: "absolute",
537
+ top: "50%",
538
+ right: -40,
539
+ transform: "translateY(-50%)"
540
+ },
529
541
  buttonMoreOption: {
530
542
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
531
543
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
@@ -23,11 +23,12 @@ function getInlineTextStyles(element) {
23
23
  }
24
24
  const handleTableCell = (el, children) => {
25
25
  const wrapChild = children?.map(c => {
26
- if (typeof c === "string") {
26
+ const cellText = typeof c === "string" ? c : typeof c === "object" && typeof c?.text === "string" ? c?.text : null;
27
+ if (cellText !== null) {
27
28
  return {
28
29
  type: "paragraph",
29
30
  children: [{
30
- text: c
31
+ text: cellText
31
32
  }],
32
33
  cellBgColor: "#FFFFFF"
33
34
  };
@@ -137,8 +138,9 @@ const ELEMENT_TAGS = {
137
138
  type: "table-row"
138
139
  }),
139
140
  TD: handleTableCell,
140
- COLGROUP: paragraphType,
141
- COL: paragraphType,
141
+ // 'colgroup' and 'col' are commented out due to issues with table data copied from Microsoft Excel
142
+ // COLGROUP: paragraphType,
143
+ // COL: paragraphType,
142
144
  HR: () => ({
143
145
  type: "divider",
144
146
  borderColor: "#CCC"
@@ -401,4 +401,8 @@ export const clearSelectionOnly = editor => {
401
401
  } catch (err) {
402
402
  console.log(err);
403
403
  }
404
+ };
405
+ export const isMobileWindow = () => {
406
+ const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
407
+ return isMobile;
404
408
  };
@@ -190,16 +190,17 @@ export const TableProvider = ({
190
190
  // selectFirstCell(tablePath, editor, updateTableSelection);
191
191
  // }, []);
192
192
 
193
+ const onClickAway = () => {
194
+ setTableSelection(getDefaultTableSelection());
195
+ setHoverPath(null);
196
+ };
193
197
  return /*#__PURE__*/_jsx(TableContext.Provider, {
194
198
  value: values,
195
199
  children: /*#__PURE__*/_jsxs(DndContext, {
196
200
  sensors: sensors,
197
201
  onDragEnd: data => handleDragEnd(data, editor, resetAll),
198
202
  children: [/*#__PURE__*/_jsx(ClickAwayListener, {
199
- onClickAway: () => {
200
- setTableSelection(getDefaultTableSelection());
201
- setHoverPath(null);
202
- },
203
+ onClickAway: onClickAway,
203
204
  children: /*#__PURE__*/_jsx("div", {
204
205
  children: children
205
206
  })
@@ -1,5 +1,6 @@
1
1
  import { Editor, Node, Path, Point, Range, Transforms } from "slate";
2
2
  import { containsSurrogatePair, getNextNode } from "../utils/helper";
3
+ import { onDeleteBackwardAccordion } from "../utils/accordion";
3
4
  const BACKWARD_BLOCKS = ["list-item", "signature"];
4
5
  const isNodeTextEmpty = node => {
5
6
  const nodeText = Node.string(node);
@@ -32,7 +33,7 @@ const withCustomDeleteBackward = editor => {
32
33
  }
33
34
  if (selection && Range.isCollapsed(selection)) {
34
35
  const [currentNode, path] = Editor.node(editor, selection);
35
- if (currentNode && typeof currentNode.text === 'string') {
36
+ if (currentNode && typeof currentNode.text === "string") {
36
37
  const text = currentNode.text;
37
38
  if (containsSurrogatePair(text)) {
38
39
  // Check if the cursor is at the end of a surrogate pair
@@ -60,6 +61,10 @@ const withCustomDeleteBackward = editor => {
60
61
  }
61
62
  }
62
63
  }
64
+ const preventDefaultAccordion = onDeleteBackwardAccordion(editor);
65
+ if (preventDefaultAccordion) {
66
+ return;
67
+ }
63
68
  }
64
69
 
65
70
  // Check if current node is a list item and is the last one, signature node