@flozy/editor 7.0.7 → 7.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 +7 -7
- package/dist/Editor/CommonEditor.js +74 -25
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +33 -16
- package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -12
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +26 -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 +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/DataView.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +23 -19
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/Embed/Image.js +2 -2
- package/dist/Editor/Elements/Form/Form.js +1 -0
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -14
- package/dist/Editor/Elements/FreeGrid/styles.js +4 -0
- package/dist/Editor/Elements/Grid/GridItem.js +2 -3
- package/dist/Editor/Elements/Link/Link.js +70 -43
- package/dist/Editor/Elements/List/CheckList.js +2 -1
- package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
- package/dist/Editor/Elements/Search/SearchList.js +8 -1
- package/dist/Editor/Elements/SimpleText/index.js +8 -1
- package/dist/Editor/Elements/SimpleText/style.js +5 -1
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +14 -9
- 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/MiniEditor.js +4 -2
- 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/PopupTool/AddTemplates.js +46 -36
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +211 -91
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +11 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +99 -7
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +2 -0
- 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 +94 -0
- package/dist/Editor/common/CustomDialog/style.js +67 -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 +1 -9
- package/dist/Editor/common/FontLoader/FontLoader.js +6 -4
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/MentionsPopup/Styles.js +3 -9
- package/dist/Editor/common/MentionsPopup/index.js +0 -1
- 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/SwitchViewport/SwitchViewport.js +14 -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 +40 -0
- package/dist/Editor/common/RnD/index.js +23 -3
- 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/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/commonStyle.js +58 -63
- package/dist/Editor/helper/ensureWrappedVariables.js +28 -0
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +224 -3
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +13 -5
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +4 -2
- 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 +161 -42
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/customHooks/useTableResize.js +2 -1
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +88 -19
- package/dist/Editor/utils/link.js +1 -1
- package/dist/Editor/utils/pageSettings.js +14 -2
- package/dist/Editor/utils/table.js +21 -0
- package/package.json +5 -2
@@ -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,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
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
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
|
-
const
|
4
|
-
export const googleFontList = [...mostUsedGoogleFonts, ...otherFonts];
|
5
|
-
const fontList = [...mostUsedGoogleFonts, ...otherFonts, ...systemFonts];
|
6
|
-
export const defaultFontFamilies = {
|
7
|
-
id: 1,
|
8
|
-
format: "fontFamily",
|
9
|
-
type: "fontfamilydropdown",
|
10
|
-
options: fontList || []
|
11
|
-
};
|
3
|
+
export const googleFontList = [...mostUsedGoogleFonts, ...otherFonts];
|
@@ -18,6 +18,7 @@ const FontLoader = props => {
|
|
18
18
|
const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
|
19
19
|
let currentIndex = 0;
|
20
20
|
let retryCount = 0;
|
21
|
+
let hideLoaderOn = 30;
|
21
22
|
const loadNextBatch = () => {
|
22
23
|
try {
|
23
24
|
if (currentIndex >= families?.length) {
|
@@ -26,7 +27,7 @@ const FontLoader = props => {
|
|
26
27
|
return;
|
27
28
|
}
|
28
29
|
const batch = families?.slice(currentIndex, currentIndex + batchSize);
|
29
|
-
const batchWithWeights = batch
|
30
|
+
const batchWithWeights = batch.map(font => `${font}:300,400,600,700`);
|
30
31
|
WebFont.load({
|
31
32
|
google: {
|
32
33
|
families: [...batchWithWeights]
|
@@ -78,10 +79,11 @@ const FontLoader = props => {
|
|
78
79
|
// console.log(err);
|
79
80
|
setLoading(false);
|
80
81
|
});
|
82
|
+
// setLoading(true);
|
81
83
|
} else {
|
82
84
|
function correctFontArray(fontString) {
|
83
|
-
let fontsArray = fontString
|
84
|
-
let cleanedFontsArray = [...new Set(fontsArray
|
85
|
+
let fontsArray = fontString.split(",");
|
86
|
+
let cleanedFontsArray = [...new Set(fontsArray.map(font => font.trim()))];
|
85
87
|
return cleanedFontsArray;
|
86
88
|
}
|
87
89
|
function sanitizeFontFamily(fontFamily) {
|
@@ -98,7 +100,7 @@ const FontLoader = props => {
|
|
98
100
|
families = correctFontArray(families.join(", "));
|
99
101
|
families = families?.map(font => font?.replace(/\"/g, ""));
|
100
102
|
families = families?.map(font => font?.replace(", sans-serif", ""));
|
101
|
-
families = families
|
103
|
+
families = families.filter(font => googleFontList.includes(font));
|
102
104
|
loadFontsInBatches(families);
|
103
105
|
}
|
104
106
|
|
@@ -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",
|
@@ -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: {
|
@@ -59,12 +59,6 @@ const usePopupStyles = theme => ({
|
|
59
59
|
"& .orderedListIcon, .bulletedListTextIcon, .checkedListTextIcon, .accordianIconSvgTextFormat": {
|
60
60
|
width: "20px !important"
|
61
61
|
},
|
62
|
-
"&::-webkit-scrollbar-thumb": {
|
63
|
-
background: `none !important`
|
64
|
-
},
|
65
|
-
"&::-webkit-scrollbar-track": {
|
66
|
-
visibility: "hidden"
|
67
|
-
},
|
68
62
|
"&::-webkit-scrollbar-thumb": {
|
69
63
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
70
64
|
},
|
@@ -148,13 +142,13 @@ const usePopupStyles = theme => ({
|
|
148
142
|
}
|
149
143
|
},
|
150
144
|
"& .calederIconSvg": {
|
151
|
-
|
145
|
+
"& rect": {
|
152
146
|
stroke: theme?.palette?.editor?.closeButtonSvgStroke
|
153
147
|
},
|
154
|
-
|
148
|
+
"& .strokePath": {
|
155
149
|
stroke: theme?.palette?.editor?.closeButtonSvgStroke
|
156
150
|
},
|
157
|
-
|
151
|
+
"& .fillPath": {
|
158
152
|
fill: theme?.palette?.editor?.closeButtonSvgStroke
|
159
153
|
}
|
160
154
|
}
|
@@ -131,7 +131,6 @@ const MentionsPopup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
131
131
|
setOpenAI("fromElements");
|
132
132
|
}
|
133
133
|
insertMention(editor, char, type);
|
134
|
-
Transforms.insertText(editor, " "); //Added to insert space after inserting mention node
|
135
134
|
setMentions({
|
136
135
|
...mentions,
|
137
136
|
target: null
|
@@ -8,7 +8,8 @@ const AppHeaderSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -27,7 +28,7 @@ const AppHeaderSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -8,7 +8,8 @@ const BoxSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path];
|
@@ -27,7 +28,7 @@ const BoxSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -8,7 +8,8 @@ const ButtonSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -28,7 +29,7 @@ const ButtonSettings = props => {
|
|
28
29
|
});
|
29
30
|
};
|
30
31
|
const handleClose = () => {
|
31
|
-
|
32
|
+
onClose();
|
32
33
|
};
|
33
34
|
return /*#__PURE__*/_jsx(Box, {
|
34
35
|
component: "div",
|
@@ -8,7 +8,8 @@ const CodeSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -27,7 +28,7 @@ const CodeSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -12,7 +12,8 @@ const FormSettings = props => {
|
|
12
12
|
const {
|
13
13
|
editor,
|
14
14
|
path,
|
15
|
-
customProps
|
15
|
+
customProps,
|
16
|
+
onClose
|
16
17
|
} = props;
|
17
18
|
const item_path = path?.split("|").map(m => parseInt(m));
|
18
19
|
const element_path = [...item_path];
|
@@ -55,13 +56,14 @@ const FormSettings = props => {
|
|
55
56
|
}
|
56
57
|
};
|
57
58
|
const handleClose = () => {
|
58
|
-
|
59
|
+
onClose();
|
59
60
|
};
|
60
61
|
const muiTheme = createTheme({
|
61
62
|
components: {
|
62
63
|
MuiAccordion: {
|
63
64
|
styleOverrides: {
|
64
65
|
root: {
|
66
|
+
background: theme?.palette?.editor?.miniToolBarBackground,
|
65
67
|
"& .MuiAccordionSummary-root": {
|
66
68
|
flexDirection: "row-reverse",
|
67
69
|
"& .MuiSvgIcon-root": {
|
@@ -8,7 +8,8 @@ const ImageSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -27,7 +28,7 @@ const ImageSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -9,7 +9,8 @@ const TableSettings = props => {
|
|
9
9
|
const {
|
10
10
|
editor,
|
11
11
|
path,
|
12
|
-
customProps
|
12
|
+
customProps,
|
13
|
+
onClose
|
13
14
|
} = props;
|
14
15
|
const item_path = path?.split("|").map(m => parseInt(m));
|
15
16
|
const element_path = [...item_path, 0];
|
@@ -57,7 +58,7 @@ const TableSettings = props => {
|
|
57
58
|
}
|
58
59
|
};
|
59
60
|
const handleClose = () => {
|
60
|
-
|
61
|
+
onClose();
|
61
62
|
};
|
62
63
|
return /*#__PURE__*/_jsx(Box, {
|
63
64
|
component: "div",
|
@@ -8,7 +8,8 @@ const VideoSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -28,7 +29,7 @@ const VideoSettings = props => {
|
|
28
29
|
});
|
29
30
|
};
|
30
31
|
const handleClose = () => {
|
31
|
-
|
32
|
+
onClose();
|
32
33
|
};
|
33
34
|
return /*#__PURE__*/_jsx(Box, {
|
34
35
|
component: "div",
|
@@ -3,24 +3,35 @@ import PersonalVideoIcon from "@mui/icons-material/PersonalVideo";
|
|
3
3
|
import PhoneIphoneIcon from "@mui/icons-material/PhoneIphone";
|
4
4
|
import useSwitchViewport from "./styles";
|
5
5
|
import { useEffect } from "react";
|
6
|
+
import { useEditorContext } from "../../../hooks/useMouseMove";
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
9
|
const SwitchViewport = props => {
|
9
10
|
const {
|
10
11
|
breakpoint,
|
11
|
-
onChange
|
12
|
+
onChange,
|
13
|
+
show
|
12
14
|
} = props;
|
13
15
|
const classes = useSwitchViewport();
|
16
|
+
const {
|
17
|
+
setSelectedElement,
|
18
|
+
setActiveBreakPoint
|
19
|
+
} = useEditorContext();
|
14
20
|
useEffect(() => {
|
15
|
-
|
21
|
+
// to reset selection on viewport changes - FS-6589
|
22
|
+
setSelectedElement({});
|
16
23
|
}, [breakpoint]);
|
17
24
|
return /*#__PURE__*/_jsxs(Box, {
|
18
25
|
sx: classes.root,
|
26
|
+
style: {
|
27
|
+
display: show ? "block" : "none"
|
28
|
+
},
|
19
29
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
20
30
|
title: "Desktop View",
|
21
31
|
children: /*#__PURE__*/_jsx(IconButton, {
|
22
32
|
className: `${!breakpoint || breakpoint === "lg" ? "active" : ""}`,
|
23
33
|
onClick: () => {
|
34
|
+
setActiveBreakPoint("");
|
24
35
|
onChange("");
|
25
36
|
},
|
26
37
|
children: /*#__PURE__*/_jsx(PersonalVideoIcon, {})
|
@@ -30,6 +41,7 @@ const SwitchViewport = props => {
|
|
30
41
|
children: /*#__PURE__*/_jsx(IconButton, {
|
31
42
|
className: `${breakpoint === "xs" ? "active" : ""}`,
|
32
43
|
onClick: () => {
|
44
|
+
setActiveBreakPoint("xs");
|
33
45
|
onChange("xs");
|
34
46
|
},
|
35
47
|
children: /*#__PURE__*/_jsx(PhoneIphoneIcon, {})
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Experimental_CssVarsProvider as CssVarsProvider, experimental_extendTheme as extendTheme } from "@mui/material/styles";
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
function MainThemeProvider({
|
4
|
+
children,
|
5
|
+
userSelectedTheme,
|
6
|
+
theme = {}
|
7
|
+
}) {
|
8
|
+
const themeVars = extendTheme(userSelectedTheme?.theme?.cssVars || {});
|
9
|
+
return /*#__PURE__*/_jsx(CssVarsProvider, {
|
10
|
+
theme: {
|
11
|
+
...themeVars,
|
12
|
+
...theme
|
13
|
+
},
|
14
|
+
children: children
|
15
|
+
});
|
16
|
+
}
|
17
|
+
export default MainThemeProvider;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { useTheme,
|
2
|
+
import { useTheme, createTheme } from "@mui/material";
|
3
3
|
import { isStimulator, STIMULATOR_MOCK } from "../../../hooks/useBreakpoints";
|
4
|
+
import MainThemeProvider from "./MainThemeProvider";
|
4
5
|
|
5
6
|
// Custom breakpoints functions
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -51,12 +52,14 @@ const extendedTheme = prevTheme => createTheme({
|
|
51
52
|
}
|
52
53
|
});
|
53
54
|
const ViewportStimulator = ({
|
54
|
-
children
|
55
|
+
children,
|
56
|
+
selectedTheme
|
55
57
|
}) => {
|
56
58
|
const theme = useTheme();
|
57
59
|
const viewportTheme = extendedTheme(theme);
|
58
|
-
return /*#__PURE__*/_jsx(
|
60
|
+
return /*#__PURE__*/_jsx(MainThemeProvider, {
|
59
61
|
theme: viewportTheme,
|
62
|
+
userSelectedTheme: selectedTheme,
|
60
63
|
children: children
|
61
64
|
});
|
62
65
|
};
|
@@ -2,10 +2,11 @@ import { Transforms, Node, Path } from "slate";
|
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
3
|
import { handleNegativeInteger } from "../../../utils/helper";
|
4
4
|
export const ROW_HEIGHT = 50;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
|
6
|
+
// const MARGIN_OF = {
|
7
|
+
// xs: 160,
|
8
|
+
// lg: 490,
|
9
|
+
// };
|
9
10
|
|
10
11
|
/**
|
11
12
|
* This method will update the grid template rows of parent section based on height
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { Transforms, Node } from "slate";
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
3
|
import { getNearestItem } from "./calculateDropItem";
|
4
|
+
import { ROW_HEIGHT, getBorderWidth } from "./gridDropItem";
|
5
|
+
import { handleNegativeInteger } from "../../../utils/helper";
|
4
6
|
const GUIDE_LINE_THRESHOLD = 5;
|
5
7
|
const GUIDE_LINE_OVERLAP_THRESHOLD = 5;
|
6
8
|
const handleMoveNode = (editor, path, newPath, {
|
@@ -248,4 +250,42 @@ export function getParentSectionPath(props, closestClass) {
|
|
248
250
|
} catch (err) {
|
249
251
|
console.log(err);
|
250
252
|
}
|
253
|
+
}
|
254
|
+
export function getAbsolutePositionX(currentEle) {
|
255
|
+
const {
|
256
|
+
left: currElementLeft
|
257
|
+
} = currentEle?.getBoundingClientRect() || {};
|
258
|
+
const parentBoxDom = currentEle?.closest(".fgi_type_box");
|
259
|
+
const relativeElementX = parentBoxDom || document.querySelector(".rnd-guideline-lv");
|
260
|
+
const {
|
261
|
+
left
|
262
|
+
} = relativeElementX?.getBoundingClientRect() || {};
|
263
|
+
const borderLeftWidth = getBorderWidth(relativeElementX, "borderLeftWidth");
|
264
|
+
const absolutePositionX = parseInt(currElementLeft - left - borderLeftWidth);
|
265
|
+
return {
|
266
|
+
absolutePositionX
|
267
|
+
};
|
268
|
+
}
|
269
|
+
export function getAbsolutePositionY(currentEle) {
|
270
|
+
const {
|
271
|
+
top: currElementTop
|
272
|
+
} = currentEle?.getBoundingClientRect() || {};
|
273
|
+
const relativeElementY = currentEle?.closest(".freegrid-container-parent");
|
274
|
+
const borderTopWidth = getBorderWidth(relativeElementY, "borderTopWidth");
|
275
|
+
const rect = relativeElementY.getBoundingClientRect();
|
276
|
+
const absolutePositionY = handleNegativeInteger(currElementTop - rect.top - borderTopWidth);
|
277
|
+
|
278
|
+
// Calculate grid position
|
279
|
+
const row = Math.floor(absolutePositionY / ROW_HEIGHT) + 1;
|
280
|
+
|
281
|
+
// Update grid area
|
282
|
+
const gridArea = `${row} / 1 / ${row + 1} / 2`;
|
283
|
+
|
284
|
+
// to calculate difference inside the grid
|
285
|
+
const marginTop = Math.abs((row - 1) * ROW_HEIGHT - absolutePositionY);
|
286
|
+
return {
|
287
|
+
absolutePositionY,
|
288
|
+
gridArea,
|
289
|
+
marginTop
|
290
|
+
};
|
251
291
|
}
|