@flozy/editor 2.1.1 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +16 -3
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +21 -7
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +18 -10
- package/dist/Editor/Elements/Color Picker/colorPicker.svg +14 -0
- package/dist/Editor/Elements/Embed/Image.js +13 -2
- package/dist/Editor/Elements/Form/Form.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +1 -0
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +7 -2
- package/dist/Editor/Elements/Form/Workflow/index.js +3 -3
- package/dist/Editor/Elements/Grid/Grid.js +4 -3
- package/dist/Editor/Styles/EditorStyles.js +7 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +46 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +41 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +72 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +92 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +172 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +124 -0
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +73 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +34 -34
- package/dist/Editor/assets/svg/DownArrowIcon.js +16 -0
- package/dist/Editor/assets/svg/PaintIcon.js +15 -0
- package/dist/Editor/assets/svg/TextToolIcon.js +32 -0
- package/dist/Editor/common/StyleBuilder/embedImageStyle.js +10 -0
- package/dist/Editor/plugins/withHTML.js +2 -2
- package/dist/Editor/service/formSubmit.js +2 -1
- package/package.json +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat.js +0 -419
@@ -0,0 +1,172 @@
|
|
1
|
+
import { useMemo } from "react";
|
2
|
+
import { activeMark, addMarkData, isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
|
3
|
+
import CustomSelectTool from "./CustomSelectTool";
|
4
|
+
import useWindowResize from "../../../hooks/useWindowResize";
|
5
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
|
6
|
+
import { sizeMap } from "../../../utils/font";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
function Label({
|
10
|
+
label,
|
11
|
+
type
|
12
|
+
}) {
|
13
|
+
return /*#__PURE__*/_jsxs("span", {
|
14
|
+
children: [/*#__PURE__*/_jsx("strong", {
|
15
|
+
children: label
|
16
|
+
}), " ", type]
|
17
|
+
});
|
18
|
+
}
|
19
|
+
function DisplayHeaderLabel({
|
20
|
+
type
|
21
|
+
}) {
|
22
|
+
return /*#__PURE__*/_jsxs("div", {
|
23
|
+
children: ["H", /*#__PURE__*/_jsx("sub", {
|
24
|
+
children: type
|
25
|
+
})]
|
26
|
+
});
|
27
|
+
}
|
28
|
+
const typographyOptions = [{
|
29
|
+
id: 11,
|
30
|
+
format: "headingOne",
|
31
|
+
type: "block",
|
32
|
+
title: /*#__PURE__*/_jsx(Label, {
|
33
|
+
label: "H1",
|
34
|
+
type: "Header"
|
35
|
+
}),
|
36
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
37
|
+
type: 1
|
38
|
+
}),
|
39
|
+
group: "typography",
|
40
|
+
value: "headingOne"
|
41
|
+
}, {
|
42
|
+
id: 12,
|
43
|
+
format: "headingTwo",
|
44
|
+
type: "block",
|
45
|
+
title: /*#__PURE__*/_jsx(Label, {
|
46
|
+
label: "H2",
|
47
|
+
type: "Header"
|
48
|
+
}),
|
49
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
50
|
+
type: 2
|
51
|
+
}),
|
52
|
+
group: "typography",
|
53
|
+
value: "headingTwo"
|
54
|
+
}, {
|
55
|
+
id: 13,
|
56
|
+
format: "headingThree",
|
57
|
+
type: "block",
|
58
|
+
title: /*#__PURE__*/_jsx(Label, {
|
59
|
+
label: "H3",
|
60
|
+
type: "Header"
|
61
|
+
}),
|
62
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
63
|
+
type: 3
|
64
|
+
}),
|
65
|
+
group: "typography",
|
66
|
+
value: "headingThree"
|
67
|
+
}, {
|
68
|
+
id: 14,
|
69
|
+
format: "fontSize",
|
70
|
+
type: "mark",
|
71
|
+
title: /*#__PURE__*/_jsx(Label, {
|
72
|
+
label: "L",
|
73
|
+
type: "Large"
|
74
|
+
}),
|
75
|
+
label: "L",
|
76
|
+
group: "typography",
|
77
|
+
value: "huge"
|
78
|
+
}, {
|
79
|
+
id: 15,
|
80
|
+
format: "fontSize",
|
81
|
+
type: "mark",
|
82
|
+
title: /*#__PURE__*/_jsx(Label, {
|
83
|
+
label: "M",
|
84
|
+
type: "Medium"
|
85
|
+
}),
|
86
|
+
label: "M",
|
87
|
+
group: "typography",
|
88
|
+
value: "medium"
|
89
|
+
}, {
|
90
|
+
id: 16,
|
91
|
+
format: "fontSize",
|
92
|
+
type: "mark",
|
93
|
+
title: /*#__PURE__*/_jsx(Label, {
|
94
|
+
label: "S",
|
95
|
+
type: "Small"
|
96
|
+
}),
|
97
|
+
label: "S",
|
98
|
+
group: "typography",
|
99
|
+
value: "small"
|
100
|
+
}];
|
101
|
+
function SelectTypography({
|
102
|
+
editor,
|
103
|
+
classes,
|
104
|
+
closeMainPopup
|
105
|
+
}) {
|
106
|
+
const [size] = useWindowResize();
|
107
|
+
const updateMarkData = newVal => {
|
108
|
+
const val = activeMark(editor, "fontSize");
|
109
|
+
let upData = {
|
110
|
+
...getBreakPointsValue(val),
|
111
|
+
[size?.device]: `${newVal}px`
|
112
|
+
};
|
113
|
+
|
114
|
+
// if desktop update to all other devices
|
115
|
+
// to avoid default normal size
|
116
|
+
if (size?.device === "lg") {
|
117
|
+
upData = BREAKPOINTS_DEVICES.reduce((a, b) => {
|
118
|
+
a[b] = `${newVal}px`;
|
119
|
+
return a;
|
120
|
+
}, {});
|
121
|
+
}
|
122
|
+
addMarkData(editor, {
|
123
|
+
format: "fontSize",
|
124
|
+
value: {
|
125
|
+
...upData
|
126
|
+
}
|
127
|
+
});
|
128
|
+
closeMainPopup();
|
129
|
+
};
|
130
|
+
const selectedBlock = useMemo(() => {
|
131
|
+
return typographyOptions.find(t => {
|
132
|
+
if (t.type === "block") {
|
133
|
+
return isBlockActive(editor, t.format);
|
134
|
+
} else if (t.type === "mark") {
|
135
|
+
const val = activeMark(editor, t.format);
|
136
|
+
if (val) {
|
137
|
+
const value = getBreakPointsValue(val, size?.device);
|
138
|
+
let selected;
|
139
|
+
Object.entries(sizeMap).forEach(([key, v]) => {
|
140
|
+
if (v === value) {
|
141
|
+
selected = key;
|
142
|
+
}
|
143
|
+
});
|
144
|
+
return selected === t.value;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
});
|
148
|
+
}, [typographyOptions, activeMark, isBlockActive, editor]);
|
149
|
+
const onChange = (format, option) => {
|
150
|
+
// add/reset block elements
|
151
|
+
toggleBlock(editor, format);
|
152
|
+
if (option.type === "block") {
|
153
|
+
// reset old font size
|
154
|
+
addMarkData(editor, {
|
155
|
+
format: "fontSize",
|
156
|
+
value: {}
|
157
|
+
});
|
158
|
+
} else if (option.type === "mark") {
|
159
|
+
const size = sizeMap[option.value] || "";
|
160
|
+
const [sizeInNumber] = size.split("px");
|
161
|
+
updateMarkData(Number(sizeInNumber));
|
162
|
+
}
|
163
|
+
};
|
164
|
+
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
165
|
+
options: typographyOptions,
|
166
|
+
editor: editor,
|
167
|
+
onChange: onChange,
|
168
|
+
value: selectedBlock?.value || "headingOne",
|
169
|
+
classes: classes
|
170
|
+
});
|
171
|
+
}
|
172
|
+
export default SelectTypography;
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import { Button, Fade, Grid, Paper, Popper } from "@mui/material";
|
2
|
+
import SelectTypography from "./SelectTypography";
|
3
|
+
import SelectList from "./SelectList";
|
4
|
+
import { toolbarGroups } from "../../toolbarGroups";
|
5
|
+
import { MarkButton } from "../../FormatTools";
|
6
|
+
import { activeMark, isBlockActive } from "../../../utils/SlateUtilityFunctions";
|
7
|
+
import LinkButton from "../../../Elements/Link/LinkButton";
|
8
|
+
import TextToolIcon from "../../../assets/svg/TextToolIcon";
|
9
|
+
import TextFormat from "../TextFormat";
|
10
|
+
import { useState } from "react";
|
11
|
+
import useWindowResize from "../../../hooks/useWindowResize";
|
12
|
+
import PopperHeader from "../PopperHeader";
|
13
|
+
import MiniColorPicker from "./MiniColorPicker";
|
14
|
+
import SelectAlignment from "./SelectAlignment";
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
|
+
const DEFAULT_COLOR = {
|
18
|
+
color: "#000000",
|
19
|
+
bgcolor: "#FFFFFF"
|
20
|
+
};
|
21
|
+
const textColorFormat = "color";
|
22
|
+
const textBgFormat = "bgColor";
|
23
|
+
const allTools = toolbarGroups.flat();
|
24
|
+
const MiniTextFormat = props => {
|
25
|
+
const {
|
26
|
+
classes,
|
27
|
+
editor,
|
28
|
+
closeMainPopup
|
29
|
+
} = props;
|
30
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
31
|
+
const open = Boolean(anchorEl);
|
32
|
+
const id = open ? "popup-edit-tool" : "";
|
33
|
+
const [size] = useWindowResize();
|
34
|
+
const removeFontStyles = ["superscript", "subscript"];
|
35
|
+
const fontStyle = allTools.filter(f => f.type === "mark" && !removeFontStyles.includes(f.format));
|
36
|
+
const link = allTools.find(f => f.format?.indexOf("link") >= 0);
|
37
|
+
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
38
|
+
const activeColor = activeMark(editor, textColorFormat) || DEFAULT_COLOR[textColorFormat];
|
39
|
+
const activeBg = activeMark(editor, textBgFormat) || DEFAULT_COLOR[textBgFormat];
|
40
|
+
return /*#__PURE__*/_jsx(Grid, {
|
41
|
+
container: true,
|
42
|
+
sx: classes.miniTextFormatWrapper,
|
43
|
+
alignItems: "center",
|
44
|
+
children: /*#__PURE__*/_jsx(Grid, {
|
45
|
+
item: true,
|
46
|
+
xs: 12,
|
47
|
+
children: /*#__PURE__*/_jsxs("div", {
|
48
|
+
className: "toolWrapper",
|
49
|
+
children: [/*#__PURE__*/_jsx(SelectTypography, {
|
50
|
+
classes: classes,
|
51
|
+
editor: editor,
|
52
|
+
closeMainPopup: closeMainPopup
|
53
|
+
}), /*#__PURE__*/_jsx("div", {
|
54
|
+
className: "verticalLine"
|
55
|
+
}), /*#__PURE__*/_jsx(SelectList, {
|
56
|
+
classes: classes,
|
57
|
+
editor: editor
|
58
|
+
}), /*#__PURE__*/_jsx("div", {
|
59
|
+
className: "verticalLine mr-1"
|
60
|
+
}), /*#__PURE__*/_jsx(SelectAlignment, {
|
61
|
+
fontAlign: fontAlign,
|
62
|
+
classes: classes,
|
63
|
+
editor: editor
|
64
|
+
}), /*#__PURE__*/_jsx("div", {
|
65
|
+
className: "verticalLine mr-1"
|
66
|
+
}), fontStyle?.map((m, i) => {
|
67
|
+
return /*#__PURE__*/_jsx(MarkButton, {
|
68
|
+
editor: editor,
|
69
|
+
...m
|
70
|
+
}, `pptool_mark_${i}_${m.id}`);
|
71
|
+
}), /*#__PURE__*/_jsx(MiniColorPicker, {
|
72
|
+
format: textColorFormat,
|
73
|
+
classes: classes,
|
74
|
+
activeColor: activeColor,
|
75
|
+
id: "11_cc",
|
76
|
+
editor: editor
|
77
|
+
}), /*#__PURE__*/_jsx(MiniColorPicker, {
|
78
|
+
format: textBgFormat,
|
79
|
+
classes: classes,
|
80
|
+
activeColor: activeBg,
|
81
|
+
id: "12_cc",
|
82
|
+
editor: editor
|
83
|
+
}), /*#__PURE__*/_jsx("div", {
|
84
|
+
className: "verticalLine ml-1 mr-1"
|
85
|
+
}), /*#__PURE__*/_jsx(LinkButton, {
|
86
|
+
active: isBlockActive(editor, link.format),
|
87
|
+
editor: editor
|
88
|
+
}, link.id), /*#__PURE__*/_jsx(Button, {
|
89
|
+
onClick: e => setAnchorEl(e.currentTarget),
|
90
|
+
className: "textSettingsIcon",
|
91
|
+
children: /*#__PURE__*/_jsx(TextToolIcon, {})
|
92
|
+
}), /*#__PURE__*/_jsx(Popper, {
|
93
|
+
id: id,
|
94
|
+
open: open,
|
95
|
+
anchorEl: anchorEl,
|
96
|
+
transition: true,
|
97
|
+
placement: "auto-end",
|
98
|
+
sx: classes.popupWrapper,
|
99
|
+
className: `tools-drawer ${size?.device}`,
|
100
|
+
children: ({
|
101
|
+
TransitionProps
|
102
|
+
}) => /*#__PURE__*/_jsx(Fade, {
|
103
|
+
...TransitionProps,
|
104
|
+
timeout: 350,
|
105
|
+
children: /*#__PURE__*/_jsxs(Paper, {
|
106
|
+
style: {
|
107
|
+
borderRadius: "10px"
|
108
|
+
},
|
109
|
+
children: [/*#__PURE__*/_jsx(PopperHeader, {
|
110
|
+
title: "Text Settings",
|
111
|
+
classes: classes,
|
112
|
+
onClose: () => setAnchorEl(null)
|
113
|
+
}), /*#__PURE__*/_jsx(TextFormat, {
|
114
|
+
editor: editor,
|
115
|
+
classes: classes
|
116
|
+
})]
|
117
|
+
})
|
118
|
+
})
|
119
|
+
})]
|
120
|
+
})
|
121
|
+
})
|
122
|
+
});
|
123
|
+
};
|
124
|
+
export default MiniTextFormat;
|
@@ -441,6 +441,79 @@ const usePopupStyle = theme => ({
|
|
441
441
|
background: "transparent",
|
442
442
|
boxShadow: "none"
|
443
443
|
}
|
444
|
+
},
|
445
|
+
miniTextFormatWrapper: {
|
446
|
+
maxWidth: "100%",
|
447
|
+
padding: "4px 8px",
|
448
|
+
overflowX: "auto",
|
449
|
+
"& .customSelectTool": {
|
450
|
+
padding: "8px",
|
451
|
+
color: theme.palette.secondary.main,
|
452
|
+
gap: "4px"
|
453
|
+
},
|
454
|
+
"& .verticalLine": {
|
455
|
+
borderLeft: "1px solid #E0E0E0",
|
456
|
+
minHeight: "35px",
|
457
|
+
height: "100%"
|
458
|
+
},
|
459
|
+
"& .toolWrapper": {
|
460
|
+
display: "flex",
|
461
|
+
alignItems: "center",
|
462
|
+
"& .mr-1": {
|
463
|
+
marginRight: "8px"
|
464
|
+
},
|
465
|
+
"& .ml-1": {
|
466
|
+
marginLeft: "8px"
|
467
|
+
}
|
468
|
+
},
|
469
|
+
"& button": {
|
470
|
+
minWidth: "0px !important",
|
471
|
+
textTransform: "none"
|
472
|
+
},
|
473
|
+
"& .fontColorBtn": {
|
474
|
+
color: theme.palette.secondary.main,
|
475
|
+
borderRadius: "unset",
|
476
|
+
fontSize: "17px",
|
477
|
+
padding: "0px",
|
478
|
+
margin: "0px 8px",
|
479
|
+
paddingBottom: "5px",
|
480
|
+
lineHeight: "16px",
|
481
|
+
position: "relative",
|
482
|
+
"& .selectedColor": {
|
483
|
+
height: "3px",
|
484
|
+
position: "absolute",
|
485
|
+
bottom: 0,
|
486
|
+
left: 0,
|
487
|
+
width: "100%"
|
488
|
+
}
|
489
|
+
},
|
490
|
+
"& .textSettingsIcon": {
|
491
|
+
minWidth: "auto !important"
|
492
|
+
}
|
493
|
+
},
|
494
|
+
customSelectPopoverWrapper: {
|
495
|
+
"& .customSelectOptionLabel": {
|
496
|
+
color: "black",
|
497
|
+
margin: "0px",
|
498
|
+
width: "100%",
|
499
|
+
justifyContent: "start",
|
500
|
+
paddingRight: "20px",
|
501
|
+
"& :hover": {
|
502
|
+
background: "#F0F5FA !important"
|
503
|
+
},
|
504
|
+
"&.selected": {
|
505
|
+
background: "#F0F5FA !important"
|
506
|
+
}
|
507
|
+
},
|
508
|
+
"& .menuOptions": {
|
509
|
+
display: "flex",
|
510
|
+
alignItems: "center",
|
511
|
+
gap: "6px"
|
512
|
+
},
|
513
|
+
"& button": {
|
514
|
+
minWidth: "0px !important",
|
515
|
+
textTransform: "none"
|
516
|
+
}
|
444
517
|
}
|
445
518
|
});
|
446
519
|
export default usePopupStyle;
|
@@ -8,13 +8,14 @@ import useDrag from "../../hooks/useDrag";
|
|
8
8
|
import PopperHeader from "./PopperHeader";
|
9
9
|
import { TableUtil } from "../../utils/table";
|
10
10
|
import useWindowResize from "../../hooks/useWindowResize";
|
11
|
-
import
|
12
|
-
import MiniTextFormat from "./MiniTextFormat";
|
11
|
+
// import MiniTextFormat from "./MiniTextFormat";
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
15
15
|
const PopupTool = props => {
|
16
16
|
const {
|
17
|
-
theme
|
17
|
+
theme,
|
18
|
+
setIsTextSelected
|
18
19
|
} = props;
|
19
20
|
const classes = usePopupStyle(theme);
|
20
21
|
const [anchorEl, setAnchorEl] = useState(null);
|
@@ -28,23 +29,19 @@ const PopupTool = props => {
|
|
28
29
|
const id = open ? "popup-edit-tool" : "";
|
29
30
|
const table = new TableUtil(editor);
|
30
31
|
const [size] = useWindowResize();
|
31
|
-
const [eventKey] = useEvent();
|
32
32
|
useEffect(() => {
|
33
33
|
if (event === "end" && anchorEl && !open) {
|
34
34
|
// for table cell selection
|
35
35
|
const isCellsSelected = table.isCellSelected(editor.selection);
|
36
36
|
if (!isCellsSelected) {
|
37
37
|
setOpen(true);
|
38
|
+
setIsTextSelected(true);
|
38
39
|
}
|
39
40
|
} else if (!anchorEl) {
|
40
41
|
setOpen(false);
|
42
|
+
setIsTextSelected(false);
|
41
43
|
}
|
42
44
|
}, [event, anchorEl]);
|
43
|
-
useEffect(() => {
|
44
|
-
if (eventKey) {
|
45
|
-
setOpen(false);
|
46
|
-
}
|
47
|
-
}, [eventKey]);
|
48
45
|
useEffect(() => {
|
49
46
|
if (!selection || !inFocus || Range.isCollapsed(selection) || Editor.string(editor, selection) === "") {
|
50
47
|
setAnchorEl(null);
|
@@ -72,31 +69,34 @@ const PopupTool = props => {
|
|
72
69
|
setAnchorEl(null);
|
73
70
|
setOpen(false);
|
74
71
|
};
|
75
|
-
return open ? /*#__PURE__*/_jsx(
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
72
|
+
return open ? /*#__PURE__*/_jsx(_Fragment, {
|
73
|
+
children: /*#__PURE__*/_jsx(Popper, {
|
74
|
+
id: id,
|
75
|
+
open: open,
|
76
|
+
anchorEl: anchorEl,
|
77
|
+
transition: true,
|
78
|
+
placement: "auto-end",
|
79
|
+
sx: classes.popupWrapper,
|
80
|
+
className: `tools-drawer ${size?.device}`,
|
81
|
+
children: ({
|
82
|
+
TransitionProps
|
83
|
+
}) => /*#__PURE__*/_jsx(Fade, {
|
84
|
+
...TransitionProps,
|
85
|
+
timeout: 350,
|
86
|
+
children: /*#__PURE__*/_jsxs(Paper, {
|
87
|
+
style: {
|
88
|
+
borderRadius: "10px"
|
89
|
+
},
|
90
|
+
className: size.device === "xs" ? "mobileMiniTextWrapper" : "",
|
91
|
+
children: [/*#__PURE__*/_jsx(PopperHeader, {
|
92
|
+
title: "Text Settings",
|
93
|
+
classes: classes,
|
94
|
+
onClose: handleClose
|
95
|
+
}), /*#__PURE__*/_jsx(TextFormat, {
|
96
|
+
editor: editor,
|
97
|
+
classes: classes
|
98
|
+
})]
|
99
|
+
})
|
100
100
|
})
|
101
101
|
})
|
102
102
|
}) : null;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
const DownArrowIcon = () => {
|
3
|
+
return /*#__PURE__*/_jsx("svg", {
|
4
|
+
width: "7",
|
5
|
+
height: "5",
|
6
|
+
viewBox: "0 0 7 5",
|
7
|
+
fill: "none",
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
9
|
+
children: /*#__PURE__*/_jsx("path", {
|
10
|
+
d: "M1 1L3.43323 3.37902L5.86646 1",
|
11
|
+
stroke: "#64748B",
|
12
|
+
strokeLinecap: "round"
|
13
|
+
})
|
14
|
+
});
|
15
|
+
};
|
16
|
+
export default DownArrowIcon;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
function PaintIcon() {
|
3
|
+
return /*#__PURE__*/_jsx("svg", {
|
4
|
+
width: "14",
|
5
|
+
height: "14",
|
6
|
+
viewBox: "0 0 14 14",
|
7
|
+
fill: "none",
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
9
|
+
children: /*#__PURE__*/_jsx("path", {
|
10
|
+
d: "M13.5512 6.73405L6.71385 12.8277C6.30072 13.1996 5.76365 13.3648 5.22658 13.3442C4.6895 13.3235 4.19375 13.0756 3.80127 12.6625L0.516875 8.98561C-0.226762 8.13869 -0.164793 6.83733 0.682127 6.09369L7.51946 0L13.5512 6.7547V6.73405ZM13.3859 8.01475C13.4479 8.26263 11.6095 11.1959 13.138 11.3818C14.9558 11.5883 13.324 7.76688 13.3859 8.01475ZM12.5183 6.67208L7.47814 1.03283L1.19854 6.65142L12.5183 6.69273V6.67208Z",
|
11
|
+
fill: "#64748B"
|
12
|
+
})
|
13
|
+
});
|
14
|
+
}
|
15
|
+
export default PaintIcon;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
3
|
+
function TextToolIcon(props = {}) {
|
4
|
+
return /*#__PURE__*/_jsxs("svg", {
|
5
|
+
width: "14",
|
6
|
+
height: "14",
|
7
|
+
viewBox: "0 0 14 14",
|
8
|
+
fill: "none",
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
10
|
+
...props,
|
11
|
+
children: [/*#__PURE__*/_jsx("path", {
|
12
|
+
d: "M1.55762 4.18323V3.12156C1.55762 2.45073 2.10012 1.91406 2.76512 1.91406H11.2351C11.906 1.91406 12.4426 2.45656 12.4426 3.12156V4.18323",
|
13
|
+
stroke: "#64748B",
|
14
|
+
strokeWidth: "1.5",
|
15
|
+
strokeLinecap: "round",
|
16
|
+
strokeLinejoin: "round"
|
17
|
+
}), /*#__PURE__*/_jsx("path", {
|
18
|
+
d: "M7 12.0876V2.39844",
|
19
|
+
stroke: "#64748B",
|
20
|
+
strokeWidth: "1.5",
|
21
|
+
strokeLinecap: "round",
|
22
|
+
strokeLinejoin: "round"
|
23
|
+
}), /*#__PURE__*/_jsx("path", {
|
24
|
+
d: "M4.70166 12.0859H9.29833",
|
25
|
+
stroke: "#64748B",
|
26
|
+
strokeWidth: "1.5",
|
27
|
+
strokeLinecap: "round",
|
28
|
+
strokeLinejoin: "round"
|
29
|
+
})]
|
30
|
+
});
|
31
|
+
}
|
32
|
+
export default TextToolIcon;
|
@@ -39,6 +39,16 @@ const embedImageStyle = [{
|
|
39
39
|
value: "RoundedLightB2",
|
40
40
|
label: "Rounded Light B2 Frame"
|
41
41
|
}]
|
42
|
+
}, {
|
43
|
+
label: "Add web address here",
|
44
|
+
key: "webAddress",
|
45
|
+
type: "text",
|
46
|
+
placeholder: "https://"
|
47
|
+
}, {
|
48
|
+
label: "Open in new tab",
|
49
|
+
key: "isNewTab",
|
50
|
+
type: "selectBox",
|
51
|
+
placeholder: "Open in new tab"
|
42
52
|
}]
|
43
53
|
}, {
|
44
54
|
tab: "Banner Spacing",
|
@@ -47,7 +47,8 @@ const withHtml = editor => {
|
|
47
47
|
const slateHTML = data?.getData("application/x-slate-fragment");
|
48
48
|
const html = data?.getData("text/html");
|
49
49
|
const currentEl = getCurrentElement(editor);
|
50
|
-
|
50
|
+
const eltype = currentEl?.type;
|
51
|
+
if (slateHTML && !formatFragment[eltype]) {
|
51
52
|
const [tableNode] = Editor.nodes(editor, {
|
52
53
|
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table"
|
53
54
|
});
|
@@ -62,7 +63,6 @@ const withHtml = editor => {
|
|
62
63
|
} else if (html) {
|
63
64
|
const parsed = new DOMParser().parseFromString(html, "text/html");
|
64
65
|
const fragment = deserialize(parsed.body);
|
65
|
-
const eltype = currentEl?.type;
|
66
66
|
const formattedFragment = formatFragment[eltype] ? formatFragment[eltype](fragment) : fragment;
|
67
67
|
Transforms.insertFragment(editor, formattedFragment);
|
68
68
|
return;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export const formSubmit = async (formData, props) => {
|
2
2
|
try {
|
3
|
-
const
|
3
|
+
const pageApiHost = props.PAGES_API_HOST || "api/v1";
|
4
|
+
const response = await fetch(`${pageApiHost}/form/submit`, {
|
4
5
|
method: "POST",
|
5
6
|
headers: {
|
6
7
|
"Content-Type": "application/json"
|