@flozy/editor 1.5.5 → 1.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -124,20 +124,25 @@ blockquote {
124
124
  z-index: 1000;
125
125
  }
126
126
 
127
+ .element-toolbar button:first-child {
128
+ margin-right: 2px;
129
+ }
130
+
127
131
  .grid-container-toolbar button,
128
132
  .grid-item-toolbar button,
129
133
  .element-toolbar button {
130
- background-color: #fff;
131
- border: 1px solid rgb(37, 99, 235, 0.23);
134
+ border-radius: 10px;
135
+ border: 1px solid rgba(37, 99, 235, 0.32);
136
+ background: #FFF;
137
+ box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.16);
138
+
139
+ /* background-color: #2684ff; */
140
+ /* color: #FFFFFF; */
132
141
  font-size: 12px;
133
- border-radius: 0px;
134
- margin-bottom: 0px;
135
- width: 24px;
136
- height: 24px;
137
- padding: 16px;
138
- margin-bottom: 4px;
139
- color: #64748B;
140
- border-radius: 50%;
142
+ margin-bottom: 2px;
143
+ width: 36px;
144
+ height: 36px;
145
+ padding: 6px;
141
146
  }
142
147
  .grid-container-toolbar button:hover,
143
148
  .grid-item-toolbar button:hover,
@@ -7,6 +7,7 @@ import SettingsIcon from "@mui/icons-material/Settings";
7
7
  import AccordionBtnPopup from "./AccordionBtnPopup";
8
8
  import { IconButton, Tooltip } from "@mui/material";
9
9
  import DeleteIcon from "@mui/icons-material/Delete";
10
+ import { GridSettingsIcon } from "../../common/iconslist";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  const Accordion = props => {
@@ -48,7 +49,7 @@ const Accordion = props => {
48
49
  children: /*#__PURE__*/_jsx(IconButton, {
49
50
  size: "small",
50
51
  onClick: onSettings,
51
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
52
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
52
53
  })
53
54
  }), /*#__PURE__*/_jsx(Tooltip, {
54
55
  title: "Delete",
@@ -4,6 +4,7 @@ import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
4
4
  import AccordionTitlePopup from "./AccordionTitlePopup";
5
5
  import { IconButton, Tooltip } from "@mui/material";
6
6
  import SettingsIcon from "@mui/icons-material/Settings";
7
+ import { GridSettingsIcon } from "../../common/iconslist";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const AccordionSummary = props => {
@@ -37,7 +38,7 @@ const AccordionSummary = props => {
37
38
  arrow: true,
38
39
  children: /*#__PURE__*/_jsx(IconButton, {
39
40
  onClick: onSettings,
40
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
41
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
41
42
  })
42
43
  })
43
44
  }) : null;
@@ -15,10 +15,10 @@ import MenuIcon from "@mui/icons-material/Menu";
15
15
  import Toolbar from "@mui/material/Toolbar";
16
16
  import Typography from "@mui/material/Typography";
17
17
  import Button from "@mui/material/Button";
18
- import SettingsIcon from "@mui/icons-material/Settings";
19
18
  import DeleteIcon from "@mui/icons-material/Delete";
20
19
  import AppHeaderPopup from "./AppHeaderPopup";
21
20
  import { Tooltip } from "@mui/material";
21
+ import { GridSettingsIcon } from "../../common/iconslist";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const drawerWidth = 240;
@@ -81,10 +81,7 @@ function AppHeader(props) {
81
81
  children: /*#__PURE__*/_jsx(IconButton, {
82
82
  size: "small",
83
83
  onClick: onSettings,
84
- style: {
85
- marginRight: "4px"
86
- },
87
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
84
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
88
85
  })
89
86
  }), /*#__PURE__*/_jsx(Tooltip, {
90
87
  title: "Delete App Header",
@@ -17,7 +17,8 @@ const ColorPicker = ({
17
17
  format,
18
18
  editor,
19
19
  showHex,
20
- title
20
+ title,
21
+ rounded
21
22
  }) => {
22
23
  const [selection, setSelection] = useState();
23
24
  const colorPickerRef = useRef(null);
@@ -44,14 +45,23 @@ const ColorPicker = ({
44
45
  style: {
45
46
  display: "flex",
46
47
  alignItems: "center",
47
- position: "relative"
48
+ position: "relative",
49
+ padding: rounded ? "6px" : "0px"
48
50
  },
49
- children: [showHex ? /*#__PURE__*/_jsx("div", {
51
+ children: [rounded ? /*#__PURE__*/_jsx(Button, {
50
52
  style: {
51
- display: "flex"
53
+ color: activeColor,
54
+ opacity: "1",
55
+ width: "24px",
56
+ height: "24px",
57
+ backgroundColor: activeColor,
58
+ border: "1px solid #ccc",
59
+ marginRight: "12px"
52
60
  },
53
- children: activeColor
54
- }) : null, /*#__PURE__*/_jsx(Button, {
61
+ className: showOptions ? "clicked" : "",
62
+ onClick: toggleOption,
63
+ title: title
64
+ }) : /*#__PURE__*/_jsx(Button, {
55
65
  style: {
56
66
  color: activeColor,
57
67
  opacity: "1"
@@ -60,7 +70,12 @@ const ColorPicker = ({
60
70
  onClick: toggleOption,
61
71
  title: title,
62
72
  children: logo[format](activeColor)
63
- }), showOptions && /*#__PURE__*/_jsx("div", {
73
+ }), showHex ? /*#__PURE__*/_jsx("div", {
74
+ style: {
75
+ display: "flex"
76
+ },
77
+ children: activeColor
78
+ }) : null, showOptions && /*#__PURE__*/_jsx("div", {
64
79
  style: {
65
80
  position: "fixed",
66
81
  top: 0,
@@ -80,4 +95,7 @@ const ColorPicker = ({
80
95
  })]
81
96
  });
82
97
  };
98
+ ColorPicker.defaultProps = {
99
+ rounded: false
100
+ };
83
101
  export default ColorPicker;
@@ -128,7 +128,7 @@ const Embed = ({
128
128
  },
129
129
  children: /*#__PURE__*/_jsxs(Grid, {
130
130
  container: true,
131
- children: [/*#__PURE__*/_jsx(Uploader, {
131
+ children: [format === "image" ? /*#__PURE__*/_jsx(Uploader, {
132
132
  value: formData,
133
133
  data: {
134
134
  key: "url"
@@ -136,7 +136,7 @@ const Embed = ({
136
136
  customProps: customProps,
137
137
  onUploaded: onUploaded,
138
138
  disableUpload: format === "video"
139
- }), /*#__PURE__*/_jsx(Grid, {
139
+ }) : null, /*#__PURE__*/_jsx(Grid, {
140
140
  item: true,
141
141
  xs: 12,
142
142
  style: {
@@ -144,7 +144,7 @@ const Embed = ({
144
144
  },
145
145
  children: /*#__PURE__*/_jsx(TextField, {
146
146
  name: "url",
147
- placeholder: "Add image url here",
147
+ placeholder: `Add ${format} url here`,
148
148
  size: "small",
149
149
  fullWidth: true,
150
150
  onChange: handleChange,
@@ -9,7 +9,8 @@ const EmbedPopup = props => {
9
9
  onSave,
10
10
  onClose,
11
11
  customProps,
12
- format
12
+ format,
13
+ onDelete
13
14
  } = props;
14
15
  return /*#__PURE__*/_jsx(StyleBuilder, {
15
16
  title: format === "image" ? "Image" : "Video",
@@ -18,7 +19,8 @@ const EmbedPopup = props => {
18
19
  onSave: onSave,
19
20
  onClose: onClose,
20
21
  renderTabs: format === "image" ? embedImageStyle : embedVideoStyle,
21
- customProps: customProps
22
+ customProps: customProps,
23
+ onDelete: onDelete
22
24
  });
23
25
  };
24
26
  export default EmbedPopup;
@@ -3,10 +3,9 @@ import { useSlateStatic, useSelected, ReactEditor } from "slate-react";
3
3
  import { Node, Transforms, Editor } from "slate";
4
4
  import AspectRatioIcon from "@mui/icons-material/AspectRatio";
5
5
  import useResize from "../../utils/customHooks/useResize";
6
- import { insertImageText } from "../../utils/imageText";
7
6
  import EmbedPopup from "./EmbedPopup";
8
7
  import { IconButton, Tooltip } from "@mui/material";
9
- import SettingsIcon from "@mui/icons-material/Settings";
8
+ import { GridSettingsIcon } from "../../common/iconslist";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
11
  const Image = ({
@@ -97,10 +96,11 @@ const Image = ({
97
96
  const onClose = () => {
98
97
  setOpenSettings(false);
99
98
  };
100
-
101
- // const onDelete = () => {
102
- // Transforms.removeNodes(editor, { at: path });
103
- // };
99
+ const onDelete = () => {
100
+ Transforms.removeNodes(editor, {
101
+ at: path
102
+ });
103
+ };
104
104
 
105
105
  // const onAddText = () => {
106
106
  // Transforms.wrapNodes(editor, {
@@ -119,7 +119,7 @@ const Image = ({
119
119
  arrow: true,
120
120
  children: /*#__PURE__*/_jsx(IconButton, {
121
121
  onClick: onSettings,
122
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
122
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
123
123
  })
124
124
  })
125
125
  }) : null;
@@ -147,7 +147,8 @@ const Image = ({
147
147
  onSave: onSave,
148
148
  onClose: onClose,
149
149
  customProps: customProps,
150
- format: "image"
150
+ format: "image",
151
+ onDelete: onDelete
151
152
  }) : null, /*#__PURE__*/_jsxs("div", {
152
153
  contentEditable: false,
153
154
  style: {
@@ -6,8 +6,8 @@ import Icon from "../../common/Icon";
6
6
  import useResize from "../../utils/customHooks/useResize";
7
7
  import { IconButton, Tooltip } from "@mui/material";
8
8
  import DeleteIcon from "@mui/icons-material/Delete";
9
- import SettingsIcon from "@mui/icons-material/Settings";
10
9
  import EmbedPopup from "./EmbedPopup";
10
+ import { GridSettingsIcon } from "../../common/iconslist";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const Video = ({
@@ -58,7 +58,7 @@ const Video = ({
58
58
  arrow: true,
59
59
  children: /*#__PURE__*/_jsx(IconButton, {
60
60
  onClick: onSettings,
61
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
61
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
62
62
  })
63
63
  }), /*#__PURE__*/_jsx(Tooltip, {
64
64
  title: "Delete Video",
@@ -108,7 +108,8 @@ const Video = ({
108
108
  onSave: onSave,
109
109
  onClose: onClose,
110
110
  customProps: customProps,
111
- format: "video"
111
+ format: "video",
112
+ onDelete: onDelete
112
113
  }) : null, /*#__PURE__*/_jsxs("div", {
113
114
  contentEditable: false,
114
115
  style: {
@@ -4,14 +4,11 @@ import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
4
4
  import { gridItem } from "../../utils/gridItem";
5
5
  import GridPopup from "./GridPopup";
6
6
  import { IconButton, Tooltip } from "@mui/material";
7
- import SettingsIcon from "@mui/icons-material/Settings";
8
- import AddIcon from "@mui/icons-material/Add";
9
- import NoteAddIcon from "@mui/icons-material/NoteAdd";
10
7
  import CompressIcon from "@mui/icons-material/Compress";
11
8
  import { insertGrid } from "../../utils/grid";
12
9
  import useDragAndDrop from "../../common/useDragAndDrop";
13
10
  import useResize from "../../utils/customHooks/useResize";
14
- // import { AddGridItemIcon } from "../../common/iconslist";
11
+ import { GridAddGridIcon, GridAddSectionIcon, GridSettingsIcon } from "../../common/iconslist";
15
12
  import { jsx as _jsx } from "react/jsx-runtime";
16
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
14
  const Grid = props => {
@@ -61,6 +58,7 @@ const Grid = props => {
61
58
  } = elSize || {};
62
59
  const editor = useSlateStatic();
63
60
  const selected = useSelected();
61
+ // const [selected, setSelected] = useState(false);
64
62
  const path = ReactEditor.findPath(editor, element);
65
63
  const [parentDOM, setParentDOM] = useState(null);
66
64
 
@@ -188,6 +186,17 @@ const Grid = props => {
188
186
  onDragEnd,
189
187
  onDrop
190
188
  });
189
+
190
+ // const onMouseOver = (e) => {
191
+ // e.stopPropagation();
192
+ // setSelected(true);
193
+ // };
194
+
195
+ // const onMouseLeave = (e) => {
196
+ // e.stopPropagation();
197
+ // setSelected(false);
198
+ // };
199
+
191
200
  const GridToolBar = () => {
192
201
  return selected ? /*#__PURE__*/_jsxs("div", {
193
202
  className: "grid-container-toolbar",
@@ -197,21 +206,21 @@ const Grid = props => {
197
206
  arrow: true,
198
207
  children: /*#__PURE__*/_jsx(IconButton, {
199
208
  onClick: onSettings,
200
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
209
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
201
210
  })
202
211
  }), /*#__PURE__*/_jsx(Tooltip, {
203
212
  title: "Add Grid Item",
204
213
  arrow: true,
205
214
  children: /*#__PURE__*/_jsx(IconButton, {
206
215
  onClick: onAddGridItem,
207
- children: /*#__PURE__*/_jsx(AddIcon, {})
216
+ children: /*#__PURE__*/_jsx(GridAddGridIcon, {})
208
217
  })
209
218
  }), /*#__PURE__*/_jsx(Tooltip, {
210
219
  title: "Add Section",
211
220
  arrow: true,
212
221
  children: /*#__PURE__*/_jsx(IconButton, {
213
222
  onClick: onAddSection(null, true),
214
- children: /*#__PURE__*/_jsx(NoteAddIcon, {})
223
+ children: /*#__PURE__*/_jsx(GridAddSectionIcon, {})
215
224
  })
216
225
  })]
217
226
  }) : null;
@@ -234,7 +243,10 @@ const Grid = props => {
234
243
  borderWidth: borderWidth || "1px",
235
244
  borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
236
245
  borderStyle: borderStyle || "solid"
237
- },
246
+ }
247
+ // onMouseOver={onMouseOver}
248
+ // onMouseLeave={onMouseLeave}
249
+ ,
238
250
  children: [fgColor && /*#__PURE__*/_jsx("div", {
239
251
  style: {
240
252
  position: "absolute",
@@ -3,7 +3,7 @@ import { Transforms } from "slate";
3
3
  import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
4
4
  import GridItemPopup from "./GridItemPopup";
5
5
  import { IconButton, Tooltip, Box } from "@mui/material";
6
- import SettingsIcon from "@mui/icons-material/Settings";
6
+ import { GridSettingsIcon } from "../../common/iconslist";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  const GridItem = props => {
@@ -50,7 +50,8 @@ const GridItem = props => {
50
50
  bottomRight
51
51
  } = borderRadius || {};
52
52
  const editor = useSlateStatic();
53
- const selected = useSelected();
53
+ // const selected = useSelected();
54
+ const [selected, setSelected] = useState(false);
54
55
  const itemWidth = (grid || 6) / 12 * 100;
55
56
  const path = ReactEditor.findPath(editor, element);
56
57
  const GridItemToolbar = () => {
@@ -66,7 +67,7 @@ const GridItem = props => {
66
67
  children: /*#__PURE__*/_jsx(IconButton, {
67
68
  size: "small",
68
69
  onClick: onSettings,
69
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
70
+ children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
70
71
  })
71
72
  })
72
73
  }) : null;
@@ -97,6 +98,18 @@ const GridItem = props => {
97
98
  });
98
99
  }
99
100
  };
101
+ const onMouseOver = e => {
102
+ if (!readOnly) {
103
+ e.stopPropagation();
104
+ setSelected(true);
105
+ }
106
+ };
107
+ const onMouseLeave = e => {
108
+ if (!readOnly) {
109
+ e.stopPropagation();
110
+ setSelected(false);
111
+ }
112
+ };
100
113
  return /*#__PURE__*/_jsxs(Box, {
101
114
  component: "div",
102
115
  className: `grid-item xs-${grid} element-root gi-top-wrpr`,
@@ -116,6 +129,8 @@ const GridItem = props => {
116
129
  background: `${bgColorHover || bgColor || "transparent"}`
117
130
  }
118
131
  },
132
+ onMouseOver: onMouseOver,
133
+ onMouseLeave: onMouseLeave,
119
134
  children: [!readOnly && /*#__PURE__*/_jsxs("div", {
120
135
  className: `element-selector ${selected ? "selected" : ""}`,
121
136
  contentEditable: false,
@@ -8,7 +8,7 @@ const usePopupStyle = () => ({
8
8
  width: "350px",
9
9
  maxheight: "300px",
10
10
  overflow: "auto",
11
- marginBottom: "12px",
11
+ // marginBottom: "12px",
12
12
  "& .textSettingHeader": {
13
13
  borderBottom: "1px solid #DCE4EC",
14
14
  padding: "8px 0px 5px",
@@ -1,18 +1,16 @@
1
1
  import React from "react";
2
- import { Grid, IconButton, Typography } from "@mui/material";
2
+ import { Grid, Typography } from "@mui/material";
3
3
  import toolbarGroups from "../toolbarGroups";
4
4
  import { Dropdown, MarkButton, TextSize, BlockButton } from "../FormatTools";
5
5
  import ColorPicker from "../../Elements/Color Picker/ColorPicker";
6
6
  import { activeMark } from "../../utils/SlateUtilityFunctions";
7
- import CloseIcon from "@mui/icons-material/Close";
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const allTools = toolbarGroups.flat();
11
10
  const TextFormat = props => {
12
11
  const {
13
12
  classes,
14
- editor,
15
- onClose
13
+ editor
16
14
  } = props;
17
15
  const fontFamily = allTools.find(f => f.format === "fontFamily");
18
16
  const fontStyle = allTools.filter(f => f.type === "mark");
@@ -21,31 +19,6 @@ const TextFormat = props => {
21
19
  container: true,
22
20
  sx: classes.textFormatWrapper,
23
21
  children: [/*#__PURE__*/_jsxs(Grid, {
24
- item: true,
25
- xs: 12,
26
- style: {
27
- display: "flex"
28
- },
29
- justifyContent: "space-between",
30
- alignItems: "center",
31
- className: "textSettingHeader",
32
- children: [/*#__PURE__*/_jsx(Typography, {
33
- color: "primary",
34
- sx: {
35
- fontSize: "16px",
36
- fontWeight: "700"
37
- },
38
- children: "TEXT SETTINGS"
39
- }), /*#__PURE__*/_jsx(Grid, {
40
- sx: classes.textFormatLabel,
41
- justifyContent: "end",
42
- children: /*#__PURE__*/_jsx(IconButton, {
43
- className: "close-popupbtn",
44
- onClick: onClose,
45
- children: /*#__PURE__*/_jsx(CloseIcon, {})
46
- })
47
- })]
48
- }), /*#__PURE__*/_jsxs(Grid, {
49
22
  item: true,
50
23
  xs: 12,
51
24
  children: [/*#__PURE__*/_jsx(Typography, {
@@ -158,7 +131,8 @@ const TextFormat = props => {
158
131
  format: "color",
159
132
  activeMark: activeMark,
160
133
  editor: editor,
161
- showHex: true
134
+ showHex: true,
135
+ rounded: true
162
136
  })
163
137
  })]
164
138
  }), /*#__PURE__*/_jsxs(Grid, {
@@ -182,7 +156,8 @@ const TextFormat = props => {
182
156
  format: "bgColor",
183
157
  activeMark: activeMark,
184
158
  editor: editor,
185
- showHex: true
159
+ showHex: true,
160
+ rounded: true
186
161
  })
187
162
  })]
188
163
  })]
@@ -1,13 +1,16 @@
1
- import React, { useEffect, useState } from "react";
2
- // import { Popper, Fade, Paper, IconButton, Drawer } from "@mui/material";
3
- import { Drawer } from "@mui/material";
4
- // import CloseIcon from "@mui/icons-material/Close";
1
+ import React, { useEffect, useMemo, useState } from "react";
2
+ import { Popper, Fade, Paper, IconButton,
3
+ // Drawer,
4
+ Grid, Typography } from "@mui/material";
5
+ // import { Drawer, Popper } from "@mui/material";
6
+ import CloseIcon from "@mui/icons-material/Close";
5
7
  import { Editor, Range } from "slate";
6
8
  import { useSlate, useFocused } from "slate-react";
7
9
  import TextFormat from "./TextFormat";
8
10
  import usePopupStyle from "./PopupToolStyle";
9
11
  import useDrag from "../../hooks/useDrag";
10
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
14
  const PopupTool = props => {
12
15
  const classes = usePopupStyle();
13
16
  const [anchorEl, setAnchorEl] = useState(null);
@@ -17,51 +20,107 @@ const PopupTool = props => {
17
20
  selection
18
21
  } = editor;
19
22
  const open = Boolean(anchorEl);
20
- // const id = open ? "popup-edit-tool" : "";
23
+ const id = open ? "popup-edit-tool" : "";
21
24
  const [event] = useDrag();
22
25
  useEffect(() => {
23
26
  if (!selection || !inFocus || Range.isCollapsed(selection) || Editor.string(editor, selection) === "") {
24
- // setAnchorEl(null);
27
+ setAnchorEl(null);
25
28
  } else {
26
29
  const domSelection = window.getSelection();
27
30
  const domRange = domSelection.getRangeAt(0);
28
- const rect = domRange.getBoundingClientRect();
29
- if (event === "end") {
30
- setAnchorEl({
31
- clientWidth: rect.width,
32
- clientHeight: rect.height,
33
- getBoundingClientRect: () => rect
34
- });
31
+ const {
32
+ startOffset,
33
+ endOffset
34
+ } = domRange || {};
35
+ if (startOffset !== endOffset) {
36
+ const rect = domRange.getBoundingClientRect();
37
+ if (event === "end" && !open && anchorEl === null) {
38
+ setAnchorEl({
39
+ clientWidth: rect.width,
40
+ clientHeight: rect.height,
41
+ getBoundingClientRect: () => rect
42
+ });
43
+ }
35
44
  }
36
45
  }
37
46
  }, [selection, event]);
38
47
  const handleClose = () => {
39
48
  setAnchorEl(null);
40
49
  };
41
- return /*#__PURE__*/_jsx(Drawer
42
- // id={id}
43
- , {
44
- open: open,
45
- fullWidth: true
46
- // disablePortal={false}
47
- // anchorEl={anchorEl}
48
- // transition
49
- // placement="bottom-start"
50
- // onMouseDown={(e) => e.preventDefault()}
51
- // sx={classes.popupWrapper}
52
- ,
53
- anchor: "right",
54
- hideBackdrop: true
55
- // handleClose={handleClose}
56
- ,
57
- className: "tools-drawer"
58
- // variant="persistent"
59
- ,
60
- children: /*#__PURE__*/_jsx(TextFormat, {
50
+ const toolTextFormat = useMemo(() => {
51
+ return /*#__PURE__*/_jsx(TextFormat, {
61
52
  editor: editor,
62
- classes: classes,
63
- onClose: handleClose
53
+ classes: classes
54
+ });
55
+ }, [open]);
56
+ return /*#__PURE__*/_jsx(Popper, {
57
+ id: id,
58
+ open: open,
59
+ disablePortal: false,
60
+ anchorEl: anchorEl,
61
+ transition: true,
62
+ placement: "auto-end",
63
+ onMouseDown: e => e.preventDefault(),
64
+ sx: classes.popupWrapper,
65
+ className: "tools-drawer",
66
+ children: ({
67
+ TransitionProps
68
+ }) => /*#__PURE__*/_jsx(Fade, {
69
+ ...TransitionProps,
70
+ timeout: 350,
71
+ children: /*#__PURE__*/_jsxs(Paper, {
72
+ children: [/*#__PURE__*/_jsxs(Grid, {
73
+ item: true,
74
+ xs: 12,
75
+ style: {
76
+ display: "flex",
77
+ padding: "12px"
78
+ },
79
+ justifyContent: "space-between",
80
+ alignItems: "center",
81
+ className: "textSettingHeader",
82
+ children: [/*#__PURE__*/_jsx(Typography, {
83
+ color: "primary",
84
+ sx: {
85
+ fontSize: "16px",
86
+ fontWeight: "700",
87
+ color: "#000"
88
+ },
89
+ children: "TEXT SETTINGS"
90
+ }), /*#__PURE__*/_jsx(Grid, {
91
+ sx: classes.textFormatLabel,
92
+ justifyContent: "end",
93
+ children: /*#__PURE__*/_jsx(IconButton, {
94
+ className: "close-popupbtn",
95
+ onClick: handleClose,
96
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
97
+ })
98
+ })]
99
+ }), toolTextFormat]
100
+ })
64
101
  })
65
102
  });
103
+
104
+ // return (
105
+ // <Drawer
106
+ // // id={id}
107
+ // open={open}
108
+ // fullWidth
109
+ // // disablePortal={false}
110
+ // // anchorEl={anchorEl}
111
+ // // transition
112
+ // // placement="bottom-start"
113
+ // // onMouseDown={(e) => e.preventDefault()}
114
+ // // sx={classes.popupWrapper}
115
+ // anchor="right"
116
+ // hideBackdrop
117
+ // // handleClose={handleClose}
118
+ // className="tools-drawer"
119
+ // // variant="persistent"
120
+ // >
121
+ // <TextFormat editor={editor} classes={classes} onClose={handleClose} />
122
+ // </Drawer>
123
+ // );
66
124
  };
125
+
67
126
  export default PopupTool;
@@ -90,16 +90,16 @@ const appHeaderStyle = [{
90
90
  tab: "Colors",
91
91
  value: "colors",
92
92
  fields: [{
93
- label: "Text",
93
+ label: "Text Color",
94
94
  key: "textColor",
95
95
  type: "color",
96
- needPreview: true
96
+ needPreview: false
97
97
  }, {
98
- label: "Background",
98
+ label: "Background Color",
99
99
  key: "bgColor",
100
100
  type: "color"
101
101
  }, {
102
- label: "Border",
102
+ label: "Border Color",
103
103
  key: "borderColor",
104
104
  type: "color"
105
105
  }]
@@ -107,16 +107,16 @@ const appHeaderStyle = [{
107
107
  tab: "Hover Colors",
108
108
  value: "hoverColors",
109
109
  fields: [{
110
- label: "Text",
110
+ label: "Hover Text Color",
111
111
  key: "textColorHover",
112
112
  type: "color",
113
- needPreview: true
113
+ needPreview: false
114
114
  }, {
115
- label: "Background",
115
+ label: "Hover Background Color",
116
116
  key: "bgColorHover",
117
117
  type: "color"
118
118
  }, {
119
- label: "Border",
119
+ label: "Hover Border Color",
120
120
  key: "borderColorHover",
121
121
  type: "color"
122
122
  }]
@@ -40,7 +40,7 @@ const BannerSpacing = props => {
40
40
  });
41
41
  };
42
42
  const maxCap = val => {
43
- return val > 100 ? 32 : val;
43
+ return val > 24 ? 24 : val;
44
44
  };
45
45
  return /*#__PURE__*/_jsxs(Grid, {
46
46
  item: true,
@@ -69,7 +69,7 @@ const BannerSpacing = props => {
69
69
  children: /*#__PURE__*/_jsxs("div", {
70
70
  style: {
71
71
  width: "100px",
72
- height: "100px",
72
+ height: "50px",
73
73
  // border: "1px solid #495efc",
74
74
  backgroundColor: "transparent",
75
75
  position: "relative",
@@ -1,5 +1,42 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  const gridItemStyle = [{
3
+ tab: "Colors",
4
+ value: "colors",
5
+ fields: [{
6
+ label: "Text Color",
7
+ key: "textColor",
8
+ type: "color",
9
+ needPreview: false
10
+ }, {
11
+ label: "Background Color",
12
+ key: "bgColor",
13
+ type: "color"
14
+ }, {
15
+ label: "Border Color",
16
+ key: "borderColor",
17
+ type: "color"
18
+ }]
19
+ }, {
20
+ tab: "Hover Colors",
21
+ value: "hoverColors",
22
+ fields: [{
23
+ label: "Hover Background Color",
24
+ key: "bgColorHover",
25
+ type: "color"
26
+ }, {
27
+ label: "Hover Border Color",
28
+ key: "borderColorHover",
29
+ type: "color"
30
+ }]
31
+ }, {
32
+ tab: "Position",
33
+ value: "position",
34
+ fields: [{
35
+ label: "Set Postion (Vertical & Horizantal)",
36
+ key: "alignment",
37
+ type: "alignment"
38
+ }]
39
+ }, {
3
40
  tab: "Margin",
4
41
  value: "margin",
5
42
  fields: [{
@@ -50,43 +87,6 @@ const gridItemStyle = [{
50
87
  });
51
88
  }
52
89
  }]
53
- }, {
54
- tab: "Colors",
55
- value: "colors",
56
- fields: [{
57
- label: "Text",
58
- key: "textColor",
59
- type: "color",
60
- needPreview: true
61
- }, {
62
- label: "Background",
63
- key: "bgColor",
64
- type: "color"
65
- }, {
66
- label: "Border",
67
- key: "borderColor",
68
- type: "color"
69
- }]
70
- }, {
71
- tab: "Hover Colors",
72
- value: "hoverColors",
73
- fields: [{
74
- label: "Background",
75
- key: "bgColorHover",
76
- type: "color"
77
- }, {
78
- label: "Border",
79
- key: "borderColorHover",
80
- type: "color"
81
- }]
82
- }, {
83
- tab: "Position",
84
- value: "position",
85
- fields: [{
86
- label: "Set Postion (Vertical & Horizantal)",
87
- key: "alignment",
88
- type: "alignment"
89
- }]
90
90
  }, {
91
91
  tab: "Size",
92
92
  value: "gridSize",
@@ -3,11 +3,52 @@ const gridStyle = [{
3
3
  tab: "General",
4
4
  value: "general",
5
5
  fields: [{
6
- label: "Section ID",
6
+ label: "Section Name",
7
7
  key: "id",
8
8
  type: "text",
9
9
  placeholder: "Id should be unique for the page..."
10
10
  }]
11
+ }, {
12
+ tab: "Colors",
13
+ value: "colors",
14
+ fields: [{
15
+ label: "Text Color",
16
+ key: "textColor",
17
+ type: "color",
18
+ needPreview: false
19
+ }, {
20
+ label: "Background Color",
21
+ key: "bgColor",
22
+ type: "color"
23
+ }, {
24
+ label: "Foreground Color",
25
+ key: "fgColor",
26
+ type: "color"
27
+ }, {
28
+ label: "Border Color",
29
+ key: "borderColor",
30
+ type: "color"
31
+ }]
32
+ }, {
33
+ tab: "Position",
34
+ value: "position",
35
+ fields: [{
36
+ label: "Set Postion (Vertical & Horizantal)",
37
+ key: "alignment",
38
+ type: "alignment"
39
+ }]
40
+ }, {
41
+ tab: "Background",
42
+ value: "backgroundImage",
43
+ fields: [{
44
+ label: "Background Image URL",
45
+ key: "backgroundImage",
46
+ type: "text"
47
+ }, {
48
+ label: "Background Image",
49
+ key: "backgroundImage",
50
+ type: "backgroundImage"
51
+ }]
11
52
  }, {
12
53
  tab: "Padding",
13
54
  value: "bannerSpacing",
@@ -51,47 +92,6 @@ const gridStyle = [{
51
92
  });
52
93
  }
53
94
  }]
54
- }, {
55
- tab: "Colors",
56
- value: "colors",
57
- fields: [{
58
- label: "Text",
59
- key: "textColor",
60
- type: "color",
61
- needPreview: true
62
- }, {
63
- label: "Background",
64
- key: "bgColor",
65
- type: "color"
66
- }, {
67
- label: "Foreground Color",
68
- key: "fgColor",
69
- type: "color"
70
- }, {
71
- label: "Border",
72
- key: "borderColor",
73
- type: "color"
74
- }]
75
- }, {
76
- tab: "Position",
77
- value: "position",
78
- fields: [{
79
- label: "Set Postion (Vertical & Horizantal)",
80
- key: "alignment",
81
- type: "alignment"
82
- }]
83
- }, {
84
- tab: "Background",
85
- value: "backgroundImage",
86
- fields: [{
87
- label: "URL",
88
- key: "backgroundImage",
89
- type: "text"
90
- }, {
91
- label: "Background Image",
92
- key: "backgroundImage",
93
- type: "backgroundImage"
94
- }]
95
95
  }, {
96
96
  tab: "Save As Template",
97
97
  value: "saveAsTemplate",
@@ -161,8 +161,8 @@ const StyleBuilder = props => {
161
161
  })
162
162
  }), /*#__PURE__*/_jsx(DialogContent, {
163
163
  sx: {
164
- p: 0,
165
- maxHeight: `${window.innerHeight - 150}px`
164
+ p: 2,
165
+ maxHeight: `${window.innerHeight - 125}px`
166
166
  // padding: "16px",
167
167
  },
168
168
  children: renderTabs.map((m, i) => {
@@ -178,7 +178,8 @@ const StyleBuilder = props => {
178
178
  }), needActions ? /*#__PURE__*/_jsxs(DialogActions, {
179
179
  sx: {
180
180
  p: 0,
181
- pt: 2
181
+ pt: 2,
182
+ justifyContent: "space-between"
182
183
  },
183
184
  children: [onDelete ? /*#__PURE__*/_jsx(Button, {
184
185
  onClick: onDelete,
@@ -186,10 +187,6 @@ const StyleBuilder = props => {
186
187
  className: "deleteBtn",
187
188
  children: "Delete"
188
189
  }) : null, /*#__PURE__*/_jsx(Button, {
189
- onClick: onClose,
190
- className: "secondaryBtn",
191
- children: "Cancel"
192
- }), /*#__PURE__*/_jsx(Button, {
193
190
  onClick: handleSave,
194
191
  className: "primaryBtn",
195
192
  children: "Save"
@@ -1289,4 +1289,96 @@ export const DirectionReverseIcon = props => /*#__PURE__*/_jsxs("svg", {
1289
1289
  strokeLinecap: "round",
1290
1290
  strokeLinejoin: "round"
1291
1291
  })]
1292
+ });
1293
+ export const GridSettingsIcon = props => /*#__PURE__*/_jsxs("svg", {
1294
+ xmlns: "http://www.w3.org/2000/svg",
1295
+ width: "22",
1296
+ height: "22",
1297
+ viewBox: "0 0 22 22",
1298
+ fill: "none",
1299
+ children: [/*#__PURE__*/_jsx("path", {
1300
+ d: "M11 13.75C12.5188 13.75 13.75 12.5188 13.75 11C13.75 9.48122 12.5188 8.25 11 8.25C9.48122 8.25 8.25 9.48122 8.25 11C8.25 12.5188 9.48122 13.75 11 13.75Z",
1301
+ stroke: "#64748B",
1302
+ strokeWidth: "1.5",
1303
+ strokeMiterlimit: "10",
1304
+ strokeLinecap: "round",
1305
+ strokeLinejoin: "round"
1306
+ }), /*#__PURE__*/_jsx("path", {
1307
+ d: "M1.8335 11.8066V10.1933C1.8335 9.23998 2.61266 8.45165 3.57516 8.45165C5.23433 8.45165 5.91266 7.27832 5.0785 5.83915C4.60183 5.01415 4.886 3.94165 5.72016 3.46498L7.306 2.55748C8.03016 2.12665 8.96516 2.38332 9.396 3.10748L9.49683 3.28165C10.3218 4.72082 11.6785 4.72082 12.5127 3.28165L12.6135 3.10748C13.0443 2.38332 13.9793 2.12665 14.7035 2.55748L16.2893 3.46498C17.1235 3.94165 17.4077 5.01415 16.931 5.83915C16.0968 7.27832 16.7752 8.45165 18.4343 8.45165C19.3877 8.45165 20.176 9.23082 20.176 10.1933V11.8066C20.176 12.76 19.3968 13.5483 18.4343 13.5483C16.7752 13.5483 16.0968 14.7216 16.931 16.1608C17.4077 16.995 17.1235 18.0583 16.2893 18.535L14.7035 19.4425C13.9793 19.8733 13.0443 19.6166 12.6135 18.8925L12.5127 18.7183C11.6877 17.2791 10.331 17.2791 9.49683 18.7183L9.396 18.8925C8.96516 19.6166 8.03016 19.8733 7.306 19.4425L5.72016 18.535C4.886 18.0583 4.60183 16.9858 5.0785 16.1608C5.91266 14.7216 5.23433 13.5483 3.57516 13.5483C2.61266 13.5483 1.8335 12.76 1.8335 11.8066Z",
1308
+ stroke: "#64748B",
1309
+ strokeWidth: "1.5",
1310
+ strokeMiterlimit: "10",
1311
+ strokeLinecap: "round",
1312
+ strokeLinejoin: "round"
1313
+ })]
1314
+ });
1315
+ export const GridAddGridIcon = props => /*#__PURE__*/_jsxs("svg", {
1316
+ xmlns: "http://www.w3.org/2000/svg",
1317
+ width: "18",
1318
+ height: "18",
1319
+ viewBox: "0 0 18 18",
1320
+ fill: "none",
1321
+ children: [/*#__PURE__*/_jsx("path", {
1322
+ d: "M6.75 16.5H11.25C15 16.5 16.5 15 16.5 11.25V6.75C16.5 3 15 1.5 11.25 1.5H6.75C3 1.5 1.5 3 1.5 6.75V11.25C1.5 15 3 16.5 6.75 16.5Z",
1323
+ stroke: "#64748B",
1324
+ strokeWidth: "1.5",
1325
+ strokeLinecap: "round",
1326
+ strokeLinejoin: "round"
1327
+ }), /*#__PURE__*/_jsx("path", {
1328
+ d: "M1.5 9H16.5",
1329
+ stroke: "#64748B",
1330
+ strokeWidth: "1.5",
1331
+ strokeLinecap: "round",
1332
+ strokeLinejoin: "round"
1333
+ }), /*#__PURE__*/_jsx("path", {
1334
+ d: "M6.1875 9V16.125",
1335
+ stroke: "#64748B",
1336
+ strokeWidth: "1.5",
1337
+ strokeLinecap: "round",
1338
+ strokeLinejoin: "round"
1339
+ }), /*#__PURE__*/_jsx("path", {
1340
+ d: "M11.8125 16.5V9",
1341
+ stroke: "#64748B",
1342
+ strokeWidth: "1.5",
1343
+ strokeLinecap: "round",
1344
+ strokeLinejoin: "round"
1345
+ }), /*#__PURE__*/_jsx("path", {
1346
+ d: "M6.1875 9V1.5",
1347
+ stroke: "#64748B",
1348
+ strokeWidth: "1.5",
1349
+ strokeLinecap: "round",
1350
+ strokeLinejoin: "round"
1351
+ }), /*#__PURE__*/_jsx("path", {
1352
+ d: "M11.8125 9.00027V1.90527",
1353
+ stroke: "#64748B",
1354
+ strokeWidth: "1.5",
1355
+ strokeLinecap: "round",
1356
+ strokeLinejoin: "round"
1357
+ })]
1358
+ });
1359
+ export const GridAddSectionIcon = props => /*#__PURE__*/_jsxs("svg", {
1360
+ xmlns: "http://www.w3.org/2000/svg",
1361
+ width: "20",
1362
+ height: "20",
1363
+ viewBox: "0 0 20 20",
1364
+ fill: "none",
1365
+ children: [/*#__PURE__*/_jsx("path", {
1366
+ d: "M10 19C14.9706 19 19 14.9706 19 10C19 5.02944 14.9706 1 10 1C5.02944 1 1 5.02944 1 10C1 14.9706 5.02944 19 10 19Z",
1367
+ stroke: "#64748B",
1368
+ strokeWidth: "1.5",
1369
+ strokeLinecap: "round",
1370
+ strokeLinejoin: "round"
1371
+ }), /*#__PURE__*/_jsx("path", {
1372
+ d: "M10.1733 6.125V14.875",
1373
+ stroke: "#64748B",
1374
+ strokeWidth: "1.5",
1375
+ strokeLinecap: "round",
1376
+ strokeLinejoin: "round"
1377
+ }), /*#__PURE__*/_jsx("path", {
1378
+ d: "M5.79834 10.5H14.5483",
1379
+ stroke: "#64748B",
1380
+ strokeWidth: "1.5",
1381
+ strokeLinecap: "round",
1382
+ strokeLinejoin: "round"
1383
+ })]
1292
1384
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"