@flozy/editor 8.0.7 → 8.0.8
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 +2 -1
- package/dist/Editor/CommonEditor.js +112 -33
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +32 -16
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +25 -9
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +57 -12
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +9 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +19 -9
- package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +32 -2
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +126 -29
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- package/dist/Editor/Elements/Embed/Image.js +2 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -14
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +2 -1
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/GridItem.js +2 -3
- package/dist/Editor/Elements/Link/Link.js +70 -43
- package/dist/Editor/Elements/SimpleText/index.js +7 -12
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +17 -16
- package/dist/Editor/Elements/Table/TableCell.js +4 -3
- package/dist/Editor/Elements/Title/title.js +13 -1
- package/dist/Editor/Elements/Variables/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/Styles/EditorStyles.js +287 -291
- 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 +7 -15
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -0
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +9 -8
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +210 -85
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +56 -9
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +34 -56
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +35 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +90 -0
- package/dist/Editor/common/CustomDialog/style.js +67 -0
- package/dist/Editor/common/CustomDialog/styles.js +80 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/DnD/Draggable.js +0 -1
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +74 -42
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/Options/Upload.js +2 -2
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -10
- package/dist/Editor/common/LinkSettings/NavComponents.js +0 -5
- package/dist/Editor/common/LinkSettings/index.js +0 -5
- package/dist/Editor/common/MentionsPopup/Styles.js +6 -12
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
- 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/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -2
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -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 +5 -4
- package/dist/Editor/common/RnD/Utils/index.js +45 -0
- package/dist/Editor/common/RnD/index.js +23 -3
- package/dist/Editor/common/Section/index.js +60 -89
- package/dist/Editor/common/Shorthands/elements.js +54 -0
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- 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 +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +35 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/commonStyle.js +114 -69
- package/dist/Editor/helper/deserialize/index.js +1 -1
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useDrag.js +17 -11
- package/dist/Editor/hooks/useEditorScroll.js +1 -2
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +20 -21
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +283 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +220 -0
- package/dist/Editor/themeSettings/fonts/style.js +44 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +320 -0
- package/dist/Editor/themeSettings/style.js +152 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +356 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +157 -49
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +59 -19
- package/dist/Editor/utils/link.js +1 -1
- package/package.json +6 -3
@@ -0,0 +1,106 @@
|
|
1
|
+
import { Box, Button, Paper, Typography, useTheme } from "@mui/material";
|
2
|
+
import ColorPickerTool from "react-gcolor-picker";
|
3
|
+
import customColorPickerStyles from "./style";
|
4
|
+
import { colors } from "../../Elements/Color Picker/defaultColors";
|
5
|
+
import { useMemo } from "react";
|
6
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
function CustomColorPicker(props) {
|
10
|
+
const {
|
11
|
+
gradient,
|
12
|
+
color,
|
13
|
+
onChange,
|
14
|
+
defaultColors,
|
15
|
+
recentColors,
|
16
|
+
closeDrawer,
|
17
|
+
hideThemeColors,
|
18
|
+
disableEditTheme
|
19
|
+
} = props;
|
20
|
+
const {
|
21
|
+
setOpenTheme
|
22
|
+
} = useEditorContext();
|
23
|
+
const classes = customColorPickerStyles();
|
24
|
+
const theme = useTheme();
|
25
|
+
const colorVars = theme?.vars?.colors || {};
|
26
|
+
const colorTabs = useMemo(() => {
|
27
|
+
const otherColors = {
|
28
|
+
title: "Recent colours",
|
29
|
+
colors: [...(recentColors || []), ...defaultColors],
|
30
|
+
onChange: onChange
|
31
|
+
};
|
32
|
+
const themeColors = Object.values(colorVars);
|
33
|
+
const tabs = [];
|
34
|
+
if (themeColors?.length && !hideThemeColors) {
|
35
|
+
tabs.push({
|
36
|
+
title: "Theme colours",
|
37
|
+
onEdit: () => {
|
38
|
+
setOpenTheme("editThemeColor");
|
39
|
+
closeDrawer();
|
40
|
+
},
|
41
|
+
colors: Object.values(colorVars),
|
42
|
+
onChange: onChange
|
43
|
+
});
|
44
|
+
}
|
45
|
+
tabs.push(otherColors);
|
46
|
+
return tabs;
|
47
|
+
}, [recentColors, defaultColors, onChange, colorVars]);
|
48
|
+
return /*#__PURE__*/_jsxs(Paper, {
|
49
|
+
component: "div",
|
50
|
+
sx: classes.customColorPickerContainer,
|
51
|
+
children: [/*#__PURE__*/_jsx(ColorPickerTool, {
|
52
|
+
gradient: gradient,
|
53
|
+
value: color?.startsWith("var") ? "" : color,
|
54
|
+
onChange: onChange,
|
55
|
+
defaultColors: [],
|
56
|
+
popupWidth: "300"
|
57
|
+
}), colorTabs.map((tab, i) => {
|
58
|
+
const {
|
59
|
+
title,
|
60
|
+
onEdit,
|
61
|
+
colors = [],
|
62
|
+
onChange
|
63
|
+
} = tab;
|
64
|
+
return /*#__PURE__*/_jsxs(Box, {
|
65
|
+
component: "div",
|
66
|
+
className: "customColorPickerWrapper",
|
67
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
68
|
+
component: "div",
|
69
|
+
className: "colorTitleWrapper",
|
70
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
71
|
+
variant: "subtitle2",
|
72
|
+
children: title
|
73
|
+
}), onEdit && !disableEditTheme ? /*#__PURE__*/_jsx(Button, {
|
74
|
+
variant: "text",
|
75
|
+
className: "editBtn",
|
76
|
+
onClick: () => onEdit(tab),
|
77
|
+
children: "Edit"
|
78
|
+
}) : null]
|
79
|
+
}), /*#__PURE__*/_jsx(Box, {
|
80
|
+
component: "div",
|
81
|
+
className: "colorPickerBtnContainer",
|
82
|
+
children: [...new Set(colors)].map((colorVar, i) => {
|
83
|
+
const isSelected = colorVar === color;
|
84
|
+
return /*#__PURE__*/_jsx(Box, {
|
85
|
+
className: isSelected ? "colorPicketBtnActive" : "",
|
86
|
+
component: "div",
|
87
|
+
children: /*#__PURE__*/_jsx("button", {
|
88
|
+
style: {
|
89
|
+
background: colorVar
|
90
|
+
},
|
91
|
+
onClick: () => onChange(colorVar),
|
92
|
+
className: `colorPicketBtn`,
|
93
|
+
type: "button"
|
94
|
+
})
|
95
|
+
}, i);
|
96
|
+
})
|
97
|
+
})]
|
98
|
+
}, i);
|
99
|
+
})]
|
100
|
+
});
|
101
|
+
}
|
102
|
+
CustomColorPicker.defaultProps = {
|
103
|
+
defaultColors: [...colors],
|
104
|
+
closeDrawer: () => {}
|
105
|
+
};
|
106
|
+
export default CustomColorPicker;
|
@@ -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: "8px"
|
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,90 @@
|
|
1
|
+
import { Button, Dialog, DialogActions, DialogContent, Grid, SwipeableDrawer, Typography, useMediaQuery } from "@mui/material";
|
2
|
+
import PropTypes from "prop-types";
|
3
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
+
import CustomDialogStyles from "./styles";
|
5
|
+
import { forwardRef, useImperativeHandle, useState } from "react";
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
9
|
+
const CustomDialog = (props, ref) => {
|
10
|
+
const {
|
11
|
+
content,
|
12
|
+
confirmText,
|
13
|
+
cancelText,
|
14
|
+
onConfirm
|
15
|
+
} = props;
|
16
|
+
const [open, setOpen] = useState(false);
|
17
|
+
const isMobile = useMediaQuery("(max-width:899px)");
|
18
|
+
const {
|
19
|
+
theme
|
20
|
+
} = useEditorContext();
|
21
|
+
const classes = CustomDialogStyles(theme);
|
22
|
+
useImperativeHandle(ref, () => ({
|
23
|
+
handleOpen: () => setOpen(true),
|
24
|
+
handleClose: () => setOpen(false)
|
25
|
+
}));
|
26
|
+
const DialogueContent = () => /*#__PURE__*/_jsxs(_Fragment, {
|
27
|
+
children: [/*#__PURE__*/_jsx(DialogContent, {
|
28
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
29
|
+
children: content
|
30
|
+
})
|
31
|
+
}), /*#__PURE__*/_jsxs(DialogActions, {
|
32
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
33
|
+
className: "closeBtn",
|
34
|
+
onClick: () => setOpen(false),
|
35
|
+
children: cancelText
|
36
|
+
}), /*#__PURE__*/_jsx(Button, {
|
37
|
+
className: "confirmBtn",
|
38
|
+
onClick: () => {
|
39
|
+
onConfirm();
|
40
|
+
setOpen(false);
|
41
|
+
},
|
42
|
+
children: confirmText
|
43
|
+
})]
|
44
|
+
})]
|
45
|
+
});
|
46
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
47
|
+
children: !isMobile ? /*#__PURE__*/_jsx(Dialog, {
|
48
|
+
className: `${classes.MuiBackdropRoot}`,
|
49
|
+
open: open,
|
50
|
+
onClose: () => setOpen(false),
|
51
|
+
fullWidth: true,
|
52
|
+
maxWidth: "sm",
|
53
|
+
sx: classes.CustomDialogu,
|
54
|
+
children: /*#__PURE__*/_jsx(DialogueContent, {})
|
55
|
+
}) : /*#__PURE__*/_jsxs(SwipeableDrawer, {
|
56
|
+
open: open,
|
57
|
+
anchor: "bottom",
|
58
|
+
onClose: () => setOpen(false),
|
59
|
+
style: {
|
60
|
+
zIndex: "1300"
|
61
|
+
},
|
62
|
+
sx: classes.CustomDialogu,
|
63
|
+
disableBackdropTransition: true,
|
64
|
+
disableSwipeToOpen: true,
|
65
|
+
children: [/*#__PURE__*/_jsx(Grid, {
|
66
|
+
container: true,
|
67
|
+
justifyContent: "center",
|
68
|
+
className: "pullerRoot",
|
69
|
+
children: /*#__PURE__*/_jsx(Grid, {
|
70
|
+
item: true,
|
71
|
+
className: "pullerGrid"
|
72
|
+
})
|
73
|
+
}), /*#__PURE__*/_jsx(DialogueContent, {})]
|
74
|
+
})
|
75
|
+
});
|
76
|
+
};
|
77
|
+
const CustomDialogComponent = /*#__PURE__*/forwardRef(CustomDialog);
|
78
|
+
CustomDialogComponent.defaultProps = {
|
79
|
+
content: "Are you sure you want to proceed?",
|
80
|
+
confirmText: "Confirm",
|
81
|
+
cancelText: "Cancel",
|
82
|
+
onConfirm: () => console.warn("onConfirm not provided")
|
83
|
+
};
|
84
|
+
CustomDialogComponent.propTypes = {
|
85
|
+
content: PropTypes.string,
|
86
|
+
confirmText: PropTypes.string,
|
87
|
+
cancelText: PropTypes.string,
|
88
|
+
onConfirm: PropTypes.func
|
89
|
+
};
|
90
|
+
export { CustomDialogComponent };
|
@@ -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,80 @@
|
|
1
|
+
const CustomDialogStyles = theme => ({
|
2
|
+
MuiBackdropRoot: {
|
3
|
+
opacity: "1",
|
4
|
+
transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"
|
5
|
+
},
|
6
|
+
CustomDialogu: {
|
7
|
+
"& .MuiPaper-root": {
|
8
|
+
borderRadius: "12px 12px 0px 0px",
|
9
|
+
backgroundColor: `${theme?.palette?.greyshades?.light9} !important`,
|
10
|
+
"@media only screen and (min-width: 899px)": {
|
11
|
+
maxWidth: "400px",
|
12
|
+
border: `1px solid ${theme?.palette?.editor?.customDialogueBorder}`,
|
13
|
+
borderRadius: "12px"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"& .MuiDialogContent-root": {
|
17
|
+
padding: "20px 24px 8px 24px",
|
18
|
+
"& .MuiTypography-root": {
|
19
|
+
textAlign: "center",
|
20
|
+
fontFamily: "Inter, sans-serif",
|
21
|
+
fontSize: "14px",
|
22
|
+
fontWeight: 500,
|
23
|
+
color: theme?.palette?.editor?.textColor
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"& .confirmBtn": {
|
27
|
+
backgroundColor: "#2563EB",
|
28
|
+
padding: "8px 12px",
|
29
|
+
color: "#ffffff",
|
30
|
+
fontWeight: 600,
|
31
|
+
fontSize: "14px",
|
32
|
+
opacity: 1,
|
33
|
+
borderRadius: "8px",
|
34
|
+
textTransform: "math-auto",
|
35
|
+
height: "36px",
|
36
|
+
padding: "0px 12px",
|
37
|
+
minWidth: "90px",
|
38
|
+
"&:hover": {
|
39
|
+
backgroundColor: "#2563EB"
|
40
|
+
},
|
41
|
+
"@media only screen and (max-width: 899px)": {
|
42
|
+
width: "50%"
|
43
|
+
}
|
44
|
+
},
|
45
|
+
"& .MuiDialogActions-root": {
|
46
|
+
justifyContent: "center",
|
47
|
+
paddingBottom: "20px"
|
48
|
+
},
|
49
|
+
"& .closeBtn": {
|
50
|
+
padding: "8px 12px",
|
51
|
+
color: theme?.palette?.editor?.customDialogueCloseBtnColor,
|
52
|
+
fontWeight: 600,
|
53
|
+
fontSize: "14px",
|
54
|
+
opacity: 1,
|
55
|
+
borderRadius: "8px",
|
56
|
+
textTransform: "math-auto",
|
57
|
+
height: "36px",
|
58
|
+
padding: "0px 12px",
|
59
|
+
minWidth: "90px",
|
60
|
+
backgroundColor: theme?.palette?.editor?.closeButtonBackground,
|
61
|
+
border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`,
|
62
|
+
"&:hover": {
|
63
|
+
backgroundColor: theme?.palette?.editor?.closeButtonBackground
|
64
|
+
},
|
65
|
+
"@media only screen and (max-width: 899px)": {
|
66
|
+
width: "50%"
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"& .pullerRoot": {
|
70
|
+
padding: "8px 0"
|
71
|
+
},
|
72
|
+
"& .pullerGrid": {
|
73
|
+
width: "40px",
|
74
|
+
height: "5px",
|
75
|
+
backgroundColor: "#ccc",
|
76
|
+
borderRadius: "10px"
|
77
|
+
}
|
78
|
+
}
|
79
|
+
});
|
80
|
+
export default CustomDialogStyles;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { MenuItem, Select } from "@mui/material";
|
2
|
+
import { fontFamilyMap } from "../utils/font";
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
function CustomSelect(props) {
|
5
|
+
const {
|
6
|
+
onChange,
|
7
|
+
options = [],
|
8
|
+
value
|
9
|
+
} = props;
|
10
|
+
return /*#__PURE__*/_jsx(Select, {
|
11
|
+
fullWidth: true,
|
12
|
+
value: value,
|
13
|
+
onChange: onChange,
|
14
|
+
className: "editor-dd",
|
15
|
+
style: {
|
16
|
+
fontFamily: fontFamilyMap[value],
|
17
|
+
width: "100%",
|
18
|
+
height: "36px",
|
19
|
+
borderRadius: "10px",
|
20
|
+
fontSize: "14px"
|
21
|
+
},
|
22
|
+
children: options.map((option, i) => {
|
23
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
24
|
+
value: option.value,
|
25
|
+
style: {
|
26
|
+
fontFamily: option.text
|
27
|
+
},
|
28
|
+
children: option?.label || option?.text
|
29
|
+
}, i);
|
30
|
+
})
|
31
|
+
});
|
32
|
+
}
|
33
|
+
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",
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useEffect } from "react";
|
2
2
|
import { useDraggable } from "@dnd-kit/core";
|
3
3
|
import { Box } from "@mui/material";
|
4
|
-
import DragIndicatorIcon from "@mui/icons-material/DragIndicator";
|
5
4
|
import { SectionDragIcon } from "../iconListV2";
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
6
|
const Draggable = props => {
|
@@ -1,11 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
export const otherFonts = ["PoppinsRegular", "PoppinsBold", "Monaco", "Qwitcher Grypen", "Bulgarian Garamond", "Redacted Script", "Herr Von Muellerhoff", "Dawning of a New Day", "Coming Soon", "Engagement", "Ingrid Darling", "La Belle Aurore", "Mea Culpa", "The Girl Next Door", "Helvetica", "Georgia", "Times New Roman", "Courier New", "Impact"];
|
5
|
-
export const googleFontList = ["Roboto", "Noto Sans JP", "Poppins", "Lato", "Inter", "Roboto Condensed", "Roboto Mono", "Oswald", "Noto Sans", "Nunito", "Nunito Sans", "Ubuntu", "Rubik", "Playfair Display", "Noto Sans KR", "Roboto Slab", "PT Sans", "Kanit", "Work Sans", "Lora", "DM Sans", "Mulish", "Quicksand", "Fira Sans", "Noto Sans TC", "Inconsolata", "Barlow", "Manrope", "IBM Plex Sans", "PT Serif", "Karla", "Titillium Web", "Heebo", "Noto Serif", "Nanum Gothic", "Noto Color Emoji", "Agdasima", "Bebas Neue", "Libre Franklin", "Mukta", "Outfit", "Josefin Sans", "Source Code Pro", "Jost", "Space Grotesk", "Hind Siliguri", "Arimo", "Cabin", "Barlow Condensed", "Dosis", "Fira Sans Condensed", "Bitter", "Archivo", "Figtree", "Noto Serif JP", "PT Sans Narrow", "Abel", "Noto Sans SC",
|
6
|
-
// "Source Sans 3",
|
7
|
-
"Hind",
|
8
|
-
// "Exo 2",
|
9
|
-
"Teko", "Oxygen", "Cairo", "Crimson Text", "Plus Jakarta Sans", "Overpass", "Pacifico", "Prompt", "Red Hat Display", "Varela Round", "Cormorant Garamond", "Assistant", "Comfortaa", "Lexend", "Signika Negative",
|
10
|
-
// "M PLUS Rounded 1c",
|
11
|
-
"Fjalla One", "Caveat", "IBM Plex Mono", "Arvo", "Lobster", "Schibsted Grotesk", "Chakra Petch", "Maven Pro", "Sora", "Kalam", "Onest", "Space Grotesk", "Outfit", 'Titillium Web', ...defaultFonts];
|
1
|
+
const otherFonts = ["PoppinsRegular", "PoppinsBold", "Qwitcher Grypen", "Bulgarian Garamond", "Redacted Script", "Herr Von Muellerhoff", "Dawning of a New Day", "Coming Soon", "Engagement", "Ingrid Darling", "La Belle Aurore", "Mea Culpa", "The Girl Next Door"];
|
2
|
+
const mostUsedGoogleFonts = ["Roboto", "Poppins", "Lato", "Inter", "Nunito", "Ubuntu", "Oswald", "Rubik", "Roboto Slab", "PT Sans", "Work Sans", "Lora", "Mulish", "DM Sans", "Fira Sans", "Quicksand", "Barlow", "Manrope", "IBM Plex Sans", "PT Serif", "Libre Franklin", "Bebas Neue", "Cabin", "Titillium Web", "Heebo", "Noto Serif", "Jost", "Source Code Pro", "Josefin Sans", "Dosis", "Fira Sans Condensed", "Archivo", "Noto Serif JP", "Crimson Text", "Cairo", "Pacifico", "Red Hat Display", "Assistant", "Comfortaa", "Lexend", "Fjalla One", "Caveat", "Arvo", "Lobster", "Schibsted Grotesk", "EB Garamond", "Sora", "Kalam", "Onest", "Space Grotesk", "Outfit", "Plus Jakarta Sans"];
|
3
|
+
export const googleFontList = [...mostUsedGoogleFonts, ...otherFonts];
|
@@ -1,7 +1,11 @@
|
|
1
|
-
import { useEffect } from "react";
|
1
|
+
import { useEffect, useState } from "react";
|
2
2
|
import WebFont from "webfontloader";
|
3
3
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
-
import {
|
4
|
+
import { googleFontList } from "./FontList";
|
5
|
+
import CircularProgress from "@mui/material/CircularProgress";
|
6
|
+
import Box from "@mui/material/Box";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
5
9
|
const FontLoader = props => {
|
6
10
|
const {
|
7
11
|
otherProps,
|
@@ -10,65 +14,72 @@ const FontLoader = props => {
|
|
10
14
|
const {
|
11
15
|
setFontFamilies
|
12
16
|
} = useEditorContext();
|
17
|
+
const [loading, setLoading] = useState(true);
|
13
18
|
const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
|
14
19
|
let currentIndex = 0;
|
15
20
|
let retryCount = 0;
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
},
|
35
|
-
inactive: () => {
|
36
|
-
// console.log(`Font loading failed for: ${batch}`);
|
37
|
-
|
38
|
-
if (retryCount < maxRetries) {
|
39
|
-
retryCount++;
|
40
|
-
// console.log(`Retrying batch (${retryCount}/${maxRetries})...`);
|
41
|
-
// Retry loading the same batch
|
42
|
-
loadNextBatch();
|
43
|
-
} else {
|
44
|
-
// console.log(
|
45
|
-
// `Max retries reached for batch: ${batch}. Moving to the next batch.`
|
46
|
-
// );
|
21
|
+
let hideLoaderOn = 30;
|
22
|
+
const loadNextBatch = () => {
|
23
|
+
try {
|
24
|
+
if (currentIndex >= families?.length) {
|
25
|
+
// console.log("All fonts have been loaded");
|
26
|
+
setLoading(false);
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
const batch = families?.slice(currentIndex, currentIndex + batchSize);
|
30
|
+
const batchWithWeights = batch.map(font => `${font}:300,400,600,700`);
|
31
|
+
WebFont.load({
|
32
|
+
google: {
|
33
|
+
families: [...batchWithWeights]
|
34
|
+
},
|
35
|
+
classes: false,
|
36
|
+
timeout: 2000,
|
37
|
+
active: () => {
|
38
|
+
// console.log(`Fonts loaded successfully: ${batch}`);
|
47
39
|
currentIndex += batchSize;
|
48
40
|
retryCount = 0; // Reset retry count for the next batch
|
49
41
|
loadNextBatch();
|
42
|
+
},
|
43
|
+
inactive: () => {
|
44
|
+
// console.log(`Font loading failed for: ${batch}`);
|
45
|
+
if (retryCount < maxRetries) {
|
46
|
+
retryCount++;
|
47
|
+
// console.log(`Retrying batch (${retryCount}/${maxRetries})...`);
|
48
|
+
// Retry loading the same batch
|
49
|
+
loadNextBatch();
|
50
|
+
} else {
|
51
|
+
// console.log(
|
52
|
+
// `Max retries reached for batch: ${batch}. Moving to the next batch.`
|
53
|
+
// );
|
54
|
+
currentIndex += batchSize;
|
55
|
+
retryCount = 0;
|
56
|
+
loadNextBatch();
|
57
|
+
}
|
50
58
|
}
|
51
|
-
}
|
52
|
-
})
|
53
|
-
|
59
|
+
});
|
60
|
+
} catch (err) {
|
61
|
+
setLoading(false);
|
62
|
+
}
|
63
|
+
};
|
54
64
|
loadNextBatch();
|
55
65
|
};
|
56
66
|
useEffect(() => {
|
57
|
-
let families = [...
|
67
|
+
let families = [...googleFontList];
|
58
68
|
if (!readOnly) {
|
59
69
|
otherProps?.services("listGoogleFont", []).then(data => {
|
60
|
-
families = [...
|
61
|
-
const filteredfamilies = families?.filter(font => !font?.includes("Material"));
|
70
|
+
families = [...(data?.data || [])];
|
62
71
|
setFontFamilies({
|
63
72
|
id: 1,
|
64
73
|
format: "fontFamily",
|
65
74
|
type: "fontfamilydropdown",
|
66
|
-
options:
|
75
|
+
options: families || []
|
67
76
|
});
|
68
77
|
loadFontsInBatches(families);
|
69
78
|
}).catch(err => {
|
70
79
|
// console.log(err);
|
80
|
+
setLoading(false);
|
71
81
|
});
|
82
|
+
// setLoading(true);
|
72
83
|
} else {
|
73
84
|
function correctFontArray(fontString) {
|
74
85
|
let fontsArray = fontString.split(",");
|
@@ -88,11 +99,32 @@ const FontLoader = props => {
|
|
88
99
|
let families = Array.from(fontSet);
|
89
100
|
families = correctFontArray(families.join(", "));
|
90
101
|
families = families?.map(font => font?.replace(/\"/g, ""));
|
91
|
-
families = families?.map(font => font?.replace(", sans-serif", ""));
|
102
|
+
families = families?.map(font => font?.replace(", sans-serif", ""));
|
92
103
|
families = families.filter(font => googleFontList.includes(font));
|
93
104
|
loadFontsInBatches(families);
|
94
105
|
}
|
106
|
+
|
107
|
+
// Set timeout to hide loader after 5 seconds
|
108
|
+
const timeoutId = setTimeout(() => {
|
109
|
+
setLoading(false);
|
110
|
+
}, 5000);
|
111
|
+
return () => clearTimeout(timeoutId);
|
95
112
|
}, []);
|
96
|
-
return
|
113
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
114
|
+
children: loading ? /*#__PURE__*/_jsx(Box, {
|
115
|
+
sx: {
|
116
|
+
position: "absolute",
|
117
|
+
top: 0,
|
118
|
+
left: 0,
|
119
|
+
right: 0,
|
120
|
+
bottom: 0,
|
121
|
+
zIndex: 99999,
|
122
|
+
display: "flex",
|
123
|
+
justifyContent: "center",
|
124
|
+
alignItems: "center"
|
125
|
+
},
|
126
|
+
children: /*#__PURE__*/_jsx(CircularProgress, {})
|
127
|
+
}) : null
|
128
|
+
});
|
97
129
|
};
|
98
130
|
export default FontLoader;
|
@@ -44,6 +44,16 @@ import ChervDown from "../assets/svg/ChervDown";
|
|
44
44
|
import ChervUp from "../assets/svg/ChervUp";
|
45
45
|
import { jsx as _jsx } from "react/jsx-runtime";
|
46
46
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
47
|
+
const HeadingIcon = ({
|
48
|
+
variant
|
49
|
+
}) => {
|
50
|
+
return /*#__PURE__*/_jsx("div", {
|
51
|
+
style: {
|
52
|
+
color: "#64748B"
|
53
|
+
},
|
54
|
+
children: variant
|
55
|
+
});
|
56
|
+
};
|
47
57
|
const iconList = {
|
48
58
|
fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
|
49
59
|
size: 20
|
@@ -76,6 +86,24 @@ const iconList = {
|
|
76
86
|
size: 18,
|
77
87
|
fill: "#64748B"
|
78
88
|
}),
|
89
|
+
headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
|
90
|
+
variant: "H4"
|
91
|
+
}),
|
92
|
+
headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
|
93
|
+
variant: "H5"
|
94
|
+
}),
|
95
|
+
headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
|
96
|
+
variant: "H6"
|
97
|
+
}),
|
98
|
+
paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
|
99
|
+
variant: "P1"
|
100
|
+
}),
|
101
|
+
paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
|
102
|
+
variant: "P2"
|
103
|
+
}),
|
104
|
+
paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
|
105
|
+
variant: "P3"
|
106
|
+
}),
|
79
107
|
blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
|
80
108
|
size: 20,
|
81
109
|
fill: "#64748B",
|