@flozy/editor 1.6.8 → 1.6.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +2 -2
- package/dist/Editor/Editor.css +6 -0
- package/dist/Editor/Elements/AppHeader/AppHeader.js +8 -0
- package/dist/Editor/Elements/Button/EditorButton.js +40 -42
- package/dist/Editor/Elements/Embed/Image.js +2 -1
- package/dist/Editor/Elements/Grid/Grid.js +72 -58
- package/dist/Editor/Elements/SimpleText.js +11 -0
- package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -2
- package/dist/Editor/Styles/EditorStyles.js +1 -1
- package/dist/Editor/common/ImageSelector/ImageSelector.js +0 -1
- package/package.json +1 -1
@@ -410,8 +410,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
410
410
|
className: `editor-wrapper ${pageWidth === "fixed" ? "fixed" : "full"}`,
|
411
411
|
style: {
|
412
412
|
backgroundColor: "transparent",
|
413
|
-
paddingLeft: `${bannerSpacing?.left ||
|
414
|
-
paddingRight: `${bannerSpacing?.right ||
|
413
|
+
paddingLeft: `${bannerSpacing?.left || 0}px`,
|
414
|
+
paddingRight: `${bannerSpacing?.right || 0}px`,
|
415
415
|
paddingTop: `${bannerSpacing?.top}px`,
|
416
416
|
paddingBottom: `${bannerSpacing?.bottom}px`,
|
417
417
|
width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
|
package/dist/Editor/Editor.css
CHANGED
@@ -215,10 +215,14 @@ function AppHeader(props) {
|
|
215
215
|
paddingRight: "0px"
|
216
216
|
},
|
217
217
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
218
|
+
className: "app-drawer-btn",
|
218
219
|
color: "inherit",
|
219
220
|
"aria-label": "open drawer",
|
220
221
|
edge: "start",
|
221
222
|
onClick: handleDrawerToggle,
|
223
|
+
style: {
|
224
|
+
color: textColor
|
225
|
+
},
|
222
226
|
sx: {
|
223
227
|
mr: 2,
|
224
228
|
display: {
|
@@ -262,10 +266,14 @@ function AppHeader(props) {
|
|
262
266
|
}
|
263
267
|
},
|
264
268
|
children: [isDrawer ? /*#__PURE__*/_jsx(IconButton, {
|
269
|
+
className: "app-drawer-btn",
|
265
270
|
color: "inherit",
|
266
271
|
"aria-label": "open drawer",
|
267
272
|
edge: "start",
|
268
273
|
onClick: handleDrawerToggle,
|
274
|
+
style: {
|
275
|
+
color: textColor
|
276
|
+
},
|
269
277
|
children: /*#__PURE__*/_jsx(MenuIcon, {})
|
270
278
|
}) : null, !isDrawer ? menus.map((item, i) => /*#__PURE__*/_jsx(Button, {
|
271
279
|
component: "a",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { Transforms } from "slate";
|
3
3
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
4
|
-
import { IconButton,
|
4
|
+
import { IconButton, Tooltip, Box } from "@mui/material";
|
5
5
|
import * as fIcons from "@mui/icons-material";
|
6
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
7
7
|
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
@@ -24,7 +24,6 @@ const EditorButton = props => {
|
|
24
24
|
const editor = useSlateStatic();
|
25
25
|
const path = ReactEditor.findPath(editor, element);
|
26
26
|
const [edit, setEdit] = useState(false);
|
27
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
28
27
|
const {
|
29
28
|
label,
|
30
29
|
bgColor,
|
@@ -80,13 +79,8 @@ const EditorButton = props => {
|
|
80
79
|
const refUrl = url ? url.includes("http") ? url : `//${url}` : "Link";
|
81
80
|
window.open(refUrl, "_blank").focus();
|
82
81
|
}
|
83
|
-
} else {
|
84
|
-
setAnchorEl(e.currentTarget);
|
85
82
|
}
|
86
83
|
};
|
87
|
-
const handleClose = () => {
|
88
|
-
setAnchorEl(null);
|
89
|
-
};
|
90
84
|
const onMenuClick = val => () => {
|
91
85
|
switch (val) {
|
92
86
|
case "open":
|
@@ -105,6 +99,36 @@ const EditorButton = props => {
|
|
105
99
|
return;
|
106
100
|
}
|
107
101
|
};
|
102
|
+
const Toolbar = () => {
|
103
|
+
return !readOnly ? /*#__PURE__*/_jsxs("div", {
|
104
|
+
className: "element-toolbar hr",
|
105
|
+
style: {
|
106
|
+
width: "max-content"
|
107
|
+
},
|
108
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
109
|
+
title: "Settings",
|
110
|
+
arrow: true,
|
111
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
112
|
+
onClick: onMenuClick("edit"),
|
113
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
114
|
+
})
|
115
|
+
}), /*#__PURE__*/_jsxs(Tooltip, {
|
116
|
+
title: "Open Link",
|
117
|
+
arrow: true,
|
118
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
119
|
+
onClick: onMenuClick("open"),
|
120
|
+
children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
|
121
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
122
|
+
title: "Delete",
|
123
|
+
arrow: true,
|
124
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
125
|
+
onClick: onMenuClick("delete"),
|
126
|
+
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
127
|
+
})
|
128
|
+
})]
|
129
|
+
})]
|
130
|
+
}) : null;
|
131
|
+
};
|
108
132
|
const onSave = data => {
|
109
133
|
const updateData = {
|
110
134
|
...data
|
@@ -152,9 +176,16 @@ const EditorButton = props => {
|
|
152
176
|
fontFamily: fontFamily || "PoppinsRegular",
|
153
177
|
display: "inline-flex",
|
154
178
|
alignItems: "center",
|
179
|
+
position: "relative",
|
180
|
+
"& .element-toolbar": {
|
181
|
+
display: "none"
|
182
|
+
},
|
155
183
|
"&:hover": {
|
156
184
|
color: `${textColorHover || textColor || "#FFFFFF"}`,
|
157
|
-
background: bgColorHover || bgColor || "rgb(30, 75, 122)"
|
185
|
+
background: bgColorHover || bgColor || "rgb(30, 75, 122)",
|
186
|
+
"& .element-toolbar": {
|
187
|
+
display: "block"
|
188
|
+
}
|
158
189
|
}
|
159
190
|
},
|
160
191
|
onClick: onClick,
|
@@ -168,7 +199,7 @@ const EditorButton = props => {
|
|
168
199
|
paddingLeft: "4px",
|
169
200
|
paddingRight: "4px"
|
170
201
|
}
|
171
|
-
})]
|
202
|
+
}), /*#__PURE__*/_jsx(Toolbar, {})]
|
172
203
|
})
|
173
204
|
}), /*#__PURE__*/_jsx("div", {
|
174
205
|
contentEditable: false,
|
@@ -176,39 +207,6 @@ const EditorButton = props => {
|
|
176
207
|
display: "inline"
|
177
208
|
},
|
178
209
|
children: children
|
179
|
-
}), /*#__PURE__*/_jsxs(Menu, {
|
180
|
-
className: "editor-btn-options",
|
181
|
-
open: anchorEl !== null,
|
182
|
-
anchorEl: anchorEl,
|
183
|
-
onClose: handleClose,
|
184
|
-
children: [!readOnly && /*#__PURE__*/_jsx(MenuItem, {
|
185
|
-
onClick: onMenuClick("edit"),
|
186
|
-
children: /*#__PURE__*/_jsx(Tooltip, {
|
187
|
-
title: "Settings",
|
188
|
-
arrow: true,
|
189
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
190
|
-
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
191
|
-
})
|
192
|
-
})
|
193
|
-
}), /*#__PURE__*/_jsx(MenuItem, {
|
194
|
-
title: "Open Link",
|
195
|
-
arrow: true,
|
196
|
-
onClick: onMenuClick("open"),
|
197
|
-
children: /*#__PURE__*/_jsx(Tooltip, {
|
198
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
199
|
-
children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
|
200
|
-
})
|
201
|
-
})
|
202
|
-
}), !readOnly && /*#__PURE__*/_jsx(MenuItem, {
|
203
|
-
title: "Delete",
|
204
|
-
arrow: true,
|
205
|
-
onClick: onMenuClick("delete"),
|
206
|
-
children: /*#__PURE__*/_jsx(Tooltip, {
|
207
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
208
|
-
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
209
|
-
})
|
210
|
-
})
|
211
|
-
})]
|
212
210
|
}), edit && /*#__PURE__*/_jsx(ButtonPopup, {
|
213
211
|
element: element,
|
214
212
|
onSave: onSave,
|
@@ -176,7 +176,8 @@ const Image = ({
|
|
176
176
|
alt: alt,
|
177
177
|
src: url,
|
178
178
|
onClick: handleImageClick,
|
179
|
-
"data-path": path.join(",")
|
179
|
+
"data-path": path.join(","),
|
180
|
+
draggable: false
|
180
181
|
}), selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
|
181
182
|
onPointerDown: onMouseDown,
|
182
183
|
style: {
|
@@ -248,71 +248,85 @@ const Grid = props => {
|
|
248
248
|
const bgImage = backgroundImage && backgroundImage !== "none" ? {
|
249
249
|
backgroundImage: `url(${backgroundImage})`
|
250
250
|
} : {};
|
251
|
-
return /*#__PURE__*/
|
252
|
-
|
253
|
-
className: `grid-container ${grid} has-hover element-root`,
|
254
|
-
...attributes,
|
255
|
-
...sectionId,
|
251
|
+
return /*#__PURE__*/_jsx("section", {
|
252
|
+
className: "section-wrapper-fluid",
|
256
253
|
style: {
|
254
|
+
display: "flex",
|
255
|
+
width: "100%",
|
257
256
|
background: bgColor,
|
258
|
-
alignContent: vertical,
|
259
257
|
...bgImage,
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
borderStyle: borderStyle || "solid"
|
258
|
+
backgroundSize: "cover",
|
259
|
+
justifyContent: "center",
|
260
|
+
alignItems: "center"
|
264
261
|
},
|
265
|
-
|
266
|
-
|
262
|
+
children: /*#__PURE__*/_jsxs(GridContainer, {
|
263
|
+
container: true,
|
264
|
+
className: `grid-container ${grid} has-hover element-root`,
|
265
|
+
...attributes,
|
266
|
+
...sectionId,
|
267
267
|
style: {
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
className: `element-selector ${selected ? "selected" : ""}`,
|
278
|
-
contentEditable: false,
|
279
|
-
children: [/*#__PURE__*/_jsx("div", {
|
280
|
-
className: "element-selector-dots tl",
|
281
|
-
children: " "
|
282
|
-
}), /*#__PURE__*/_jsx("div", {
|
283
|
-
className: "element-selector-dots tr",
|
284
|
-
children: " "
|
285
|
-
}), /*#__PURE__*/_jsx("div", {
|
286
|
-
className: "element-selector-dots bl",
|
287
|
-
children: " "
|
288
|
-
}), /*#__PURE__*/_jsx("div", {
|
289
|
-
className: "element-selector-dots br",
|
290
|
-
children: " "
|
291
|
-
}), /*#__PURE__*/_jsx(GridToolBar, {})]
|
292
|
-
}), openSetttings ? /*#__PURE__*/_jsx(GridPopup, {
|
293
|
-
element: element,
|
294
|
-
onSave: onSave,
|
295
|
-
onClose: onClose,
|
296
|
-
onDelete: onDelete,
|
297
|
-
customProps: customProps
|
298
|
-
}) : null, /*#__PURE__*/_jsx(GridContainer, {
|
299
|
-
item: true,
|
300
|
-
xs: 12,
|
301
|
-
className: "grid-c-wrpr",
|
302
|
-
style: {
|
303
|
-
display: "flex",
|
304
|
-
paddingLeft: `${left}px`,
|
305
|
-
paddingRight: `${right}px`,
|
306
|
-
paddingTop: `${top}px`,
|
307
|
-
paddingBottom: `${bottom}px`,
|
308
|
-
alignItems: vertical || "start",
|
309
|
-
justifyContent: horizantal || "start",
|
310
|
-
flexDirection: flexDirection || "row",
|
311
|
-
width: "100%"
|
268
|
+
// background: bgColor,
|
269
|
+
alignContent: vertical,
|
270
|
+
// ...bgImage,
|
271
|
+
borderColor: borderColor || "transparent",
|
272
|
+
borderWidth: borderWidth || "1px",
|
273
|
+
borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
|
274
|
+
borderStyle: borderStyle || "solid",
|
275
|
+
maxWidth: "1440px",
|
276
|
+
width: "80%"
|
312
277
|
},
|
313
278
|
"data-path": path.join(","),
|
314
|
-
children:
|
315
|
-
|
279
|
+
children: [fgColor && /*#__PURE__*/_jsx("div", {
|
280
|
+
style: {
|
281
|
+
position: "absolute",
|
282
|
+
pointerEvents: "none",
|
283
|
+
width: "100%",
|
284
|
+
height: "100%",
|
285
|
+
background: fgColor,
|
286
|
+
backgroundRepeat: "no-repeat",
|
287
|
+
backgroundSize: "cover"
|
288
|
+
}
|
289
|
+
}), !readOnly && /*#__PURE__*/_jsxs("div", {
|
290
|
+
className: `element-selector ${selected ? "selected" : ""}`,
|
291
|
+
contentEditable: false,
|
292
|
+
children: [/*#__PURE__*/_jsx("div", {
|
293
|
+
className: "element-selector-dots tl",
|
294
|
+
children: " "
|
295
|
+
}), /*#__PURE__*/_jsx("div", {
|
296
|
+
className: "element-selector-dots tr",
|
297
|
+
children: " "
|
298
|
+
}), /*#__PURE__*/_jsx("div", {
|
299
|
+
className: "element-selector-dots bl",
|
300
|
+
children: " "
|
301
|
+
}), /*#__PURE__*/_jsx("div", {
|
302
|
+
className: "element-selector-dots br",
|
303
|
+
children: " "
|
304
|
+
}), /*#__PURE__*/_jsx(GridToolBar, {})]
|
305
|
+
}), openSetttings ? /*#__PURE__*/_jsx(GridPopup, {
|
306
|
+
element: element,
|
307
|
+
onSave: onSave,
|
308
|
+
onClose: onClose,
|
309
|
+
onDelete: onDelete,
|
310
|
+
customProps: customProps
|
311
|
+
}) : null, /*#__PURE__*/_jsx(GridContainer, {
|
312
|
+
item: true,
|
313
|
+
xs: 12,
|
314
|
+
className: "grid-c-wrpr",
|
315
|
+
style: {
|
316
|
+
display: "flex",
|
317
|
+
paddingLeft: `${left}px`,
|
318
|
+
paddingRight: `${right}px`,
|
319
|
+
paddingTop: `${top}px`,
|
320
|
+
paddingBottom: `${bottom}px`,
|
321
|
+
alignItems: vertical || "start",
|
322
|
+
justifyContent: horizantal || "start",
|
323
|
+
flexDirection: flexDirection || "row",
|
324
|
+
width: "100%"
|
325
|
+
},
|
326
|
+
"data-path": path.join(","),
|
327
|
+
children: children
|
328
|
+
}), /*#__PURE__*/_jsx(NewLineButtons, {})]
|
329
|
+
})
|
316
330
|
});
|
317
331
|
};
|
318
332
|
export default Grid;
|
@@ -26,6 +26,17 @@ const SimpleTextStyle = () => ({
|
|
26
26
|
fontSize: "12px"
|
27
27
|
}
|
28
28
|
}
|
29
|
+
},
|
30
|
+
section: {
|
31
|
+
display: "flex",
|
32
|
+
width: "100%",
|
33
|
+
backgroundSize: "cover",
|
34
|
+
justifyContent: "center",
|
35
|
+
alignItems: "center",
|
36
|
+
"& .simple-text": {
|
37
|
+
width: "80%",
|
38
|
+
maxWidth: "1440px"
|
39
|
+
}
|
29
40
|
}
|
30
41
|
});
|
31
42
|
const SimpleText = props => {
|
@@ -73,7 +73,7 @@ const TopBanner = props => {
|
|
73
73
|
...attributes,
|
74
74
|
style: {
|
75
75
|
position: "relative",
|
76
|
-
height: "
|
76
|
+
height: "280px",
|
77
77
|
textAlign: "center"
|
78
78
|
},
|
79
79
|
contentEditable: false,
|
@@ -83,7 +83,7 @@ const TopBanner = props => {
|
|
83
83
|
alt: "Top Banner",
|
84
84
|
style: {
|
85
85
|
width: "100%",
|
86
|
-
height: "
|
86
|
+
height: "280px",
|
87
87
|
objectFit: "cover",
|
88
88
|
borderRadius: "0px",
|
89
89
|
margin: "0px 0px"
|