@flozy/editor 4.9.9 → 5.0.1

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.
@@ -298,9 +298,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
298
298
  hideTools: updatedHideTools || []
299
299
  }) : [];
300
300
  const handleEditorChange = newValue => {
301
- debounced(newValue);
302
- if (!isInteracted) {
303
- setIsInteracted(true);
301
+ if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
302
+ debounced(newValue);
303
+ if (!isInteracted) {
304
+ setIsInteracted(true);
305
+ }
304
306
  }
305
307
  };
306
308
  const onDrawerOpen = status => {
@@ -648,9 +648,12 @@ blockquote {
648
648
  height: fit-content;
649
649
  margin-left: auto;
650
650
  margin-right: auto;
651
- background: #000000b6;
652
- padding: 6px 10px 2px 10px;
653
- border-radius: 8px 8px 0 0;
651
+ padding: 4px;
652
+ border-radius: 8px;
653
+ }
654
+
655
+ .embed .element-toolbar .last-btn {
656
+ margin-right: 0px
654
657
  }
655
658
 
656
659
  .embed-code .element-toolbar {
@@ -667,6 +670,13 @@ blockquote {
667
670
  position: absolute !important;
668
671
  bottom: 2px;
669
672
  right: 2px;
673
+ border-radius: 7px !important;
674
+ padding: 2px !important;
675
+ color: #64748B !important;
676
+ }
677
+
678
+ .resize-br.img-resizer {
679
+ bottom: 8px;
670
680
  }
671
681
 
672
682
  .visible-on-hover {
@@ -814,6 +824,7 @@ blockquote {
814
824
 
815
825
  .element-toolbar button {
816
826
  margin-right: 4px;
827
+ margin-bottom: 0px;
817
828
  }
818
829
 
819
830
  .empty-carousel-wrapper .element-selector {
@@ -1075,6 +1086,10 @@ blockquote {
1075
1086
  font-size: 14px;
1076
1087
  }
1077
1088
 
1089
+ .listItemMargin {
1090
+ margin: 0px;
1091
+ }
1092
+
1078
1093
  .content-editable.empty {
1079
1094
  position: relative;
1080
1095
  }
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { Box, IconButton, Popover } from "@mui/material";
3
- import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
3
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
4
4
  import Button from "../../common/Button";
5
5
  import { colors } from "./defaultColors";
6
6
  import ColorPicker from "./colorPicker.svg";
@@ -46,7 +46,7 @@ const SingleColorButton = ({
46
46
  id: `in_${id}`,
47
47
  onClick: handleMore,
48
48
  className: "more-btn-cbs",
49
- children: /*#__PURE__*/_jsx(ArrowDropDownIcon, {})
49
+ children: /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {})
50
50
  }) : null]
51
51
  }, `ci_bs_row_${index}}`);
52
52
  };
@@ -9,7 +9,7 @@ const ColorPickerStyles = theme => ({
9
9
  width: "24px",
10
10
  height: "24px",
11
11
  marginRight: "8px",
12
- border: "1px solid #ccc"
12
+ border: "unset"
13
13
  }
14
14
  },
15
15
  colorPopper: {
@@ -58,7 +58,7 @@ const ColorPickerStyles = theme => ({
58
58
  width: "24px",
59
59
  height: "24px",
60
60
  margin: "0px 4px",
61
- border: "1px solid #ccc"
61
+ border: "unset"
62
62
  }
63
63
  },
64
64
  colorPickerIcon: {
@@ -1,4 +1,4 @@
1
- export const colors = ["#292D32", "#578CFF", "#A58CFF", "#46BBFF", "#FFC93A", "#33B24F", "#F06C83", "#64748B", "#82A9FE", "#C4B3FF", "#71CBFF", "#FFD055", "#61D57A", "#FA91A4", "#A2B0B9", "#A4C1FF", "#D7CBFF", "#9FDCFF", "#FFDC80", "#8AE59E", "#FCB0BE", "#E4ECF3", "#CDDCFF", "#E0D7FF", "#BEE7FF", "#FFE49E", "#B9F6C6", "#FDCAD3", "#FFFFFF", "#489FF8", "#FE7A00", "linear-gradient(327.62deg, #EBB9E0 13.53%, #9CEEE5 86.82%)", "linear-gradient(310.6deg, #7FA4F4 15.53%, #805EF5 83.64%)", "linear-gradient(95.19deg, #A831E7 4.17%, #F05339 88.89%)", "linear-gradient(90deg, #3F2AB7 12.5%, #0DC9B5 100%)", "#0F172A", "#2563EB", "#8360FD", "#19A9FC", "#FDB52A", "#0E8E2A", "#E1425E"
1
+ export const colors = ["#000000", "#578CFF", "#A58CFF", "#46BBFF", "#FFC93A", "#33B24F", "#F06C83", "#64748B", "#82A9FE", "#C4B3FF", "#71CBFF", "#FFD055", "#61D57A", "#FA91A4", "#A2B0B9", "#A4C1FF", "#D7CBFF", "#9FDCFF", "#FFDC80", "#8AE59E", "#FCB0BE", "#E4ECF3", "#CDDCFF", "#E0D7FF", "#BEE7FF", "#FFE49E", "#B9F6C6", "#FDCAD3", "#FFFFFF", "#489FF8", "#FE7A00", "linear-gradient(327.62deg, #EBB9E0 13.53%, #9CEEE5 86.82%)", "linear-gradient(310.6deg, #7FA4F4 15.53%, #805EF5 83.64%)", "linear-gradient(95.19deg, #A831E7 4.17%, #F05339 88.89%)", "linear-gradient(90deg, #3F2AB7 12.5%, #0DC9B5 100%)", "#0F172A", "#2563EB", "#8360FD", "#19A9FC", "#FDB52A", "#0E8E2A", "#E1425E"
2
2
  // "#E6E6E6",
3
- // "#BEBEBE"
3
+ // "#BEBEBE",
4
4
  ];
@@ -41,6 +41,7 @@ const ToolBar = ({
41
41
  title: "Link Settings",
42
42
  arrow: true,
43
43
  children: /*#__PURE__*/_jsx(IconButton, {
44
+ className: "last-btn",
44
45
  onClick: () => setOpenNav(true),
45
46
  children: /*#__PURE__*/_jsx(LinkIcon, {})
46
47
  })
@@ -299,13 +300,13 @@ const Image = props => {
299
300
  editor: editor,
300
301
  handleImageClick: handleImageClick
301
302
  })
302
- }) : null, selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
303
+ }) : null, selected && !readOnly && url && /*#__PURE__*/_jsx(IconButton, {
303
304
  onPointerDown: onMouseDown,
304
305
  style: {
305
306
  opacity: 1,
306
307
  background: "#FFF"
307
308
  },
308
- className: "resize-br visible-on-hover",
309
+ className: "resize-br visible-on-hover img-resizer",
309
310
  children: /*#__PURE__*/_jsx(AspectRatioIcon, {})
310
311
  })]
311
312
  }), /*#__PURE__*/_jsx("span", {
@@ -312,7 +312,7 @@ const Grid = props => {
312
312
  return /*#__PURE__*/_jsx(GridProvider, {
313
313
  children: /*#__PURE__*/_jsxs(GridContainer, {
314
314
  container: true,
315
- className: `grid-container ${grid} has-hover element-root dpath ${equalItems ? "equal-cols" : ""} cc-${element?.children?.length}`,
315
+ className: `grid-container ${grid} element-root dpath ${equalItems ? "equal-cols" : ""} cc-${element?.children?.length}`,
316
316
  ...attributes,
317
317
  ...sectionId,
318
318
  sx: {
@@ -125,6 +125,7 @@ const GridItem = props => {
125
125
  const [parentDOM, setParentDOM] = useState({});
126
126
  const [alert, setAlert] = useState(null);
127
127
  const childCount = getChildCount(editor, path);
128
+ const lastChild = childCount - 1 === [...path].pop();
128
129
  const [size, onMouseDown, resizing, onLoad, isDone] = useTableResize({
129
130
  ...parentDOM
130
131
  });
@@ -283,6 +284,7 @@ const GridItem = props => {
283
284
  }
284
285
  },
285
286
  "data-path": path.join(","),
287
+ "data-info": "handle-outside-editor-click",
286
288
  children: [!readOnly && /*#__PURE__*/_jsxs("div", {
287
289
  className: `element-selector ${selected ? "selected" : ""}`,
288
290
  contentEditable: false,
@@ -327,6 +329,7 @@ const GridItem = props => {
327
329
  }
328
330
  },
329
331
  placeholder: "Column",
332
+ "data-info": "handle-outside-editor-click",
330
333
  children: children
331
334
  }), openSetttings ? /*#__PURE__*/_jsx(GridItemPopup, {
332
335
  element: element,
@@ -336,7 +339,7 @@ const GridItem = props => {
336
339
  customProps: customProps
337
340
  }) : null, !readOnly ? /*#__PURE__*/_jsx(Resizer, {
338
341
  classes: classes,
339
- className: resizing ? "resizing" : "",
342
+ className: `${lastChild ? "last-resize" : ""} ${resizing ? "resizing" : ""}`,
340
343
  onMouseDown: onMouseDown,
341
344
  height: "auto"
342
345
  }) : null, /*#__PURE__*/_jsxs(Dialog, {
@@ -41,8 +41,8 @@ const GridStyles = (theme, appTheme) => ({
41
41
  display: "none !important"
42
42
  }
43
43
  },
44
- "&:last-child": {
45
- "& .col-width-resizer": {
44
+ "& .col-width-resizer": {
45
+ "&.last-resize": {
46
46
  display: "none"
47
47
  }
48
48
  },
@@ -36,7 +36,7 @@ const SearchAttachment = props => {
36
36
  display: "block"
37
37
  },
38
38
  children: /*#__PURE__*/_jsxs(Card, {
39
- style: {
39
+ sx: {
40
40
  display: "flex",
41
41
  justifyContent: "flex-start",
42
42
  alignItems: "flex-end",
@@ -48,6 +48,10 @@ const SearchAttachment = props => {
48
48
  borderRadius: "7px !important",
49
49
  background: theme?.palette?.containers?.slashBrainCardBg,
50
50
  cursor: 'pointer',
51
+ "&.MuiPaper-root.MuiPaper-rounded": {
52
+ borderRadius: "7px !important",
53
+ paddingTop: '0px !important'
54
+ },
51
55
  "& *::selection": {
52
56
  background: "#000"
53
57
  }
@@ -7,6 +7,7 @@ import SwipeableDrawerComponent from "../../common/SwipeableDrawer";
7
7
  import SearchAndDocList from "./SearchList";
8
8
  import { insertBrain } from "../../utils/brains";
9
9
  import { useDebounce } from "use-debounce";
10
+ import { Editor, Transforms } from "slate";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  import { Fragment as _Fragment } from "react/jsx-runtime";
12
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -88,6 +89,15 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
88
89
  setSkip(0);
89
90
  };
90
91
  const handleClose = () => {
92
+ const {
93
+ selection
94
+ } = editor;
95
+ if (selection) {
96
+ const [, currentPath] = Editor.node(editor, selection);
97
+ Transforms.insertText(editor, '', {
98
+ at: currentPath
99
+ });
100
+ }
91
101
  setAnchorEl(null);
92
102
  };
93
103
  const handleClick = data => {
@@ -35,12 +35,12 @@ const SearchAndDocList = ({
35
35
  },
36
36
  sx: {
37
37
  borderRadius: "6px",
38
- backgroundColor: theme?.palette?.containers?.bg7,
39
- border: theme?.palette?.type === 'dark' ? `1px solid ${theme?.palette?.editor?.popUpBorderColor}` : '',
38
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
39
+ border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
40
40
  padding: "5px",
41
41
  "&:hover": {
42
- backgroundColor: theme?.palette?.containers?.bg8,
43
- background: theme?.palette?.containers?.bg8
42
+ backgroundColor: theme?.palette?.editor?.sectionSettingIconHover,
43
+ background: theme?.palette?.editor?.sectionSettingIconHover
44
44
  }
45
45
  },
46
46
  children: /*#__PURE__*/_jsx(Icon, {
@@ -77,6 +77,7 @@ const SearchAndDocList = ({
77
77
  "& .MuiOutlinedInput-root": {
78
78
  color: theme?.palette?.primary?.main,
79
79
  boxShadow: theme?.palette?.shadows?.shadow12,
80
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
80
81
  "&:hover .MuiOutlinedInput-notchedOutline": {
81
82
  borderRadius: "8px",
82
83
  border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
@@ -85,7 +86,7 @@ const SearchAndDocList = ({
85
86
  "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
86
87
  borderRadius: "8px",
87
88
  border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
88
- borderColor: theme?.palette?.primary?.slashBrainBorder
89
+ borderColor: `${theme?.palette?.primary?.slashBrainBorder} !important`
89
90
  }
90
91
  },
91
92
  '& .MuiOutlinedInput-notchedOutline': {
@@ -113,7 +114,26 @@ const SearchAndDocList = ({
113
114
  overflowY: 'auto',
114
115
  overflowX: 'hidden',
115
116
  padding: '0px 16px 8px',
116
- marginBottom: '20px'
117
+ marginBottom: '20px',
118
+ scrollbarWidth: "thin",
119
+ scrollbarColor: `${theme?.palette?.primary?.slashBrainBorder} transparent`,
120
+ "&::-webkit-scrollbar": {
121
+ width: "3px",
122
+ height: "3px !important",
123
+ borderRadius: "10px !important"
124
+ },
125
+ "&::-webkit-scrollbar-thumb": {
126
+ backgroundColor: theme?.palette?.primary?.slashBrainBorder,
127
+ borderRadius: "10px !important",
128
+ width: "3px !important"
129
+ },
130
+ "&::-webkit-scrollbar-thumb:hover": {
131
+ backgroundColor: theme?.palette?.primary?.slashBrainBorder
132
+ },
133
+ "&::-webkit-scrollbar-track": {
134
+ background: "transparent",
135
+ borderRadius: "10px !important"
136
+ }
117
137
  },
118
138
  children: [mapData?.map((doc, index) => {
119
139
  const title = doc?.title?.trim() === "" ? 'Untitled' : doc?.title;
@@ -172,15 +172,18 @@ const Table = props => {
172
172
  table.insertColumn("after");
173
173
  Transforms.deselect(editor);
174
174
  };
175
- const handleScrollStop = useDebouncedCallback(() => {
176
- containerRef?.current?.classList.add("hideScroll");
177
- }, 200);
178
- const handleScroll = () => {
175
+ const handleRowDragBtns = () => {
179
176
  if (containerRef?.current?.scrollLeft > 0) {
180
177
  hideRowDragBtns("none", dragRowBtnCls);
181
178
  } else {
182
179
  hideRowDragBtns("", dragRowBtnCls);
183
180
  }
181
+ };
182
+ const handleScrollStop = useDebouncedCallback(() => {
183
+ containerRef?.current?.classList.add("hideScroll");
184
+ }, 200);
185
+ const handleScroll = () => {
186
+ handleRowDragBtns();
184
187
  containerRef?.current?.classList.remove("hideScroll");
185
188
  handleScrollStop();
186
189
  };
@@ -113,6 +113,7 @@ const TableCell = props => {
113
113
  const tableDOM = table.getDOMNode(path, true);
114
114
  const isCellSelected = getSelectedCells();
115
115
  const hasSelected = (isCellSelected || [])?.findIndex(f => f.join(",") === path.join(",")) > -1;
116
+ const containerEle = tableDOM?.parentNode?.parentNode;
116
117
  useEffect(() => {
117
118
  if (tableDOM) {
118
119
  const {
@@ -390,6 +391,7 @@ const TableCell = props => {
390
391
  dndProps,
391
392
  resetSelection
392
393
  };
394
+ const showRowDragBtn = (showRowDrag || isRowDragging) && containerEle?.scrollLeft <= 0;
393
395
  return /*#__PURE__*/_jsxs(_Fragment, {
394
396
  children: [/*#__PURE__*/_jsxs("td", {
395
397
  ...element.attr,
@@ -429,7 +431,7 @@ const TableCell = props => {
429
431
  dragType: "col",
430
432
  onDrag: onColDrag,
431
433
  hideDelete: rowProps?.children?.length <= 1
432
- }) : null, showRowDrag || isRowDragging ? /*#__PURE__*/_jsx(DragButton, {
434
+ }) : null, showRowDragBtn ? /*#__PURE__*/_jsx(DragButton, {
433
435
  ...commonDragBtnProps,
434
436
  dragType: "row",
435
437
  onDrag: onRowDrag,
@@ -291,9 +291,11 @@ const editorStyles = ({
291
291
  }
292
292
  },
293
293
  fullScreenWrapper: {
294
+ "& .editor-wrapper": {
295
+ paddingTop: '20px'
296
+ },
294
297
  "& .MuiPaper-root": {
295
298
  borderRadius: "0px !important",
296
- paddingTop: "20px",
297
299
  "& .MuiDialogTitle-root": {
298
300
  position: "absolute",
299
301
  top: 0,
@@ -1,10 +1,11 @@
1
1
  import React, { useState } from "react";
2
- import { Grid, Typography, IconButton, Tooltip, TextField } from "@mui/material";
2
+ import { Grid, Typography, IconButton, Tooltip, TextField, InputAdornment } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import OpenInFullIcon from "@mui/icons-material/OpenInFull";
5
5
  import CloseFullscreenIcon from "@mui/icons-material/CloseFullscreen";
6
6
  import Icon from "../../common/Icon";
7
7
  import { ToggleFullScreenIcon } from "../../common/iconListV2";
8
+ import { SearchIcon } from "../../common/iconslist";
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
11
  const SearchBox = props => {
@@ -17,7 +18,13 @@ const SearchBox = props => {
17
18
  sx: classes.searchBox,
18
19
  size: "small",
19
20
  value: search,
20
- onChange: handleChange
21
+ onChange: handleChange,
22
+ InputProps: {
23
+ startAdornment: /*#__PURE__*/_jsx(InputAdornment, {
24
+ position: "start",
25
+ children: /*#__PURE__*/_jsx(SearchIcon, {})
26
+ })
27
+ }
21
28
  });
22
29
  };
23
30
  const PopperHeader = props => {
@@ -63,6 +70,7 @@ const PopperHeader = props => {
63
70
  sx: {
64
71
  position: 'relative'
65
72
  },
73
+ className: "inputField",
66
74
  children: [/*#__PURE__*/_jsx(IconButton, {
67
75
  className: openSearch ? 'searchContainer' : '',
68
76
  onClick: handleSearchButton,
@@ -24,6 +24,37 @@ const usePopupStyle = theme => ({
24
24
  "& .MuiDialog-paperFullScreen": {
25
25
  borderRadius: "0px !important"
26
26
  },
27
+ "& .inputField": {
28
+ height: "29px",
29
+ "& .MuiIconButton-root": {
30
+ padding: "5px"
31
+ },
32
+ "& .MuiOutlinedInput-root ": {
33
+ background: `${theme?.palette?.editor?.inputFieldBgColor}`,
34
+ borderRadius: "8px",
35
+ border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
36
+ },
37
+ "& .MuiFormControl-root": {
38
+ background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
39
+ borderRadius: "8px",
40
+ height: "29px"
41
+ },
42
+ "& .MuiOutlinedInput-notchedOutline": {
43
+ borderRadius: "8px",
44
+ border: `1px solid transparent`
45
+ },
46
+ "& .MuiOutlinedInput-input": {
47
+ padding: "3px 35px 4px 2px !important"
48
+ },
49
+ "& .MuiInputBase-adornedStart": {
50
+ padding: "0px 0px 0px 9px"
51
+ },
52
+ "& svg": {
53
+ "& path": {
54
+ stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
55
+ }
56
+ }
57
+ },
27
58
  "&.textSettings": {
28
59
  "@media only screen and (max-width: 600px)": {
29
60
  margin: "4px !important",
@@ -56,6 +87,11 @@ const usePopupStyle = theme => ({
56
87
  "& .buttonsWrpr": {
57
88
  "& button": {
58
89
  color: theme?.palette?.editor?.textColor
90
+ },
91
+ "& .more-btn-cbs": {
92
+ color: `${theme?.palette?.editor?.closeButtonSvgStroke}`,
93
+ border: `1.5px solid ${theme?.palette?.editor?.closeButtonSvgStroke}`,
94
+ paddingTop: "10px"
59
95
  }
60
96
  },
61
97
  "@media only screen and (max-width: 599px)": {
@@ -596,7 +632,7 @@ const usePopupStyle = theme => ({
596
632
  borderRadius: "7px !important",
597
633
  "& .buttonsWrpr": {
598
634
  "& button": {
599
- border: "1px solid #ccc",
635
+ // border: "1px solid #ccc",
600
636
  margin: "4px",
601
637
  width: "24px",
602
638
  height: "24px",
@@ -652,14 +688,16 @@ const usePopupStyle = theme => ({
652
688
  padding: "7px 15px",
653
689
  color: "#FFF",
654
690
  width: "100px",
655
- marginBottom: "10px"
691
+ marginBottom: "10px",
692
+ textTransform: "capitalize"
656
693
  },
657
694
  "& .outlineBtn": {
658
695
  border: "1px solid #D7DBEC",
659
696
  borderRadius: "7px",
660
697
  padding: "7px 15px",
661
698
  color: "#FFF",
662
- width: "100px"
699
+ width: "100px",
700
+ textTransform: "capitalize"
663
701
  }
664
702
  },
665
703
  searchBox: {
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { Button, ButtonGroup, Divider, Grid, Typography } from "@mui/material";
3
- import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
3
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
4
4
  import { Dropdown, MarkButton, TextSize, BlockButton, AccordionButton } from "../FormatTools";
5
5
  import { toolbarGroups } from "../toolbarGroups";
6
6
  import ColorPicker from "../../Elements/Color Picker/ColorPicker";
@@ -438,8 +438,8 @@ const TextFormat = props => {
438
438
  className: "vl"
439
439
  }), /*#__PURE__*/_jsx(Button, {
440
440
  onClick: handleColorPicker("bgColor"),
441
- className: "colorPicker",
442
- children: /*#__PURE__*/_jsx(ArrowDropDownIcon, {})
441
+ className: "colorPicker textFormatMUIIcon",
442
+ children: /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {})
443
443
  })]
444
444
  }), /*#__PURE__*/_jsxs(ButtonGroup, {
445
445
  sx: classes.btnGroup2,
@@ -460,8 +460,8 @@ const TextFormat = props => {
460
460
  className: "vl"
461
461
  }), /*#__PURE__*/_jsx(Button, {
462
462
  onClick: handleColorPicker("color"),
463
- className: "colorPicker",
464
- children: /*#__PURE__*/_jsx(ArrowDropDownIcon, {})
463
+ className: "colorPicker textFormatMUIIcon",
464
+ children: /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {})
465
465
  })]
466
466
  })]
467
467
  }), /*#__PURE__*/_jsx(AllColors, {
@@ -104,7 +104,7 @@ const Section = props => {
104
104
  });
105
105
  };
106
106
  const isFreeGrid = element?.children?.find(f => f.type === "freegrid");
107
- const needHover = element?.children?.find(f => f.type === "grid" && !list_types.includes(element.type)) ? "needHover" : "";
107
+ const needHover = element?.children?.find(f => f.type === "grid" && !list_types.includes(element.type)) ? "" : "";
108
108
  let tempProps = {};
109
109
  if (element?.type === "temp") {
110
110
  tempProps = {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Grid, Radio, RadioGroup, FormControl, FormLabel, FormControlLabel, Typography } from "@mui/material";
2
+ import { Grid, Radio, RadioGroup, FormControl, FormLabel, FormControlLabel, Typography, Tooltip } from "@mui/material";
3
3
  import { JustifyStartIcon, JustifyCenterIcon, JustifyEndIcon, AlignEndIcon, AlignCenterIcon, AlignStartIcon, DirectionRowIcon, DirectionColumIcon, DirectionReverseIcon } from "../../iconslist";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -44,7 +44,7 @@ const Alignment = props => {
44
44
  },
45
45
  children: [/*#__PURE__*/_jsxs(RadioGroup, {
46
46
  row: true,
47
- "aria-labelledby": "pos-align-tems",
47
+ "aria-labelledby": "pos-jc",
48
48
  name: "horizantal",
49
49
  value: value?.horizantal || "start",
50
50
  onChange: handleChange,
@@ -52,22 +52,31 @@ const Alignment = props => {
52
52
  style: {
53
53
  display: "flex"
54
54
  },
55
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
56
- value: "start",
57
- control: /*#__PURE__*/_jsx(Radio, {}),
58
- label: /*#__PURE__*/_jsx(AlignStartIcon, {})
59
- }), /*#__PURE__*/_jsx(FormControlLabel, {
60
- value: "center",
61
- control: /*#__PURE__*/_jsx(Radio, {}),
62
- label: /*#__PURE__*/_jsx(AlignCenterIcon, {})
63
- }), /*#__PURE__*/_jsx(FormControlLabel, {
64
- value: "end",
65
- control: /*#__PURE__*/_jsx(Radio, {}),
66
- label: /*#__PURE__*/_jsx(AlignEndIcon, {})
55
+ children: [/*#__PURE__*/_jsx(Tooltip, {
56
+ title: "Align Left",
57
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
58
+ value: "start",
59
+ control: /*#__PURE__*/_jsx(Radio, {}),
60
+ label: /*#__PURE__*/_jsx(JustifyStartIcon, {})
61
+ })
62
+ }), /*#__PURE__*/_jsx(Tooltip, {
63
+ title: "Align Center",
64
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
65
+ value: "center",
66
+ control: /*#__PURE__*/_jsx(Radio, {}),
67
+ label: /*#__PURE__*/_jsx(JustifyCenterIcon, {})
68
+ })
69
+ }), /*#__PURE__*/_jsx(Tooltip, {
70
+ title: "Align Right",
71
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
72
+ value: "end",
73
+ control: /*#__PURE__*/_jsx(Radio, {}),
74
+ label: /*#__PURE__*/_jsx(JustifyEndIcon, {})
75
+ })
67
76
  })]
68
77
  }), /*#__PURE__*/_jsxs(RadioGroup, {
69
78
  row: true,
70
- "aria-labelledby": "pos-jc",
79
+ "aria-labelledby": "pos-align-tems",
71
80
  name: "vertical",
72
81
  value: value?.vertical || "start",
73
82
  onChange: handleChange,
@@ -75,18 +84,27 @@ const Alignment = props => {
75
84
  style: {
76
85
  display: "flex"
77
86
  },
78
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
79
- value: "start",
80
- control: /*#__PURE__*/_jsx(Radio, {}),
81
- label: /*#__PURE__*/_jsx(JustifyStartIcon, {})
82
- }), /*#__PURE__*/_jsx(FormControlLabel, {
83
- value: "center",
84
- control: /*#__PURE__*/_jsx(Radio, {}),
85
- label: /*#__PURE__*/_jsx(JustifyCenterIcon, {})
86
- }), /*#__PURE__*/_jsx(FormControlLabel, {
87
- value: "end",
88
- control: /*#__PURE__*/_jsx(Radio, {}),
89
- label: /*#__PURE__*/_jsx(JustifyEndIcon, {})
87
+ children: [/*#__PURE__*/_jsx(Tooltip, {
88
+ title: "Align Top",
89
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
90
+ value: "start",
91
+ control: /*#__PURE__*/_jsx(Radio, {}),
92
+ label: /*#__PURE__*/_jsx(AlignStartIcon, {})
93
+ })
94
+ }), /*#__PURE__*/_jsx(Tooltip, {
95
+ title: "Align Middle",
96
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
97
+ value: "center",
98
+ control: /*#__PURE__*/_jsx(Radio, {}),
99
+ label: /*#__PURE__*/_jsx(AlignCenterIcon, {})
100
+ })
101
+ }), /*#__PURE__*/_jsx(Tooltip, {
102
+ title: "Align Bottom",
103
+ children: /*#__PURE__*/_jsx(FormControlLabel, {
104
+ value: "end",
105
+ control: /*#__PURE__*/_jsx(Radio, {}),
106
+ label: /*#__PURE__*/_jsx(AlignEndIcon, {})
107
+ })
90
108
  })]
91
109
  })]
92
110
  })]
@@ -253,7 +253,7 @@ const StyleBuilder = props => {
253
253
  style: {
254
254
  zIndex: "1300"
255
255
  },
256
- sx: classes.bottomBarDrawer,
256
+ sx: classes.sideBarDrawer,
257
257
  children: renderDrawerMenu()
258
258
  }) : /*#__PURE__*/_jsx(Drawer, {
259
259
  open: true,
@@ -162,7 +162,8 @@ const useCommonStyle = theme => ({
162
162
  background: `${theme?.palette?.editor?.closeButtonBgColor} !important`
163
163
  },
164
164
  "& .deleteBtn": {
165
- background: "transparent"
165
+ background: "transparent",
166
+ margin: '0px !important'
166
167
  },
167
168
  "& .MuiGrid-container": {
168
169
  "& .workFlowButton": {
@@ -170,7 +171,9 @@ const useCommonStyle = theme => ({
170
171
  textTransform: "unset !important",
171
172
  color: `${theme?.palette?.editor?.textColor} !important`,
172
173
  fontSize: "14px !important",
173
- fontWeight: "500 !important"
174
+ fontWeight: "500 !important",
175
+ borderRadius: "25px",
176
+ padding: "5px 15px"
174
177
  }
175
178
  },
176
179
  "& .MuiDialogActions-root": {
@@ -1,9 +1,11 @@
1
1
  import { Transforms, Path, Node } from "slate";
2
2
  const AvoidCopying = ["headingOne", "headingTwo", "headingThree", "blockquote"];
3
+ const BlockTypes = ["grid"];
3
4
  const withEmbeds = editor => {
4
5
  const {
5
6
  isVoid,
6
- insertBreak
7
+ insertBreak,
8
+ insertNodes
7
9
  } = editor;
8
10
  editor.isVoid = element => {
9
11
  if (["video", "htmlCode"].includes(element.type)) {
@@ -14,6 +16,30 @@ const withEmbeds = editor => {
14
16
  return isVoid(element);
15
17
  }
16
18
  };
19
+ editor.insertNodes = (...args) => {
20
+ try {
21
+ const parentPath = Path.parent(editor.selection.focus.path);
22
+ const parentNode = Node.get(editor, parentPath);
23
+ const previousPath = Path.previous(parentPath);
24
+ const previousNode = Node.get(editor, previousPath);
25
+ if (BlockTypes.includes(previousNode?.children[0]?.type) && parentNode?.type?.indexOf("heading") >= 0) {
26
+ console.log("grid is in previous", parentPath, previousPath, [...args]);
27
+ insertNodes(...[{
28
+ type: "paragraph",
29
+ children: [{
30
+ text: ""
31
+ }]
32
+ }, {
33
+ at: parentPath
34
+ }]);
35
+ } else {
36
+ insertNodes(...args);
37
+ }
38
+ } catch (err) {
39
+ console.log(err);
40
+ insertNodes(...args);
41
+ }
42
+ };
17
43
  editor.insertBreak = (...args) => {
18
44
  const parentPath = Path.parent(editor.selection.focus.path);
19
45
  const parentNode = Node.get(editor, parentPath);
@@ -369,12 +369,14 @@ export const getBlock = props => {
369
369
  });
370
370
  case "orderedList":
371
371
  return /*#__PURE__*/_jsx("ol", {
372
+ className: "listItemMargin",
372
373
  type: "1",
373
374
  ...attributes,
374
375
  children: children
375
376
  });
376
377
  case "unorderedList":
377
378
  return /*#__PURE__*/_jsx("ul", {
379
+ className: "listItemMargin",
378
380
  ...attributes,
379
381
  children: children
380
382
  });
@@ -110,10 +110,31 @@ export const isEmptyNode = (editor, children, path) => {
110
110
  }
111
111
  };
112
112
  export const outsideEditorClickLabel = "handle-outside-editor-click";
113
+ const insertNewLineOnColumn = (editor, pathStr) => {
114
+ try {
115
+ const path = pathStr.split(",").map(m => parseInt(m));
116
+ const colNode = Node.get(editor, path);
117
+ if (colNode?.type === "grid-item") {
118
+ const newPath = [...path, colNode?.children.length];
119
+ Transforms.insertNodes(editor, [{
120
+ type: "paragraph",
121
+ children: [{
122
+ text: ""
123
+ }]
124
+ }], {
125
+ at: newPath,
126
+ select: true
127
+ });
128
+ }
129
+ } catch (err) {
130
+ console.log(err);
131
+ }
132
+ };
113
133
  export const handleInsertLastElement = (event, editor) => {
114
134
  if (event.target.dataset.info !== outsideEditorClickLabel) {
115
135
  return;
116
136
  }
137
+ const hasPath = event.target.dataset.path;
117
138
  const lastElement = editor.children[editor.children?.length - 1];
118
139
  const isFreeGrid = lastElement?.type === "freegrid" || lastElement?.children[0]?.type === "freegrid";
119
140
  if (isFreeGrid) {
@@ -122,6 +143,10 @@ export const handleInsertLastElement = (event, editor) => {
122
143
  const isLastElementEmpty = lastElement.type === "paragraph" && !lastElement.children[0]?.text && !lastElement.children?.some(c => c.type === "grid");
123
144
  if (!ReactEditor.isFocused(editor)) {
124
145
  if (isLastElementEmpty) {
146
+ if (hasPath) {
147
+ insertNewLineOnColumn(editor, hasPath);
148
+ return;
149
+ }
125
150
  // just focus on the last empty element
126
151
  const path = [editor.children.length - 1, 0];
127
152
  const move = {
@@ -136,6 +161,11 @@ export const handleInsertLastElement = (event, editor) => {
136
161
  Transforms.move(editor, move);
137
162
  Transforms.select(editor, move);
138
163
  } else {
164
+ // if dataset has path insert new line on the path (for columns / grid)
165
+ if (hasPath) {
166
+ insertNewLineOnColumn(editor, hasPath);
167
+ return;
168
+ }
139
169
  // insert an new empty element and focus
140
170
  Transforms.insertNodes(editor, [{
141
171
  type: "paragraph",
@@ -148,6 +178,8 @@ export const handleInsertLastElement = (event, editor) => {
148
178
  });
149
179
  }
150
180
  ReactEditor.focus(editor);
181
+ } else if (hasPath) {
182
+ insertNewLineOnColumn(editor, hasPath);
151
183
  }
152
184
  };
153
185
  export const isListItem = editor => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.9.9",
3
+ "version": "5.0.1",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"