@flozy/editor 5.8.5 → 5.8.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 (61) hide show
  1. package/dist/Editor/CommonEditor.js +11 -6
  2. package/dist/Editor/Editor.css +30 -15
  3. package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -12
  4. package/dist/Editor/Elements/Button/EditorButton.js +3 -1
  5. package/dist/Editor/Elements/DataView/DataView.js +4 -3
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +5 -1
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +5 -1
  8. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +23 -19
  9. package/dist/Editor/Elements/Form/Form.js +1 -0
  10. package/dist/Editor/Elements/FreeGrid/styles.js +1 -0
  11. package/dist/Editor/Elements/Grid/GridItem.js +1 -2
  12. package/dist/Editor/Elements/Link/Link.js +42 -31
  13. package/dist/Editor/Elements/List/CheckList.js +2 -1
  14. package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
  15. package/dist/Editor/Elements/Search/SearchList.js +8 -1
  16. package/dist/Editor/Elements/SimpleText/index.js +8 -1
  17. package/dist/Editor/Elements/SimpleText/style.js +5 -1
  18. package/dist/Editor/Elements/Table/Table.js +3 -3
  19. package/dist/Editor/Elements/Table/TableCell.js +14 -9
  20. package/dist/Editor/Elements/Title/title.js +13 -1
  21. package/dist/Editor/Elements/Variables/Style.js +28 -2
  22. package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
  23. package/dist/Editor/MiniEditor.js +4 -2
  24. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +37 -28
  25. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +3 -1
  26. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
  27. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +3 -1
  28. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
  29. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +9 -3
  30. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +5 -0
  31. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
  32. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +45 -0
  33. package/dist/Editor/Toolbar/PopupTool/index.js +2 -0
  34. package/dist/Editor/common/FontLoader/FontList.js +3 -11
  35. package/dist/Editor/common/FontLoader/FontLoader.js +37 -11
  36. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
  37. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
  38. package/dist/Editor/common/Section/index.js +39 -29
  39. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  40. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  41. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  42. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
  43. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
  44. package/dist/Editor/common/Uploader.js +8 -0
  45. package/dist/Editor/commonStyle.js +58 -57
  46. package/dist/Editor/helper/deserialize/index.js +18 -5
  47. package/dist/Editor/helper/ensureWrappedVariables.js +28 -0
  48. package/dist/Editor/helper/index.js +2 -2
  49. package/dist/Editor/helper/markdown.js +45 -0
  50. package/dist/Editor/helper/theme.js +24 -1
  51. package/dist/Editor/hooks/useMouseMove.js +5 -2
  52. package/dist/Editor/plugins/withHTML.js +8 -1
  53. package/dist/Editor/plugins/withLayout.js +1 -1
  54. package/dist/Editor/utils/SlateUtilityFunctions.js +41 -4
  55. package/dist/Editor/utils/button.js +4 -4
  56. package/dist/Editor/utils/customHooks/useTableResize.js +2 -1
  57. package/dist/Editor/utils/draftToSlate.js +3 -2
  58. package/dist/Editor/utils/helper.js +60 -19
  59. package/dist/Editor/utils/pageSettings.js +14 -2
  60. package/dist/Editor/utils/table.js +21 -0
  61. package/package.json +3 -2
@@ -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 { getTRBLBreakPoints } from "./helper/theme";
29
+ import { getBreakpointLineSpacing, 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";
@@ -96,7 +96,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
96
96
  const editorWrapper = useRef();
97
97
  const mentionsRef = useRef();
98
98
  const convertedContent = draftToSlate({
99
- data: content
99
+ data: content,
100
+ needLayout: otherProps?.needLayout
100
101
  });
101
102
  const [value, setValue] = useState(convertedContent);
102
103
  const [isInteracted, setIsInteracted] = useState(false);
@@ -139,7 +140,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
139
140
  pageColor,
140
141
  color: pageTextColor,
141
142
  pageWidth,
142
- maxWidth: pageMaxWidth
143
+ maxWidth: pageMaxWidth,
144
+ lineHeight
143
145
  } = pageSt?.pageProps || {
144
146
  bannerSpacing: {
145
147
  left: 0,
@@ -166,11 +168,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
166
168
  const debounced = useDebouncedCallback(
167
169
  // function
168
170
  value => {
171
+ debouncedValue.current = value;
169
172
  const {
170
173
  value: strVal,
171
174
  ...restVal
172
175
  } = getOnSaveData(value);
173
- debouncedValue.current = value;
174
176
  onSave(strVal, restVal);
175
177
  },
176
178
  // delay in ms
@@ -181,7 +183,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
181
183
  return {
182
184
  value: JSON.stringify(val),
183
185
  text: text,
184
- title: serializeToText(title?.children) || "Untitled"
186
+ title: serializeToText(title?.children) || ""
185
187
  };
186
188
  };
187
189
  const getPreviewImage = async (needBackground = false, options = {}) => {
@@ -330,6 +332,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
330
332
  onDrawerOpen: onDrawerOpen,
331
333
  ICON_API: "https://assets.agenciflow.com"
332
334
  };
335
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
333
336
  const renderElement = useCallback(props => {
334
337
  return /*#__PURE__*/_jsx(Element, {
335
338
  ...props,
@@ -532,6 +535,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
532
535
  padding: {
533
536
  ...getTRBLBreakPoints(bannerSpacing)
534
537
  },
538
+ lineHeight: lineH,
535
539
  width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
536
540
  height: viewport.h ? `${viewport.h}px` : `100%`,
537
541
  alignSelf: "center",
@@ -593,8 +597,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
593
597
  setIsTextSelected: setIsTextSelected,
594
598
  customProps: customProps,
595
599
  editorWrapper: editorWrapper
596
- }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
600
+ }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
597
601
  breakpoint: breakpoint,
602
+ show: showViewport,
598
603
  onChange: b => onSwitchBreakpoint(b)
599
604
  }) : null]
600
605
  })
@@ -995,7 +995,7 @@ blockquote {
995
995
 
996
996
  .sliderInput {
997
997
  width: 66px !important;
998
- padding: 2px 10px;
998
+ padding: 2px 0px 2px 4px;
999
999
  margin-left: 18px;
1000
1000
  box-shadow: 0px 4px 16px 0px #0000000d;
1001
1001
  border: 1px solid #6f6f6f33;
@@ -1263,6 +1263,19 @@ 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
+ }
1266
1279
  .hideScroll {
1267
1280
  overflow-anchor: none;
1268
1281
  }
@@ -1278,20 +1291,6 @@ blockquote {
1278
1291
  .hideScroll::-webkit-scrollbar-thumb:hover {
1279
1292
  background: none !important;
1280
1293
  }
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
- }
1295
1294
 
1296
1295
  .custom-scroll::-webkit-scrollbar {
1297
1296
  height: .6rem;
@@ -1330,3 +1329,19 @@ blockquote {
1330
1329
  background: linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important;
1331
1330
  text-transform: math-auto !important;
1332
1331
  }
1332
+
1333
+ code.markcode {
1334
+ border-radius: 4px;
1335
+ padding: 6px 8px;
1336
+ margin: 8px 0px;
1337
+ display: block;
1338
+ background-color: #f3f3f3;
1339
+ 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
+ }
@@ -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 } from "../../utils/helper";
9
+ import { getSelectedText, getSlateDom, viewSlateSelection } from "../../utils/helper";
10
10
  import { VoiceToText } from "./VoiceToText";
11
11
  import deserialize from "../../helper/deserialize";
12
12
  import useEditorScroll from "../../hooks/useEditorScroll";
@@ -286,17 +286,7 @@ function PopoverAIInput({
286
286
  };
287
287
  useEffect(() => {
288
288
  if (openAI && getSelectedText(editor).trim()) {
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
- }
289
+ viewSlateSelection();
300
290
  }
301
291
  }, [editor.selection, openAI]);
302
292
  return /*#__PURE__*/_jsxs("div", {
@@ -162,6 +162,7 @@ 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,
165
166
  ...classes.buttonMoreOption3
166
167
  },
167
168
  ...btnProps,
@@ -264,11 +265,12 @@ const EditorButton = props => {
264
265
  ...btnSp,
265
266
  borderStyle: borderStyle || "solid",
266
267
  color: `${textColor || "#FFFFFF"}`,
267
- fontSize: textSize || "inherit",
268
+ fontSize: textSize || "12px",
268
269
  fontFamily: fontFamily || "PoppinsRegular",
269
270
  display: "inline-flex",
270
271
  alignItems: "center",
271
272
  position: "relative",
273
+ lineHeight: 1.43,
272
274
  "& .element-toolbar": {
273
275
  display: "none"
274
276
  },
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { Node, Path, Transforms } from "slate";
3
- import { ReactEditor, useSlateStatic } from "slate-react";
3
+ import { ReactEditor, useSlate } 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 = useSlateStatic();
18
+ const editor = useSlate();
19
19
  const {
20
20
  attributes,
21
21
  children,
@@ -113,7 +113,8 @@ const DataView = props => {
113
113
  onDuplicate: onDuplicate,
114
114
  readOnly: readOnly,
115
115
  title: title,
116
- onTitleChange: onTitleChange
116
+ onTitleChange: onTitleChange,
117
+ path: path
117
118
  }), /*#__PURE__*/_jsx(LayoutView, {
118
119
  readOnly: readOnly,
119
120
  children: children
@@ -1,6 +1,7 @@
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";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const NumberType = props => {
6
7
  const {
@@ -16,6 +17,7 @@ const NumberType = props => {
16
17
  onChange(rowIndex, {
17
18
  [property]: e?.target?.value
18
19
  });
20
+ focusDynamicTableInput(e);
19
21
  };
20
22
  return /*#__PURE__*/_jsx(TextField, {
21
23
  type: "number",
@@ -24,7 +26,9 @@ const NumberType = props => {
24
26
  value: value,
25
27
  size: "small",
26
28
  onChange: handleChange,
27
- disabled: readOnly
29
+ disabled: readOnly,
30
+ id: `tv-number-input-${rowIndex}-${property}` // * should be unique
28
31
  });
29
32
  };
33
+
30
34
  export default NumberType;
@@ -1,6 +1,7 @@
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";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const TextType = props => {
6
7
  const {
@@ -16,6 +17,7 @@ const TextType = props => {
16
17
  onChange(rowIndex, {
17
18
  [property]: e?.target?.value
18
19
  });
20
+ focusDynamicTableInput(e);
19
21
  };
20
22
  const formatValue = () => {
21
23
  if (typeof value === "string") {
@@ -30,7 +32,9 @@ const TextType = props => {
30
32
  value: formatValue(value),
31
33
  size: "small",
32
34
  onChange: handleChange,
33
- disabled: readOnly
35
+ disabled: readOnly,
36
+ id: `tv-text-input-${rowIndex}-${property}` // * should be unique
34
37
  });
35
38
  };
39
+
36
40
  export default TextType;
@@ -5,6 +5,7 @@ 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";
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
11
  const FilterView = props => {
@@ -15,7 +16,8 @@ const FilterView = props => {
15
16
  onEnter,
16
17
  readOnly,
17
18
  title,
18
- onTitleChange
19
+ onTitleChange,
20
+ path
19
21
  } = props;
20
22
  const {
21
23
  sort,
@@ -70,6 +72,7 @@ const FilterView = props => {
70
72
  };
71
73
  const handleTitleChange = e => {
72
74
  onTitleChange(e?.target?.value);
75
+ focusDynamicTableInput(e);
73
76
  };
74
77
  const handleEnter = e => {
75
78
  if (e?.key === "Enter") {
@@ -96,24 +99,25 @@ const FilterView = props => {
96
99
  },
97
100
  value: title,
98
101
  onChange: handleTitleChange,
99
- onKeyUp: handleEnter
102
+ onKeyUp: handleEnter,
103
+ id: `tv-title-input-${path.join("|")}`
100
104
  }) : title || "Untitled"
101
105
  }), /*#__PURE__*/_jsxs(Box, {
102
106
  className: "tv-fi-wrpr",
103
107
  sx: {
104
- alignItems: 'center'
108
+ alignItems: "center"
105
109
  },
106
110
  children: [/*#__PURE__*/_jsxs(Box, {
107
111
  className: `tv-sb mr ${toggle ? "open" : ""}`,
108
112
  sx: {
109
- minHeight: '32px'
113
+ minHeight: "32px"
110
114
  },
111
115
  children: [/*#__PURE__*/_jsx(IconButton, {
112
116
  type: "button",
113
117
  sx: {
114
- '& svg': {
115
- width: '14px',
116
- height: '14px'
118
+ "& svg": {
119
+ width: "14px",
120
+ height: "14px"
117
121
  }
118
122
  },
119
123
  "aria-label": "search",
@@ -137,12 +141,12 @@ const FilterView = props => {
137
141
  className: ` ${sort?.length > 0 ? "active" : ""}`,
138
142
  onClick: handleSortClick,
139
143
  sx: {
140
- '& svg': {
144
+ "& svg": {
141
145
  strokeWidth: 1.2
142
146
  }
143
147
  },
144
148
  children: /*#__PURE__*/_jsx(Icon, {
145
- icon: 'sortBy'
149
+ icon: "sortBy"
146
150
  })
147
151
  }), /*#__PURE__*/_jsx(FilterSort, {
148
152
  open: open,
@@ -152,7 +156,7 @@ const FilterView = props => {
152
156
  }), !readOnly ? /*#__PURE__*/_jsx(IconButton, {
153
157
  className: "mr",
154
158
  sx: {
155
- '& svg': {
159
+ "& svg": {
156
160
  fill: theme?.palette?.editor?.tv_stroke
157
161
  }
158
162
  },
@@ -162,7 +166,7 @@ const FilterView = props => {
162
166
  className: "mr",
163
167
  onClick: handleDeleteRow,
164
168
  children: /*#__PURE__*/_jsx(Icon, {
165
- icon: 'trashIcon'
169
+ icon: "trashIcon"
166
170
  })
167
171
  }) : null, !readOnly ? /*#__PURE__*/_jsxs(Menu, {
168
172
  sx: classes.basicMenu,
@@ -185,24 +189,24 @@ const FilterView = props => {
185
189
  onClick: onMenuClick("Duplicate"),
186
190
  children: [" ", /*#__PURE__*/_jsx(Box, {
187
191
  sx: {
188
- marginRight: '5px',
189
- display: ' flex',
190
- alignItems: 'center'
192
+ marginRight: "5px",
193
+ display: " flex",
194
+ alignItems: "center"
191
195
  },
192
196
  children: /*#__PURE__*/_jsx(Icon, {
193
- icon: 'duplicateIcon'
197
+ icon: "duplicateIcon"
194
198
  })
195
199
  }), "Duplicate"]
196
200
  }), /*#__PURE__*/_jsxs(MenuItem, {
197
201
  onClick: onMenuClick("Delete"),
198
202
  children: [" ", /*#__PURE__*/_jsx(Box, {
199
203
  sx: {
200
- marginRight: '5px',
201
- display: ' flex',
202
- alignItems: 'center'
204
+ marginRight: "5px",
205
+ display: " flex",
206
+ alignItems: "center"
203
207
  },
204
208
  children: /*#__PURE__*/_jsx(Icon, {
205
- icon: 'trashIcon'
209
+ icon: "trashIcon"
206
210
  })
207
211
  }), "Delete"]
208
212
  })]
@@ -402,6 +402,7 @@ const Form = props => {
402
402
  borderStyle: borderStyle || "solid",
403
403
  background: bgColor || "transparent",
404
404
  position: "relative",
405
+ lineHeight: 1.43,
405
406
  ...formSX
406
407
  },
407
408
  ref: formEle,
@@ -171,6 +171,7 @@ const useFreeGridStyles = ({
171
171
  height: "100%",
172
172
  "& .signature-container": {
173
173
  height: "100%",
174
+ LineHeight: 1.43,
174
175
  "& .signature-btn-container": {
175
176
  height: "100%",
176
177
  display: "flex",
@@ -50,8 +50,7 @@ const GridItemToolbar = props => {
50
50
  open: true,
51
51
  placement: "top-end",
52
52
  sx: classes.popTools,
53
- className: "gi-tool-pp",
54
- disablePortal: true,
53
+ className: "gi-tool-pp hide-popper-on-overlap",
55
54
  contentEditable: false,
56
55
  children: /*#__PURE__*/_jsxs(Box, {
57
56
  className: "ico-grp-ss",
@@ -1,7 +1,7 @@
1
- import React, { useState } from "react";
1
+ import React, { useRef, useState } from "react";
2
2
  import { Node, Transforms } from "slate";
3
3
  import { ReactEditor, useFocused, useSelected, useSlateStatic } from "slate-react";
4
- import { Box, IconButton, Tooltip } from "@mui/material";
4
+ import { Box, IconButton, Popper, 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";
@@ -53,6 +53,7 @@ const Link = props => {
53
53
  const showInNewTab = element?.showInNewTab || element?.target;
54
54
  const linkType = element?.linkType;
55
55
  const classes = linkStyles();
56
+ const linkRef = useRef(null);
56
57
  const updateLink = data => {
57
58
  Transforms.setNodes(editor, data, {
58
59
  at: path
@@ -81,43 +82,53 @@ const Link = props => {
81
82
  const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
82
83
  const navType = getLinkType(linkType, urlPath);
83
84
  const hideOpenLink = navType === "page" || !navType;
84
- return selected && focused ? /*#__PURE__*/_jsxs("div", {
85
- className: "element-toolbar hr",
85
+ return selected && focused ? /*#__PURE__*/_jsx(Popper, {
86
+ anchorEl: linkRef?.current,
87
+ open: true,
88
+ placement: "top-start",
89
+ className: "hide-popper-on-overlap",
86
90
  contentEditable: false,
87
91
  style: {
88
- width: "150px",
89
- top: "100%",
90
- left: "0px",
91
- display: "flex"
92
+ zIndex: 1
92
93
  },
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
- })]
94
+ children: /*#__PURE__*/_jsxs(Box, {
95
+ className: "element-toolbar hr",
96
+ style: {
97
+ width: "150px",
98
+ display: "flex",
99
+ position: "unset"
100
+ },
101
+ component: "div",
102
+ children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
103
+ title: "Open",
104
+ children: /*#__PURE__*/_jsx(Box, {
105
+ sx: {
106
+ display: "inline-flex",
107
+ color: "rgba(0, 0, 0, 0.54)"
108
+ },
109
+ ...btnProps,
110
+ children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
111
+ })
112
+ }), /*#__PURE__*/_jsx(Tooltip, {
113
+ title: "Edit",
114
+ children: /*#__PURE__*/_jsx(IconButton, {
115
+ onClick: onEditLink,
116
+ children: /*#__PURE__*/_jsx(EditIcon, {})
117
+ })
118
+ }), /*#__PURE__*/_jsx(Tooltip, {
119
+ title: "Remove",
120
+ children: /*#__PURE__*/_jsx(IconButton, {
121
+ onClick: () => removeLink(editor),
122
+ children: /*#__PURE__*/_jsx(LinkOffIcon, {})
123
+ })
124
+ })]
125
+ })
116
126
  }) : null;
117
127
  };
118
128
  const buttonProps = handleLinkType(urlPath, linkType, readOnly, showInNewTab === "_blank");
119
129
  return /*#__PURE__*/_jsxs("div", {
120
130
  className: "link",
131
+ ref: linkRef,
121
132
  children: [/*#__PURE__*/_jsx(Box, {
122
133
  ...attributes,
123
134
  ...element.attr,
@@ -39,7 +39,8 @@ const CheckList = ({
39
39
  display: "flex",
40
40
  justifyContent: "center",
41
41
  alignItems: "center",
42
- ...(style || {})
42
+ ...(style || {}),
43
+ lineHeight: 1.43
43
44
  },
44
45
  children: [/*#__PURE__*/_jsxs("div", {
45
46
  contentEditable: false,
@@ -49,6 +49,7 @@ const SearchAttachment = props => {
49
49
  background: `${theme?.palette?.containers?.slashBrainCardBg} !important`,
50
50
  cursor: 'pointer',
51
51
  margin: '4px 0px',
52
+ lineHeight: 1.43,
52
53
  "&.MuiPaper-root.MuiPaper-rounded": {
53
54
  borderRadius: "7px !important",
54
55
  paddingTop: '0px !important'
@@ -185,6 +185,9 @@ const SearchAndDocList = ({
185
185
  gap: 1,
186
186
  children: [/*#__PURE__*/_jsx(Grid, {
187
187
  item: true,
188
+ sx: {
189
+ maxWidth: 'calc(100% - 45px)'
190
+ },
188
191
  children: /*#__PURE__*/_jsxs(Grid, {
189
192
  container: true,
190
193
  alignItems: "center",
@@ -207,6 +210,9 @@ const SearchAndDocList = ({
207
210
  })
208
211
  }), /*#__PURE__*/_jsx(Grid, {
209
212
  item: true,
213
+ sx: {
214
+ maxWidth: '100%'
215
+ },
210
216
  children: /*#__PURE__*/_jsx(Typography, {
211
217
  sx: {
212
218
  fontSize: "12px",
@@ -219,7 +225,8 @@ const SearchAndDocList = ({
219
225
  maxWidth: '230px',
220
226
  textAlign: 'left',
221
227
  '@media only screen and (min-width: 350px) and (max-width: 899px)': {
222
- maxWidth: '100%'
228
+ maxWidth: '100%',
229
+ width: '100%'
223
230
  }
224
231
  },
225
232
  children: title
@@ -5,6 +5,7 @@ import { getPageSettings } from "../../utils/pageSettings";
5
5
  import { isTextSelected } from "../../utils/helper";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import SimpleTextStyle from "./style";
8
+ import { getBreakpointLineSpacing } from "../../helper/theme";
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  import { Fragment as _Fragment } from "react/jsx-runtime";
10
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -33,8 +34,14 @@ const SimpleText = props => {
33
34
  const {
34
35
  pageColor
35
36
  } = pageSt?.pageProps || {};
37
+ const {
38
+ activeBreakPoint
39
+ } = useEditorContext();
40
+ const lineHeight = element?.children[0]?.lineHeight;
41
+ const lineH = getBreakpointLineSpacing(lineHeight, activeBreakPoint);
36
42
  const classes = SimpleTextStyle({
37
- pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF"
43
+ pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF",
44
+ lineHeight: lineH
38
45
  });
39
46
  const selected = useSelected();
40
47
  const path = ReactEditor.findPath(editor, element);
@@ -1,10 +1,12 @@
1
1
  import { invertColor } from "../../helper";
2
2
  const SimpleTextStyle = ({
3
- pageColor
3
+ pageColor,
4
+ lineHeight
4
5
  }) => ({
5
6
  root: {
6
7
  position: "relative",
7
8
  padding: "0px",
9
+ lineHeight: lineHeight,
8
10
  "&.dataView": {
9
11
  "& .placeholder-simple-text": {
10
12
  opacity: 0
@@ -33,6 +35,8 @@ const SimpleTextStyle = ({
33
35
  height: "24px",
34
36
  overflow: "hidden",
35
37
  fontSize: "14px",
38
+ display: "inline-flex",
39
+ alignItems: "center",
36
40
  "& .bg-pad-sl": {
37
41
  padding: "2px 4px 2px 4px",
38
42
  background: "transparent",
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from "react";
2
2
  import { Editor, Transforms } from "slate";
3
3
  import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
4
4
  import { Box, IconButton, Tooltip, Table as TableComp, TableBody, useTheme, Popper, ClickAwayListener } from "@mui/material";
5
- import { TableUtil } from "../../utils/table";
5
+ import { TableUtil, getTableColumns, getTableRows } from "../../utils/table";
6
6
  import TablePopup from "./TablePopup";
7
7
  import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
8
8
  import TableStyles from "./Styles";
@@ -206,7 +206,7 @@ const Table = props => {
206
206
  }
207
207
  }, theme);
208
208
  const addRow = () => {
209
- const lastRow = element?.rows - 1;
209
+ const lastRow = getTableRows(element) - 1;
210
210
  const firstCol = 0;
211
211
  const lastRowPath = [...path, lastRow, firstCol];
212
212
  const position = Editor.start(editor, lastRowPath);
@@ -221,7 +221,7 @@ const Table = props => {
221
221
  Transforms.deselect(editor);
222
222
  };
223
223
  const addCol = () => {
224
- const lastCol = element?.columns - 1;
224
+ const lastCol = getTableColumns(element) - 1;
225
225
  const firstRow = 0;
226
226
  const lastColumnPath = [...path, firstRow, lastCol];
227
227
  const position = Editor.start(editor, lastColumnPath);