@flozy/editor 5.9.2 → 5.9.3
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 +11 -6
- package/dist/Editor/Editor.css +22 -16
- package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -12
- package/dist/Editor/Elements/Button/EditorButton.js +3 -1
- package/dist/Editor/Elements/DataView/DataView.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +8 -14
- 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/Form/Form.js +1 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +1 -0
- package/dist/Editor/Elements/Grid/GridItem.js +1 -2
- 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/PopupTool/AddTemplates.js +37 -28
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +9 -3
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +5 -0
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +45 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +2 -0
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +72 -53
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- 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/pageSettingsStyle.js +4 -0
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/common/iconslist.js +1 -2
- package/dist/Editor/commonStyle.js +58 -57
- package/dist/Editor/helper/ensureWrappedVariables.js +28 -0
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +24 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +10 -4
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/customHooks/useTableResize.js +2 -1
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/helper.js +60 -19
- package/dist/Editor/utils/pageSettings.js +14 -2
- package/dist/Editor/utils/table.js +21 -0
- package/package.json +1 -1
@@ -1,9 +1,11 @@
|
|
1
1
|
import { useEffect, useState } from "react";
|
2
2
|
import WebFont from "webfontloader";
|
3
|
-
import { Backdrop, CircularProgress } from "@mui/material";
|
4
3
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
5
|
-
import {
|
4
|
+
import { googleFontList } from "./FontList";
|
5
|
+
import CircularProgress from "@mui/material/CircularProgress";
|
6
|
+
import Box from "@mui/material/Box";
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
7
9
|
const FontLoader = props => {
|
8
10
|
const {
|
9
11
|
otherProps,
|
@@ -12,67 +14,72 @@ const FontLoader = props => {
|
|
12
14
|
const {
|
13
15
|
setFontFamilies
|
14
16
|
} = useEditorContext();
|
15
|
-
const [
|
17
|
+
const [loading, setLoading] = useState(true);
|
16
18
|
const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
|
17
19
|
let currentIndex = 0;
|
18
20
|
let retryCount = 0;
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
loadNextBatch();
|
38
|
-
},
|
39
|
-
inactive: () => {
|
40
|
-
// console.log(`Font loading failed for: ${batch}`);
|
41
|
-
|
42
|
-
if (retryCount < maxRetries) {
|
43
|
-
retryCount++;
|
44
|
-
// console.log(`Retrying batch (${retryCount}/${maxRetries})...`);
|
45
|
-
// Retry loading the same batch
|
46
|
-
loadNextBatch();
|
47
|
-
} else {
|
48
|
-
console.log(
|
49
|
-
// `Max retries reached for batch: ${batch}. Moving to the next batch.`
|
50
|
-
);
|
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}`);
|
51
39
|
currentIndex += batchSize;
|
52
40
|
retryCount = 0; // Reset retry count for the next batch
|
53
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
|
+
}
|
54
58
|
}
|
55
|
-
}
|
56
|
-
})
|
57
|
-
|
59
|
+
});
|
60
|
+
} catch (err) {
|
61
|
+
setLoading(false);
|
62
|
+
}
|
63
|
+
};
|
58
64
|
loadNextBatch();
|
59
65
|
};
|
60
66
|
useEffect(() => {
|
61
|
-
let families = [...
|
67
|
+
let families = [...googleFontList];
|
62
68
|
if (!readOnly) {
|
63
69
|
otherProps?.services("listGoogleFont", []).then(data => {
|
64
|
-
families = [...
|
65
|
-
const filteredfamilies = families?.filter(font => !font?.includes("Material"));
|
70
|
+
families = [...(data?.data || [])];
|
66
71
|
setFontFamilies({
|
67
72
|
id: 1,
|
68
73
|
format: "fontFamily",
|
69
74
|
type: "fontfamilydropdown",
|
70
|
-
options:
|
75
|
+
options: families || []
|
71
76
|
});
|
72
77
|
loadFontsInBatches(families);
|
73
78
|
}).catch(err => {
|
74
|
-
console.log(err);
|
79
|
+
// console.log(err);
|
80
|
+
setLoading(false);
|
75
81
|
});
|
82
|
+
// setLoading(true);
|
76
83
|
} else {
|
77
84
|
function correctFontArray(fontString) {
|
78
85
|
let fontsArray = fontString.split(",");
|
@@ -92,20 +99,32 @@ const FontLoader = props => {
|
|
92
99
|
let families = Array.from(fontSet);
|
93
100
|
families = correctFontArray(families.join(", "));
|
94
101
|
families = families?.map(font => font?.replace(/\"/g, ""));
|
95
|
-
families = families?.map(font => font?.replace(", sans-serif", ""));
|
102
|
+
families = families?.map(font => font?.replace(", sans-serif", ""));
|
96
103
|
families = families.filter(font => googleFontList.includes(font));
|
97
104
|
loadFontsInBatches(families);
|
98
105
|
}
|
106
|
+
|
107
|
+
// Set timeout to hide loader after 5 seconds
|
108
|
+
const timeoutId = setTimeout(() => {
|
109
|
+
setLoading(false);
|
110
|
+
}, 5000);
|
111
|
+
return () => clearTimeout(timeoutId);
|
99
112
|
}, []);
|
100
|
-
return /*#__PURE__*/_jsx(
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
109
128
|
});
|
110
129
|
};
|
111
130
|
export default FontLoader;
|
@@ -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, {})
|
@@ -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
|
}
|
@@ -18,6 +18,7 @@ import FontSize from "./fontSize";
|
|
18
18
|
import SelectSwitch from "./selectSwitch";
|
19
19
|
import CardsMapping from "./card";
|
20
20
|
import MetaDataMapping from "./metaDataMapping";
|
21
|
+
import LineSpacing from "./lineSpacing";
|
21
22
|
const FieldMap = {
|
22
23
|
text: Text,
|
23
24
|
bannerSpacing: BannerSpacing,
|
@@ -38,6 +39,7 @@ const FieldMap = {
|
|
38
39
|
fontSize: FontSize,
|
39
40
|
selectSwitch: SelectSwitch,
|
40
41
|
card: CardsMapping,
|
41
|
-
metadatamapping: MetaDataMapping
|
42
|
+
metadatamapping: MetaDataMapping,
|
43
|
+
lineSpacing: LineSpacing
|
42
44
|
};
|
43
45
|
export default FieldMap;
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Grid, Slider, Typography, Box } from "@mui/material";
|
3
|
+
import { getBreakPointsValue } from "../../../helper/theme";
|
4
|
+
import useWindowResize from "../../../hooks/useWindowResize";
|
5
|
+
import { useEditorContext } from "../../../hooks/useMouseMove";
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
+
const LineSpacing = props => {
|
9
|
+
const {
|
10
|
+
value: val,
|
11
|
+
data,
|
12
|
+
onChange
|
13
|
+
} = props;
|
14
|
+
const {
|
15
|
+
theme
|
16
|
+
} = useEditorContext();
|
17
|
+
const {
|
18
|
+
key
|
19
|
+
} = data;
|
20
|
+
const [size] = useWindowResize();
|
21
|
+
const pro_value = getBreakPointsValue(val, size?.device);
|
22
|
+
const [value, setValue] = useState(pro_value);
|
23
|
+
let breakpointValue = getBreakPointsValue(val, null);
|
24
|
+
breakpointValue = typeof breakpointValue['lg'] === 'object' ? breakpointValue['lg'] : breakpointValue;
|
25
|
+
useState(() => {
|
26
|
+
setValue(pro_value);
|
27
|
+
}, [pro_value]);
|
28
|
+
const handleChange = e => {
|
29
|
+
onChange({
|
30
|
+
[key]: {
|
31
|
+
...breakpointValue,
|
32
|
+
[size?.device]: e.target.value
|
33
|
+
}
|
34
|
+
});
|
35
|
+
};
|
36
|
+
return /*#__PURE__*/_jsxs(Grid, {
|
37
|
+
item: true,
|
38
|
+
xs: 12,
|
39
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
40
|
+
variant: "body1",
|
41
|
+
color: "primary",
|
42
|
+
style: {
|
43
|
+
fontSize: "14px",
|
44
|
+
fontWeight: 500
|
45
|
+
},
|
46
|
+
children: data?.label
|
47
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
48
|
+
container: true,
|
49
|
+
wrap: "nowrap",
|
50
|
+
className: "sld-wrpr",
|
51
|
+
children: [/*#__PURE__*/_jsx(Slider, {
|
52
|
+
className: "spacingSlider",
|
53
|
+
defaultValue: value || 1.43,
|
54
|
+
"aria-label": "Default",
|
55
|
+
valueLabelDisplay: "auto",
|
56
|
+
min: 0.5,
|
57
|
+
max: 3.0,
|
58
|
+
step: 0.1,
|
59
|
+
name: "lineHeight",
|
60
|
+
onChange: handleChange
|
61
|
+
}), /*#__PURE__*/_jsx(Box, {
|
62
|
+
component: "input",
|
63
|
+
sx: {
|
64
|
+
background: theme?.palette?.editor?.background,
|
65
|
+
color: theme?.palette?.editor?.textColor
|
66
|
+
},
|
67
|
+
name: "lineHeight",
|
68
|
+
value: pro_value,
|
69
|
+
className: "sliderInput",
|
70
|
+
onChange: handleChange,
|
71
|
+
type: "number",
|
72
|
+
placeholder: "0",
|
73
|
+
disabled: true,
|
74
|
+
defaultValue: pro_value || 1.43
|
75
|
+
})]
|
76
|
+
})]
|
77
|
+
});
|
78
|
+
};
|
79
|
+
export default LineSpacing;
|
@@ -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",
|
@@ -49,15 +49,19 @@ const useCommonStyle = theme => ({
|
|
49
49
|
fontWeight: "500",
|
50
50
|
fontFamily: "Inter, sans-serif"
|
51
51
|
},
|
52
|
+
"& .MuiPaper-root": {
|
53
|
+
border: `unset !important`,
|
54
|
+
borderRadius: "0px",
|
55
|
+
height: "fit-content",
|
56
|
+
padding: "2px"
|
57
|
+
},
|
52
58
|
"& p": {
|
53
59
|
marginBottom: "7px",
|
54
60
|
marginTop: "4px"
|
55
61
|
},
|
56
|
-
"&
|
57
|
-
|
58
|
-
|
59
|
-
height: 'fit-content',
|
60
|
-
padding: '2px'
|
62
|
+
"& p": {
|
63
|
+
marginBottom: "7px",
|
64
|
+
marginTop: "4px"
|
61
65
|
},
|
62
66
|
"& .muiIconsListParent": {
|
63
67
|
"& svg": {
|
@@ -71,15 +75,12 @@ const useCommonStyle = theme => ({
|
|
71
75
|
},
|
72
76
|
"&::-webkit-scrollbar-thumb": {
|
73
77
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
74
|
-
},
|
75
|
-
"&::-webkit-scrollbar-track": {
|
76
|
-
visibility: "hidden"
|
77
78
|
}
|
78
79
|
},
|
79
80
|
"& .MuiGrid-root>.MuiGrid-item": {
|
80
81
|
paddingRight: "0px !important",
|
81
82
|
fontFamily: "Inter, sans-serif",
|
82
|
-
height:
|
83
|
+
height: "fit-content"
|
83
84
|
},
|
84
85
|
"& .MuiInputBase-root": {
|
85
86
|
borderRadius: "10px",
|
@@ -140,11 +141,11 @@ const useCommonStyle = theme => ({
|
|
140
141
|
borderRadius: "10px",
|
141
142
|
width: "46px !important",
|
142
143
|
marginLeft: "10px",
|
143
|
-
height:
|
144
|
+
height: "36px !important"
|
144
145
|
}
|
145
146
|
},
|
146
|
-
|
147
|
-
margin:
|
147
|
+
"& .MuiFormHelperText-root": {
|
148
|
+
margin: "4px 0px 0px 0px",
|
148
149
|
color: theme?.palette?.editor?.closeButtonSvgStroke,
|
149
150
|
fontFamily: "Inter, sans-serif"
|
150
151
|
}
|
@@ -400,14 +401,14 @@ const useCommonStyle = theme => ({
|
|
400
401
|
padding: "8px 12px",
|
401
402
|
fontSize: "12px",
|
402
403
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
403
|
-
fontWeight:
|
404
|
+
fontWeight: "500",
|
404
405
|
fontFamily: "Inter, sans-serif",
|
405
|
-
minHeight:
|
406
|
+
minHeight: "36px",
|
406
407
|
"&:hover": {
|
407
408
|
backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
|
408
409
|
}
|
409
410
|
},
|
410
|
-
|
411
|
+
"& .Mui-selected": {
|
411
412
|
background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
412
413
|
},
|
413
414
|
"& .MuiListSubheader-root": {
|
@@ -416,16 +417,16 @@ const useCommonStyle = theme => ({
|
|
416
417
|
fontSize: "12px"
|
417
418
|
},
|
418
419
|
"& .MuiPaper-root": {
|
419
|
-
borderRadius:
|
420
|
-
padding:
|
420
|
+
borderRadius: "8px",
|
421
|
+
padding: "0px",
|
421
422
|
background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
|
422
423
|
},
|
423
|
-
|
424
|
-
margin:
|
425
|
-
borderRadius:
|
424
|
+
"& .MuiButtonBase-root": {
|
425
|
+
margin: "4px",
|
426
|
+
borderRadius: "6px"
|
426
427
|
},
|
427
|
-
|
428
|
-
padding:
|
428
|
+
"& .MuiList-root": {
|
429
|
+
padding: "0px"
|
429
430
|
}
|
430
431
|
},
|
431
432
|
datePicker: {
|
@@ -470,27 +471,27 @@ const useCommonStyle = theme => ({
|
|
470
471
|
}
|
471
472
|
}
|
472
473
|
},
|
473
|
-
pageSettingPopUpRoot: {
|
474
|
-
padding: "16px 8px 16px 10px!important",
|
475
|
-
height: "100%"
|
476
|
-
},
|
477
474
|
buttonMoreOption: {
|
478
475
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
479
476
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
480
|
-
padding:
|
481
|
-
|
482
|
-
width:
|
483
|
-
height:
|
484
|
-
|
477
|
+
padding: "4px !important",
|
478
|
+
"& svg": {
|
479
|
+
width: "18px !important",
|
480
|
+
height: "18px !important",
|
481
|
+
"& path": {
|
485
482
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
486
483
|
}
|
487
484
|
}
|
488
485
|
},
|
486
|
+
pageSettingPopUpRoot: {
|
487
|
+
padding: "16px 8px 16px 10px!important",
|
488
|
+
height: "100%"
|
489
|
+
},
|
489
490
|
buttonMoreOption2: {
|
490
491
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
491
492
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
492
|
-
|
493
|
-
|
493
|
+
"& svg": {
|
494
|
+
"& path": {
|
494
495
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
495
496
|
}
|
496
497
|
}
|
@@ -498,11 +499,11 @@ const useCommonStyle = theme => ({
|
|
498
499
|
buttonMoreOption3: {
|
499
500
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
500
501
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
501
|
-
padding:
|
502
|
-
|
503
|
-
width:
|
504
|
-
height:
|
505
|
-
|
502
|
+
padding: "5px !important",
|
503
|
+
"& svg": {
|
504
|
+
width: "16px !important",
|
505
|
+
height: "16px !important",
|
506
|
+
"& path": {
|
506
507
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
507
508
|
}
|
508
509
|
}
|
@@ -510,37 +511,37 @@ const useCommonStyle = theme => ({
|
|
510
511
|
resizeButton: {
|
511
512
|
background: theme?.palette?.editor?.aiInputBackground,
|
512
513
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1}`,
|
513
|
-
padding:
|
514
|
-
borderRadius:
|
515
|
-
|
516
|
-
width:
|
517
|
-
height:
|
518
|
-
|
514
|
+
padding: "5px !important",
|
515
|
+
borderRadius: "50% !important",
|
516
|
+
"& svg": {
|
517
|
+
width: "18px",
|
518
|
+
height: "18px",
|
519
|
+
"& path": {
|
519
520
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
|
520
521
|
}
|
521
522
|
},
|
522
|
-
|
523
|
+
"&:hover": {
|
523
524
|
background: theme?.palette?.editor?.aiInputBackground
|
524
525
|
}
|
525
526
|
},
|
526
527
|
gradientFillBtn: {
|
527
528
|
background: `linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important`,
|
528
|
-
textTransform:
|
529
|
-
color:
|
530
|
-
padding:
|
531
|
-
height:
|
532
|
-
borderRadius:
|
533
|
-
fontWeight:
|
534
|
-
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"
|
535
536
|
},
|
536
537
|
emptyThumbBtn: {
|
537
538
|
background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
|
538
539
|
color: `${theme?.palette?.editor?.textColor} !important`,
|
539
|
-
fontSize:
|
540
|
-
|
541
|
-
width:
|
542
|
-
height:
|
543
|
-
|
540
|
+
fontSize: "14px !important",
|
541
|
+
"& svg": {
|
542
|
+
width: "20px !important",
|
543
|
+
height: "20px !important",
|
544
|
+
"& path": {
|
544
545
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
545
546
|
}
|
546
547
|
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
export const ensureWrappedVariables = content => {
|
2
|
+
return content.map(node => {
|
3
|
+
if (node.children) {
|
4
|
+
return {
|
5
|
+
...node,
|
6
|
+
children: node.children.reduce((result, child, index, arr) => {
|
7
|
+
if (child.type === "variables") {
|
8
|
+
if (index === 0 || !arr[index - 1].text || arr[index - 1].text.trim() === "") {
|
9
|
+
result.push({
|
10
|
+
text: ""
|
11
|
+
});
|
12
|
+
}
|
13
|
+
result.push(child);
|
14
|
+
if (index === arr.length - 1 || !arr[index + 1]?.text || arr[index + 1]?.text.trim() === "") {
|
15
|
+
result.push({
|
16
|
+
text: ""
|
17
|
+
});
|
18
|
+
}
|
19
|
+
} else {
|
20
|
+
result.push(child);
|
21
|
+
}
|
22
|
+
return result;
|
23
|
+
}, [])
|
24
|
+
};
|
25
|
+
}
|
26
|
+
return node;
|
27
|
+
});
|
28
|
+
};
|