@flozy/editor 5.4.8 → 5.5.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 +3 -7
- package/dist/Editor/Editor.css +16 -18
- package/dist/Editor/Elements/Button/EditorButton.js +1 -3
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -0
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +1 -0
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +3 -3
- package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +19 -5
- package/dist/Editor/Elements/Form/Form.js +0 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +2 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -2
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -1
- package/dist/Editor/Elements/List/CheckList.js +1 -2
- package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
- package/dist/Editor/Elements/SimpleText/index.js +3 -11
- package/dist/Editor/Elements/SimpleText/style.js +1 -5
- package/dist/Editor/MiniEditor.js +6 -1
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -5
- package/dist/Editor/Toolbar/Mini/Styles.js +0 -5
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +1 -10
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
- package/dist/Editor/common/MentionsPopup/Styles.js +0 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +6 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/commonStyle.js +8 -8
- package/dist/Editor/helper/deserialize/index.js +24 -66
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +1 -24
- package/dist/Editor/hooks/useMouseMove.js +2 -5
- package/dist/Editor/plugins/withHTML.js +5 -42
- package/dist/Editor/utils/SlateUtilityFunctions.js +1 -8
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +7 -51
- package/dist/Editor/utils/helper.js +16 -19
- package/dist/Editor/utils/pageSettings.js +2 -14
- package/package.json +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
@@ -26,7 +26,7 @@ import editorStyles from "./Styles/EditorStyles";
|
|
26
26
|
import DragAndDrop from "./common/DnD";
|
27
27
|
import Section from "./common/Section";
|
28
28
|
import decorators from "./utils/Decorators";
|
29
|
-
import {
|
29
|
+
import { getTRBLBreakPoints } from "./helper/theme";
|
30
30
|
import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isPageSettings, outsideEditorClickLabel } from "./utils/helper";
|
31
31
|
import useWindowResize from "./hooks/useWindowResize";
|
32
32
|
import PopoverAIInput from "./Elements/AI/PopoverAIInput";
|
@@ -139,8 +139,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
139
139
|
pageColor,
|
140
140
|
color: pageTextColor,
|
141
141
|
pageWidth,
|
142
|
-
maxWidth: pageMaxWidth
|
143
|
-
lineHeight
|
142
|
+
maxWidth: pageMaxWidth
|
144
143
|
} = pageSt?.pageProps || {
|
145
144
|
bannerSpacing: {
|
146
145
|
left: 0,
|
@@ -333,7 +332,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
333
332
|
onDrawerOpen: onDrawerOpen,
|
334
333
|
ICON_API: "https://assets.agenciflow.com"
|
335
334
|
};
|
336
|
-
const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
|
337
335
|
const renderElement = useCallback(props => {
|
338
336
|
return /*#__PURE__*/_jsx(Element, {
|
339
337
|
...props,
|
@@ -536,7 +534,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
536
534
|
padding: {
|
537
535
|
...getTRBLBreakPoints(bannerSpacing)
|
538
536
|
},
|
539
|
-
lineHeight: lineH,
|
540
537
|
width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
|
541
538
|
height: viewport.h ? `${viewport.h}px` : `100%`,
|
542
539
|
alignSelf: "center",
|
@@ -594,9 +591,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
594
591
|
setIsTextSelected: setIsTextSelected,
|
595
592
|
customProps: customProps,
|
596
593
|
editorWrapper: editorWrapper
|
597
|
-
}) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
|
594
|
+
}) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
|
598
595
|
breakpoint: breakpoint,
|
599
|
-
show: showViewport,
|
600
596
|
onChange: b => onSwitchBreakpoint(b)
|
601
597
|
}) : null]
|
602
598
|
})
|
package/dist/Editor/Editor.css
CHANGED
@@ -18,10 +18,7 @@
|
|
18
18
|
.ml-1 {
|
19
19
|
margin-left: 10px;
|
20
20
|
}
|
21
|
-
|
22
|
-
{
|
23
|
-
margin: 0px
|
24
|
-
}
|
21
|
+
|
25
22
|
.dflex {
|
26
23
|
display: flex;
|
27
24
|
}
|
@@ -880,7 +877,7 @@ blockquote {
|
|
880
877
|
.dialogComp .MuiInputBase-input {
|
881
878
|
border-radius: 8px;
|
882
879
|
/* box-shadow: 0px 4px 18px 0px rgba(0, 0, 0, 0.05); */
|
883
|
-
font-size:
|
880
|
+
font-size: 14px;
|
884
881
|
font-weight: 500;
|
885
882
|
}
|
886
883
|
|
@@ -1257,19 +1254,6 @@ blockquote {
|
|
1257
1254
|
pointer-events: auto;
|
1258
1255
|
}
|
1259
1256
|
|
1260
|
-
@media (max-width: 899px) {
|
1261
|
-
.MuiPopover-root {
|
1262
|
-
z-index: 1302 !important;
|
1263
|
-
}
|
1264
|
-
canvas {
|
1265
|
-
max-width: 100% !important;
|
1266
|
-
}
|
1267
|
-
}
|
1268
|
-
|
1269
|
-
.settingsHeader {
|
1270
|
-
font-size: 14px !important;
|
1271
|
-
font-weight: 500 !important;
|
1272
|
-
}
|
1273
1257
|
.hideScroll {
|
1274
1258
|
overflow-anchor: none;
|
1275
1259
|
}
|
@@ -1285,6 +1269,20 @@ blockquote {
|
|
1285
1269
|
.hideScroll::-webkit-scrollbar-thumb:hover {
|
1286
1270
|
background: none !important;
|
1287
1271
|
}
|
1272
|
+
@media (max-width: 899px) {
|
1273
|
+
.MuiPopover-root {
|
1274
|
+
z-index: 1302 !important;
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
canvas {
|
1278
|
+
max-width: 100% !important;
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
|
1282
|
+
.settingsHeader {
|
1283
|
+
font-size: 14px !important;
|
1284
|
+
font-weight: 500 !important;
|
1285
|
+
}
|
1288
1286
|
|
1289
1287
|
.custom-scroll::-webkit-scrollbar {
|
1290
1288
|
height: .6rem;
|
@@ -162,7 +162,6 @@ const EditorButton = props => {
|
|
162
162
|
display: "inline-flex",
|
163
163
|
color: "rgba(0, 0, 0, 0.54)",
|
164
164
|
marginBottom: "0px !important",
|
165
|
-
...classes.buttonMoreOption,
|
166
165
|
...classes.buttonMoreOption3
|
167
166
|
},
|
168
167
|
...btnProps,
|
@@ -265,12 +264,11 @@ const EditorButton = props => {
|
|
265
264
|
...btnSp,
|
266
265
|
borderStyle: borderStyle || "solid",
|
267
266
|
color: `${textColor || "#FFFFFF"}`,
|
268
|
-
fontSize: textSize || "
|
267
|
+
fontSize: textSize || "inherit",
|
269
268
|
fontFamily: fontFamily || "PoppinsRegular",
|
270
269
|
display: "inline-flex",
|
271
270
|
alignItems: "center",
|
272
271
|
position: "relative",
|
273
|
-
lineHeight: 1.43,
|
274
272
|
"& .element-toolbar": {
|
275
273
|
display: "none"
|
276
274
|
},
|
@@ -17,6 +17,7 @@ const ColorPickerStyles = theme => ({
|
|
17
17
|
borderRadius: "7px !important",
|
18
18
|
"& .MuiPaper-root": {
|
19
19
|
backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
|
20
|
+
background: `${theme?.palette?.editor?.miniToolBarBackground}`,
|
20
21
|
border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
|
21
22
|
borderRadius: "7px !important",
|
22
23
|
padding: "0px 5px",
|
@@ -5,6 +5,7 @@ import ColorButtons from "../../../Color Picker/ColorButtons";
|
|
5
5
|
import ColorPickerStyles from "../../../Color Picker/Styles";
|
6
6
|
import { DEFAULT_OPTION_COLORS } from "./Constants";
|
7
7
|
import Icon from "../../../../common/Icon";
|
8
|
+
import { useEditorContext } from "../../../../hooks/useMouseMove";
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
11
|
const EditOption = props => {
|
@@ -20,11 +21,14 @@ const EditOption = props => {
|
|
20
21
|
const editData = useRef({
|
21
22
|
...edit
|
22
23
|
});
|
24
|
+
const {
|
25
|
+
theme
|
26
|
+
} = useEditorContext();
|
23
27
|
const {
|
24
28
|
optionIndex
|
25
29
|
} = edit;
|
26
30
|
const selectedOption = edit?.options[optionIndex] || {};
|
27
|
-
const pickerStyles = ColorPickerStyles();
|
31
|
+
const pickerStyles = ColorPickerStyles(theme);
|
28
32
|
useEffect(() => {
|
29
33
|
return () => {
|
30
34
|
// on un-mount update the option change
|
@@ -42,10 +42,10 @@ const useTableStyles = (theme, appTheme) => ({
|
|
42
42
|
'& .MuiButton-startIcon': {
|
43
43
|
background: appTheme?.palette?.editor?.tv_ico_bg,
|
44
44
|
borderRadius: '4px',
|
45
|
-
padding: '
|
45
|
+
padding: '4px',
|
46
46
|
"& svg": {
|
47
|
-
width: '
|
48
|
-
height: '
|
47
|
+
width: '14px',
|
48
|
+
height: '14px'
|
49
49
|
}
|
50
50
|
},
|
51
51
|
"&.ico": {
|
@@ -32,7 +32,7 @@ const multiSortRows = (rows, criteria, columnConfig) => {
|
|
32
32
|
key,
|
33
33
|
operator
|
34
34
|
} of criteria) {
|
35
|
-
const column = columnConfig
|
35
|
+
const column = columnConfig?.find(col => col.key === key);
|
36
36
|
if (!column) continue;
|
37
37
|
const dataType = column.type;
|
38
38
|
const valueA = a[key];
|
@@ -40,7 +40,7 @@ const multiSortRows = (rows, criteria, columnConfig) => {
|
|
40
40
|
let comparison = 0;
|
41
41
|
switch (dataType) {
|
42
42
|
case "text":
|
43
|
-
comparison = valueA
|
43
|
+
comparison = valueA?.localeCompare(valueB, undefined, {
|
44
44
|
sensitivity: "base"
|
45
45
|
});
|
46
46
|
break;
|
@@ -49,8 +49,9 @@ const multiSortRows = (rows, criteria, columnConfig) => {
|
|
49
49
|
break;
|
50
50
|
case "select":
|
51
51
|
case "multi-select":
|
52
|
-
|
53
|
-
|
52
|
+
case "person":
|
53
|
+
if (Array?.isArray(valueA) && Array?.isArray(valueB)) {
|
54
|
+
comparison = Array?.isArray(valueA) ? valueA?.map(m => m?.value)?.join(", ")?.localeCompare(valueB?.map(m => m?.value).join(", "), undefined, {
|
54
55
|
sensitivity: "base"
|
55
56
|
}) : 0;
|
56
57
|
}
|
@@ -59,7 +60,20 @@ const multiSortRows = (rows, criteria, columnConfig) => {
|
|
59
60
|
comparison = sortByDate(valueA, valueB);
|
60
61
|
break;
|
61
62
|
case "check":
|
62
|
-
|
63
|
+
if (operator === "desc") {
|
64
|
+
if (valueA) {
|
65
|
+
return 1;
|
66
|
+
} else {
|
67
|
+
return -1;
|
68
|
+
}
|
69
|
+
} else {
|
70
|
+
if (valueA) {
|
71
|
+
return -1;
|
72
|
+
} else {
|
73
|
+
return 1;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
// return valueA && operator === "desc" ? 1 : valueB && operator === "asc" ;
|
63
77
|
default:
|
64
78
|
break;
|
65
79
|
}
|
@@ -19,6 +19,7 @@ const FormStyles = theme => ({
|
|
19
19
|
"& .editorWorkflow": {
|
20
20
|
minHeight: '130px',
|
21
21
|
padding: '12px',
|
22
|
+
paddingBottom: 0,
|
22
23
|
'&:focus-visible': {
|
23
24
|
outline: 'none',
|
24
25
|
border: 'none'
|
@@ -104,6 +105,7 @@ const FormStyles = theme => ({
|
|
104
105
|
padding: "4px 22px",
|
105
106
|
textTransform: "none",
|
106
107
|
border: "1px solid #D8DDE1",
|
108
|
+
minWidth: '126px',
|
107
109
|
"& svg": {
|
108
110
|
"& path": {
|
109
111
|
stroke: "#64748B"
|
@@ -25,7 +25,8 @@ const FreeGridBox = props => {
|
|
25
25
|
const editor = useSlateStatic();
|
26
26
|
const path = ReactEditor.findPath(editor, element);
|
27
27
|
const {
|
28
|
-
readOnly
|
28
|
+
readOnly,
|
29
|
+
hideTools
|
29
30
|
} = customProps;
|
30
31
|
const {
|
31
32
|
updated_at,
|
@@ -147,12 +148,13 @@ const FreeGridBox = props => {
|
|
147
148
|
}
|
148
149
|
};
|
149
150
|
const repeatTimes = Math.floor(height / ROW_HEIGHT);
|
151
|
+
const sectionTypeOptions = (itemOptions?.box || []).filter(f => (hideTools || []).indexOf(f) === -1);
|
150
152
|
return /*#__PURE__*/_jsx(RnD, {
|
151
153
|
id: `freegrid_box_item_${path.join("|")}_${updated_at}_${breakpoint}`,
|
152
154
|
className: `freegrid-item path-${path.length} breakpoint-${breakpoint}`,
|
153
155
|
editor: editor,
|
154
156
|
path: path,
|
155
|
-
actions:
|
157
|
+
actions: sectionTypeOptions,
|
156
158
|
settingsProps: {
|
157
159
|
settings: "freegridBoxItem",
|
158
160
|
onChange: onChangeSettings,
|
@@ -49,7 +49,6 @@ const SearchAttachment = props => {
|
|
49
49
|
background: theme?.palette?.containers?.slashBrainCardBg,
|
50
50
|
cursor: 'pointer',
|
51
51
|
margin: '4px 0px',
|
52
|
-
lineHeight: 1.43,
|
53
52
|
"&.MuiPaper-root.MuiPaper-rounded": {
|
54
53
|
borderRadius: "7px !important",
|
55
54
|
paddingTop: '0px !important'
|
@@ -5,7 +5,6 @@ import { getPageSettings } from "../../utils/pageSettings";
|
|
5
5
|
import { isTextSelected } from "../../utils/helper";
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import SimpleTextStyle from "./style";
|
8
|
-
import { getBreakpointLineSpacing } from "../../helper/theme";
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
9
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -21,8 +20,7 @@ const SimpleText = props => {
|
|
21
20
|
attributes,
|
22
21
|
children,
|
23
22
|
customProps,
|
24
|
-
isEmpty
|
25
|
-
isChatEditor = false
|
23
|
+
isEmpty
|
26
24
|
} = props;
|
27
25
|
const {
|
28
26
|
readOnly,
|
@@ -34,18 +32,12 @@ const SimpleText = props => {
|
|
34
32
|
const {
|
35
33
|
pageColor
|
36
34
|
} = pageSt?.pageProps || {};
|
37
|
-
const {
|
38
|
-
activeBreakPoint
|
39
|
-
} = useEditorContext();
|
40
|
-
const lineHeight = element?.children[0]?.lineHeight;
|
41
|
-
const lineH = getBreakpointLineSpacing(lineHeight, activeBreakPoint);
|
42
35
|
const classes = SimpleTextStyle({
|
43
|
-
pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF"
|
44
|
-
lineHeight: lineH
|
36
|
+
pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF"
|
45
37
|
});
|
46
38
|
const selected = useSelected();
|
47
39
|
const path = ReactEditor.findPath(editor, element);
|
48
|
-
const showPlaceHolder = !readOnly && path.length === 1 && isEmpty
|
40
|
+
const showPlaceHolder = !readOnly && path.length === 1 && isEmpty;
|
49
41
|
const isEmptyEditor = !readOnly && isEmpty && editor.children.length === 1 && !selected;
|
50
42
|
const opacity = !isTextSelected(editor?.selection);
|
51
43
|
const nextType = element?.children[0]?.type;
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import { invertColor } from "../../helper";
|
2
2
|
const SimpleTextStyle = ({
|
3
|
-
pageColor
|
4
|
-
lineHeight
|
3
|
+
pageColor
|
5
4
|
}) => ({
|
6
5
|
root: {
|
7
6
|
position: "relative",
|
8
7
|
padding: "0px",
|
9
|
-
lineHeight: lineHeight,
|
10
8
|
"&.dataView": {
|
11
9
|
"& .placeholder-simple-text": {
|
12
10
|
opacity: 0
|
@@ -35,8 +33,6 @@ const SimpleTextStyle = ({
|
|
35
33
|
height: "24px",
|
36
34
|
overflow: "hidden",
|
37
35
|
fontSize: "14px",
|
38
|
-
display: "inline-flex",
|
39
|
-
alignItems: "center",
|
40
36
|
"& .bg-pad-sl": {
|
41
37
|
padding: "2px 4px 2px 4px",
|
42
38
|
background: "transparent",
|
@@ -158,7 +158,12 @@ const MiniEditor = props => {
|
|
158
158
|
className: className || "mini-editor-cls",
|
159
159
|
renderElement: renderElement,
|
160
160
|
renderLeaf: renderLeaf,
|
161
|
-
onKeyDown: onKeyDown
|
161
|
+
onKeyDown: onKeyDown,
|
162
|
+
style: {
|
163
|
+
height: '200px',
|
164
|
+
overflow: 'auto',
|
165
|
+
marginBottom: '12px'
|
166
|
+
}
|
162
167
|
})]
|
163
168
|
})
|
164
169
|
});
|
@@ -139,17 +139,14 @@ const MiniToolbar = props => {
|
|
139
139
|
icon: Icon
|
140
140
|
}) => {
|
141
141
|
const isDisabled = popupType === type || type === "undo" ? !canUndo : type === "redo" ? !canRedo : false;
|
142
|
-
const isFocussed = editor?.selection?.anchor?.path;
|
143
|
-
const disableAddElement = type === "addElement" && !isFocussed;
|
144
142
|
return /*#__PURE__*/_jsx(Tooltip, {
|
145
143
|
arrow: true,
|
146
144
|
title: label,
|
147
145
|
disableHoverListener: toolTip,
|
148
146
|
children: /*#__PURE__*/_jsx(IconButton, {
|
149
|
-
className: `${type === popper ? "active" : ""} ${type === "undo" && !canUndo || type === "redo" && !canRedo ? "disabled" : ""} ${type === "undo" ? canUndo ? "activeUndo" : "disabledUndo" : type === "redo" ? canRedo ? "activeRedo" : "disabledRedo" : ""}
|
150
|
-
`,
|
147
|
+
className: `${type === popper ? "active" : ""} ${type === "undo" && !canUndo || type === "redo" && !canRedo ? "disabled" : ""} ${type === "undo" ? canUndo ? "activeUndo" : "disabledUndo" : type === "redo" ? canRedo ? "activeRedo" : "disabledRedo" : ""}`,
|
151
148
|
onClick: handleClick(type),
|
152
|
-
disabled: isDisabled
|
149
|
+
disabled: isDisabled,
|
153
150
|
children: type === "page-settings" ? /*#__PURE__*/_jsx(PageSettingsButton, {
|
154
151
|
from: "miniToolBar",
|
155
152
|
icoBtnType: "mini",
|
@@ -185,11 +185,6 @@ const usePopupStyle = theme => ({
|
|
185
185
|
justifyContent: "start",
|
186
186
|
borderRadius: "10px !important",
|
187
187
|
transition: "background-color 0.3s ease",
|
188
|
-
// "& .colorBoxElementIcon": {
|
189
|
-
// "& path": {
|
190
|
-
// fill: theme?.palette?.type === "dark" ? "none" : "",
|
191
|
-
// },
|
192
|
-
// },
|
193
188
|
"& .signatureElementIcon": {
|
194
189
|
"& path": {
|
195
190
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
|
@@ -416,11 +411,6 @@ const usePopupStyle = theme => ({
|
|
416
411
|
"& .MuiOutlinedInput-notchedOutline": {
|
417
412
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
|
418
413
|
},
|
419
|
-
'& .MuiInputBase-root': {
|
420
|
-
'& input': {
|
421
|
-
border: "none !important"
|
422
|
-
}
|
423
|
-
},
|
424
414
|
"& svg": {
|
425
415
|
width: "20px",
|
426
416
|
height: "24px"
|
@@ -940,6 +930,7 @@ const usePopupStyle = theme => ({
|
|
940
930
|
colorPopper: {
|
941
931
|
"& .MuiPaper-root": {
|
942
932
|
backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
|
933
|
+
background: `${theme?.palette?.editor?.miniToolBarBackground}`,
|
943
934
|
borderRadius: "7px !important",
|
944
935
|
"@media only screen and (max-width: 600px)": {
|
945
936
|
marginTop: "-40px"
|
@@ -14,8 +14,6 @@ import SelectSuperSubscript from "./MiniTextFormat/SelectSuperSubscript";
|
|
14
14
|
import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
|
15
15
|
import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
|
16
16
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
17
|
-
import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
|
18
|
-
import { getPageSettings } from "../../utils/pageSettings";
|
19
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
20
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
21
19
|
const allTools = toolbarGroups.flat();
|
@@ -33,18 +31,10 @@ const TextFormat = props => {
|
|
33
31
|
const [anchorEl, setAnchorEl] = useState(null);
|
34
32
|
const [type, setType] = useState(null);
|
35
33
|
const open = Boolean(anchorEl);
|
36
|
-
const {
|
37
|
-
element: pageSt
|
38
|
-
} = getPageSettings(editor) || {};
|
39
|
-
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
40
34
|
const {
|
41
35
|
fontFamilies,
|
42
36
|
theme
|
43
37
|
} = useEditorContext();
|
44
|
-
const {
|
45
|
-
activeBreakPoint
|
46
|
-
} = useEditorContext();
|
47
|
-
const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
48
38
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
49
39
|
const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
|
50
40
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
@@ -61,8 +51,6 @@ const TextFormat = props => {
|
|
61
51
|
color: "",
|
62
52
|
bgColor: ""
|
63
53
|
};
|
64
|
-
let lineSpacingValue = activeMark(editor, 'lineHeight');
|
65
|
-
lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
|
66
54
|
const handleColorPicker = type => e => {
|
67
55
|
setType(type);
|
68
56
|
setAnchorEl(e.currentTarget);
|
@@ -103,13 +91,6 @@ const TextFormat = props => {
|
|
103
91
|
value
|
104
92
|
});
|
105
93
|
};
|
106
|
-
const handleLineSpacing = data => {
|
107
|
-
const [[format, value]] = Object.entries(data);
|
108
|
-
addMarkData(editor, {
|
109
|
-
format,
|
110
|
-
value
|
111
|
-
});
|
112
|
-
};
|
113
94
|
return /*#__PURE__*/_jsxs(Grid, {
|
114
95
|
container: true,
|
115
96
|
sx: classes.textFormatWrapper,
|
@@ -379,32 +360,6 @@ const TextFormat = props => {
|
|
379
360
|
xs: 12,
|
380
361
|
sx: classes.dividerGrid,
|
381
362
|
children: /*#__PURE__*/_jsx(Divider, {})
|
382
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
383
|
-
item: true,
|
384
|
-
xs: 12,
|
385
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
386
|
-
variant: "body1",
|
387
|
-
color: "primary",
|
388
|
-
sx: classes.typoLabel,
|
389
|
-
children: "Line Spacing"
|
390
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
391
|
-
item: true,
|
392
|
-
xs: 12,
|
393
|
-
className: "typo-icons",
|
394
|
-
sx: classes.evenSpace,
|
395
|
-
children: /*#__PURE__*/_jsx(LineSpacing, {
|
396
|
-
value: lineSpacingValue,
|
397
|
-
onChange: handleLineSpacing,
|
398
|
-
data: {
|
399
|
-
key: 'lineHeight'
|
400
|
-
}
|
401
|
-
})
|
402
|
-
})]
|
403
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
404
|
-
item: true,
|
405
|
-
xs: 12,
|
406
|
-
sx: classes.dividerGrid,
|
407
|
-
children: /*#__PURE__*/_jsx(Divider, {})
|
408
363
|
}), /*#__PURE__*/_jsx(Grid, {
|
409
364
|
item: true,
|
410
365
|
xs: 12,
|
@@ -41,9 +41,9 @@ const FontLoader = props => {
|
|
41
41
|
// Retry loading the same batch
|
42
42
|
loadNextBatch();
|
43
43
|
} else {
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
console.log(
|
45
|
+
// `Max retries reached for batch: ${batch}. Moving to the next batch.`
|
46
|
+
);
|
47
47
|
currentIndex += batchSize;
|
48
48
|
retryCount = 0; // Reset retry count for the next batch
|
49
49
|
loadNextBatch();
|
@@ -67,7 +67,7 @@ const FontLoader = props => {
|
|
67
67
|
});
|
68
68
|
loadFontsInBatches(families);
|
69
69
|
}).catch(err => {
|
70
|
-
|
70
|
+
console.log(err);
|
71
71
|
});
|
72
72
|
} else {
|
73
73
|
function correctFontArray(fontString) {
|
@@ -3,35 +3,24 @@ 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";
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
8
|
const SwitchViewport = props => {
|
10
9
|
const {
|
11
10
|
breakpoint,
|
12
|
-
onChange
|
13
|
-
show
|
11
|
+
onChange
|
14
12
|
} = props;
|
15
13
|
const classes = useSwitchViewport();
|
16
|
-
const {
|
17
|
-
setSelectedElement,
|
18
|
-
setActiveBreakPoint
|
19
|
-
} = useEditorContext();
|
20
14
|
useEffect(() => {
|
21
|
-
|
22
|
-
setSelectedElement({});
|
15
|
+
console.log(breakpoint);
|
23
16
|
}, [breakpoint]);
|
24
17
|
return /*#__PURE__*/_jsxs(Box, {
|
25
18
|
sx: classes.root,
|
26
|
-
style: {
|
27
|
-
display: show ? "block" : "none"
|
28
|
-
},
|
29
19
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
30
20
|
title: "Desktop View",
|
31
21
|
children: /*#__PURE__*/_jsx(IconButton, {
|
32
22
|
className: `${!breakpoint || breakpoint === "lg" ? "active" : ""}`,
|
33
23
|
onClick: () => {
|
34
|
-
setActiveBreakPoint("");
|
35
24
|
onChange("");
|
36
25
|
},
|
37
26
|
children: /*#__PURE__*/_jsx(PersonalVideoIcon, {})
|
@@ -41,7 +30,6 @@ const SwitchViewport = props => {
|
|
41
30
|
children: /*#__PURE__*/_jsx(IconButton, {
|
42
31
|
className: `${breakpoint === "xs" ? "active" : ""}`,
|
43
32
|
onClick: () => {
|
44
|
-
setActiveBreakPoint("xs");
|
45
33
|
onChange("xs");
|
46
34
|
},
|
47
35
|
children: /*#__PURE__*/_jsx(PhoneIphoneIcon, {})
|