@flozy/editor 2.1.8 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +19 -5
- package/dist/Editor/Elements/AppHeader/AppHeader.js +1 -0
- package/dist/Editor/Elements/Color Picker/defaultColors.js +4 -1
- package/dist/Editor/Elements/Embed/EmbedPopup.js +1 -1
- package/dist/Editor/Elements/Embed/Frames/ImageFrame.js +7 -11
- package/dist/Editor/Elements/Embed/Frames/Slider.js +32 -8
- package/dist/Editor/Elements/Embed/Frames/Styles.js +26 -0
- package/dist/Editor/Elements/EmbedScript/Code.js +12 -11
- package/dist/Editor/Elements/Form/FormElements/validations.js +1 -2
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +6 -2
- package/dist/Editor/Styles/EditorStyles.js +3 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +8 -3
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +13 -1
- package/dist/Editor/Toolbar/Mini/Options/Options.js +5 -0
- package/dist/Editor/Toolbar/Mini/Styles.js +3 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +116 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +6 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +15 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +8 -6
- package/dist/Editor/common/ColorPickerButton.js +7 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +25 -2
- package/dist/Editor/common/StyleBuilder/tableStyle.js +1 -1
- package/dist/Editor/common/ToolbarIcon.js +2 -2
- package/dist/Editor/common/iconslist.js +23 -18
- package/dist/Editor/commonStyle.js +16 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +4 -0
- package/dist/Editor/utils/embed.js +1 -1
- package/dist/Editor/utils/font.js +6 -1
- package/package.json +1 -1
@@ -371,6 +371,21 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
371
371
|
return true;
|
372
372
|
}
|
373
373
|
}, [readOnly, isTextSelected]);
|
374
|
+
const handleFooterClick = () => {
|
375
|
+
window.open('https://www.flozy.com', '_blank');
|
376
|
+
};
|
377
|
+
const editorWrapperStyle = useMemo(() => {
|
378
|
+
const style = {
|
379
|
+
color: pageTextColor || ""
|
380
|
+
};
|
381
|
+
if (pageBgImage && pageBgImage !== "none") {
|
382
|
+
style.backgroundImage = `url(${pageBgImage})`;
|
383
|
+
style.backgroundSize = `cover`;
|
384
|
+
} else {
|
385
|
+
style.background = pageColor || "";
|
386
|
+
}
|
387
|
+
return style;
|
388
|
+
}, [pageBgImage, pageColor]);
|
374
389
|
return /*#__PURE__*/_jsx(EditorProvider, {
|
375
390
|
theme: theme,
|
376
391
|
editor: editor,
|
@@ -396,10 +411,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
396
411
|
className: `${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} ${isScrolling ? "" : "hideScroll"} scrollable-content`,
|
397
412
|
sx: classes.slateWrapper,
|
398
413
|
id: "slate-wrapper-scroll-container",
|
399
|
-
style:
|
400
|
-
background: pageColor || "",
|
401
|
-
color: pageTextColor || ""
|
402
|
-
},
|
414
|
+
style: editorWrapperStyle,
|
403
415
|
onClick: e => {
|
404
416
|
handleInsertLastElement(e, editor);
|
405
417
|
},
|
@@ -460,10 +472,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
460
472
|
sx: {
|
461
473
|
color: "rgb(100, 116, 139)",
|
462
474
|
fontSize: "13px",
|
463
|
-
paddingBottom: hideMiniToolBar ? "0px" : "12px"
|
475
|
+
paddingBottom: hideMiniToolBar ? "0px" : "12px",
|
476
|
+
cursor: 'pointer'
|
464
477
|
},
|
465
478
|
align: "center",
|
466
479
|
"data-info": outsideEditorClickLabel,
|
480
|
+
onClick: handleFooterClick,
|
467
481
|
children: footer
|
468
482
|
})]
|
469
483
|
})
|
@@ -1 +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 = ["#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"
|
2
|
+
// "#E6E6E6",
|
3
|
+
// "#BEBEBE"
|
4
|
+
];
|
@@ -13,7 +13,7 @@ const EmbedPopup = props => {
|
|
13
13
|
onDelete
|
14
14
|
} = props;
|
15
15
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
16
|
-
title: format === "image" ? "Image" : "
|
16
|
+
title: format === "image" ? "Image" : "Embed",
|
17
17
|
type: format === "image" ? "embedImageStyle" : "embedVideoStyle",
|
18
18
|
element: element,
|
19
19
|
onSave: onSave,
|
@@ -6,6 +6,7 @@ import ContinuousSlider from "./Slider";
|
|
6
6
|
import frames from ".";
|
7
7
|
import { useEditorContext } from "../../../hooks/useMouseMove";
|
8
8
|
import { CloseIcon } from "../../../common/iconslist";
|
9
|
+
import FramesStyles from "./Styles";
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -49,6 +50,10 @@ const ImageFrame = props => {
|
|
49
50
|
setSelectedPath
|
50
51
|
} = useEditorContext();
|
51
52
|
const open = selectedPath === id && Boolean(anchorEl);
|
53
|
+
const {
|
54
|
+
theme
|
55
|
+
} = useEditorContext();
|
56
|
+
const classes = FramesStyles(theme);
|
52
57
|
useEffect(() => {
|
53
58
|
if (imageRef?.current && !readOnly) {
|
54
59
|
setDOM(dom);
|
@@ -112,18 +117,9 @@ const ImageFrame = props => {
|
|
112
117
|
},
|
113
118
|
placement: "top",
|
114
119
|
children: /*#__PURE__*/_jsxs(Box, {
|
115
|
-
sx:
|
116
|
-
width: 200,
|
117
|
-
padding: "0px 16px",
|
118
|
-
boxShadow: "5px 5px 5px 1px rgb(0,0,0,0.07)",
|
119
|
-
border: "1px solid rgba(0,0,0,0.07)",
|
120
|
-
borderRadius: "12px",
|
121
|
-
backgroundColor: "#FFF",
|
122
|
-
marginBottom: "8px",
|
123
|
-
position: "relative",
|
124
|
-
paddingRight: "48px"
|
125
|
-
},
|
120
|
+
sx: classes?.sliderContainer,
|
126
121
|
children: [/*#__PURE__*/_jsx(ContinuousSlider, {
|
122
|
+
classes: classes,
|
127
123
|
val: scale,
|
128
124
|
onChange: onScaleChange,
|
129
125
|
min: 50,
|
@@ -6,6 +6,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
7
|
const ContinuousSlider = props => {
|
8
8
|
const {
|
9
|
+
classes,
|
9
10
|
val,
|
10
11
|
min,
|
11
12
|
max,
|
@@ -20,22 +21,45 @@ const ContinuousSlider = props => {
|
|
20
21
|
spacing: 2,
|
21
22
|
direction: "row",
|
22
23
|
sx: {
|
23
|
-
mb: 0
|
24
|
+
mb: 0,
|
25
|
+
ml: '8px'
|
24
26
|
},
|
25
27
|
alignItems: "center",
|
26
|
-
children: [/*#__PURE__*/_jsx(
|
27
|
-
variant: "div",
|
28
|
-
children: "-"
|
29
|
-
}), /*#__PURE__*/_jsx(Slider, {
|
28
|
+
children: [/*#__PURE__*/_jsx(Slider, {
|
30
29
|
"aria-label": "Volume",
|
31
30
|
value: value,
|
32
31
|
onChange: handleChange,
|
33
32
|
min: min,
|
34
33
|
step: 1,
|
35
|
-
max: max
|
36
|
-
|
34
|
+
max: max,
|
35
|
+
sx: {
|
36
|
+
height: 6,
|
37
|
+
'& .MuiSlider-thumb': {
|
38
|
+
width: 16,
|
39
|
+
height: 16,
|
40
|
+
background: 'linear-gradient(180deg, #4D61FF 0%, #2C92FF 100%)'
|
41
|
+
},
|
42
|
+
'& .MuiSlider-thumb::after': {
|
43
|
+
position: 'absolute',
|
44
|
+
content: '""',
|
45
|
+
borderRadius: '50%',
|
46
|
+
width: 18,
|
47
|
+
height: 18,
|
48
|
+
top: '50%',
|
49
|
+
left: '50%',
|
50
|
+
transform: 'translate(-50%, -50%)',
|
51
|
+
border: '2px solid #fff',
|
52
|
+
boxShadow: '0px 4px 4px 0px #0000001A'
|
53
|
+
},
|
54
|
+
'& .MuiSlider-track': {
|
55
|
+
border: '1px solid #2563EB',
|
56
|
+
background: '#2563EB'
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}), /*#__PURE__*/_jsxs(Typography, {
|
60
|
+
sx: classes?.sliderText,
|
37
61
|
variant: "div",
|
38
|
-
children: "
|
62
|
+
children: [value, "%"]
|
39
63
|
})]
|
40
64
|
});
|
41
65
|
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
const FramesStyles = theme => ({
|
2
|
+
sliderContainer: {
|
3
|
+
width: 200,
|
4
|
+
padding: "0px 16px",
|
5
|
+
boxShadow: "5px 5px 5px 1px rgb(0,0,0,0.07)",
|
6
|
+
border: "1px solid rgba(0,0,0,0.07)",
|
7
|
+
borderRadius: "23px",
|
8
|
+
backgroundColor: theme?.palette?.editor?.background,
|
9
|
+
marginBottom: "8px",
|
10
|
+
position: "relative",
|
11
|
+
paddingRight: "30px"
|
12
|
+
},
|
13
|
+
sliderText: {
|
14
|
+
fontSize: "12px",
|
15
|
+
fontWeight: 600,
|
16
|
+
padding: "0px 4px",
|
17
|
+
color: theme?.palette?.editor?.textColor,
|
18
|
+
borderRadius: "22px",
|
19
|
+
minWidth: "50px",
|
20
|
+
display: "block",
|
21
|
+
textAlign: "center",
|
22
|
+
border: `1px solid ${theme?.palette?.primary?.border13}`,
|
23
|
+
boxShadow: '0px 4px 16px 0px #0000000D'
|
24
|
+
}
|
25
|
+
});
|
26
|
+
export default FramesStyles;
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
2
|
+
|
3
|
+
// const sanitize = (input) => {
|
4
|
+
// const doc = new DOMParser().parseFromString(input, "text/html");
|
5
|
+
// for (const elm of doc.querySelectorAll("*")) {
|
6
|
+
// for (const attrib of elm.attributes) {
|
7
|
+
// if (attrib.name.startsWith("on")) {
|
8
|
+
// elm.removeAttribute(attrib.name);
|
9
|
+
// }
|
10
|
+
// }
|
11
|
+
// }
|
12
|
+
// return doc.body.innerHTML;
|
13
|
+
// };
|
2
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
3
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
4
|
-
const sanitize = input => {
|
5
|
-
const doc = new DOMParser().parseFromString(input, "text/html");
|
6
|
-
for (const elm of doc.querySelectorAll("*")) {
|
7
|
-
for (const attrib of elm.attributes) {
|
8
|
-
if (attrib.name.startsWith("on")) {
|
9
|
-
elm.removeAttribute(attrib.name);
|
10
|
-
}
|
11
|
-
}
|
12
|
-
}
|
13
|
-
return doc.body.innerHTML;
|
14
|
-
};
|
15
16
|
const Code = props => {
|
16
17
|
const codeRef = useRef();
|
17
18
|
const {
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { bool } from "prop-types";
|
2
1
|
export const validationMethods = {
|
3
2
|
isEmail: value => {
|
4
|
-
const regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
3
|
+
const regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; //eslint-disable-line
|
5
4
|
const result = regex.test(String(value).toLowerCase());
|
6
5
|
if (result) {
|
7
6
|
let domain = String(value).toLowerCase().split('@')[1];
|
@@ -10,7 +10,8 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
const PageSettingsButton = props => {
|
11
11
|
const {
|
12
12
|
customProps,
|
13
|
-
icoBtnType
|
13
|
+
icoBtnType,
|
14
|
+
from
|
14
15
|
} = props;
|
15
16
|
const [openSetttings, setOpenSettings] = useState(false);
|
16
17
|
const editor = useSlateStatic();
|
@@ -40,7 +41,10 @@ const PageSettingsButton = props => {
|
|
40
41
|
setOpenSettings(false);
|
41
42
|
};
|
42
43
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
43
|
-
children: [/*#__PURE__*/_jsx(
|
44
|
+
children: [from === "miniToolBar" ? /*#__PURE__*/_jsx(PageSettings, {
|
45
|
+
onClick: onSettings,
|
46
|
+
className: "removeDefaultSvgCls"
|
47
|
+
}) : /*#__PURE__*/_jsx(ToolbarIcon, {
|
44
48
|
title: "Page Settings",
|
45
49
|
onClick: onSettings,
|
46
50
|
icon: /*#__PURE__*/_jsx(PageSettings, {}),
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { TextField, IconButton } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
4
|
-
import { sizeMap } from "../../utils/font.js";
|
3
|
+
import { addMarkData, activeMark, isBlockActive } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { headingMap, sizeMap } from "../../utils/font.js";
|
5
5
|
import { TextMinusIcon, TextPlusIcon } from "../../common/iconslist.js";
|
6
6
|
import { getBreakPointsValue } from "../../helper/theme.js";
|
7
7
|
import useWindowResize from "../../hooks/useWindowResize.js";
|
@@ -46,7 +46,12 @@ const TextSize = ({
|
|
46
46
|
};
|
47
47
|
const getSizeVal = () => {
|
48
48
|
try {
|
49
|
-
|
49
|
+
let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
|
50
|
+
Object.entries(headingMap).forEach(([format, value]) => {
|
51
|
+
if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
|
52
|
+
size = value;
|
53
|
+
}
|
54
|
+
});
|
50
55
|
return parseInt(size);
|
51
56
|
} catch (err) {
|
52
57
|
return "";
|
@@ -9,6 +9,7 @@ import miniToolbarStyles from "./Styles";
|
|
9
9
|
import usePopupStyle from "../PopupTool/PopupToolStyle";
|
10
10
|
import PopperHeader from "../PopupTool/PopperHeader";
|
11
11
|
import { getSelectedText } from "../../utils/helper";
|
12
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -44,6 +45,9 @@ const MiniToolbar = props => {
|
|
44
45
|
hideTools
|
45
46
|
} = customProps;
|
46
47
|
const UPDATED_MENU_OPTIONS = MENU_OPTIONS.filter(f => (hideTools || [])?.indexOf(f.type) === -1);
|
48
|
+
const {
|
49
|
+
popupType
|
50
|
+
} = useEditorContext();
|
47
51
|
useEffect(() => {
|
48
52
|
if (popper) {
|
49
53
|
setPopper(null);
|
@@ -73,13 +77,21 @@ const MiniToolbar = props => {
|
|
73
77
|
label,
|
74
78
|
icon: Icon
|
75
79
|
}) => {
|
80
|
+
const isDisabled = popupType === type; // for textFormat type
|
81
|
+
|
76
82
|
return /*#__PURE__*/_jsx(Tooltip, {
|
77
83
|
arrow: true,
|
78
84
|
title: label,
|
79
85
|
children: /*#__PURE__*/_jsx(IconButton, {
|
80
86
|
className: type === popper ? "active" : "",
|
81
87
|
onClick: handleClick(type),
|
82
|
-
|
88
|
+
disabled: isDisabled,
|
89
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
90
|
+
from: "miniToolBar",
|
91
|
+
icoBtnType: "mini",
|
92
|
+
customProps: customProps,
|
93
|
+
editor: editor
|
94
|
+
})
|
83
95
|
})
|
84
96
|
}, `mini_tool_btn_${type}`);
|
85
97
|
})
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import TextIcon from "../../../assets/svg/TextIcon";
|
2
2
|
import AddElementIcon from "../../../assets/svg/AddElementIcon";
|
3
3
|
import AddTemplateIcon from "../../../assets/svg/AddTemplateIcon";
|
4
|
+
import PageSettingsButton from "../../../Elements/PageSettings/PageSettingsButton";
|
4
5
|
const MENU_OPTIONS = [{
|
5
6
|
type: "textFormat",
|
6
7
|
icon: TextIcon,
|
@@ -13,5 +14,9 @@ const MENU_OPTIONS = [{
|
|
13
14
|
type: "addTemplate",
|
14
15
|
icon: AddTemplateIcon,
|
15
16
|
label: "Add Template"
|
17
|
+
}, {
|
18
|
+
type: "pageSettings",
|
19
|
+
icon: PageSettingsButton,
|
20
|
+
label: "Page Settings"
|
16
21
|
}];
|
17
22
|
export default MENU_OPTIONS;
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
2
|
+
import { activeMark, addMarkData, isBlockActive } from "../../../utils/SlateUtilityFunctions";
|
3
|
+
import { Button, IconButton, Popover, TextField } from "@mui/material";
|
4
|
+
import DownArrowIcon from "../../../assets/svg/DownArrowIcon";
|
5
|
+
import useWindowResize from "../../../hooks/useWindowResize";
|
6
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
|
7
|
+
import { headingMap, sizeMap } from "../../../utils/font";
|
8
|
+
import { useDebounce } from "use-debounce";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
const fontSizeOptions = [16, 18, 20, 22, 26, 32, 36, 40, 48, 64, 96, 128];
|
12
|
+
function SelectFontSize({
|
13
|
+
editor,
|
14
|
+
classes
|
15
|
+
}) {
|
16
|
+
const format = "fontSize";
|
17
|
+
const [fontSize, setFontSize] = useState();
|
18
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
19
|
+
const open = Boolean(anchorEl);
|
20
|
+
const containerRef = useRef();
|
21
|
+
const [size] = useWindowResize();
|
22
|
+
const val = activeMark(editor, format);
|
23
|
+
const value = getBreakPointsValue(val, size?.device);
|
24
|
+
const [deboundedValue] = useDebounce(fontSize, 500);
|
25
|
+
const updateMarkData = newVal => {
|
26
|
+
let upData = {
|
27
|
+
...getBreakPointsValue(val),
|
28
|
+
[size?.device]: `${newVal}px`
|
29
|
+
};
|
30
|
+
|
31
|
+
// if desktop update to all other devices
|
32
|
+
// to avoid default normal size
|
33
|
+
if (size?.device === "lg") {
|
34
|
+
upData = BREAKPOINTS_DEVICES.reduce((a, b) => {
|
35
|
+
a[b] = `${newVal}px`;
|
36
|
+
return a;
|
37
|
+
}, {});
|
38
|
+
}
|
39
|
+
addMarkData(editor, {
|
40
|
+
format,
|
41
|
+
value: {
|
42
|
+
...upData
|
43
|
+
}
|
44
|
+
});
|
45
|
+
};
|
46
|
+
const onChangeSize = value => {
|
47
|
+
if (value) {
|
48
|
+
let inc = parseInt(value);
|
49
|
+
inc = inc > 200 ? 200 : inc;
|
50
|
+
updateMarkData(inc);
|
51
|
+
} else {
|
52
|
+
setFontSize(null);
|
53
|
+
}
|
54
|
+
};
|
55
|
+
useEffect(() => {
|
56
|
+
if (deboundedValue) {
|
57
|
+
onChangeSize(deboundedValue);
|
58
|
+
}
|
59
|
+
}, [deboundedValue]);
|
60
|
+
const getSizeVal = () => {
|
61
|
+
try {
|
62
|
+
let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
|
63
|
+
Object.entries(headingMap).forEach(([format, value]) => {
|
64
|
+
if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
|
65
|
+
size = value;
|
66
|
+
}
|
67
|
+
});
|
68
|
+
return parseInt(size);
|
69
|
+
} catch (err) {
|
70
|
+
return "";
|
71
|
+
}
|
72
|
+
};
|
73
|
+
useEffect(() => {
|
74
|
+
setFontSize(getSizeVal());
|
75
|
+
}, [value]);
|
76
|
+
return /*#__PURE__*/_jsxs("div", {
|
77
|
+
ref: containerRef,
|
78
|
+
style: {
|
79
|
+
display: "flex",
|
80
|
+
alignItems: "center"
|
81
|
+
},
|
82
|
+
children: [/*#__PURE__*/_jsx(TextField, {
|
83
|
+
sx: classes?.miniFontSizeInput,
|
84
|
+
value: fontSize,
|
85
|
+
onChange: e => setFontSize(e.target.value),
|
86
|
+
size: "small"
|
87
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
88
|
+
onClick: e => {
|
89
|
+
e.preventDefault();
|
90
|
+
setAnchorEl(containerRef.current);
|
91
|
+
},
|
92
|
+
children: /*#__PURE__*/_jsx(DownArrowIcon, {})
|
93
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
94
|
+
open: open,
|
95
|
+
anchorEl: anchorEl,
|
96
|
+
onClose: () => setAnchorEl(null),
|
97
|
+
anchorOrigin: {
|
98
|
+
vertical: 'bottom',
|
99
|
+
horizontal: 'left'
|
100
|
+
},
|
101
|
+
sx: classes.customSelectPopoverWrapper,
|
102
|
+
children: fontSizeOptions.map((s, i) => {
|
103
|
+
return /*#__PURE__*/_jsx("div", {
|
104
|
+
children: /*#__PURE__*/_jsx(Button, {
|
105
|
+
className: `customSelectOptionLabel ${fontSize === s ? "selected" : ""}`,
|
106
|
+
onClick: () => {
|
107
|
+
setFontSize(s);
|
108
|
+
},
|
109
|
+
children: s
|
110
|
+
})
|
111
|
+
}, i);
|
112
|
+
})
|
113
|
+
})]
|
114
|
+
});
|
115
|
+
}
|
116
|
+
export default SelectFontSize;
|
@@ -12,6 +12,7 @@ import useWindowResize from "../../../hooks/useWindowResize";
|
|
12
12
|
import PopperHeader from "../PopperHeader";
|
13
13
|
import MiniColorPicker from "./MiniColorPicker";
|
14
14
|
import SelectAlignment from "./SelectAlignment";
|
15
|
+
import SelectFontSize from "./SelectFontSize";
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
18
|
const DEFAULT_COLOR = {
|
@@ -64,6 +65,11 @@ const MiniTextFormat = props => {
|
|
64
65
|
editor: editor
|
65
66
|
}), /*#__PURE__*/_jsx("div", {
|
66
67
|
className: "verticalLine mr-1"
|
68
|
+
}), /*#__PURE__*/_jsx(SelectFontSize, {
|
69
|
+
classes: classes,
|
70
|
+
editor: editor
|
71
|
+
}), /*#__PURE__*/_jsx("div", {
|
72
|
+
className: "verticalLine mr-1"
|
67
73
|
}), fontStyle?.map((m, i) => {
|
68
74
|
return /*#__PURE__*/_jsx(MarkButton, {
|
69
75
|
editor: editor,
|
@@ -102,7 +108,6 @@ const MiniTextFormat = props => {
|
|
102
108
|
TransitionProps
|
103
109
|
}) => /*#__PURE__*/_jsx(Fade, {
|
104
110
|
...TransitionProps,
|
105
|
-
timeout: 350,
|
106
111
|
children: /*#__PURE__*/_jsxs(Paper, {
|
107
112
|
style: {
|
108
113
|
borderRadius: "10px"
|
@@ -499,6 +499,9 @@ const usePopupStyle = theme => ({
|
|
499
499
|
}
|
500
500
|
},
|
501
501
|
customSelectPopoverWrapper: {
|
502
|
+
"& .MuiPopover-paper": {
|
503
|
+
maxHeight: '140px'
|
504
|
+
},
|
502
505
|
"& .customSelectOptionLabel": {
|
503
506
|
color: "black",
|
504
507
|
margin: "0px",
|
@@ -506,6 +509,8 @@ const usePopupStyle = theme => ({
|
|
506
509
|
justifyContent: "start",
|
507
510
|
paddingRight: "20px",
|
508
511
|
fontSize: "14px",
|
512
|
+
lineHeight: "1.75 !important",
|
513
|
+
fontWeight: 400,
|
509
514
|
"& :hover": {
|
510
515
|
background: "#F0F5FA !important"
|
511
516
|
},
|
@@ -529,6 +534,16 @@ const usePopupStyle = theme => ({
|
|
529
534
|
bottom: "env(safe-area-inset-bottom)",
|
530
535
|
left: 0,
|
531
536
|
width: "100%"
|
537
|
+
},
|
538
|
+
miniFontSizeInput: {
|
539
|
+
"& input": {
|
540
|
+
fontSize: "14px",
|
541
|
+
width: "16px",
|
542
|
+
padding: "8px 4px"
|
543
|
+
},
|
544
|
+
"& fieldset": {
|
545
|
+
border: "none !important"
|
546
|
+
}
|
532
547
|
}
|
533
548
|
});
|
534
549
|
export default usePopupStyle;
|
@@ -7,6 +7,7 @@ import useDrag from "../../hooks/useDrag";
|
|
7
7
|
import { TableUtil } from "../../utils/table";
|
8
8
|
import useWindowResize from "../../hooks/useWindowResize";
|
9
9
|
import MiniTextFormat from "./MiniTextFormat";
|
10
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
12
13
|
const PopupTool = props => {
|
@@ -15,6 +16,9 @@ const PopupTool = props => {
|
|
15
16
|
setIsTextSelected
|
16
17
|
} = props;
|
17
18
|
const classes = usePopupStyle(theme);
|
19
|
+
const {
|
20
|
+
setPopupType
|
21
|
+
} = useEditorContext();
|
18
22
|
const [anchorEl, setAnchorEl] = useState(null);
|
19
23
|
const [open, setOpen] = useState(false);
|
20
24
|
const editor = useSlate();
|
@@ -32,10 +36,12 @@ const PopupTool = props => {
|
|
32
36
|
const isCellsSelected = table.isCellSelected(editor.selection);
|
33
37
|
if (!isCellsSelected) {
|
34
38
|
setOpen(true);
|
39
|
+
setPopupType("textFormat");
|
35
40
|
setIsTextSelected(true);
|
36
41
|
}
|
37
42
|
} else if (!anchorEl) {
|
38
43
|
setOpen(false);
|
44
|
+
setPopupType("");
|
39
45
|
setIsTextSelected(false);
|
40
46
|
}
|
41
47
|
}, [event, anchorEl]);
|
@@ -65,6 +71,7 @@ const PopupTool = props => {
|
|
65
71
|
const handleClose = () => {
|
66
72
|
setAnchorEl(null);
|
67
73
|
setOpen(false);
|
74
|
+
setPopupType("");
|
68
75
|
};
|
69
76
|
return open ? /*#__PURE__*/_jsx(_Fragment, {
|
70
77
|
children: size.device === "xs" ? /*#__PURE__*/_jsx("div", {
|
@@ -86,7 +93,6 @@ const PopupTool = props => {
|
|
86
93
|
TransitionProps
|
87
94
|
}) => /*#__PURE__*/_jsx(Fade, {
|
88
95
|
...TransitionProps,
|
89
|
-
timeout: 350,
|
90
96
|
children: /*#__PURE__*/_jsx(Paper, {
|
91
97
|
style: {
|
92
98
|
borderRadius: "10px"
|
@@ -243,9 +243,11 @@ export const toolbarGroups = [[{
|
|
243
243
|
format: "form",
|
244
244
|
type: "form",
|
245
245
|
group: "elements"
|
246
|
-
}
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
246
|
+
}
|
247
|
+
// {
|
248
|
+
// id: 33,
|
249
|
+
// format: "pageSettings",
|
250
|
+
// type: "page-settings",
|
251
|
+
// group: "elements",
|
252
|
+
// },
|
253
|
+
]];
|
@@ -10,7 +10,8 @@ const ColorPickerButton = props => {
|
|
10
10
|
value,
|
11
11
|
onSave,
|
12
12
|
defaultColors = [],
|
13
|
-
classes = {}
|
13
|
+
classes = {},
|
14
|
+
recentColors = []
|
14
15
|
} = props;
|
15
16
|
const [anchorEl, setAnchorEl] = useState(null);
|
16
17
|
const [color, setColor] = useState(value);
|
@@ -25,6 +26,9 @@ const ColorPickerButton = props => {
|
|
25
26
|
const handleClose = () => {
|
26
27
|
setAnchorEl(null);
|
27
28
|
};
|
29
|
+
const handleColorChange = color => {
|
30
|
+
setColor(color);
|
31
|
+
};
|
28
32
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
29
33
|
children: [/*#__PURE__*/_jsx(Button, {
|
30
34
|
style: {
|
@@ -59,8 +63,8 @@ const ColorPickerButton = props => {
|
|
59
63
|
children: /*#__PURE__*/_jsx(ColorPickerTool, {
|
60
64
|
gradient: true,
|
61
65
|
value: color,
|
62
|
-
onChange:
|
63
|
-
defaultColors: defaultColors || []
|
66
|
+
onChange: handleColorChange,
|
67
|
+
defaultColors: [...recentColors, ...defaultColors] || []
|
64
68
|
})
|
65
69
|
}), /*#__PURE__*/_jsxs("div", {
|
66
70
|
style: {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from "react";
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
2
|
import { Grid, TextField, InputAdornment, Typography } from "@mui/material";
|
3
3
|
import ColorPickerButton from "../../ColorPickerButton";
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -14,10 +14,32 @@ const Color = props => {
|
|
14
14
|
key,
|
15
15
|
label
|
16
16
|
} = data;
|
17
|
+
const [recentColors, setRecentColors] = useState({});
|
18
|
+
useEffect(() => {
|
19
|
+
const storedColors = JSON.parse(localStorage.getItem('recentColors'));
|
20
|
+
if (storedColors) {
|
21
|
+
setRecentColors(storedColors);
|
22
|
+
}
|
23
|
+
}, []);
|
17
24
|
const onSave = color => {
|
18
25
|
onChange({
|
19
26
|
[key]: color
|
20
27
|
});
|
28
|
+
let updatedColors = [];
|
29
|
+
if (recentColors[key]) {
|
30
|
+
updatedColors = [color, ...recentColors[key]?.filter(c => c !== color)];
|
31
|
+
} else {
|
32
|
+
updatedColors?.unshift(color);
|
33
|
+
}
|
34
|
+
if (updatedColors?.length > 10) {
|
35
|
+
updatedColors?.pop();
|
36
|
+
}
|
37
|
+
updatedColors = {
|
38
|
+
...recentColors,
|
39
|
+
[key]: updatedColors
|
40
|
+
};
|
41
|
+
setRecentColors(updatedColors);
|
42
|
+
localStorage.setItem('recentColors', JSON.stringify(updatedColors));
|
21
43
|
};
|
22
44
|
return /*#__PURE__*/_jsxs(Grid, {
|
23
45
|
item: true,
|
@@ -45,7 +67,8 @@ const Color = props => {
|
|
45
67
|
children: /*#__PURE__*/_jsx(ColorPickerButton, {
|
46
68
|
classes: classes,
|
47
69
|
value: value,
|
48
|
-
onSave: onSave
|
70
|
+
onSave: onSave,
|
71
|
+
recentColors: recentColors[key]
|
49
72
|
})
|
50
73
|
})
|
51
74
|
}
|
@@ -17,7 +17,7 @@ const ToolbarIcon = props => {
|
|
17
17
|
children: /*#__PURE__*/_jsx(Typography, {
|
18
18
|
sx: {
|
19
19
|
fontSize: '14px',
|
20
|
-
fontWeight:
|
20
|
+
fontWeight: 400
|
21
21
|
},
|
22
22
|
children: title
|
23
23
|
})
|
@@ -27,7 +27,7 @@ const ToolbarIcon = props => {
|
|
27
27
|
children: /*#__PURE__*/_jsx(Typography, {
|
28
28
|
sx: {
|
29
29
|
fontSize: '14px',
|
30
|
-
fontWeight:
|
30
|
+
fontWeight: 400
|
31
31
|
},
|
32
32
|
children: title
|
33
33
|
})
|
@@ -855,30 +855,35 @@ export const Carousal = props => /*#__PURE__*/_jsxs("svg", {
|
|
855
855
|
fill: "#64748B"
|
856
856
|
})]
|
857
857
|
});
|
858
|
-
export const PageSettings = props => /*#__PURE__*/_jsxs("svg", {
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
viewBox: "0 0 17 17",
|
858
|
+
export const PageSettings = (props = {}) => /*#__PURE__*/_jsxs("svg", {
|
859
|
+
width: "16",
|
860
|
+
height: "16",
|
861
|
+
viewBox: "0 0 16 16",
|
863
862
|
fill: "none",
|
863
|
+
xmlns: "http://www.w3.org/2000/svg",
|
864
|
+
...props,
|
864
865
|
children: [/*#__PURE__*/_jsx("path", {
|
865
|
-
d: "
|
866
|
-
fill: "#
|
866
|
+
d: "M13.2386 0.535156H2.76091C2.30289 0.535814 1.86383 0.718051 1.53996 1.04192C1.2161 1.36578 1.03386 1.80485 1.0332 2.26286V11.7453C1.03386 12.2033 1.2161 12.6424 1.53996 12.9663C1.86383 13.2901 2.30289 13.4724 2.76091 13.473H4.29405C4.30918 13.5774 4.3571 13.6743 4.43089 13.7497L5.23503 14.5539C5.3155 14.6344 5.42114 14.6849 5.53434 14.6969C5.64753 14.7089 5.76143 14.6818 5.85704 14.62L6.42979 14.2498C6.5507 14.308 6.67481 14.3594 6.80151 14.4036L6.94482 15.0704C6.96871 15.1816 7.02999 15.2813 7.11846 15.3528C7.20692 15.4243 7.31722 15.4634 7.43099 15.4635H8.56852C8.68229 15.4634 8.79259 15.4243 8.88105 15.3528C8.96952 15.2813 9.0308 15.1816 9.05469 15.0704L9.198 14.4036C9.32471 14.3594 9.44881 14.308 9.56972 14.2498L10.1425 14.62C10.2381 14.6818 10.352 14.7089 10.4652 14.6969C10.5784 14.6849 10.684 14.6344 10.7645 14.5539L11.5686 13.7497C11.6424 13.6743 11.6903 13.5774 11.7055 13.473H13.2386C13.6966 13.4724 14.1357 13.2901 14.4595 12.9663C14.7834 12.6424 14.9657 12.2033 14.9663 11.7453V2.26286C14.9657 1.80485 14.7834 1.36578 14.4595 1.04192C14.1357 0.718051 13.6966 0.535814 13.2386 0.535156ZM2.76091 1.53038H13.2386C13.4328 1.53051 13.6191 1.60772 13.7564 1.74506C13.8937 1.8824 13.971 2.06864 13.9711 2.26286V3.52082H2.02842V2.26286C2.02856 2.06864 2.10577 1.8824 2.24311 1.74506C2.38045 1.60772 2.56668 1.53051 2.76091 1.53038ZM10.345 13.5656L9.8643 13.2546C9.78643 13.2042 9.696 13.1765 9.60323 13.1747C9.51047 13.173 9.41906 13.1972 9.33932 13.2446C9.12471 13.3725 8.89275 13.4687 8.65063 13.5303C8.56076 13.553 8.47904 13.6005 8.41468 13.6672C8.35032 13.7339 8.30588 13.8173 8.28638 13.908L8.16596 14.4683H7.83355L7.71313 13.908C7.69363 13.8173 7.64919 13.7339 7.58483 13.6672C7.52047 13.6005 7.43875 13.553 7.34888 13.5303C7.10676 13.4687 6.8748 13.3725 6.66019 13.2446C6.58045 13.1972 6.48904 13.173 6.39628 13.1747C6.30351 13.1765 6.21308 13.2042 6.13521 13.2546L5.65452 13.5656L5.41915 13.3302L5.73015 12.8495C5.78059 12.7717 5.80825 12.6812 5.81001 12.5885C5.81177 12.4957 5.78755 12.4043 5.7401 12.3246C5.61223 12.1099 5.51603 11.878 5.45448 11.6359C5.4317 11.546 5.38428 11.4643 5.31754 11.3999C5.25081 11.3355 5.16743 11.2911 5.07679 11.2716L4.51648 11.1512V10.8188L5.07679 10.6984C5.16743 10.6789 5.25081 10.6344 5.31754 10.5701C5.38428 10.5057 5.4317 10.424 5.45448 10.3341C5.51603 10.092 5.61223 9.86003 5.7401 9.64542C5.78755 9.56568 5.81177 9.47427 5.81001 9.38151C5.80825 9.28874 5.78059 9.19831 5.73015 9.12044L5.41915 8.63975L5.65452 8.40438L6.13521 8.71538C6.21308 8.76582 6.30351 8.79348 6.39628 8.79524C6.48904 8.797 6.58045 8.77278 6.66019 8.72533C6.8748 8.59746 7.10676 8.50126 7.34888 8.43971C7.43875 8.41693 7.52047 8.36951 7.58483 8.30277C7.64919 8.23604 7.69363 8.15266 7.71313 8.06202L7.83355 7.50171H8.16596L8.28638 8.06202C8.30588 8.15266 8.35032 8.23604 8.41468 8.30277C8.47904 8.36951 8.56076 8.41693 8.65063 8.43971C8.89275 8.50126 9.12471 8.59746 9.33932 8.72533C9.41906 8.77278 9.51047 8.797 9.60323 8.79524C9.696 8.79348 9.78643 8.76582 9.8643 8.71538L10.345 8.40438L10.5804 8.63975L10.2694 9.12044C10.2189 9.19831 10.1913 9.28874 10.1895 9.38151C10.1877 9.47427 10.212 9.56568 10.2594 9.64542C10.3873 9.86003 10.4835 10.092 10.545 10.3341C10.5678 10.424 10.6152 10.5057 10.682 10.5701C10.7487 10.6344 10.8321 10.6789 10.9227 10.6984L11.483 10.8188V11.1512L10.9227 11.2716C10.8321 11.2911 10.7487 11.3355 10.682 11.3999C10.6152 11.4643 10.5678 11.546 10.545 11.6359C10.4835 11.878 10.3873 12.1099 10.2594 12.3246C10.212 12.4043 10.1877 12.4957 10.1895 12.5885C10.1913 12.6812 10.2189 12.7717 10.2694 12.8495L10.5804 13.3302L10.345 13.5656ZM11.7132 12.4001L11.7055 13.473C11.7493 13.3735 11.385 12.2838 11.4198 12.1832L12.0866 12.0399C12.1979 12.016 12.2975 11.9547 12.3691 11.8663C12.4406 11.7778 12.4797 11.6675 12.4797 11.5538V10.4162C12.4797 10.3025 12.4406 10.1921 12.3691 10.1037C12.2975 10.0152 12.1979 9.95394 12.0866 9.93005L11.4198 9.78674C11.3756 9.66004 11.3243 9.53593 11.2661 9.41502L11.6363 8.84227C11.6981 8.74666 11.7252 8.63276 11.7132 8.51957C11.7011 8.40637 11.6506 8.30073 11.5701 8.22026L10.766 7.41612C10.6855 7.33561 10.5799 7.28512 10.4667 7.27307C10.3535 7.26103 10.2396 7.28816 10.144 7.34994L9.57121 7.72016C9.4503 7.66194 9.3262 7.61061 9.1995 7.5664L9.05618 6.8996C9.03229 6.78837 8.97101 6.68869 8.88255 6.61716C8.79408 6.54563 8.68378 6.50657 8.57002 6.50649H7.43099C7.31722 6.50657 7.20692 6.54563 7.11846 6.61716C7.02999 6.68869 6.96871 6.78837 6.94482 6.8996L6.80151 7.5664C6.67481 7.61061 6.5507 7.66194 6.42979 7.72016L5.85704 7.35243C5.76143 7.29065 5.64753 7.26352 5.53434 7.27556C5.42114 7.28761 5.3155 7.3381 5.23503 7.41861L4.43089 8.22026C4.35038 8.30073 4.29989 8.40637 4.28784 8.51957C4.2758 8.63276 4.30293 8.74666 4.36471 8.84227L4.73493 9.41502C4.67671 9.53593 4.62538 9.66004 4.58117 9.78674L3.91437 9.93005C3.80314 9.95394 3.70346 10.0152 3.63193 10.1037C3.5604 10.1921 3.52134 10.3025 3.52126 10.4162V11.5538C3.52134 11.6675 3.5604 11.7778 3.63193 11.8663C3.70346 11.9547 3.80314 12.016 3.91437 12.0399L4.58117 12.1832C4.616 12.2828 4.25026 13.3775 4.29405 13.473V12.5C4.19775 12.5001 2.57072 12.4591 2.48171 12.4224C2.3927 12.3856 2.3118 12.3317 2.24364 12.2637C2.17548 12.1956 2.12138 12.1148 2.08446 12.0259C2.04753 11.937 2.02849 11.8416 2.02842 11.7453V4.51604H13.9711V11.7453C13.971 11.9396 13.8937 12.1258 13.7564 12.2631C13.6191 12.4005 11.9074 12.4 11.7132 12.4001Z",
|
867
|
+
fill: "#64748A"
|
867
868
|
}), /*#__PURE__*/_jsx("path", {
|
868
|
-
d: "
|
869
|
-
|
870
|
-
|
871
|
-
d: "M14.8013 3.24464C15.0982 3.24464 15.3388 2.9352 15.3388 2.55347C15.3388 2.17175 15.0982 1.8623 14.8013 1.8623C14.5044 1.8623 14.2637 2.17175 14.2637 2.55347C14.2637 2.9352 14.5044 3.24464 14.8013 3.24464Z",
|
872
|
-
fill: "#64748B"
|
869
|
+
d: "M4.29405 13.473H2.76091C2.30289 13.4724 1.86383 13.2901 1.53996 12.9663C1.2161 12.6424 1.03386 12.2033 1.0332 11.7453V2.26286C1.03386 1.80485 1.2161 1.36578 1.53996 1.04192C1.86383 0.718051 2.30289 0.535814 2.76091 0.535156H13.2386C13.6966 0.535814 14.1357 0.718051 14.4595 1.04192C14.7834 1.36578 14.9657 1.80485 14.9663 2.26286V11.7453C14.9657 12.2033 14.7834 12.6424 14.4595 12.9663C14.1357 13.2901 13.6966 13.4724 13.2386 13.473H11.7055M4.29405 13.473C4.30918 13.5774 4.3571 13.6743 4.43089 13.7497L5.23503 14.5539C5.3155 14.6344 5.42114 14.6849 5.53434 14.6969C5.64753 14.7089 5.76143 14.6818 5.85704 14.62L6.42979 14.2498C6.5507 14.308 6.67481 14.3594 6.80151 14.4036L6.94482 15.0704C6.96871 15.1816 7.02999 15.2813 7.11846 15.3528C7.20692 15.4243 7.31722 15.4634 7.43099 15.4635H8.56852C8.68229 15.4634 8.79259 15.4243 8.88105 15.3528C8.96952 15.2813 9.0308 15.1816 9.05469 15.0704L9.198 14.4036C9.32471 14.3594 9.44881 14.308 9.56972 14.2498L10.1425 14.62C10.2381 14.6818 10.352 14.7089 10.4652 14.6969C10.5784 14.6849 10.684 14.6344 10.7645 14.5539L11.5686 13.7497C11.6424 13.6743 11.6903 13.5774 11.7055 13.473M4.29405 13.473C4.25026 13.3775 4.616 12.2828 4.58117 12.1832L3.91437 12.0399C3.80314 12.016 3.70346 11.9547 3.63193 11.8663C3.5604 11.7778 3.52134 11.6675 3.52126 11.5538V10.4162C3.52134 10.3025 3.5604 10.1921 3.63193 10.1037C3.70346 10.0152 3.80314 9.95394 3.91437 9.93005L4.58117 9.78674C4.62538 9.66004 4.67671 9.53593 4.73493 9.41502L4.36471 8.84227C4.30293 8.74666 4.2758 8.63276 4.28784 8.51957C4.29989 8.40637 4.35038 8.30073 4.43089 8.22026L5.23503 7.41861C5.3155 7.3381 5.42114 7.28761 5.53434 7.27556C5.64753 7.26352 5.76143 7.29065 5.85704 7.35243L6.42979 7.72016C6.5507 7.66194 6.67481 7.61061 6.80151 7.5664L6.94482 6.8996C6.96871 6.78837 7.02999 6.68869 7.11846 6.61716C7.20692 6.54563 7.31722 6.50657 7.43099 6.50649H8.57002C8.68378 6.50657 8.79408 6.54563 8.88255 6.61716C8.97101 6.68869 9.03229 6.78837 9.05618 6.8996L9.1995 7.5664C9.3262 7.61061 9.4503 7.66194 9.57121 7.72016L10.144 7.34994C10.2396 7.28816 10.3535 7.26103 10.4667 7.27307C10.5799 7.28512 10.6855 7.33561 10.766 7.41612L11.5701 8.22026C11.6506 8.30073 11.7011 8.40637 11.7132 8.51957C11.7252 8.63276 11.6981 8.74666 11.6363 8.84227L11.2661 9.41502C11.3243 9.53593 11.3756 9.66004 11.4198 9.78674L12.0866 9.93005C12.1979 9.95394 12.2975 10.0152 12.3691 10.1037C12.4406 10.1921 12.4797 10.3025 12.4797 10.4162V11.5538C12.4797 11.6675 12.4406 11.7778 12.3691 11.8663C12.2975 11.9547 12.1979 12.016 12.0866 12.0399L11.4198 12.1832C11.385 12.2838 11.7493 13.3735 11.7055 13.473M4.29405 13.473V12.5C4.19775 12.5001 2.57072 12.4591 2.48171 12.4224C2.3927 12.3856 2.3118 12.3317 2.24364 12.2637C2.17548 12.1956 2.12138 12.1148 2.08446 12.0259C2.04753 11.937 2.02849 11.8416 2.02842 11.7453V4.51604H13.9711V11.7453C13.971 11.9396 13.8937 12.1258 13.7564 12.2631C13.6191 12.4005 11.9074 12.4 11.7132 12.4001L11.7055 13.473M2.76091 1.53038H13.2386C13.4328 1.53051 13.6191 1.60772 13.7564 1.74506C13.8937 1.8824 13.971 2.06864 13.9711 2.26286V3.52082H2.02842V2.26286C2.02856 2.06864 2.10577 1.8824 2.24311 1.74506C2.38045 1.60772 2.56668 1.53051 2.76091 1.53038ZM10.345 13.5656L9.8643 13.2546C9.78643 13.2042 9.696 13.1765 9.60323 13.1747C9.51047 13.173 9.41906 13.1972 9.33932 13.2446C9.12471 13.3725 8.89275 13.4687 8.65063 13.5303C8.56076 13.553 8.47904 13.6005 8.41468 13.6672C8.35032 13.7339 8.30588 13.8173 8.28638 13.908L8.16596 14.4683H7.83355L7.71313 13.908C7.69363 13.8173 7.64919 13.7339 7.58483 13.6672C7.52047 13.6005 7.43875 13.553 7.34888 13.5303C7.10676 13.4687 6.8748 13.3725 6.66019 13.2446C6.58045 13.1972 6.48904 13.173 6.39628 13.1747C6.30351 13.1765 6.21308 13.2042 6.13521 13.2546L5.65452 13.5656L5.41915 13.3302L5.73015 12.8495C5.78059 12.7717 5.80825 12.6812 5.81001 12.5885C5.81177 12.4957 5.78755 12.4043 5.7401 12.3246C5.61223 12.1099 5.51603 11.878 5.45448 11.6359C5.4317 11.546 5.38428 11.4643 5.31754 11.3999C5.25081 11.3355 5.16743 11.2911 5.07679 11.2716L4.51648 11.1512V10.8188L5.07679 10.6984C5.16743 10.6789 5.25081 10.6344 5.31754 10.5701C5.38428 10.5057 5.4317 10.424 5.45448 10.3341C5.51603 10.092 5.61223 9.86003 5.7401 9.64542C5.78755 9.56568 5.81177 9.47427 5.81001 9.38151C5.80825 9.28874 5.78059 9.19831 5.73015 9.12044L5.41915 8.63975L5.65452 8.40438L6.13521 8.71538C6.21308 8.76582 6.30351 8.79348 6.39628 8.79524C6.48904 8.797 6.58045 8.77278 6.66019 8.72533C6.8748 8.59746 7.10676 8.50126 7.34888 8.43971C7.43875 8.41693 7.52047 8.36951 7.58483 8.30277C7.64919 8.23604 7.69363 8.15266 7.71313 8.06202L7.83355 7.50171H8.16596L8.28638 8.06202C8.30588 8.15266 8.35032 8.23604 8.41468 8.30277C8.47904 8.36951 8.56076 8.41693 8.65063 8.43971C8.89275 8.50126 9.12471 8.59746 9.33932 8.72533C9.41906 8.77278 9.51047 8.797 9.60323 8.79524C9.696 8.79348 9.78643 8.76582 9.8643 8.71538L10.345 8.40438L10.5804 8.63975L10.2694 9.12044C10.2189 9.19831 10.1913 9.28874 10.1895 9.38151C10.1877 9.47427 10.212 9.56568 10.2594 9.64542C10.3873 9.86003 10.4835 10.092 10.545 10.3341C10.5678 10.424 10.6152 10.5057 10.682 10.5701C10.7487 10.6344 10.8321 10.6789 10.9227 10.6984L11.483 10.8188V11.1512L10.9227 11.2716C10.8321 11.2911 10.7487 11.3355 10.682 11.3999C10.6152 11.4643 10.5678 11.546 10.545 11.6359C10.4835 11.878 10.3873 12.1099 10.2594 12.3246C10.212 12.4043 10.1877 12.4957 10.1895 12.5885C10.1913 12.6812 10.2189 12.7717 10.2694 12.8495L10.5804 13.3302L10.345 13.5656Z",
|
870
|
+
stroke: "white",
|
871
|
+
strokeWidth: "0.1"
|
873
872
|
}), /*#__PURE__*/_jsx("path", {
|
874
|
-
d: "
|
875
|
-
fill: "#
|
873
|
+
d: "M3.52105 3.02257C3.79587 3.02257 4.01866 2.79978 4.01866 2.52495C4.01866 2.25013 3.79587 2.02734 3.52105 2.02734C3.24623 2.02734 3.02344 2.25013 3.02344 2.52495C3.02344 2.79978 3.24623 3.02257 3.52105 3.02257Z",
|
874
|
+
fill: "#64748A",
|
875
|
+
stroke: "white",
|
876
|
+
strokeWidth: "0.1"
|
876
877
|
}), /*#__PURE__*/_jsx("path", {
|
877
|
-
d: "
|
878
|
-
fill: "#
|
878
|
+
d: "M5.01421 3.02257C5.28904 3.02257 5.51182 2.79978 5.51182 2.52495C5.51182 2.25013 5.28904 2.02734 5.01421 2.02734C4.73939 2.02734 4.5166 2.25013 4.5166 2.52495C4.5166 2.79978 4.73939 3.02257 5.01421 3.02257Z",
|
879
|
+
fill: "#64748A",
|
880
|
+
stroke: "white",
|
881
|
+
strokeWidth: "0.1"
|
879
882
|
}), /*#__PURE__*/_jsx("path", {
|
880
|
-
d: "
|
881
|
-
fill: "#
|
883
|
+
d: "M7.99972 8.99414C7.60605 8.99414 7.22122 9.11088 6.89389 9.32959C6.56656 9.5483 6.31144 9.85917 6.16079 10.2229C6.01014 10.5866 5.97072 10.9868 6.04752 11.3729C6.12433 11.759 6.3139 12.1137 6.59227 12.392C6.87063 12.6704 7.2253 12.86 7.61141 12.9368C7.99751 13.0136 8.39773 12.9742 8.76143 12.8235C9.12514 12.6729 9.436 12.4177 9.65472 12.0904C9.87343 11.7631 9.99017 11.3783 9.99017 10.9846C9.99017 10.4567 9.78046 9.95041 9.40718 9.57713C9.0339 9.20385 8.52762 8.99414 7.99972 8.99414ZM7.99972 11.9798C7.80289 11.9798 7.61047 11.9214 7.44681 11.8121C7.28314 11.7027 7.15558 11.5473 7.08026 11.3654C7.00493 11.1836 6.98522 10.9835 7.02362 10.7904C7.06202 10.5974 7.15681 10.42 7.29599 10.2809C7.43518 10.1417 7.61251 10.0469 7.80556 10.0085C7.99862 9.97008 8.19872 9.98979 8.38058 10.0651C8.56243 10.1404 8.71786 10.268 8.82722 10.4317C8.93658 10.5953 8.99494 10.7877 8.99494 10.9846C8.99494 11.2485 8.89009 11.5017 8.70345 11.6883C8.51681 11.875 8.26367 11.9798 7.99972 11.9798Z",
|
884
|
+
fill: "#64748A",
|
885
|
+
stroke: "white",
|
886
|
+
strokeWidth: "0.1"
|
882
887
|
})]
|
883
888
|
});
|
884
889
|
export const TextLeftAlign = props => /*#__PURE__*/_jsxs("svg", {
|
@@ -39,7 +39,22 @@ const useCommonStyle = theme => ({
|
|
39
39
|
}
|
40
40
|
},
|
41
41
|
"& .colorpicker": {
|
42
|
-
backgroundColor: theme?.palette?.editor?.background
|
42
|
+
backgroundColor: theme?.palette?.editor?.background,
|
43
|
+
"& .default-color-panel": {
|
44
|
+
display: "grid",
|
45
|
+
gridTemplateColumns: "repeat(auto-fill, 20px)",
|
46
|
+
gridGap: "3px",
|
47
|
+
justifyContent: "space-between",
|
48
|
+
margin: "14px -16px 0px -16px",
|
49
|
+
padding: "2px 16px 0px 16px",
|
50
|
+
overflow: "auto",
|
51
|
+
maxHeight: "105px",
|
52
|
+
"& .default-color-panel_item": {
|
53
|
+
height: '20px',
|
54
|
+
width: '20px',
|
55
|
+
border: '1px solid #E2E8F0'
|
56
|
+
}
|
57
|
+
}
|
43
58
|
},
|
44
59
|
"& .color-picker-panel": {
|
45
60
|
backgroundColor: theme?.palette?.editor?.background
|
@@ -26,6 +26,8 @@ export const EditorProvider = ({
|
|
26
26
|
const [drop, setDrop] = useState(0);
|
27
27
|
const [selectedPath, setSelectedPath] = useState(null);
|
28
28
|
const path = event?.target?.getAttribute("data-path");
|
29
|
+
const [popupType, setPopupType] = useState(""); // opened popup name in the editor will be stored
|
30
|
+
|
29
31
|
const onDrop = () => {
|
30
32
|
setDrop(drop + 1);
|
31
33
|
};
|
@@ -48,7 +50,9 @@ export const EditorProvider = ({
|
|
48
50
|
drop,
|
49
51
|
theme: theme,
|
50
52
|
selectedPath: selectedPath,
|
51
|
-
setSelectedPath: setSelectedPath
|
53
|
+
setSelectedPath: setSelectedPath,
|
54
|
+
popupType,
|
55
|
+
setPopupType
|
52
56
|
},
|
53
57
|
children: children
|
54
58
|
});
|
@@ -319,11 +319,15 @@ export const getBlock = props => {
|
|
319
319
|
children: children
|
320
320
|
});
|
321
321
|
case "list-item":
|
322
|
+
const firstChildren = element.children[0] || {};
|
322
323
|
return /*#__PURE__*/_jsx("li", {
|
323
324
|
...attributes,
|
324
325
|
...element.attr,
|
325
326
|
className: `content-editable ${isEmpty ? "empty" : ""}`,
|
326
327
|
placeholder: "List",
|
328
|
+
style: {
|
329
|
+
color: firstChildren?.color
|
330
|
+
},
|
327
331
|
children: children
|
328
332
|
});
|
329
333
|
case "orderedList":
|