@flozy/editor 5.8.8 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/CommonEditor.js +17 -13
- package/dist/Editor/Editor.css +29 -14
- package/dist/Editor/Elements/Button/EditorButton.js +2 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +8 -12
- package/dist/Editor/Elements/Grid/GridItem.js +1 -2
- 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/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/Toolbar/PopupTool/PopupToolStyle.js +5 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +28 -31
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +24 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
- package/dist/Editor/common/Section/index.js +60 -89
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/common/iconslist.js +1 -2
- package/dist/Editor/commonStyle.js +55 -59
- package/dist/Editor/helper/deserialize/index.js +18 -5
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/markdown.js +45 -0
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/plugins/withHTML.js +8 -1
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +36 -0
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/helper.js +20 -20
- package/package.json +3 -2
@@ -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,9 @@
|
|
1
|
-
import { useEffect } from "react";
|
1
|
+
import { useEffect, useState } from "react";
|
2
2
|
import WebFont from "webfontloader";
|
3
|
+
import { Backdrop, CircularProgress } from "@mui/material";
|
3
4
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
-
import {
|
5
|
+
import { googleFontList } from "./FontList";
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
7
|
const FontLoader = props => {
|
6
8
|
const {
|
7
9
|
otherProps,
|
@@ -10,14 +12,20 @@ const FontLoader = props => {
|
|
10
12
|
const {
|
11
13
|
setFontFamilies
|
12
14
|
} = useEditorContext();
|
15
|
+
const [loader, setLoader] = useState(true);
|
13
16
|
const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
|
14
17
|
let currentIndex = 0;
|
15
18
|
let retryCount = 0;
|
19
|
+
let hideLoaderOn = 30;
|
16
20
|
function loadNextBatch() {
|
17
21
|
if (currentIndex >= families?.length) {
|
18
22
|
// console.log("All fonts have been loaded");
|
23
|
+
setLoader(false);
|
19
24
|
return;
|
20
25
|
}
|
26
|
+
if (currentIndex >= hideLoaderOn) {
|
27
|
+
setLoader(false);
|
28
|
+
}
|
21
29
|
const batch = families?.slice(currentIndex, currentIndex + batchSize);
|
22
30
|
const batchWithWeights = batch.map(font => `${font}:300,400,600,700`);
|
23
31
|
WebFont.load({
|
@@ -54,21 +62,21 @@ const FontLoader = props => {
|
|
54
62
|
loadNextBatch();
|
55
63
|
};
|
56
64
|
useEffect(() => {
|
57
|
-
let families = [...
|
65
|
+
let families = [...googleFontList];
|
58
66
|
if (!readOnly) {
|
59
67
|
otherProps?.services("listGoogleFont", []).then(data => {
|
60
|
-
families = [...
|
61
|
-
const filteredfamilies = families?.filter(font => !font?.includes("Material"));
|
68
|
+
families = [...(data?.data || [])];
|
62
69
|
setFontFamilies({
|
63
70
|
id: 1,
|
64
71
|
format: "fontFamily",
|
65
72
|
type: "fontfamilydropdown",
|
66
|
-
options:
|
73
|
+
options: families || []
|
67
74
|
});
|
68
75
|
loadFontsInBatches(families);
|
69
76
|
}).catch(err => {
|
70
77
|
// console.log(err);
|
71
78
|
});
|
79
|
+
// setLoading(true);
|
72
80
|
} else {
|
73
81
|
function correctFontArray(fontString) {
|
74
82
|
let fontsArray = fontString.split(",");
|
@@ -93,6 +101,15 @@ const FontLoader = props => {
|
|
93
101
|
loadFontsInBatches(families);
|
94
102
|
}
|
95
103
|
}, []);
|
96
|
-
return
|
104
|
+
return /*#__PURE__*/_jsx(Backdrop, {
|
105
|
+
open: loader,
|
106
|
+
sx: {
|
107
|
+
color: "#fff",
|
108
|
+
zIndex: theme => theme.zIndex.drawer + 1 // Ensure it's above other UI elements
|
109
|
+
},
|
110
|
+
children: /*#__PURE__*/_jsx(CircularProgress, {
|
111
|
+
color: "inherit"
|
112
|
+
})
|
113
|
+
});
|
97
114
|
};
|
98
115
|
export default FontLoader;
|
@@ -9,17 +9,23 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const SwitchViewport = props => {
|
10
10
|
const {
|
11
11
|
breakpoint,
|
12
|
-
onChange
|
12
|
+
onChange,
|
13
|
+
show
|
13
14
|
} = props;
|
14
15
|
const classes = useSwitchViewport();
|
15
16
|
const {
|
17
|
+
setSelectedElement,
|
16
18
|
setActiveBreakPoint
|
17
19
|
} = useEditorContext();
|
18
20
|
useEffect(() => {
|
19
|
-
|
21
|
+
// to reset selection on viewport changes - FS-6589
|
22
|
+
setSelectedElement({});
|
20
23
|
}, [breakpoint]);
|
21
24
|
return /*#__PURE__*/_jsxs(Box, {
|
22
25
|
sx: classes.root,
|
26
|
+
style: {
|
27
|
+
display: show ? "block" : "none"
|
28
|
+
},
|
23
29
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
24
30
|
title: "Desktop View",
|
25
31
|
children: /*#__PURE__*/_jsx(IconButton, {
|
@@ -2,36 +2,34 @@ import React, { useRef, useState } from "react";
|
|
2
2
|
import { useTheme } from "@mui/material";
|
3
3
|
import { Transforms } from "slate";
|
4
4
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
5
|
-
import { Box, IconButton,
|
5
|
+
import { Box, IconButton, Tooltip } from "@mui/material";
|
6
6
|
import SectionPopup from "../../Elements/Grid/SectionPopup";
|
7
7
|
import { getBreakPointsValue, getTRBLBreakPoints, groupByBreakpoint } from "../../helper/theme";
|
8
|
-
import DragHandle from "../DnD/DragHandleButton";
|
9
|
-
import { useEditorSelection } from "../../hooks/useMouseMove";
|
8
|
+
// import DragHandle from "../DnD/DragHandleButton";
|
9
|
+
// import { useEditorSelection } from "../../hooks/useMouseMove";
|
10
10
|
import SectionStyle from "./styles";
|
11
11
|
import useWindowResize from "../../hooks/useWindowResize";
|
12
12
|
import { SectionSettingIcon } from "../iconListV2";
|
13
|
+
|
14
|
+
// const list_types = ["orderedList", "unorderedList"];
|
13
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
16
17
|
const Toolbar = ({
|
17
|
-
fromPopper,
|
18
18
|
readOnly,
|
19
19
|
showTool,
|
20
|
-
onSettings
|
20
|
+
onSettings,
|
21
|
+
isSectionFullWidth
|
21
22
|
}) => {
|
22
23
|
return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
|
23
24
|
component: "div",
|
24
25
|
className: `element-toolbar no-border-button hr section-tw sectionIcon`,
|
25
26
|
contentEditable: false,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
} : {
|
33
|
-
left: "-28px",
|
34
|
-
top: "1px"
|
27
|
+
sx: {
|
28
|
+
left: isSectionFullWidth ? "0px" : "-28px",
|
29
|
+
top: isSectionFullWidth ? "-28px" : "1px",
|
30
|
+
"&:hover": {
|
31
|
+
backgroundColor: "rgba(0,0,0,0.5)"
|
32
|
+
}
|
35
33
|
},
|
36
34
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
37
35
|
title: "Section Settings",
|
@@ -42,7 +40,6 @@ const Toolbar = ({
|
|
42
40
|
})
|
43
41
|
}) : null;
|
44
42
|
};
|
45
|
-
const list_types = ["orderedList", "unorderedList"];
|
46
43
|
const Section = props => {
|
47
44
|
const themeReact = useTheme();
|
48
45
|
const theme = props?.theme;
|
@@ -56,7 +53,8 @@ const Section = props => {
|
|
56
53
|
readOnly
|
57
54
|
} = customProps;
|
58
55
|
const editor = useSlateStatic();
|
59
|
-
const [
|
56
|
+
// const [isHovering, setIsHovering] = useState(false);
|
57
|
+
const [size] = useWindowResize();
|
60
58
|
const [openSetttings, setOpenSettings] = useState(false);
|
61
59
|
const {
|
62
60
|
sectionBgColor,
|
@@ -73,41 +71,11 @@ const Section = props => {
|
|
73
71
|
} = sectionAlignment || {};
|
74
72
|
const path = ReactEditor.findPath(editor, element);
|
75
73
|
const anchorEl = useRef(null);
|
76
|
-
const popperEl = useRef(null);
|
77
|
-
const [
|
74
|
+
// const popperEl = useRef(null);
|
75
|
+
// const [showTool] = useEditorSelection(editor);
|
78
76
|
const isSectionFullWidth = sectionGridSize && sectionGridSize[size?.device] >= 12;
|
79
|
-
const [
|
80
|
-
const
|
81
|
-
setIsHovering(true);
|
82
|
-
};
|
83
|
-
const onMouseLeave = () => {
|
84
|
-
setIsHovering(false);
|
85
|
-
};
|
86
|
-
const onSettings = () => {
|
87
|
-
setOpenSettings(true);
|
88
|
-
};
|
89
|
-
const onSave = data => {
|
90
|
-
const updateData = {
|
91
|
-
...data
|
92
|
-
};
|
93
|
-
delete updateData.children;
|
94
|
-
Transforms.setNodes(editor, {
|
95
|
-
...updateData
|
96
|
-
}, {
|
97
|
-
at: path
|
98
|
-
});
|
99
|
-
onClose();
|
100
|
-
};
|
101
|
-
const onClose = () => {
|
102
|
-
setOpenSettings(false);
|
103
|
-
};
|
104
|
-
const onDelete = () => {
|
105
|
-
Transforms.removeNodes(editor, {
|
106
|
-
at: path
|
107
|
-
});
|
108
|
-
};
|
109
|
-
const isFreeGrid = element?.children?.find(f => f.type === "freegrid");
|
110
|
-
const needHover = element?.children?.find(f => f.type === "grid" && !list_types.includes(element.type)) ? "" : "";
|
77
|
+
const isFreeGrid = element?.children[0]?.type === "freegrid";
|
78
|
+
const needHover = false;
|
111
79
|
let tempProps = {};
|
112
80
|
if (element?.type === "temp") {
|
113
81
|
tempProps = {
|
@@ -131,6 +99,38 @@ const Section = props => {
|
|
131
99
|
...getBreakPointsValue(sectionGridSize || 8, null, "overrideGridSize", true)
|
132
100
|
}
|
133
101
|
}, themeReact);
|
102
|
+
|
103
|
+
// const onMouseEnter = () => {
|
104
|
+
// setIsHovering(true);
|
105
|
+
// };
|
106
|
+
|
107
|
+
// const onMouseLeave = () => {
|
108
|
+
// setIsHovering(false);
|
109
|
+
// };
|
110
|
+
|
111
|
+
const onSettings = () => {
|
112
|
+
setOpenSettings(true);
|
113
|
+
};
|
114
|
+
const onSave = data => {
|
115
|
+
const updateData = {
|
116
|
+
...data
|
117
|
+
};
|
118
|
+
delete updateData.children;
|
119
|
+
Transforms.setNodes(editor, {
|
120
|
+
...updateData
|
121
|
+
}, {
|
122
|
+
at: path
|
123
|
+
});
|
124
|
+
onClose();
|
125
|
+
};
|
126
|
+
const onClose = () => {
|
127
|
+
setOpenSettings(false);
|
128
|
+
};
|
129
|
+
const onDelete = () => {
|
130
|
+
Transforms.removeNodes(editor, {
|
131
|
+
at: path
|
132
|
+
});
|
133
|
+
};
|
134
134
|
return path.length === 1 && !isFreeGrid ? /*#__PURE__*/_jsxs(Box, {
|
135
135
|
component: "div",
|
136
136
|
className: `ed-section-wrapper ${readOnly ? "" : "hselect"} ${needHover} is-${element?.type}`,
|
@@ -145,9 +145,10 @@ const Section = props => {
|
|
145
145
|
flexDirection: flexDirection || "column",
|
146
146
|
alignItems: horizantal,
|
147
147
|
justifyContent: vertical
|
148
|
-
}
|
149
|
-
|
150
|
-
|
148
|
+
}
|
149
|
+
// onMouseEnter={onMouseEnter}
|
150
|
+
// onMouseLeave={onMouseLeave}
|
151
|
+
,
|
151
152
|
children: [/*#__PURE__*/_jsxs(Box, {
|
152
153
|
className: "ed-section-inner",
|
153
154
|
sx: {
|
@@ -155,41 +156,11 @@ const Section = props => {
|
|
155
156
|
...edInnerSp
|
156
157
|
},
|
157
158
|
ref: anchorEl,
|
158
|
-
children: [
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
zIndex: 9999
|
164
|
-
},
|
165
|
-
disablePortal: true,
|
166
|
-
ref: popperEl,
|
167
|
-
className: "sectionPopper",
|
168
|
-
children: /*#__PURE__*/_jsxs(Box, {
|
169
|
-
sx: {
|
170
|
-
bgcolor: "background.paper",
|
171
|
-
height: "30px",
|
172
|
-
position: "relative",
|
173
|
-
background: theme?.palette?.type === "dark" ? theme?.palette?.editor?.miniToolBarBackground : "#F6F6F6"
|
174
|
-
},
|
175
|
-
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
176
|
-
...props,
|
177
|
-
fromPopper: true
|
178
|
-
}) : null, /*#__PURE__*/_jsx(Toolbar, {
|
179
|
-
fromPopper: true,
|
180
|
-
readOnly: readOnly,
|
181
|
-
showTool: showTool,
|
182
|
-
onSettings: onSettings
|
183
|
-
})]
|
184
|
-
})
|
185
|
-
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
186
|
-
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
187
|
-
...props
|
188
|
-
}) : null, /*#__PURE__*/_jsx(Toolbar, {
|
189
|
-
readOnly: readOnly,
|
190
|
-
showTool: showTool,
|
191
|
-
onSettings: onSettings
|
192
|
-
})]
|
159
|
+
children: [/*#__PURE__*/_jsx(Toolbar, {
|
160
|
+
isSectionFullWidth: isSectionFullWidth,
|
161
|
+
readOnly: readOnly,
|
162
|
+
showTool: false,
|
163
|
+
onSettings: onSettings
|
193
164
|
}), children]
|
194
165
|
}), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
|
195
166
|
element: {
|
@@ -73,6 +73,11 @@ const BackgroundImage = props => {
|
|
73
73
|
children: "REMOVE"
|
74
74
|
}) : /*#__PURE__*/_jsx(Grid, {
|
75
75
|
className: "uploadImageText",
|
76
|
+
sx: {
|
77
|
+
padding: 0,
|
78
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
79
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
80
|
+
},
|
76
81
|
children: /*#__PURE__*/_jsxs(Button, {
|
77
82
|
component: "label",
|
78
83
|
variant: "text",
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Box, Card, Checkbox, FormControlLabel, Grid, Tooltip, Typography } from "@mui/material";
|
2
2
|
import React from "react";
|
3
3
|
import Icon from "../../Icon";
|
4
|
+
import { useEditorContext } from "../../../hooks/useMouseMove";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
6
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -15,7 +16,10 @@ const RenderCard = ({
|
|
15
16
|
return /*#__PURE__*/_jsx(Card, {
|
16
17
|
sx: {
|
17
18
|
position: 'relative',
|
18
|
-
padding: "10px"
|
19
|
+
padding: "10px",
|
20
|
+
'& .MuiCheckbox-root svg': {
|
21
|
+
fill: 'unset !important'
|
22
|
+
}
|
19
23
|
},
|
20
24
|
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
21
25
|
control: /*#__PURE__*/_jsx(Checkbox, {
|
@@ -81,6 +85,9 @@ const CardsMapping = props => {
|
|
81
85
|
selectedCard,
|
82
86
|
infoIcon
|
83
87
|
} = data;
|
88
|
+
const {
|
89
|
+
theme
|
90
|
+
} = useEditorContext();
|
84
91
|
const activeCard = value === selectedCard;
|
85
92
|
const handleChange = e => {
|
86
93
|
if (selectedCard === data?.value) {
|
@@ -99,7 +106,8 @@ const CardsMapping = props => {
|
|
99
106
|
sx: {
|
100
107
|
marginBottom: "12px",
|
101
108
|
"& .MuiPaper-root": {
|
102
|
-
|
109
|
+
background: theme?.palette?.editor?.miniToolBarBackground,
|
110
|
+
border: activeCard ? "1px solid #2563EB" : `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
103
111
|
borderRadius: "8px",
|
104
112
|
boxShadow: activeCard ? "0px 4px 16px 0px #2563EB40" : "unset"
|
105
113
|
}
|
@@ -4,6 +4,7 @@ import { convertBase64 } from "../utils/helper";
|
|
4
4
|
import { uploadFile } from "../service/fileupload";
|
5
5
|
import Icon from "./Icon";
|
6
6
|
import UploadStyles from "../common/ImageSelector/UploadStyles";
|
7
|
+
import { useEditorContext } from "../hooks/useMouseMove";
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
9
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -18,6 +19,9 @@ const Uploader = props => {
|
|
18
19
|
const [base64, setBase64] = useState(value?.url);
|
19
20
|
const [fileName, setFileName] = useState("");
|
20
21
|
const [uploading, setUploading] = useState(false);
|
22
|
+
const {
|
23
|
+
theme
|
24
|
+
} = useEditorContext();
|
21
25
|
const handleChange = async e => {
|
22
26
|
const uFile = e.target.files[0];
|
23
27
|
const strImage = await convertBase64(uFile);
|
@@ -99,6 +103,10 @@ const Uploader = props => {
|
|
99
103
|
className: "uploadImageSection",
|
100
104
|
children: base64 ? renderThumb() : /*#__PURE__*/_jsx(Grid, {
|
101
105
|
className: "uploadImageText",
|
106
|
+
sx: {
|
107
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
108
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
109
|
+
},
|
102
110
|
children: /*#__PURE__*/_jsxs(Button, {
|
103
111
|
component: "label",
|
104
112
|
variant: "text",
|
@@ -1654,13 +1654,12 @@ export const CsvIcon = () => /*#__PURE__*/_jsxs("svg", {
|
|
1654
1654
|
fill: "white"
|
1655
1655
|
})]
|
1656
1656
|
});
|
1657
|
-
export const CloseIcon =
|
1657
|
+
export const CloseIcon = () => /*#__PURE__*/_jsxs("svg", {
|
1658
1658
|
width: "20",
|
1659
1659
|
height: "20",
|
1660
1660
|
viewBox: "0 0 20 20",
|
1661
1661
|
fill: "none",
|
1662
1662
|
xmlns: "http://www.w3.org/2000/svg",
|
1663
|
-
...(props || {}),
|
1664
1663
|
children: [/*#__PURE__*/_jsx("path", {
|
1665
1664
|
d: "M14.1245 5.875L5.87493 14.1246",
|
1666
1665
|
stroke: "#64748B",
|
@@ -51,18 +51,17 @@ const useCommonStyle = theme => ({
|
|
51
51
|
},
|
52
52
|
"& .MuiPaper-root": {
|
53
53
|
border: `unset !important`,
|
54
|
-
borderRadius:
|
55
|
-
height:
|
54
|
+
borderRadius: "0px",
|
55
|
+
height: "fit-content",
|
56
|
+
padding: "2px"
|
56
57
|
},
|
57
58
|
"& p": {
|
58
59
|
marginBottom: "7px",
|
59
60
|
marginTop: "4px"
|
60
61
|
},
|
61
|
-
"&
|
62
|
-
|
63
|
-
|
64
|
-
height: 'fit-content',
|
65
|
-
padding: '2px'
|
62
|
+
"& p": {
|
63
|
+
marginBottom: "7px",
|
64
|
+
marginTop: "4px"
|
66
65
|
},
|
67
66
|
"& .muiIconsListParent": {
|
68
67
|
"& svg": {
|
@@ -76,15 +75,12 @@ const useCommonStyle = theme => ({
|
|
76
75
|
},
|
77
76
|
"&::-webkit-scrollbar-thumb": {
|
78
77
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
79
|
-
},
|
80
|
-
"&::-webkit-scrollbar-track": {
|
81
|
-
visibility: "hidden"
|
82
78
|
}
|
83
79
|
},
|
84
80
|
"& .MuiGrid-root>.MuiGrid-item": {
|
85
81
|
paddingRight: "0px !important",
|
86
82
|
fontFamily: "Inter, sans-serif",
|
87
|
-
height:
|
83
|
+
height: "fit-content"
|
88
84
|
},
|
89
85
|
"& .MuiInputBase-root": {
|
90
86
|
borderRadius: "10px",
|
@@ -145,11 +141,11 @@ const useCommonStyle = theme => ({
|
|
145
141
|
borderRadius: "10px",
|
146
142
|
width: "46px !important",
|
147
143
|
marginLeft: "10px",
|
148
|
-
height:
|
144
|
+
height: "36px !important"
|
149
145
|
}
|
150
146
|
},
|
151
|
-
|
152
|
-
margin:
|
147
|
+
"& .MuiFormHelperText-root": {
|
148
|
+
margin: "4px 0px 0px 0px",
|
153
149
|
color: theme?.palette?.editor?.closeButtonSvgStroke,
|
154
150
|
fontFamily: "Inter, sans-serif"
|
155
151
|
}
|
@@ -405,14 +401,14 @@ const useCommonStyle = theme => ({
|
|
405
401
|
padding: "8px 12px",
|
406
402
|
fontSize: "12px",
|
407
403
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
408
|
-
fontWeight:
|
404
|
+
fontWeight: "500",
|
409
405
|
fontFamily: "Inter, sans-serif",
|
410
|
-
minHeight:
|
406
|
+
minHeight: "36px",
|
411
407
|
"&:hover": {
|
412
408
|
backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
|
413
409
|
}
|
414
410
|
},
|
415
|
-
|
411
|
+
"& .Mui-selected": {
|
416
412
|
background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
417
413
|
},
|
418
414
|
"& .MuiListSubheader-root": {
|
@@ -421,16 +417,16 @@ const useCommonStyle = theme => ({
|
|
421
417
|
fontSize: "12px"
|
422
418
|
},
|
423
419
|
"& .MuiPaper-root": {
|
424
|
-
borderRadius:
|
425
|
-
padding:
|
420
|
+
borderRadius: "8px",
|
421
|
+
padding: "0px",
|
426
422
|
background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
|
427
423
|
},
|
428
|
-
|
429
|
-
margin:
|
430
|
-
borderRadius:
|
424
|
+
"& .MuiButtonBase-root": {
|
425
|
+
margin: "4px",
|
426
|
+
borderRadius: "6px"
|
431
427
|
},
|
432
|
-
|
433
|
-
padding:
|
428
|
+
"& .MuiList-root": {
|
429
|
+
padding: "0px"
|
434
430
|
}
|
435
431
|
},
|
436
432
|
datePicker: {
|
@@ -475,27 +471,27 @@ const useCommonStyle = theme => ({
|
|
475
471
|
}
|
476
472
|
}
|
477
473
|
},
|
478
|
-
pageSettingPopUpRoot: {
|
479
|
-
padding: "16px 8px 16px 10px!important",
|
480
|
-
height: "100%"
|
481
|
-
},
|
482
474
|
buttonMoreOption: {
|
483
475
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
484
476
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
485
|
-
padding:
|
486
|
-
|
487
|
-
width:
|
488
|
-
height:
|
489
|
-
|
477
|
+
padding: "4px !important",
|
478
|
+
"& svg": {
|
479
|
+
width: "18px !important",
|
480
|
+
height: "18px !important",
|
481
|
+
"& path": {
|
490
482
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
491
483
|
}
|
492
484
|
}
|
493
485
|
},
|
486
|
+
pageSettingPopUpRoot: {
|
487
|
+
padding: "16px 8px 16px 10px!important",
|
488
|
+
height: "100%"
|
489
|
+
},
|
494
490
|
buttonMoreOption2: {
|
495
491
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
496
492
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
497
|
-
|
498
|
-
|
493
|
+
"& svg": {
|
494
|
+
"& path": {
|
499
495
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
500
496
|
}
|
501
497
|
}
|
@@ -503,11 +499,11 @@ const useCommonStyle = theme => ({
|
|
503
499
|
buttonMoreOption3: {
|
504
500
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
505
501
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
506
|
-
padding:
|
507
|
-
|
508
|
-
width:
|
509
|
-
height:
|
510
|
-
|
502
|
+
padding: "5px !important",
|
503
|
+
"& svg": {
|
504
|
+
width: "16px !important",
|
505
|
+
height: "16px !important",
|
506
|
+
"& path": {
|
511
507
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
512
508
|
}
|
513
509
|
}
|
@@ -515,37 +511,37 @@ const useCommonStyle = theme => ({
|
|
515
511
|
resizeButton: {
|
516
512
|
background: theme?.palette?.editor?.aiInputBackground,
|
517
513
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1}`,
|
518
|
-
padding:
|
519
|
-
borderRadius:
|
520
|
-
|
521
|
-
width:
|
522
|
-
height:
|
523
|
-
|
514
|
+
padding: "5px !important",
|
515
|
+
borderRadius: "50% !important",
|
516
|
+
"& svg": {
|
517
|
+
width: "18px",
|
518
|
+
height: "18px",
|
519
|
+
"& path": {
|
524
520
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
|
525
521
|
}
|
526
522
|
},
|
527
|
-
|
523
|
+
"&:hover": {
|
528
524
|
background: theme?.palette?.editor?.aiInputBackground
|
529
525
|
}
|
530
526
|
},
|
531
527
|
gradientFillBtn: {
|
532
528
|
background: `linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important`,
|
533
|
-
textTransform:
|
534
|
-
color:
|
535
|
-
padding:
|
536
|
-
height:
|
537
|
-
borderRadius:
|
538
|
-
fontWeight:
|
539
|
-
fontSize:
|
529
|
+
textTransform: "math-auto !important",
|
530
|
+
color: "#FFFFFF !important",
|
531
|
+
padding: "0px 12px !important",
|
532
|
+
height: "32px",
|
533
|
+
borderRadius: "8px",
|
534
|
+
fontWeight: "500",
|
535
|
+
fontSize: "14px"
|
540
536
|
},
|
541
537
|
emptyThumbBtn: {
|
542
538
|
background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
|
543
539
|
color: `${theme?.palette?.editor?.textColor} !important`,
|
544
|
-
fontSize:
|
545
|
-
|
546
|
-
width:
|
547
|
-
height:
|
548
|
-
|
540
|
+
fontSize: "14px !important",
|
541
|
+
"& svg": {
|
542
|
+
width: "20px !important",
|
543
|
+
height: "20px !important",
|
544
|
+
"& path": {
|
549
545
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
550
546
|
}
|
551
547
|
}
|