@flozy/editor 10.6.5 → 10.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/CommonEditor.js +17 -1
- package/dist/Editor/Editor.css +26 -0
- package/dist/Editor/Elements/Accordion/Accordion.js +46 -9
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +2 -25
- package/dist/Editor/Elements/AppHeader/AppHeader.js +7 -2
- package/dist/Editor/Elements/Button/EditorButton.js +2 -2
- package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +510 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +10 -10
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +28 -9
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +12 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +44 -18
- package/dist/Editor/Elements/Divider/Divider.js +1 -1
- package/dist/Editor/Elements/Embed/Embed.css +4 -0
- package/dist/Editor/Elements/Form/Form.js +3 -3
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +0 -1
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +4 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
- package/dist/Editor/Elements/Grid/Grid.js +14 -2
- package/dist/Editor/Elements/Signature/Signature.css +2 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +18 -5
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +16 -3
- package/dist/Editor/Elements/Table/AddRowCol.js +8 -2
- package/dist/Editor/Elements/Table/DragButton.js +0 -1
- package/dist/Editor/Elements/Table/Draggable.js +6 -2
- package/dist/Editor/Elements/Table/Styles.js +7 -0
- package/dist/Editor/Elements/Table/TableCell.js +24 -5
- package/dist/Editor/Elements/Title/title.js +2 -5
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +4 -4
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -3
- package/dist/Editor/common/Checkbox/index.js +46 -0
- package/dist/Editor/common/Checkbox/styles.js +45 -0
- package/dist/Editor/common/ColorPickerButton.js +3 -0
- package/dist/Editor/common/LinkSettings/NavComponents.js +45 -65
- package/dist/Editor/common/LinkSettings/index.js +17 -28
- package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
- package/dist/Editor/common/LinkSettings/style.js +164 -244
- package/dist/Editor/common/RadioGroup/index.js +48 -0
- package/dist/Editor/common/RadioGroup/styles.js +29 -0
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +4 -5
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +4 -3
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
- package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -1
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +0 -1
- package/dist/Editor/common/RnD/Utils/index.js +55 -24
- package/dist/Editor/common/RnD/VirtualElement/helper.js +3 -2
- package/dist/Editor/common/RnD/index.js +30 -27
- package/dist/Editor/common/Select/index.js +44 -7
- package/dist/Editor/common/Select/styles.js +30 -2
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
- package/dist/Editor/common/SwipeableDrawer/style.js +14 -12
- package/dist/Editor/common/iconListV2.js +76 -0
- package/dist/Editor/commonStyle.js +12 -0
- package/dist/Editor/helper/deserialize/index.js +6 -4
- package/dist/Editor/helper/index.js +4 -0
- package/dist/Editor/hooks/useTable.js +5 -4
- package/dist/Editor/plugins/withCustomDeleteBackward.js +6 -1
- package/dist/Editor/plugins/withHTML.js +11 -4
- package/dist/Editor/utils/SlateUtilityFunctions.js +21 -32
- package/dist/Editor/utils/accordion.js +129 -39
- package/dist/Editor/utils/customHooks/useTableResize.js +49 -9
- package/dist/Editor/utils/events.js +17 -5
- package/dist/Editor/utils/formfield.js +1 -0
- package/dist/Editor/utils/helper.js +53 -9
- package/dist/Editor/utils/insertAppHeader.js +1 -1
- package/dist/Editor/utils/signature.js +2 -9
- package/dist/Editor/utils/updateFormName.js +22 -0
- package/package.json +1 -1
@@ -19,6 +19,7 @@ const EditOption = props => {
|
|
19
19
|
const [edit, setEdit] = useState({
|
20
20
|
...(mode?.edit || {})
|
21
21
|
});
|
22
|
+
const [errorMessage, setErrorMessage] = useState("");
|
22
23
|
const editData = useRef({
|
23
24
|
...edit
|
24
25
|
});
|
@@ -31,10 +32,13 @@ const EditOption = props => {
|
|
31
32
|
const selectedOption = edit?.options[optionIndex] || {};
|
32
33
|
const pickerStyles = ColorPickerStyles(theme);
|
33
34
|
const hideBackButton = edit?.hideBackButton || false;
|
35
|
+
const errorMessageRef = useRef(errorMessage);
|
36
|
+
useEffect(() => {
|
37
|
+
errorMessageRef.current = errorMessage;
|
38
|
+
}, [errorMessage]);
|
34
39
|
useEffect(() => {
|
35
40
|
return () => {
|
36
|
-
|
37
|
-
if (editData?.current) {
|
41
|
+
if (editData?.current && !errorMessageRef.current) {
|
38
42
|
delete editData?.current?.edited;
|
39
43
|
onEvent("updateProperty", {
|
40
44
|
...editData?.current
|
@@ -43,18 +47,24 @@ const EditOption = props => {
|
|
43
47
|
};
|
44
48
|
}, []);
|
45
49
|
const onChange = e => {
|
46
|
-
const
|
50
|
+
const {
|
51
|
+
name,
|
52
|
+
value,
|
53
|
+
delete: isDelete
|
54
|
+
} = e?.target || {};
|
55
|
+
const targetValue = value?.toLowerCase();
|
56
|
+
const updatedOptions = edit?.options?.map((m, i) => {
|
47
57
|
if (i === edit?.optionIndex) {
|
48
58
|
return {
|
49
59
|
...m,
|
50
|
-
[
|
60
|
+
[name]: value
|
51
61
|
};
|
52
62
|
}
|
53
63
|
return m;
|
54
64
|
});
|
55
65
|
|
56
|
-
//
|
57
|
-
if (edit?.optionIndex > -1 &&
|
66
|
+
// If deleting the option
|
67
|
+
if (edit?.optionIndex > -1 && isDelete) {
|
58
68
|
updatedOptions.splice(edit?.optionIndex, 1);
|
59
69
|
}
|
60
70
|
const latest = {
|
@@ -68,14 +78,28 @@ const EditOption = props => {
|
|
68
78
|
...latest,
|
69
79
|
edited: true
|
70
80
|
};
|
81
|
+
if (name === "value" && !value?.trim()) {
|
82
|
+
setErrorMessage("Option name must not be empty");
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
const isDuplicate = name === "value" && targetValue && edit?.options?.some((op, i) => i !== edit?.optionIndex && op?.value?.toLowerCase?.() === targetValue);
|
86
|
+
if (isDuplicate) {
|
87
|
+
setErrorMessage("Option name must be unique");
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
setErrorMessage(""); // Clear error on valid input
|
71
91
|
|
72
|
-
//
|
73
|
-
if (
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
92
|
+
// If delete go back
|
93
|
+
if (isDelete) {
|
94
|
+
if (hideBackButton) {
|
95
|
+
onClose();
|
96
|
+
} else {
|
97
|
+
onEvent("editProperty", {
|
98
|
+
edit: {
|
99
|
+
...latest
|
100
|
+
}
|
101
|
+
});
|
102
|
+
}
|
79
103
|
}
|
80
104
|
};
|
81
105
|
const onBack = () => {
|
@@ -110,15 +134,15 @@ const EditOption = props => {
|
|
110
134
|
size: "small",
|
111
135
|
onClick: onBack,
|
112
136
|
children: /*#__PURE__*/_jsx(Icon, {
|
113
|
-
icon:
|
137
|
+
icon: "leftArrow"
|
114
138
|
})
|
115
139
|
}) : null, translation("Edit Option")]
|
116
140
|
}), /*#__PURE__*/_jsx(IconButton, {
|
117
141
|
className: "tv-act-ico bg br1",
|
118
142
|
size: "small",
|
119
143
|
sx: {
|
120
|
-
|
121
|
-
|
144
|
+
"& svg": {
|
145
|
+
"& path": {
|
122
146
|
strokeWidth: 0
|
123
147
|
}
|
124
148
|
}
|
@@ -137,7 +161,9 @@ const EditOption = props => {
|
|
137
161
|
value: selectedOption?.value,
|
138
162
|
onChange: onChange,
|
139
163
|
fullWidth: true,
|
140
|
-
placeholder: translation("Option Name")
|
164
|
+
placeholder: translation("Option Name"),
|
165
|
+
helperText: errorMessage,
|
166
|
+
error: !!errorMessage
|
141
167
|
}),
|
142
168
|
labelPlacement: "top"
|
143
169
|
})
|
@@ -161,7 +187,7 @@ const EditOption = props => {
|
|
161
187
|
onClick: onDeleteOption,
|
162
188
|
children: [/*#__PURE__*/_jsx(ListItemIcon, {
|
163
189
|
children: /*#__PURE__*/_jsx(Icon, {
|
164
|
-
icon:
|
190
|
+
icon: "trashIcon"
|
165
191
|
})
|
166
192
|
}), /*#__PURE__*/_jsx(ListItemText, {
|
167
193
|
children: translation("Delete Option")
|
@@ -4,7 +4,6 @@ import { Node } from "slate";
|
|
4
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
5
5
|
import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography, useTheme } from "@mui/material";
|
6
6
|
import DeleteIcon from "@mui/icons-material/Delete";
|
7
|
-
import BackupIcon from "@mui/icons-material/Backup";
|
8
7
|
import { GridSettingsIcon, GridAddSectionIcon, WorkflowIcon } from "../../common/iconslist";
|
9
8
|
import FormPopup from "./FormPopup";
|
10
9
|
import ButtonPopup from "../Button/ButtonPopup";
|
@@ -160,7 +159,8 @@ const Form = props => {
|
|
160
159
|
[pair[0]]: pair[1],
|
161
160
|
placeholder: placeholder,
|
162
161
|
form_name: formName,
|
163
|
-
tagName: tagName
|
162
|
+
tagName: tagName,
|
163
|
+
uid: fieldData?.uid
|
164
164
|
});
|
165
165
|
}
|
166
166
|
let params = {
|
@@ -207,7 +207,7 @@ const Form = props => {
|
|
207
207
|
}, {
|
208
208
|
at: path
|
209
209
|
});
|
210
|
-
// adding form field style to the current form node
|
210
|
+
// adding form field style to the current form node
|
211
211
|
const currentNode = Node.get(editor, path);
|
212
212
|
if (currentNode) {
|
213
213
|
currentNode.children.forEach((item, index) => {
|
@@ -42,7 +42,6 @@ const FormTextArea = props => {
|
|
42
42
|
},
|
43
43
|
height: height || "150px",
|
44
44
|
borderColor: borderColor && `${borderColor} !important`,
|
45
|
-
borderWidth: borderWidth || "1px",
|
46
45
|
borderRadius: {
|
47
46
|
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
48
47
|
},
|
@@ -22,6 +22,7 @@ import { DEFAULT_TABLE_NODE } from "../../utils/table";
|
|
22
22
|
import itemOptions from "./Options/sectionItemOptions";
|
23
23
|
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
24
24
|
import { useDebouncedCallback } from "use-debounce";
|
25
|
+
import updateFormName from "../../utils/updateFormName";
|
25
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
26
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
27
28
|
const MAX_DEVICE_WIDTH = {
|
@@ -140,8 +141,10 @@ const FreeGrid = props => {
|
|
140
141
|
});
|
141
142
|
break;
|
142
143
|
case "duplicateSection":
|
144
|
+
const currentNode = Node.get(editor, cur_root_path);
|
145
|
+
const updatedFormNameNode = updateFormName(currentNode);
|
143
146
|
Transforms.insertNodes(editor, [{
|
144
|
-
...JSON.parse(JSON.stringify(
|
147
|
+
...JSON.parse(JSON.stringify(updatedFormNameNode))
|
145
148
|
}], {
|
146
149
|
at: next_path
|
147
150
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import React, { useState } from "react";
|
3
|
-
import { Transforms, Path, Node } from "slate";
|
3
|
+
import { Transforms, Path, Node, Editor, Element } from "slate";
|
4
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
5
5
|
import { IconButton, Tooltip, Grid as GridContainer, useTheme } from "@mui/material";
|
6
6
|
import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
|
@@ -206,7 +206,19 @@ const Grid = props => {
|
|
206
206
|
};
|
207
207
|
const onAddSection = () => () => {
|
208
208
|
try {
|
209
|
-
|
209
|
+
let duplicateGrid = JSON.parse(JSON.stringify(element));
|
210
|
+
const carousel = Editor.above(editor, {
|
211
|
+
at: path,
|
212
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "carousel-item"
|
213
|
+
});
|
214
|
+
if (carousel) {
|
215
|
+
const [carouselNode, carouselItemPath] = carousel || [];
|
216
|
+
const duplicatecCarousel = JSON.parse(JSON.stringify(carouselNode));
|
217
|
+
Transforms.insertNodes(editor, duplicatecCarousel, {
|
218
|
+
at: Path.next(carouselItemPath)
|
219
|
+
});
|
220
|
+
return;
|
221
|
+
}
|
210
222
|
insertGrid(editor, duplicateGrid, [path[0] + 1, 0]);
|
211
223
|
} catch (err) {
|
212
224
|
console.log(err);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useRef, useState } from "react";
|
2
2
|
import SignatureCanvas from "react-signature-canvas";
|
3
|
-
import { Grid, useMediaQuery } from "@mui/material";
|
3
|
+
import { Grid, IconButton, useMediaQuery } from "@mui/material";
|
4
|
+
import { ResetIcon } from "../../../common/iconListV2";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
6
7
|
const DrawSignature = props => {
|
@@ -24,6 +25,13 @@ const DrawSignature = props => {
|
|
24
25
|
signature: result?.imageURL || strImage
|
25
26
|
});
|
26
27
|
};
|
28
|
+
const onClear = () => {
|
29
|
+
canvasRef.clear();
|
30
|
+
setUploading(false);
|
31
|
+
onDataChange({
|
32
|
+
signature: ""
|
33
|
+
});
|
34
|
+
};
|
27
35
|
const isMobile = useMediaQuery("(max-width:599px)");
|
28
36
|
const signatureCanvasStyle = isMobile ? {
|
29
37
|
width: "260px",
|
@@ -31,14 +39,15 @@ const DrawSignature = props => {
|
|
31
39
|
} : {};
|
32
40
|
return /*#__PURE__*/_jsxs(Grid, {
|
33
41
|
container: true,
|
34
|
-
children: [uploading ? "Uploading..." : "", /*#__PURE__*/
|
42
|
+
children: [uploading ? "Uploading..." : "", /*#__PURE__*/_jsxs(Grid, {
|
35
43
|
item: true,
|
36
44
|
xs: 12,
|
37
45
|
style: {
|
38
46
|
width: "100%",
|
39
|
-
height: "209px"
|
47
|
+
height: "209px",
|
48
|
+
position: "relative"
|
40
49
|
},
|
41
|
-
children: /*#__PURE__*/_jsx(SignatureCanvas, {
|
50
|
+
children: [/*#__PURE__*/_jsx(SignatureCanvas, {
|
42
51
|
canvasProps: {
|
43
52
|
className: "signature-canvas",
|
44
53
|
...signatureCanvasStyle
|
@@ -47,7 +56,11 @@ const DrawSignature = props => {
|
|
47
56
|
ref: ref => canvasRef = ref,
|
48
57
|
maxWidth: brush.size || 2,
|
49
58
|
penColor: brush?.color || "#000"
|
50
|
-
})
|
59
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
60
|
+
className: "clear-canvas",
|
61
|
+
onClick: onClear,
|
62
|
+
children: /*#__PURE__*/_jsx(ResetIcon, {})
|
63
|
+
})]
|
51
64
|
})]
|
52
65
|
});
|
53
66
|
};
|
@@ -30,15 +30,28 @@ const UploadSignature = props => {
|
|
30
30
|
signature: result?.imageURL || strImage
|
31
31
|
});
|
32
32
|
};
|
33
|
+
const onRemove = () => {
|
34
|
+
setBase64(null);
|
35
|
+
setUploading(false);
|
36
|
+
onUploadDone({
|
37
|
+
signature: ""
|
38
|
+
});
|
39
|
+
};
|
33
40
|
return /*#__PURE__*/_jsxs("div", {
|
34
41
|
className: "signature-tab2",
|
35
|
-
children: [uploading ? "Uploading..." : "", base64 ? /*#__PURE__*/
|
42
|
+
children: [uploading ? "Uploading..." : "", base64 ? /*#__PURE__*/_jsxs("div", {
|
36
43
|
className: "upload-sign-img-wrapper",
|
37
|
-
children: /*#__PURE__*/_jsx("img", {
|
44
|
+
children: [/*#__PURE__*/_jsx("img", {
|
38
45
|
className: "upload-sign-img",
|
39
46
|
src: base64,
|
40
47
|
alt: "Signature"
|
41
|
-
})
|
48
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
49
|
+
variant: "body2",
|
50
|
+
gutterBottom: true,
|
51
|
+
className: "remove-sign-img-btn",
|
52
|
+
onClick: onRemove,
|
53
|
+
children: "Remove"
|
54
|
+
})]
|
42
55
|
}) : /*#__PURE__*/_jsxs("div", {
|
43
56
|
className: "upload-input-wrapper",
|
44
57
|
children: [/*#__PURE__*/_jsx("input", {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Button } from "@mui/material";
|
2
2
|
import { useMemo, useState } from "react";
|
3
3
|
import useTable from "../../hooks/useTable";
|
4
|
+
import AddRoundedIcon from "@mui/icons-material/AddRounded";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
const showAddButton = (addType, tableNode, hoverPath) => {
|
6
7
|
const [row, col] = hoverPath && hoverPath?.length ? hoverPath.slice(-2) : [];
|
@@ -61,7 +62,7 @@ function AddRowCol(props) {
|
|
61
62
|
fontSize: "14px",
|
62
63
|
border: "1px dashed #8DA8E3",
|
63
64
|
color: "#2563EB !important",
|
64
|
-
padding: "
|
65
|
+
padding: "4px 4px",
|
65
66
|
minWidth: "unset",
|
66
67
|
lineHeight: "18px",
|
67
68
|
fontWeight: "normal !important",
|
@@ -70,7 +71,12 @@ function AddRowCol(props) {
|
|
70
71
|
},
|
71
72
|
disabled: !showBtn,
|
72
73
|
onClick: onAdd,
|
73
|
-
children:
|
74
|
+
children: /*#__PURE__*/_jsx(AddRoundedIcon, {
|
75
|
+
sx: {
|
76
|
+
width: 18,
|
77
|
+
height: 18
|
78
|
+
}
|
79
|
+
})
|
74
80
|
})
|
75
81
|
});
|
76
82
|
}
|
@@ -13,9 +13,13 @@ function Draggable(props) {
|
|
13
13
|
} = props?.data || {};
|
14
14
|
const style = transform ? {
|
15
15
|
transform: dragType === "row" ? `translate3d(0, ${transform.y}px, 0)` : `translate3d(${transform.x}px, 0, 0)`
|
16
|
-
} :
|
16
|
+
} : {};
|
17
17
|
return /*#__PURE__*/_jsx(Box, {
|
18
|
-
style:
|
18
|
+
style: {
|
19
|
+
...style,
|
20
|
+
touchAction: "none" // Disables scrolling while dragging. Necessary for proper mobile drag functionality.
|
21
|
+
},
|
22
|
+
|
19
23
|
ref: setNodeRef,
|
20
24
|
...listeners,
|
21
25
|
...attributes,
|
@@ -86,6 +86,13 @@ const TableStyles = theme => {
|
|
86
86
|
background: "#2563EB"
|
87
87
|
}
|
88
88
|
},
|
89
|
+
mobileCellResizer: {
|
90
|
+
position: "absolute",
|
91
|
+
right: "-10px",
|
92
|
+
top: "-10px",
|
93
|
+
zIndex: 4000,
|
94
|
+
padding: "2px"
|
95
|
+
},
|
89
96
|
mobileToolDrawer: {
|
90
97
|
"& .customSelectContainer": {
|
91
98
|
border: "none !important",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useState, useEffect, useMemo } from "react";
|
2
2
|
import { Editor, Path, Range, Transforms } from "slate";
|
3
|
-
import { Box } from "@mui/material";
|
3
|
+
import { Box, IconButton } from "@mui/material";
|
4
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
5
5
|
import useTableResize from "../../utils/customHooks/useTableResize";
|
6
6
|
import { TableUtil } from "../../utils/table";
|
@@ -12,6 +12,7 @@ import TablePopup from "./TablePopup";
|
|
12
12
|
import { Droppable } from "./Droppable";
|
13
13
|
import { useDndContext } from "@dnd-kit/core";
|
14
14
|
import { getNodeWithType } from "../../utils/helper";
|
15
|
+
import { ResizeIcon } from "../../common/iconListV2";
|
15
16
|
import { isEmptyTextNode } from "../../helper";
|
16
17
|
import SimpleText from "../SimpleText";
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -41,16 +42,32 @@ const Resizer = ({
|
|
41
42
|
onMouseDown,
|
42
43
|
height
|
43
44
|
}) => {
|
45
|
+
const eventProps = {
|
46
|
+
onPointerDown: onMouseDown
|
47
|
+
};
|
44
48
|
return /*#__PURE__*/_jsx(_Fragment, {
|
45
49
|
children: /*#__PURE__*/_jsx(Box, {
|
46
50
|
component: "div",
|
47
51
|
className: "cell-resizer",
|
48
52
|
contentEditable: false,
|
49
|
-
onPointerDown: onMouseDown,
|
50
53
|
sx: classes.cellResizer,
|
51
54
|
style: {
|
52
55
|
height: `${height}px`
|
53
|
-
}
|
56
|
+
},
|
57
|
+
...eventProps
|
58
|
+
})
|
59
|
+
});
|
60
|
+
};
|
61
|
+
const MobileResizer = ({
|
62
|
+
classes,
|
63
|
+
onMouseDown
|
64
|
+
}) => {
|
65
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
66
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
67
|
+
contentEditable: false,
|
68
|
+
sx: classes.mobileCellResizer,
|
69
|
+
onTouchStart: onMouseDown,
|
70
|
+
children: /*#__PURE__*/_jsx(ResizeIcon, {})
|
54
71
|
})
|
55
72
|
});
|
56
73
|
};
|
@@ -115,7 +132,8 @@ const TableCell = props => {
|
|
115
132
|
size: element?.size,
|
116
133
|
minMaxProps: {
|
117
134
|
minWidth: 30
|
118
|
-
}
|
135
|
+
},
|
136
|
+
isMobile
|
119
137
|
});
|
120
138
|
const [tableSize, setTableSize] = useState({});
|
121
139
|
const [openSettings, setOpenSettings] = useState(false);
|
@@ -424,6 +442,7 @@ const TableCell = props => {
|
|
424
442
|
resetSelection
|
425
443
|
};
|
426
444
|
const showRowDragBtn = (showRowDrag || isRowDragging) && containerEle?.scrollLeft <= 0;
|
445
|
+
const TableResizer = isMobile && hoverCol === column ? MobileResizer : Resizer;
|
427
446
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
428
447
|
children: [/*#__PURE__*/_jsxs("td", {
|
429
448
|
...element.attr,
|
@@ -458,7 +477,7 @@ const TableCell = props => {
|
|
458
477
|
padding: "8px"
|
459
478
|
},
|
460
479
|
children: children
|
461
|
-
}), isHeader && !readOnly && tableSize?.height && !showTool ? /*#__PURE__*/_jsx(
|
480
|
+
}), isHeader && !readOnly && tableSize?.height && !showTool ? /*#__PURE__*/_jsx(TableResizer, {
|
462
481
|
classes: classes,
|
463
482
|
onMouseDown: onMouseDown,
|
464
483
|
height: tableDOM?.getBoundingClientRect()?.height
|
@@ -3,7 +3,6 @@ import { Editor, Text } from "slate";
|
|
3
3
|
import { useSlate } from "slate-react";
|
4
4
|
import { getNodeText } from "../../utils/helper";
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
6
|
const Title = props => {
|
8
7
|
const {
|
9
8
|
attributes,
|
@@ -13,7 +12,7 @@ const Title = props => {
|
|
13
12
|
} = props;
|
14
13
|
const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
|
15
14
|
useDetectExitFromTitle(element, customProps?.getTitleSaveData);
|
16
|
-
return /*#__PURE__*/
|
15
|
+
return /*#__PURE__*/_jsx("div", {
|
17
16
|
...attributes,
|
18
17
|
placeholder: "Title",
|
19
18
|
className: `content-editable ${isEmpty}`,
|
@@ -21,9 +20,7 @@ const Title = props => {
|
|
21
20
|
fontWeight: "bold",
|
22
21
|
fontSize: "20px"
|
23
22
|
},
|
24
|
-
children:
|
25
|
-
contentEditable: false
|
26
|
-
})]
|
23
|
+
children: children
|
27
24
|
});
|
28
25
|
};
|
29
26
|
export default Title;
|
@@ -130,7 +130,7 @@ const usePopupStyle = theme => ({
|
|
130
130
|
},
|
131
131
|
"& .accordionIcon": {
|
132
132
|
"& p": {
|
133
|
-
textAlign:
|
133
|
+
textAlign: "left"
|
134
134
|
}
|
135
135
|
}
|
136
136
|
},
|
@@ -437,8 +437,8 @@ const usePopupStyle = theme => ({
|
|
437
437
|
margin: "5px",
|
438
438
|
borderRadius: "8px",
|
439
439
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
440
|
-
fontSize:
|
441
|
-
padding:
|
440
|
+
fontSize: "14px",
|
441
|
+
padding: "8px 12px",
|
442
442
|
'&[aria-selected="true"]': {
|
443
443
|
backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
444
444
|
}
|
@@ -1050,7 +1050,7 @@ const usePopupStyle = theme => ({
|
|
1050
1050
|
},
|
1051
1051
|
customSelectPopoverWrapper: {
|
1052
1052
|
"& .MuiPopover-paper": {
|
1053
|
-
maxHeight: "
|
1053
|
+
maxHeight: "180px",
|
1054
1054
|
// minWidth: "130px",
|
1055
1055
|
// border: "1px solid #E4E8EB",
|
1056
1056
|
background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`,
|
@@ -139,10 +139,14 @@ const PopupTool = props => {
|
|
139
139
|
anchorEl: anchorEl,
|
140
140
|
sx: classes.popupWrapper,
|
141
141
|
placement: "top-start",
|
142
|
+
style: {
|
143
|
+
boxShadow: 'unset'
|
144
|
+
} //this is for overriding global shadow from popupwrapper used in other places
|
145
|
+
,
|
142
146
|
children: /*#__PURE__*/_jsx(Paper, {
|
143
|
-
|
144
|
-
|
145
|
-
|
147
|
+
sx: {
|
148
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
149
|
+
boxShadow: '1px 2px 12px 0px #0000001F'
|
146
150
|
},
|
147
151
|
children: /*#__PURE__*/_jsx(MiniTextFormat, {
|
148
152
|
editor: editor,
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { Checkbox as Core, FormControlLabel, IconButton, Typography } from "@mui/material";
|
2
|
+
import CheckboxStyles from "./styles";
|
3
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
+
import { CheckedBoxCheckIcon } from "../iconListV2";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
function Checkbox(props) {
|
7
|
+
const {
|
8
|
+
value,
|
9
|
+
onChange,
|
10
|
+
label,
|
11
|
+
labelProps,
|
12
|
+
checkboxProps,
|
13
|
+
...rest
|
14
|
+
} = props;
|
15
|
+
const {
|
16
|
+
theme
|
17
|
+
} = useEditorContext();
|
18
|
+
const classes = CheckboxStyles(theme);
|
19
|
+
return /*#__PURE__*/_jsx(FormControlLabel, {
|
20
|
+
className: "ccheckbox-primary",
|
21
|
+
sx: {
|
22
|
+
...classes.customCheckBox
|
23
|
+
},
|
24
|
+
control: /*#__PURE__*/_jsx(Core, {
|
25
|
+
value: value,
|
26
|
+
checked: value,
|
27
|
+
onChange: onChange,
|
28
|
+
checkedIcon: /*#__PURE__*/_jsx(IconButton, {
|
29
|
+
className: "checkedIcon",
|
30
|
+
children: /*#__PURE__*/_jsx(CheckedBoxCheckIcon, {})
|
31
|
+
}),
|
32
|
+
icon: /*#__PURE__*/_jsx(IconButton, {
|
33
|
+
className: "unCheckedIcon"
|
34
|
+
}),
|
35
|
+
...(checkboxProps || {})
|
36
|
+
}),
|
37
|
+
label: /*#__PURE__*/_jsx(Typography, {
|
38
|
+
variant: "body1",
|
39
|
+
sx: classes.label,
|
40
|
+
...(labelProps || {}),
|
41
|
+
children: label
|
42
|
+
}),
|
43
|
+
...rest
|
44
|
+
});
|
45
|
+
}
|
46
|
+
export default Checkbox;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
const SelectStyles = (theme = {}) => {
|
2
|
+
const {
|
3
|
+
buttonBorder3,
|
4
|
+
checkedIconBg,
|
5
|
+
tv_text
|
6
|
+
} = theme?.palette?.editor || {};
|
7
|
+
return {
|
8
|
+
customCheckBox: {
|
9
|
+
padding: "0px",
|
10
|
+
marginTop: "8px",
|
11
|
+
"& .MuiCheckbox-root": {
|
12
|
+
padding: "8px 8px 8px 10px",
|
13
|
+
"&:hover": {
|
14
|
+
background: "unset !important"
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"& button": {
|
18
|
+
width: "18px !important",
|
19
|
+
height: "18px !important",
|
20
|
+
borderRadius: "3px",
|
21
|
+
border: `1px solid ${buttonBorder3}`,
|
22
|
+
"& svg": {
|
23
|
+
width: "14px",
|
24
|
+
height: "14px"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"& .checkedIcon": {
|
28
|
+
background: "#2563EB",
|
29
|
+
borderColor: "#2563EB",
|
30
|
+
padding: "0px"
|
31
|
+
},
|
32
|
+
"& .unCheckedIcon": {
|
33
|
+
background: checkedIconBg
|
34
|
+
},
|
35
|
+
"& p": {
|
36
|
+
margin: "0px !important"
|
37
|
+
}
|
38
|
+
},
|
39
|
+
label: {
|
40
|
+
fontSize: "14px",
|
41
|
+
color: `${tv_text} !important`
|
42
|
+
}
|
43
|
+
};
|
44
|
+
};
|
45
|
+
export default SelectStyles;
|