@flozy/editor 10.4.4 → 10.4.6
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/ChatEditor.js +17 -16
- package/dist/Editor/CommonEditor.js +131 -16
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +46 -8
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
- package/dist/Editor/Elements/Accordion/Accordion.js +46 -9
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +1 -23
- package/dist/Editor/Elements/AppHeader/AppHeader.js +10 -5
- package/dist/Editor/Elements/Button/EditorButton.js +27 -9
- package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -1
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +27 -26
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +5 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +10 -4
- package/dist/Editor/Elements/Embed/Video.js +1 -1
- package/dist/Editor/Elements/Form/Form.js +3 -3
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +0 -1
- package/dist/Editor/Elements/Form/FormField.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +35 -31
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
- package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
- package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +1 -1
- package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +14 -0
- package/dist/Editor/Elements/Grid/Grid.js +14 -2
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- 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/SimpleText/style.js +2 -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/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +24 -5
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +2 -1
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -4
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +72 -12
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +58 -10
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/BackIcon.js +18 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
- package/dist/Editor/common/Checkbox/index.js +46 -0
- package/dist/Editor/common/Checkbox/styles.js +45 -0
- package/dist/Editor/common/ColorPickerButton.js +41 -16
- package/dist/Editor/common/CustomColorPicker/index.js +130 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +43 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +2 -2
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +45 -65
- package/dist/Editor/common/LinkSettings/index.js +14 -28
- package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
- package/dist/Editor/common/LinkSettings/style.js +164 -244
- package/dist/Editor/common/MentionsPopup/index.js +4 -1
- 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/Settings.js +2 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +4 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +3 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- 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/SwitchViewport/SwitchViewport.js +11 -2
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -19
- package/dist/Editor/common/RnD/Utils/index.js +3 -1
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +42 -58
- package/dist/Editor/common/RnD/VirtualElement/helper.js +323 -132
- package/dist/Editor/common/RnD/VirtualElement/styles.js +16 -0
- package/dist/Editor/common/RnD/index.js +67 -38
- package/dist/Editor/common/Select/index.js +44 -7
- package/dist/Editor/common/Select/styles.js +30 -2
- package/dist/Editor/common/Shorthands/elements.js +54 -0
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/SwipeableDrawer/style.js +14 -12
- package/dist/Editor/common/Uploader.js +16 -0
- package/dist/Editor/common/iconListV2.js +76 -0
- package/dist/Editor/common/iconslist.js +21 -0
- package/dist/Editor/commonStyle.js +116 -61
- package/dist/Editor/helper/index.js +5 -1
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +203 -2
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/hooks/useTable.js +5 -4
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +3 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
- package/dist/Editor/themeSettings/buttons/index.js +300 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +240 -0
- package/dist/Editor/themeSettings/fonts/style.js +62 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +380 -0
- package/dist/Editor/themeSettings/style.js +299 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
- package/dist/Editor/themeSettingsAI/style.js +332 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +161 -37
- package/dist/Editor/utils/accordion.js +14 -4
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/customHooks/useTableResize.js +49 -9
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/events.js +50 -6
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/formfield.js +1 -0
- package/dist/Editor/utils/helper.js +210 -26
- 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 +4 -4
@@ -0,0 +1,53 @@
|
|
1
|
+
const styles = () => ({
|
2
|
+
customColorPickerContainer: {
|
3
|
+
width: "300px",
|
4
|
+
boxShadow: "none",
|
5
|
+
"& .popup_tabs": {
|
6
|
+
boxShadow: "none"
|
7
|
+
},
|
8
|
+
".customColorPickerWrapper": {
|
9
|
+
padding: "10px 0px",
|
10
|
+
margin: "0px 16px",
|
11
|
+
borderTop: "1px solid #DCE4EC"
|
12
|
+
},
|
13
|
+
".colorTitleWrapper": {
|
14
|
+
display: "flex",
|
15
|
+
justifyContent: "space-between",
|
16
|
+
alignItems: "center",
|
17
|
+
paddingBottom: "10px",
|
18
|
+
".MuiTypography-root": {
|
19
|
+
fontWeight: "600"
|
20
|
+
},
|
21
|
+
".editBtn": {
|
22
|
+
textTransform: "none",
|
23
|
+
color: "#2563EB",
|
24
|
+
textDecoration: "underline",
|
25
|
+
padding: "0px",
|
26
|
+
minWidth: "unset"
|
27
|
+
}
|
28
|
+
},
|
29
|
+
".colorPickerBtnContainer": {
|
30
|
+
display: "flex",
|
31
|
+
flexWrap: "wrap",
|
32
|
+
gap: "6px"
|
33
|
+
},
|
34
|
+
".colorPicketBtn": {
|
35
|
+
width: "26px",
|
36
|
+
height: "26px",
|
37
|
+
outline: "none",
|
38
|
+
borderRadius: "50%",
|
39
|
+
cursor: "pointer",
|
40
|
+
border: "1.5px solid #DCE4EC",
|
41
|
+
margin: "1px"
|
42
|
+
},
|
43
|
+
".colorPicketBtnActive": {
|
44
|
+
borderRadius: "50%",
|
45
|
+
outline: "1.5px solid rgb(83, 83, 249)",
|
46
|
+
width: "fit-content",
|
47
|
+
height: "fit-content",
|
48
|
+
display: "flex",
|
49
|
+
justifyContent: "center"
|
50
|
+
}
|
51
|
+
}
|
52
|
+
});
|
53
|
+
export default styles;
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import Dialog from "@mui/material/Dialog";
|
2
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
3
|
+
import DialogContent from "@mui/material/DialogContent";
|
4
|
+
import DialogActions from "@mui/material/DialogActions";
|
5
|
+
import IconButton from "@mui/material/IconButton";
|
6
|
+
import CloseIcon from "@mui/icons-material/Close";
|
7
|
+
import { Box, Typography, Button } from "@mui/material";
|
8
|
+
import SwipeableDrawer from "../SwipeableDrawer";
|
9
|
+
import customDialogStyles from "./style";
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
13
|
+
function CustomDialog(props) {
|
14
|
+
const {
|
15
|
+
handleClose,
|
16
|
+
customProps,
|
17
|
+
children,
|
18
|
+
onSubmit
|
19
|
+
} = props;
|
20
|
+
const {
|
21
|
+
isMobile
|
22
|
+
} = customProps;
|
23
|
+
const classes = customDialogStyles();
|
24
|
+
if (isMobile) {
|
25
|
+
return /*#__PURE__*/_jsx(Box, {
|
26
|
+
sx: classes.dialogContainer,
|
27
|
+
children: /*#__PURE__*/_jsxs(SwipeableDrawer, {
|
28
|
+
onClose: handleClose,
|
29
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
30
|
+
variant: "subtitle1",
|
31
|
+
gutterBottom: true,
|
32
|
+
sx: {
|
33
|
+
fontWeight: 600
|
34
|
+
},
|
35
|
+
children: "What do you want to link to?"
|
36
|
+
}), /*#__PURE__*/_jsx(Box, {
|
37
|
+
sx: classes.mobileDialogContent,
|
38
|
+
children: children
|
39
|
+
}), /*#__PURE__*/_jsx(Box, {
|
40
|
+
component: "div",
|
41
|
+
sx: classes.mobileActionBtns,
|
42
|
+
children: /*#__PURE__*/_jsx(ActionsButtons, {
|
43
|
+
classes: classes,
|
44
|
+
onCancel: handleClose,
|
45
|
+
onSave: onSubmit
|
46
|
+
})
|
47
|
+
})]
|
48
|
+
})
|
49
|
+
});
|
50
|
+
} else {
|
51
|
+
return /*#__PURE__*/_jsxs(Dialog, {
|
52
|
+
onClose: handleClose,
|
53
|
+
open: true,
|
54
|
+
sx: classes.dialogContainer,
|
55
|
+
fullWidth: true,
|
56
|
+
maxWidth: "sm",
|
57
|
+
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
58
|
+
children: "What do you want to link to?"
|
59
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
60
|
+
"aria-label": "close",
|
61
|
+
onClick: handleClose,
|
62
|
+
sx: classes.closeIcon,
|
63
|
+
children: /*#__PURE__*/_jsx(CloseIcon, {})
|
64
|
+
}), /*#__PURE__*/_jsx(DialogContent, {
|
65
|
+
dividers: true,
|
66
|
+
children: children
|
67
|
+
}), /*#__PURE__*/_jsx(DialogActions, {
|
68
|
+
children: /*#__PURE__*/_jsx(ActionsButtons, {
|
69
|
+
classes: classes,
|
70
|
+
onCancel: handleClose,
|
71
|
+
onSave: onSubmit
|
72
|
+
})
|
73
|
+
})]
|
74
|
+
});
|
75
|
+
}
|
76
|
+
}
|
77
|
+
export default CustomDialog;
|
78
|
+
function ActionsButtons({
|
79
|
+
classes,
|
80
|
+
onCancel,
|
81
|
+
onSave
|
82
|
+
}) {
|
83
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
84
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
85
|
+
onClick: onCancel,
|
86
|
+
sx: classes.closeBtn,
|
87
|
+
children: "Cancel"
|
88
|
+
}), /*#__PURE__*/_jsx(Button, {
|
89
|
+
onClick: onSave,
|
90
|
+
sx: classes.saveBtn,
|
91
|
+
children: "Save"
|
92
|
+
})]
|
93
|
+
});
|
94
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
const styles = () => ({
|
2
|
+
dialogContainer: {
|
3
|
+
"& .MuiDialogContent-root": {
|
4
|
+
padding: "0px 20px"
|
5
|
+
},
|
6
|
+
"& .MuiDialogActions-root": {
|
7
|
+
padding: "10px"
|
8
|
+
},
|
9
|
+
"& .MuiTypography-h6": {
|
10
|
+
fontWeight: 600,
|
11
|
+
fontSize: "16px",
|
12
|
+
paddingRight: "20px"
|
13
|
+
},
|
14
|
+
"& .MuiGrid-container": {
|
15
|
+
marginTop: "0px"
|
16
|
+
},
|
17
|
+
"& .MuiGrid-item": {
|
18
|
+
padding: "14px"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
saveBtn: {
|
22
|
+
color: "#fff",
|
23
|
+
background: "#2563EB",
|
24
|
+
fontSize: "14px",
|
25
|
+
fontWeight: 500,
|
26
|
+
padding: "4px 24px",
|
27
|
+
textTransform: "none",
|
28
|
+
"&:hover": {
|
29
|
+
color: "#fff",
|
30
|
+
background: "#2563EB"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
closeBtn: {
|
34
|
+
backgroundColor: "#F4F6F9",
|
35
|
+
color: "#64748B",
|
36
|
+
fontSize: "14px",
|
37
|
+
fontWeight: 500,
|
38
|
+
padding: "4px 22px",
|
39
|
+
textTransform: "none",
|
40
|
+
border: "1px solid #D8DDE1",
|
41
|
+
"&:hover": {
|
42
|
+
border: "1px solid #64748B"
|
43
|
+
}
|
44
|
+
},
|
45
|
+
closeIcon: {
|
46
|
+
position: "absolute",
|
47
|
+
right: 8,
|
48
|
+
top: 8,
|
49
|
+
color: theme => theme.palette.grey[500]
|
50
|
+
},
|
51
|
+
gridDivider: {
|
52
|
+
borderRight: "1px solid rgba(0, 0, 0, 0.12)"
|
53
|
+
},
|
54
|
+
mobileActionBtns: {
|
55
|
+
display: "flex",
|
56
|
+
justifyContent: "flex-end",
|
57
|
+
gap: "8px",
|
58
|
+
paddingTop: "14px",
|
59
|
+
marginTop: "14px",
|
60
|
+
borderTop: theme => `1px solid ${theme.palette.grey[300]}`
|
61
|
+
},
|
62
|
+
mobileDialogContent: {
|
63
|
+
borderTop: theme => `1px solid ${theme.palette.grey[300]}`,
|
64
|
+
paddingTop: "14px"
|
65
|
+
}
|
66
|
+
});
|
67
|
+
export default styles;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { MenuItem, Select } from "@mui/material";
|
2
|
+
import { fontFamilyMap } from "../utils/font";
|
3
|
+
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
function CustomSelect(props) {
|
6
|
+
const {
|
7
|
+
classes,
|
8
|
+
onChange,
|
9
|
+
options = [],
|
10
|
+
value
|
11
|
+
} = props;
|
12
|
+
return /*#__PURE__*/_jsx(Select, {
|
13
|
+
fullWidth: true,
|
14
|
+
value: value,
|
15
|
+
onChange: onChange,
|
16
|
+
className: "editor-dd",
|
17
|
+
style: {
|
18
|
+
fontFamily: fontFamilyMap[value],
|
19
|
+
width: "100%",
|
20
|
+
height: "36px",
|
21
|
+
borderRadius: "10px",
|
22
|
+
fontSize: "14px"
|
23
|
+
},
|
24
|
+
MenuProps: {
|
25
|
+
PaperProps: {
|
26
|
+
sx: classes?.textOptions
|
27
|
+
}
|
28
|
+
},
|
29
|
+
sx: classes.textFormatSelect,
|
30
|
+
IconComponent: KeyboardArrowDownRoundedIcon,
|
31
|
+
children: options.map((option, i) => {
|
32
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
33
|
+
value: option.value,
|
34
|
+
style: {
|
35
|
+
fontFamily: option.text || "inherit"
|
36
|
+
},
|
37
|
+
sx: classes.textFormatSelectOptions,
|
38
|
+
children: option?.label || option?.text
|
39
|
+
}, i);
|
40
|
+
})
|
41
|
+
});
|
42
|
+
}
|
43
|
+
export default CustomSelect;
|
@@ -7,7 +7,7 @@ import { useEditorContext } from "../../hooks/useMouseMove";
|
|
7
7
|
import { Transforms } from "slate";
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
-
const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "grid"];
|
10
|
+
const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree", "grid"];
|
11
11
|
const DragHandleStyle = fromPopper => {
|
12
12
|
const handleDragStyle = fromPopper ? {
|
13
13
|
position: "absolute",
|
@@ -19,6 +19,8 @@ const FontLoader = props => {
|
|
19
19
|
const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
|
20
20
|
let currentIndex = 0;
|
21
21
|
let retryCount = 0;
|
22
|
+
// let hideLoaderOn = 30;
|
23
|
+
|
22
24
|
const loadNextBatch = () => {
|
23
25
|
try {
|
24
26
|
if (currentIndex >= families?.length) {
|
@@ -79,6 +81,7 @@ const FontLoader = props => {
|
|
79
81
|
// console.log(err);
|
80
82
|
// setLoading(false);
|
81
83
|
});
|
84
|
+
// setLoading(true);
|
82
85
|
} else {
|
83
86
|
function correctFontArray(fontString) {
|
84
87
|
let fontsArray = fontString?.split(",");
|
@@ -48,6 +48,16 @@ import ChervUp from "../assets/svg/ChervUp";
|
|
48
48
|
import ResetIconNew from "../assets/svg/ResetIconNew";
|
49
49
|
import { jsx as _jsx } from "react/jsx-runtime";
|
50
50
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
51
|
+
const HeadingIcon = ({
|
52
|
+
variant
|
53
|
+
}) => {
|
54
|
+
return /*#__PURE__*/_jsx("div", {
|
55
|
+
style: {
|
56
|
+
color: "#64748B"
|
57
|
+
},
|
58
|
+
children: variant
|
59
|
+
});
|
60
|
+
};
|
51
61
|
const iconList = {
|
52
62
|
fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
|
53
63
|
size: 20
|
@@ -80,6 +90,24 @@ const iconList = {
|
|
80
90
|
size: 18,
|
81
91
|
fill: "#64748B"
|
82
92
|
}),
|
93
|
+
headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
|
94
|
+
variant: "H4"
|
95
|
+
}),
|
96
|
+
headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
|
97
|
+
variant: "H5"
|
98
|
+
}),
|
99
|
+
headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
|
100
|
+
variant: "H6"
|
101
|
+
}),
|
102
|
+
paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
|
103
|
+
variant: "P1"
|
104
|
+
}),
|
105
|
+
paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
|
106
|
+
variant: "P2"
|
107
|
+
}),
|
108
|
+
paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
|
109
|
+
variant: "P3"
|
110
|
+
}),
|
83
111
|
blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
|
84
112
|
size: 20,
|
85
113
|
fill: "#64748B",
|
@@ -17,7 +17,7 @@ const IMAGE_SLECTOR_OPTIONS = {
|
|
17
17
|
};
|
18
18
|
const TAB_SHOW = {
|
19
19
|
Image: ["upload", "choose", "addLink"],
|
20
|
-
Video: ["addLink"],
|
20
|
+
Video: ["upload", "addLink"],
|
21
21
|
Embed: ["addLink"],
|
22
22
|
Document: ["addLink", "upload"]
|
23
23
|
};
|
@@ -35,7 +35,7 @@ const ImageSelector = props => {
|
|
35
35
|
customProps
|
36
36
|
} = props;
|
37
37
|
const translation = customProps?.translation;
|
38
|
-
const [tabValue, setTabValue] = useState(title === "Image" ? "choose" : "addLink");
|
38
|
+
const [tabValue, setTabValue] = useState(title === "Image" ? "choose" : "Video" ? "upload" : "addLink");
|
39
39
|
const [image, setImage] = useState(value || "");
|
40
40
|
const handleTabChange = (e, newValue) => {
|
41
41
|
setImage("");
|
@@ -76,7 +76,7 @@ const ImageSelectorStyles = theme => ({
|
|
76
76
|
background: theme?.palette?.editor?.deviderBgColor,
|
77
77
|
"@media only screen and (min-width: 899px)": {
|
78
78
|
margin: "0px 24px",
|
79
|
-
width:
|
79
|
+
width: "calc(100% - 48px)"
|
80
80
|
}
|
81
81
|
},
|
82
82
|
"& .primaryBtn": {
|
@@ -104,12 +104,6 @@ const ImageSelectorStyles = theme => ({
|
|
104
104
|
marginRight: "8px !important"
|
105
105
|
},
|
106
106
|
"& .MuiGrid-root": {
|
107
|
-
"&::-webkit-scrollbar-thumb": {
|
108
|
-
background: `none !important`
|
109
|
-
},
|
110
|
-
"&::-webkit-scrollbar-track": {
|
111
|
-
visibility: "hidden"
|
112
|
-
},
|
113
107
|
"&::-webkit-scrollbar-thumb": {
|
114
108
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
115
109
|
},
|
@@ -118,10 +112,10 @@ const ImageSelectorStyles = theme => ({
|
|
118
112
|
}
|
119
113
|
},
|
120
114
|
"& .MuiImageList-root": {
|
121
|
-
margin:
|
115
|
+
margin: "0px"
|
122
116
|
},
|
123
117
|
"& .MuiDialogContent-root": {
|
124
|
-
padding:
|
118
|
+
padding: "20px 24px 5px 24px"
|
125
119
|
}
|
126
120
|
},
|
127
121
|
titleTypo: {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { Autocomplete,
|
1
|
+
import { Autocomplete, TextField, Typography, createFilterOptions } from "@mui/material";
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
3
3
|
import { useSlate } from "slate-react";
|
4
4
|
import Select from "../Select";
|
5
|
-
import
|
5
|
+
import Checkbox from "../Checkbox";
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
7
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
8
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -28,24 +28,10 @@ const OpenInNewTab = props => {
|
|
28
28
|
onNewTabChange,
|
29
29
|
translation
|
30
30
|
} = props;
|
31
|
-
return nav?.showOpenInNewTab ? /*#__PURE__*/_jsx(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
onChange: onNewTabChange,
|
36
|
-
className: "checkBox",
|
37
|
-
checkedIcon: /*#__PURE__*/_jsx(IconButton, {
|
38
|
-
className: "checkedIcon",
|
39
|
-
children: /*#__PURE__*/_jsx(CheckedBoxCheckIcon, {})
|
40
|
-
}),
|
41
|
-
icon: /*#__PURE__*/_jsx(IconButton, {
|
42
|
-
className: "unCheckedIcon"
|
43
|
-
})
|
44
|
-
}),
|
45
|
-
label: /*#__PURE__*/_jsx(Typography, {
|
46
|
-
variant: "body2",
|
47
|
-
children: "Open in new tab"
|
48
|
-
})
|
31
|
+
return nav?.showOpenInNewTab ? /*#__PURE__*/_jsx(Checkbox, {
|
32
|
+
checked: openInNewTab,
|
33
|
+
onChange: onNewTabChange,
|
34
|
+
label: translation("Open in new tab")
|
49
35
|
}) : null;
|
50
36
|
};
|
51
37
|
export const TextInput = props => {
|
@@ -72,8 +58,7 @@ export const SelectPage = props => {
|
|
72
58
|
value,
|
73
59
|
onChange,
|
74
60
|
services,
|
75
|
-
translation
|
76
|
-
classes
|
61
|
+
translation
|
77
62
|
} = props;
|
78
63
|
const [pages, setPages] = useState([]);
|
79
64
|
const editor = useSlate();
|
@@ -126,28 +111,42 @@ export const SelectPage = props => {
|
|
126
111
|
}, [value, pages]);
|
127
112
|
const isCurrentPage = page?.value === "_currentPage";
|
128
113
|
return /*#__PURE__*/_jsxs("div", {
|
129
|
-
children: [/*#__PURE__*/_jsx(
|
130
|
-
label: page?.label,
|
131
|
-
setValue: val => onChange(val?.value || ""),
|
132
|
-
placeholder: translation("Select Page"),
|
114
|
+
children: [/*#__PURE__*/_jsx(Select, {
|
133
115
|
options: pages,
|
116
|
+
value: page?.value,
|
117
|
+
onChange: e => onChange(e.target.value || ""),
|
134
118
|
disabled: isCurrentPage,
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
let url = page?.value;
|
140
|
-
if (val?.value) {
|
141
|
-
url += `#${val?.value}`;
|
142
|
-
}
|
143
|
-
onChange(url);
|
144
|
-
},
|
145
|
-
placeholder: translation("Select Section or anchor"),
|
119
|
+
label: translation("Select Page"),
|
120
|
+
showDefault: true,
|
121
|
+
translation: translation
|
122
|
+
}), /*#__PURE__*/_jsx(Select, {
|
146
123
|
options: page?.sections?.map(p => ({
|
147
124
|
label: p,
|
148
125
|
value: p
|
149
126
|
})),
|
150
|
-
|
127
|
+
value: section?.value,
|
128
|
+
onChange: e => {
|
129
|
+
const {
|
130
|
+
value = ""
|
131
|
+
} = e.target;
|
132
|
+
let url = page?.value;
|
133
|
+
if (value) {
|
134
|
+
url += `#${value}`;
|
135
|
+
} else {
|
136
|
+
const [page] = url.split("#");
|
137
|
+
url = page;
|
138
|
+
}
|
139
|
+
onChange(url);
|
140
|
+
},
|
141
|
+
disabled: isCurrentPage,
|
142
|
+
label: translation("Select Section or anchor"),
|
143
|
+
labelProps: {
|
144
|
+
sx: {
|
145
|
+
padding: "10px 0px 4px 0px"
|
146
|
+
}
|
147
|
+
},
|
148
|
+
showDefault: true,
|
149
|
+
translation: translation
|
151
150
|
}), isCurrentPage ? null : /*#__PURE__*/_jsx(OpenInNewTab, {
|
152
151
|
...props
|
153
152
|
})]
|
@@ -176,34 +175,15 @@ export const ScrollTopBottom = props => {
|
|
176
175
|
const {
|
177
176
|
value,
|
178
177
|
onChange,
|
179
|
-
translation
|
180
|
-
classes
|
178
|
+
translation
|
181
179
|
} = props;
|
182
|
-
return /*#__PURE__*/
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
}), /*#__PURE__*/_jsx(Select, {
|
190
|
-
size: "small",
|
191
|
-
fullWidth: true,
|
192
|
-
value: value,
|
193
|
-
onChange: e => onChange(e.target.value),
|
194
|
-
MenuProps: {
|
195
|
-
sx: classes.customSelect
|
196
|
-
},
|
197
|
-
children: scrollToOptions.map((option, i) => {
|
198
|
-
return /*#__PURE__*/_jsx(MenuItem, {
|
199
|
-
value: option.value,
|
200
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
201
|
-
variant: "body2",
|
202
|
-
children: translation(option.label)
|
203
|
-
})
|
204
|
-
}, i);
|
205
|
-
})
|
206
|
-
})]
|
180
|
+
return /*#__PURE__*/_jsx(Select, {
|
181
|
+
options: scrollToOptions,
|
182
|
+
value: value,
|
183
|
+
onChange: e => onChange(e.target.value),
|
184
|
+
label: translation("Choose Top/Bottom of page"),
|
185
|
+
showDefault: true,
|
186
|
+
translation: translation
|
207
187
|
});
|
208
188
|
};
|
209
189
|
const filter = createFilterOptions();
|
@@ -5,7 +5,7 @@ import DialogContent from "@mui/material/DialogContent";
|
|
5
5
|
import DialogActions from "@mui/material/DialogActions";
|
6
6
|
import IconButton from "@mui/material/IconButton";
|
7
7
|
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
8
|
-
import { Box, FormControl,
|
8
|
+
import { Box, FormControl, Grid, Typography, useMediaQuery } from "@mui/material";
|
9
9
|
import { useState } from "react";
|
10
10
|
import LinkSettingsStyles from "./style";
|
11
11
|
import { getNavOptions } from "./navOptions";
|
@@ -13,6 +13,7 @@ import { ScrollTopBottom, SelectPage, TextInput, Trigger } from "./NavComponents
|
|
13
13
|
import SwipeableDrawer from "../SwipeableDrawer";
|
14
14
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
15
15
|
import Select from "../Select";
|
16
|
+
import RadioGroup from "../RadioGroup";
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
17
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
19
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -46,7 +47,7 @@ export default function LinkSettings(props) {
|
|
46
47
|
tagName,
|
47
48
|
translation
|
48
49
|
} = customProps;
|
49
|
-
const isMobile = useMediaQuery(
|
50
|
+
const isMobile = useMediaQuery("(max-width: 899px)");
|
50
51
|
const navOptions = getNavOptions(customProps.hideTools, tagName, allowTrigger);
|
51
52
|
const classes = LinkSettingsStyles(theme);
|
52
53
|
const [nav, setNav] = useState(getNav(navType, navOptions));
|
@@ -68,7 +69,7 @@ export default function LinkSettings(props) {
|
|
68
69
|
open: true,
|
69
70
|
onClose: handleClose,
|
70
71
|
children: /*#__PURE__*/_jsxs(Grid, {
|
71
|
-
sx: classes.
|
72
|
+
sx: classes.swipeableDrawerContainer,
|
72
73
|
children: [/*#__PURE__*/_jsx(Typography, {
|
73
74
|
variant: "subtitle1",
|
74
75
|
gutterBottom: true,
|
@@ -78,8 +79,7 @@ export default function LinkSettings(props) {
|
|
78
79
|
className: "link-settings-title",
|
79
80
|
children: translation("dialogueTitle")
|
80
81
|
}), /*#__PURE__*/_jsx(Select, {
|
81
|
-
|
82
|
-
fullWidth: true,
|
82
|
+
options: navOptions,
|
83
83
|
value: nav?.value,
|
84
84
|
onChange: e => {
|
85
85
|
const {
|
@@ -90,19 +90,10 @@ export default function LinkSettings(props) {
|
|
90
90
|
setNavValue("");
|
91
91
|
},
|
92
92
|
displayEmpty: true,
|
93
|
+
translation: translation,
|
93
94
|
MenuProps: {
|
94
|
-
sx: classes.customSelect
|
95
|
-
|
96
|
-
},
|
97
|
-
children: navOptions.map((navOption, i) => {
|
98
|
-
return /*#__PURE__*/_jsx(MenuItem, {
|
99
|
-
value: navOption.value,
|
100
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
101
|
-
variant: "body2",
|
102
|
-
children: translation(navOption.label)
|
103
|
-
})
|
104
|
-
}, i);
|
105
|
-
})
|
95
|
+
sx: classes.customSelect
|
96
|
+
}
|
106
97
|
}), /*#__PURE__*/_jsx(Box, {
|
107
98
|
sx: {
|
108
99
|
paddingTop: "14px"
|
@@ -167,18 +158,13 @@ export default function LinkSettings(props) {
|
|
167
158
|
children: /*#__PURE__*/_jsx(FormControl, {
|
168
159
|
sx: classes.customRadioBtn,
|
169
160
|
children: /*#__PURE__*/_jsx(RadioGroup, {
|
161
|
+
options: navOptions,
|
170
162
|
value: nav?.value,
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
onChange: () => {
|
177
|
-
setNav(navOption);
|
178
|
-
setNavValue("");
|
179
|
-
}
|
180
|
-
}, i);
|
181
|
-
})
|
163
|
+
onChange: navOption => {
|
164
|
+
setNav(navOption);
|
165
|
+
setNavValue("");
|
166
|
+
},
|
167
|
+
translation: translation
|
182
168
|
})
|
183
169
|
})
|
184
170
|
}), /*#__PURE__*/_jsx(Grid, {
|
@@ -26,11 +26,11 @@ export const getNavOptions = (hideTools = [], tagName = "", allowTrigger) => {
|
|
26
26
|
}, {
|
27
27
|
label: "Email",
|
28
28
|
value: "email",
|
29
|
-
placeholder: "
|
29
|
+
placeholder: "mail@example.com"
|
30
30
|
}, {
|
31
31
|
label: "Phone number",
|
32
32
|
value: "phone",
|
33
|
-
placeholder: "
|
33
|
+
placeholder: "+1 (702) 123-4567"
|
34
34
|
}];
|
35
35
|
navOptions = navOptions.filter(n => !hideTools.includes(n.value));
|
36
36
|
if (!allowTrigger) {
|