@flozy/editor 5.9.3 → 5.9.4

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 (58) hide show
  1. package/dist/Editor/CommonEditor.js +14 -16
  2. package/dist/Editor/Editor.css +16 -22
  3. package/dist/Editor/Elements/AI/PopoverAIInput.js +12 -2
  4. package/dist/Editor/Elements/Button/EditorButton.js +1 -3
  5. package/dist/Editor/Elements/DataView/DataView.js +3 -4
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +14 -8
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +1 -5
  8. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +1 -5
  9. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +19 -23
  10. package/dist/Editor/Elements/Form/Form.js +0 -1
  11. package/dist/Editor/Elements/FreeGrid/styles.js +0 -1
  12. package/dist/Editor/Elements/Grid/GridItem.js +2 -1
  13. package/dist/Editor/Elements/Link/Link.js +43 -70
  14. package/dist/Editor/Elements/List/CheckList.js +1 -2
  15. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
  16. package/dist/Editor/Elements/Search/SearchList.js +1 -8
  17. package/dist/Editor/Elements/SimpleText/index.js +1 -8
  18. package/dist/Editor/Elements/SimpleText/style.js +1 -5
  19. package/dist/Editor/Elements/Table/Table.js +3 -3
  20. package/dist/Editor/Elements/Table/TableCell.js +9 -14
  21. package/dist/Editor/Elements/Title/title.js +1 -13
  22. package/dist/Editor/Elements/Variables/Style.js +2 -28
  23. package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
  24. package/dist/Editor/MiniEditor.js +2 -4
  25. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +28 -37
  26. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +1 -3
  27. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
  28. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +1 -3
  29. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
  30. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -9
  31. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +0 -5
  32. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
  33. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
  34. package/dist/Editor/Toolbar/PopupTool/index.js +0 -2
  35. package/dist/Editor/common/FontLoader/FontLoader.js +0 -2
  36. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
  37. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  38. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  39. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  40. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  41. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  42. package/dist/Editor/common/Uploader.js +0 -8
  43. package/dist/Editor/common/iconslist.js +2 -1
  44. package/dist/Editor/commonStyle.js +57 -58
  45. package/dist/Editor/helper/index.js +2 -2
  46. package/dist/Editor/helper/theme.js +1 -24
  47. package/dist/Editor/hooks/useMouseMove.js +2 -5
  48. package/dist/Editor/plugins/withLayout.js +1 -1
  49. package/dist/Editor/utils/SlateUtilityFunctions.js +4 -10
  50. package/dist/Editor/utils/button.js +4 -4
  51. package/dist/Editor/utils/customHooks/useTableResize.js +1 -2
  52. package/dist/Editor/utils/draftToSlate.js +2 -3
  53. package/dist/Editor/utils/helper.js +19 -60
  54. package/dist/Editor/utils/pageSettings.js +2 -14
  55. package/dist/Editor/utils/table.js +0 -21
  56. package/package.json +1 -1
  57. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  58. package/dist/Editor/helper/ensureWrappedVariables.js +0 -28
@@ -26,7 +26,7 @@ import editorStyles from "./Styles/EditorStyles";
26
26
  import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
- import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
29
+ import { getTRBLBreakPoints } from "./helper/theme";
30
30
  import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
31
31
  import useWindowResize from "./hooks/useWindowResize";
32
32
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
@@ -98,8 +98,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
98
98
  const editorWrapper = useRef();
99
99
  const mentionsRef = useRef();
100
100
  const convertedContent = draftToSlate({
101
- data: content,
102
- needLayout: otherProps?.needLayout
101
+ data: content
103
102
  });
104
103
  const [value, setValue] = useState(convertedContent);
105
104
  const [isInteracted, setIsInteracted] = useState(false);
@@ -142,8 +141,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
142
141
  pageColor,
143
142
  color: pageTextColor,
144
143
  pageWidth,
145
- maxWidth: pageMaxWidth,
146
- lineHeight
144
+ maxWidth: pageMaxWidth
147
145
  } = pageSt?.pageProps || {
148
146
  bannerSpacing: {
149
147
  left: 0,
@@ -170,11 +168,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
170
168
  const debounced = useDebouncedCallback(
171
169
  // function
172
170
  value => {
173
- debouncedValue.current = value;
174
171
  const {
175
172
  value: strVal,
176
173
  ...restVal
177
174
  } = getOnSaveData(value);
175
+ debouncedValue.current = value;
178
176
  onSave(strVal, restVal);
179
177
  },
180
178
  // delay in ms
@@ -185,7 +183,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
185
183
  return {
186
184
  value: JSON.stringify(val),
187
185
  text: text,
188
- title: serializeToText(title?.children) || ""
186
+ title: serializeToText(title?.children) || "Untitled"
189
187
  };
190
188
  };
191
189
  const getPreviewImage = async (needBackground = false, options = {}) => {
@@ -334,7 +332,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
334
332
  onDrawerOpen: onDrawerOpen,
335
333
  ICON_API: "https://assets.agenciflow.com"
336
334
  };
337
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
338
335
  const renderElement = useCallback(props => {
339
336
  return /*#__PURE__*/_jsx(Element, {
340
337
  ...props,
@@ -496,7 +493,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
496
493
  ...props,
497
494
  fullScreen: fullScreen,
498
495
  footer: footer || "",
499
- children: /*#__PURE__*/_jsx(Box, {
496
+ children: /*#__PURE__*/_jsxs(Box, {
500
497
  component: "div",
501
498
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
502
499
  sx: classes.root,
@@ -506,7 +503,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
506
503
  "data-breakpoint": breakpoint
507
504
  // onContextMenu={handleContextMenu}
508
505
  ,
509
- children: /*#__PURE__*/_jsxs(Slate, {
506
+ children: [/*#__PURE__*/_jsxs(Slate, {
510
507
  editor: editor,
511
508
  initialValue: getInitialValue(debouncedValue?.current, readOnly),
512
509
  onChange: handleEditorChange,
@@ -537,7 +534,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
537
534
  padding: {
538
535
  ...getTRBLBreakPoints(bannerSpacing)
539
536
  },
540
- lineHeight: lineH,
541
537
  width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
542
538
  height: viewport.h ? `${viewport.h}px` : `100%`,
543
539
  alignSelf: "center",
@@ -599,19 +595,21 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
599
595
  setIsTextSelected: setIsTextSelected,
600
596
  customProps: customProps,
601
597
  editorWrapper: editorWrapper
602
- }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
598
+ }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
603
599
  breakpoint: breakpoint,
604
- show: showViewport,
605
600
  onChange: b => onSwitchBreakpoint(b)
606
601
  }) : null]
607
602
  })
608
603
  }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
609
604
  ...htmlAction,
610
605
  handleCodeToText: handleCodeToText
611
- }), /*#__PURE__*/_jsx(FontLoader, {
612
- ...props
613
606
  })]
614
- }, id)
607
+ }, id), /*#__PURE__*/_jsx(FontLoader, {
608
+ otherProps: {
609
+ services: otherProps?.services
610
+ },
611
+ readOnly: readOnly
612
+ })]
615
613
  })
616
614
  })
617
615
  });
@@ -995,7 +995,7 @@ blockquote {
995
995
 
996
996
  .sliderInput {
997
997
  width: 66px !important;
998
- padding: 2px 0px 2px 4px;
998
+ padding: 2px 10px;
999
999
  margin-left: 18px;
1000
1000
  box-shadow: 0px 4px 16px 0px #0000000d;
1001
1001
  border: 1px solid #6f6f6f33;
@@ -1263,19 +1263,6 @@ blockquote {
1263
1263
  pointer-events: auto;
1264
1264
  }
1265
1265
 
1266
- @media (max-width: 899px) {
1267
- .MuiPopover-root {
1268
- z-index: 1302 !important;
1269
- }
1270
- canvas {
1271
- max-width: 100% !important;
1272
- }
1273
- }
1274
-
1275
- .settingsHeader {
1276
- font-size: 14px !important;
1277
- font-weight: 500 !important;
1278
- }
1279
1266
  .hideScroll {
1280
1267
  overflow-anchor: none;
1281
1268
  }
@@ -1291,6 +1278,20 @@ blockquote {
1291
1278
  .hideScroll::-webkit-scrollbar-thumb:hover {
1292
1279
  background: none !important;
1293
1280
  }
1281
+ @media (max-width: 899px) {
1282
+ .MuiPopover-root {
1283
+ z-index: 1302 !important;
1284
+ }
1285
+
1286
+ canvas {
1287
+ max-width: 100% !important;
1288
+ }
1289
+ }
1290
+
1291
+ .settingsHeader {
1292
+ font-size: 14px !important;
1293
+ font-weight: 500 !important;
1294
+ }
1294
1295
 
1295
1296
  .custom-scroll::-webkit-scrollbar {
1296
1297
  height: .6rem;
@@ -1337,11 +1338,4 @@ code.markcode {
1337
1338
  display: block;
1338
1339
  background-color: #f3f3f3;
1339
1340
  font-family: 'Source Code Pro' !important;
1340
- }
1341
-
1342
- /* Hide the popper when the reference is hidden */
1343
- .hide-popper-on-overlap[data-popper-escaped],
1344
- .hide-popper-on-overlap[data-popper-reference-hidden] {
1345
- visibility: hidden;
1346
- pointer-events: none;
1347
- }
1341
+ }
@@ -6,7 +6,7 @@ import AIInput from "./AIInput";
6
6
  import { ReactEditor, useSlate } from "slate-react";
7
7
  import { Node, Range, Transforms } from "slate";
8
8
  import { MODES } from "./helper";
9
- import { getSelectedText, getSlateDom, viewSlateSelection } from "../../utils/helper";
9
+ import { getSelectedText, getSlateDom } from "../../utils/helper";
10
10
  import { VoiceToText } from "./VoiceToText";
11
11
  import deserialize from "../../helper/deserialize";
12
12
  import useEditorScroll from "../../hooks/useEditorScroll";
@@ -286,7 +286,17 @@ function PopoverAIInput({
286
286
  };
287
287
  useEffect(() => {
288
288
  if (openAI && getSelectedText(editor).trim()) {
289
- viewSlateSelection();
289
+ const customSelection = document.querySelectorAll(".slate-highlight");
290
+ const selectionBg = "rgba(35, 131, 226, 0.35)";
291
+ if (customSelection?.length) {
292
+ customSelection?.forEach(el => el.style.background = selectionBg);
293
+
294
+ // if ai is opened, remove the window selection class and open then slate selection, To resolve: focussing on the ai input removes window selection automatically
295
+ const selection = window.getSelection();
296
+ if (selection) {
297
+ selection.removeAllRanges(); // Clears the selection
298
+ }
299
+ }
290
300
  }
291
301
  }, [editor.selection, openAI]);
292
302
  return /*#__PURE__*/_jsxs("div", {
@@ -162,7 +162,6 @@ const EditorButton = props => {
162
162
  display: "inline-flex",
163
163
  color: "rgba(0, 0, 0, 0.54)",
164
164
  marginBottom: "0px !important",
165
- ...classes.buttonMoreOption,
166
165
  ...classes.buttonMoreOption3
167
166
  },
168
167
  ...btnProps,
@@ -265,12 +264,11 @@ const EditorButton = props => {
265
264
  ...btnSp,
266
265
  borderStyle: borderStyle || "solid",
267
266
  color: `${textColor || "#FFFFFF"}`,
268
- fontSize: textSize || "12px",
267
+ fontSize: textSize || "inherit",
269
268
  fontFamily: fontFamily || "PoppinsRegular",
270
269
  display: "inline-flex",
271
270
  alignItems: "center",
272
271
  position: "relative",
273
- lineHeight: 1.43,
274
272
  "& .element-toolbar": {
275
273
  display: "none"
276
274
  },
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { Node, Path, Transforms } from "slate";
3
- import { ReactEditor, useSlate } from "slate-react";
3
+ import { ReactEditor, useSlateStatic } from "slate-react";
4
4
  import { Box, useTheme } from "@mui/material";
5
5
  import { DataViewProvider } from "./Providers/DataViewProvider";
6
6
  import useDataViewStyles from "./styles";
@@ -15,7 +15,7 @@ const DataView = props => {
15
15
  theme: appTheme
16
16
  } = useEditorContext();
17
17
  const theme = useTheme();
18
- const editor = useSlate();
18
+ const editor = useSlateStatic();
19
19
  const {
20
20
  attributes,
21
21
  children,
@@ -113,8 +113,7 @@ const DataView = props => {
113
113
  onDuplicate: onDuplicate,
114
114
  readOnly: readOnly,
115
115
  title: title,
116
- onTitleChange: onTitleChange,
117
- path: path
116
+ onTitleChange: onTitleChange
118
117
  }), /*#__PURE__*/_jsx(LayoutView, {
119
118
  readOnly: readOnly,
120
119
  children: children
@@ -104,9 +104,9 @@ export default function Select(props) {
104
104
  return /*#__PURE__*/_jsx(Box, {
105
105
  className: "tv-ms-tag-wrpr",
106
106
  sx: {
107
- '& svg': {
108
- marginRight: '5px',
109
- '& path': {
107
+ "& svg": {
108
+ marginRight: "5px",
109
+ "& path": {
110
110
  stroke: "#000"
111
111
  }
112
112
  }
@@ -125,15 +125,21 @@ export default function Select(props) {
125
125
  sx: {
126
126
  background: option?.color || appTheme?.palette?.editor?.tv_border1,
127
127
  border: "none",
128
- '& .MuiChip-label': {
129
- paddingLeft: '12px !important'
128
+ "& .MuiChip-label": {
129
+ paddingLeft: "12px !important",
130
+ paddingRight: disabled ? "12px !important" : ""
130
131
  }
131
132
  },
132
133
  avatar: /*#__PURE__*/_jsx(AvatarIcon, {
133
134
  option: option,
134
135
  avatar: optionAvatar
135
136
  }),
136
- deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {})
137
+ deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {
138
+ style: {
139
+ cursor: "pointer",
140
+ display: disabled ? "none" : ""
141
+ }
142
+ })
137
143
  }, key) : null;
138
144
  })
139
145
  });
@@ -149,8 +155,8 @@ export default function Select(props) {
149
155
  label: option.label || option.value || "",
150
156
  sx: {
151
157
  background: option.color || appTheme?.palette?.editor?.tv_border1,
152
- '& .MuiChip-label': {
153
- paddingLeft: '12px !important'
158
+ "& .MuiChip-label": {
159
+ paddingLeft: "12px !important"
154
160
  }
155
161
  },
156
162
  avatar: /*#__PURE__*/_jsx(AvatarIcon, {
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import { TextField } from "@mui/material";
3
3
  import { useDataView } from "../../Providers/DataViewProvider";
4
- import { focusDynamicTableInput } from "../../../../utils/helper";
5
4
  import { jsx as _jsx } from "react/jsx-runtime";
6
5
  const NumberType = props => {
7
6
  const {
@@ -17,7 +16,6 @@ const NumberType = props => {
17
16
  onChange(rowIndex, {
18
17
  [property]: e?.target?.value
19
18
  });
20
- focusDynamicTableInput(e);
21
19
  };
22
20
  return /*#__PURE__*/_jsx(TextField, {
23
21
  type: "number",
@@ -26,9 +24,7 @@ const NumberType = props => {
26
24
  value: value,
27
25
  size: "small",
28
26
  onChange: handleChange,
29
- disabled: readOnly,
30
- id: `tv-number-input-${rowIndex}-${property}` // * should be unique
27
+ disabled: readOnly
31
28
  });
32
29
  };
33
-
34
30
  export default NumberType;
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import { TextField } from "@mui/material";
3
3
  import { useDataView } from "../../Providers/DataViewProvider";
4
- import { focusDynamicTableInput } from "../../../../utils/helper";
5
4
  import { jsx as _jsx } from "react/jsx-runtime";
6
5
  const TextType = props => {
7
6
  const {
@@ -17,7 +16,6 @@ const TextType = props => {
17
16
  onChange(rowIndex, {
18
17
  [property]: e?.target?.value
19
18
  });
20
- focusDynamicTableInput(e);
21
19
  };
22
20
  const formatValue = () => {
23
21
  if (typeof value === "string") {
@@ -32,9 +30,7 @@ const TextType = props => {
32
30
  value: formatValue(value),
33
31
  size: "small",
34
32
  onChange: handleChange,
35
- disabled: readOnly,
36
- id: `tv-text-input-${rowIndex}-${property}` // * should be unique
33
+ disabled: readOnly
37
34
  });
38
35
  };
39
-
40
36
  export default TextType;
@@ -5,7 +5,6 @@ import FilterSort from "./FilterSort";
5
5
  import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
6
6
  import Icon from "../../../common/Icon";
7
7
  import { useEditorContext } from "../../../hooks/useMouseMove";
8
- import { focusDynamicTableInput } from "../../../utils/helper";
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
10
  const FilterView = props => {
@@ -16,8 +15,7 @@ const FilterView = props => {
16
15
  onEnter,
17
16
  readOnly,
18
17
  title,
19
- onTitleChange,
20
- path
18
+ onTitleChange
21
19
  } = props;
22
20
  const {
23
21
  sort,
@@ -72,7 +70,6 @@ const FilterView = props => {
72
70
  };
73
71
  const handleTitleChange = e => {
74
72
  onTitleChange(e?.target?.value);
75
- focusDynamicTableInput(e);
76
73
  };
77
74
  const handleEnter = e => {
78
75
  if (e?.key === "Enter") {
@@ -99,25 +96,24 @@ const FilterView = props => {
99
96
  },
100
97
  value: title,
101
98
  onChange: handleTitleChange,
102
- onKeyUp: handleEnter,
103
- id: `tv-title-input-${path.join("|")}`
99
+ onKeyUp: handleEnter
104
100
  }) : title || "Untitled"
105
101
  }), /*#__PURE__*/_jsxs(Box, {
106
102
  className: "tv-fi-wrpr",
107
103
  sx: {
108
- alignItems: "center"
104
+ alignItems: 'center'
109
105
  },
110
106
  children: [/*#__PURE__*/_jsxs(Box, {
111
107
  className: `tv-sb mr ${toggle ? "open" : ""}`,
112
108
  sx: {
113
- minHeight: "32px"
109
+ minHeight: '32px'
114
110
  },
115
111
  children: [/*#__PURE__*/_jsx(IconButton, {
116
112
  type: "button",
117
113
  sx: {
118
- "& svg": {
119
- width: "14px",
120
- height: "14px"
114
+ '& svg': {
115
+ width: '14px',
116
+ height: '14px'
121
117
  }
122
118
  },
123
119
  "aria-label": "search",
@@ -141,12 +137,12 @@ const FilterView = props => {
141
137
  className: ` ${sort?.length > 0 ? "active" : ""}`,
142
138
  onClick: handleSortClick,
143
139
  sx: {
144
- "& svg": {
140
+ '& svg': {
145
141
  strokeWidth: 1.2
146
142
  }
147
143
  },
148
144
  children: /*#__PURE__*/_jsx(Icon, {
149
- icon: "sortBy"
145
+ icon: 'sortBy'
150
146
  })
151
147
  }), /*#__PURE__*/_jsx(FilterSort, {
152
148
  open: open,
@@ -156,7 +152,7 @@ const FilterView = props => {
156
152
  }), !readOnly ? /*#__PURE__*/_jsx(IconButton, {
157
153
  className: "mr",
158
154
  sx: {
159
- "& svg": {
155
+ '& svg': {
160
156
  fill: theme?.palette?.editor?.tv_stroke
161
157
  }
162
158
  },
@@ -166,7 +162,7 @@ const FilterView = props => {
166
162
  className: "mr",
167
163
  onClick: handleDeleteRow,
168
164
  children: /*#__PURE__*/_jsx(Icon, {
169
- icon: "trashIcon"
165
+ icon: 'trashIcon'
170
166
  })
171
167
  }) : null, !readOnly ? /*#__PURE__*/_jsxs(Menu, {
172
168
  sx: classes.basicMenu,
@@ -189,24 +185,24 @@ const FilterView = props => {
189
185
  onClick: onMenuClick("Duplicate"),
190
186
  children: [" ", /*#__PURE__*/_jsx(Box, {
191
187
  sx: {
192
- marginRight: "5px",
193
- display: " flex",
194
- alignItems: "center"
188
+ marginRight: '5px',
189
+ display: ' flex',
190
+ alignItems: 'center'
195
191
  },
196
192
  children: /*#__PURE__*/_jsx(Icon, {
197
- icon: "duplicateIcon"
193
+ icon: 'duplicateIcon'
198
194
  })
199
195
  }), "Duplicate"]
200
196
  }), /*#__PURE__*/_jsxs(MenuItem, {
201
197
  onClick: onMenuClick("Delete"),
202
198
  children: [" ", /*#__PURE__*/_jsx(Box, {
203
199
  sx: {
204
- marginRight: "5px",
205
- display: " flex",
206
- alignItems: "center"
200
+ marginRight: '5px',
201
+ display: ' flex',
202
+ alignItems: 'center'
207
203
  },
208
204
  children: /*#__PURE__*/_jsx(Icon, {
209
- icon: "trashIcon"
205
+ icon: 'trashIcon'
210
206
  })
211
207
  }), "Delete"]
212
208
  })]
@@ -402,7 +402,6 @@ const Form = props => {
402
402
  borderStyle: borderStyle || "solid",
403
403
  background: bgColor || "transparent",
404
404
  position: "relative",
405
- lineHeight: 1.43,
406
405
  ...formSX
407
406
  },
408
407
  ref: formEle,
@@ -171,7 +171,6 @@ const useFreeGridStyles = ({
171
171
  height: "100%",
172
172
  "& .signature-container": {
173
173
  height: "100%",
174
- LineHeight: 1.43,
175
174
  "& .signature-btn-container": {
176
175
  height: "100%",
177
176
  display: "flex",
@@ -50,7 +50,8 @@ const GridItemToolbar = props => {
50
50
  open: true,
51
51
  placement: "top-end",
52
52
  sx: classes.popTools,
53
- className: "gi-tool-pp hide-popper-on-overlap",
53
+ className: "gi-tool-pp",
54
+ disablePortal: true,
54
55
  contentEditable: false,
55
56
  children: /*#__PURE__*/_jsxs(Box, {
56
57
  className: "ico-grp-ss",
@@ -1,7 +1,7 @@
1
- import React, { useRef, useState } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Node, Transforms } from "slate";
3
- import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
4
- import { Box, IconButton, Popper, Tooltip } from "@mui/material";
3
+ import { ReactEditor, useFocused, useSelected, useSlateStatic } from "slate-react";
4
+ import { Box, IconButton, Tooltip } from "@mui/material";
5
5
  import OpenInNewIcon from "@mui/icons-material/OpenInNew";
6
6
  import EditIcon from "@mui/icons-material/Edit";
7
7
  import LinkOffIcon from "@mui/icons-material/LinkOff";
@@ -11,62 +11,6 @@ import { getLinkType, handleLinkType } from "../../utils/helper";
11
11
  import LinkSettings from "../../common/LinkSettings";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
- const Toolbar = props => {
15
- const {
16
- urlPath,
17
- linkType,
18
- showInNewTab,
19
- selected,
20
- linkRef,
21
- onEditLink,
22
- editor
23
- } = props;
24
- const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
25
- const navType = getLinkType(linkType, urlPath);
26
- const hideOpenLink = navType === "page" || !navType;
27
- return selected ? /*#__PURE__*/_jsx(Popper, {
28
- anchorEl: linkRef?.current,
29
- open: true,
30
- placement: "top-start",
31
- className: "hide-popper-on-overlap",
32
- contentEditable: false,
33
- style: {
34
- zIndex: 1
35
- },
36
- children: /*#__PURE__*/_jsxs(Box, {
37
- className: "element-toolbar hr",
38
- style: {
39
- width: "150px",
40
- display: "flex",
41
- position: "unset"
42
- },
43
- component: "div",
44
- children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
45
- title: "Open",
46
- children: /*#__PURE__*/_jsx(Box, {
47
- sx: {
48
- display: "inline-flex",
49
- color: "rgba(0, 0, 0, 0.54)"
50
- },
51
- ...btnProps,
52
- children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
53
- })
54
- }), /*#__PURE__*/_jsx(Tooltip, {
55
- title: "Edit",
56
- children: /*#__PURE__*/_jsx(IconButton, {
57
- onClick: onEditLink,
58
- children: /*#__PURE__*/_jsx(EditIcon, {})
59
- })
60
- }), /*#__PURE__*/_jsx(Tooltip, {
61
- title: "Remove",
62
- children: /*#__PURE__*/_jsx(IconButton, {
63
- onClick: () => removeLink(editor),
64
- children: /*#__PURE__*/_jsx(LinkOffIcon, {})
65
- })
66
- })]
67
- })
68
- }) : null;
69
- };
70
14
  const linkStyles = () => ({
71
15
  linkBtn: {
72
16
  border: "none",
@@ -96,6 +40,7 @@ const Link = props => {
96
40
  } = customProps;
97
41
  const editor = useSlateStatic();
98
42
  const selected = useSelected();
43
+ const focused = useFocused();
99
44
  const [showInput, setShowInput] = useState(false);
100
45
  const [linkData, setLinkData] = useState({
101
46
  name: "",
@@ -108,7 +53,6 @@ const Link = props => {
108
53
  const showInNewTab = element?.showInNewTab || element?.target;
109
54
  const linkType = element?.linkType;
110
55
  const classes = linkStyles();
111
- const linkRef = useRef(null);
112
56
  const updateLink = data => {
113
57
  Transforms.setNodes(editor, data, {
114
58
  at: path
@@ -133,25 +77,54 @@ const Link = props => {
133
77
  const handleClose = () => {
134
78
  setShowInput(false);
135
79
  };
80
+ const Toolbar = () => {
81
+ const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
82
+ const navType = getLinkType(linkType, urlPath);
83
+ const hideOpenLink = navType === "page" || !navType;
84
+ return selected && focused ? /*#__PURE__*/_jsxs("div", {
85
+ className: "element-toolbar hr",
86
+ contentEditable: false,
87
+ style: {
88
+ width: "150px",
89
+ top: "100%",
90
+ left: "0px",
91
+ display: "flex"
92
+ },
93
+ children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
94
+ title: "Open",
95
+ children: /*#__PURE__*/_jsx(Box, {
96
+ sx: {
97
+ display: "inline-flex",
98
+ color: "rgba(0, 0, 0, 0.54)"
99
+ },
100
+ ...btnProps,
101
+ children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
102
+ })
103
+ }), /*#__PURE__*/_jsx(Tooltip, {
104
+ title: "Edit",
105
+ children: /*#__PURE__*/_jsx(IconButton, {
106
+ onClick: onEditLink,
107
+ children: /*#__PURE__*/_jsx(EditIcon, {})
108
+ })
109
+ }), /*#__PURE__*/_jsx(Tooltip, {
110
+ title: "Remove",
111
+ children: /*#__PURE__*/_jsx(IconButton, {
112
+ onClick: () => removeLink(editor),
113
+ children: /*#__PURE__*/_jsx(LinkOffIcon, {})
114
+ })
115
+ })]
116
+ }) : null;
117
+ };
136
118
  const buttonProps = handleLinkType(urlPath, linkType, readOnly, showInNewTab === "_blank");
137
119
  return /*#__PURE__*/_jsxs("div", {
138
120
  className: "link",
139
- ref: linkRef,
140
121
  children: [/*#__PURE__*/_jsx(Box, {
141
122
  ...attributes,
142
123
  ...element.attr,
143
124
  sx: classes.linkBtn,
144
125
  ...buttonProps,
145
126
  children: children
146
- }), /*#__PURE__*/_jsx(Toolbar, {
147
- urlPath: urlPath,
148
- linkType: linkType,
149
- showInNewTab: showInNewTab,
150
- selected: selected,
151
- linkRef: linkRef,
152
- onEditLink: onEditLink,
153
- editor: editor
154
- }), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
127
+ }), /*#__PURE__*/_jsx(Toolbar, {}), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
155
128
  handleClose: handleClose,
156
129
  onSave: ({
157
130
  linkType,
@@ -39,8 +39,7 @@ const CheckList = ({
39
39
  display: "flex",
40
40
  justifyContent: "center",
41
41
  alignItems: "center",
42
- ...(style || {}),
43
- lineHeight: 1.43
42
+ ...(style || {})
44
43
  },
45
44
  children: [/*#__PURE__*/_jsxs("div", {
46
45
  contentEditable: false,
@@ -49,7 +49,6 @@ const SearchAttachment = props => {
49
49
  background: `${theme?.palette?.containers?.slashBrainCardBg} !important`,
50
50
  cursor: 'pointer',
51
51
  margin: '4px 0px',
52
- lineHeight: 1.43,
53
52
  "&.MuiPaper-root.MuiPaper-rounded": {
54
53
  borderRadius: "7px !important",
55
54
  paddingTop: '0px !important'