@flozy/editor 10.8.7 → 10.8.9
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 +16 -17
- package/dist/Editor/CommonEditor.js +27 -138
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +11 -39
- package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -11
- package/dist/Editor/Elements/AI/Styles.js +0 -1
- package/dist/Editor/Elements/Accordion/Accordion.js +22 -28
- package/dist/Editor/Elements/Accordion/AccordionButton.js +3 -12
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Attachments/Attachments.js +11 -153
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +3 -8
- package/dist/Editor/Elements/Button/EditorButton.js +7 -23
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -61
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +7 -10
- package/dist/Editor/Elements/Color Picker/Styles.js +13 -15
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +55 -134
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +8 -7
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +3 -8
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
- package/dist/Editor/Elements/Embed/Embed.js +43 -36
- package/dist/Editor/Elements/Embed/Image.js +23 -240
- package/dist/Editor/Elements/Embed/Video.js +15 -246
- package/dist/Editor/Elements/Form/FormField.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
- package/dist/Editor/Elements/Form/Workflow/constant.js +1 -25
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +33 -39
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -7
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +0 -1
- package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -9
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -2
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -4
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +3 -5
- package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
- package/dist/Editor/MiniEditor.js +1 -2
- package/dist/Editor/Styles/EditorStyles.js +5 -20
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +29 -33
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +23 -23
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +7 -25
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +8 -24
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +10 -70
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +14 -73
- package/dist/Editor/Toolbar/PopupTool/index.js +2 -5
- package/dist/Editor/Toolbar/toolbarGroups.js +10 -56
- package/dist/Editor/common/ColorPickerButton.js +16 -38
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +0 -4
- package/dist/Editor/common/Icon.js +0 -28
- package/dist/Editor/common/ImageSelector/ImageSelector.js +7 -45
- package/dist/Editor/common/ImageSelector/Options/Upload.js +11 -26
- package/dist/Editor/common/ImageSelector/Styles.js +9 -3
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -6
- package/dist/Editor/common/MentionsPopup/index.js +1 -9
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +7 -20
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +1 -9
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +7 -20
- package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -11
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +18 -28
- package/dist/Editor/common/RnD/Utils/index.js +1 -3
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +58 -45
- package/dist/Editor/common/RnD/VirtualElement/helper.js +130 -320
- package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -22
- package/dist/Editor/common/RnD/index.js +13 -48
- package/dist/Editor/common/Shorthands/elements.js +4 -62
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +2 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +8 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +10 -36
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +7 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +0 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
- package/dist/Editor/common/StyleBuilder/index.js +4 -8
- package/dist/Editor/common/Uploader.js +17 -125
- package/dist/Editor/common/iconslist.js +0 -21
- package/dist/Editor/commonStyle.js +64 -107
- package/dist/Editor/helper/index.js +2 -10
- package/dist/Editor/helper/theme.js +2 -203
- package/dist/Editor/hooks/useMouseMove.js +3 -9
- package/dist/Editor/plugins/withEmbeds.js +1 -12
- package/dist/Editor/plugins/withHTML.js +3 -58
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/service/fileupload.js +0 -53
- package/dist/Editor/theme/ThemeList.js +173 -51
- package/dist/Editor/utils/SlateUtilityFunctions.js +21 -183
- package/dist/Editor/utils/accordion.js +40 -68
- package/dist/Editor/utils/button.js +17 -1
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/events.js +89 -94
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +21 -97
- package/dist/Editor/utils/insertAppHeader.js +4 -8
- package/package.json +4 -4
- package/dist/Editor/Elements/Attachments/AttachmentStyles.js +0 -16
- package/dist/Editor/Elements/FreeGrid/helper.js +0 -115
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -439
- package/dist/Editor/assets/svg/BackIcon.js +0 -18
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -293
- package/dist/Editor/common/CustomColorPicker/index.js +0 -130
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog2/index.js +0 -94
- package/dist/Editor/common/CustomDialog2/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -43
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
- package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +0 -115
- package/dist/Editor/common/UploaderWithProgress.js +0 -183
- package/dist/Editor/helper/textIndeces.js +0 -58
- package/dist/Editor/hooks/useEditorTheme.js +0 -155
- package/dist/Editor/hooks/useThemeValues.js +0 -63
- package/dist/Editor/theme/index.js +0 -149
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -82
- package/dist/Editor/themeSettings/buttons/index.js +0 -300
- package/dist/Editor/themeSettings/buttons/style.js +0 -23
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
- package/dist/Editor/themeSettings/fonts/index.js +0 -240
- package/dist/Editor/themeSettings/fonts/style.js +0 -62
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -380
- package/dist/Editor/themeSettings/style.js +0 -299
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -355
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -202
- package/dist/Editor/themeSettingsAI/style.js +0 -332
@@ -1,9 +1,9 @@
|
|
1
|
-
import { Fade, Grid, IconButton, Paper, Popper
|
1
|
+
import { Fade, Grid, IconButton, Paper, Popper } from "@mui/material";
|
2
2
|
import SelectTypography from "./SelectTypography";
|
3
3
|
import SelectList from "./SelectList";
|
4
4
|
import { toolbarGroups } from "../../toolbarGroups";
|
5
5
|
import { MarkButton } from "../../FormatTools";
|
6
|
-
import { activeMark,
|
6
|
+
import { activeMark, isBlockActive } from "../../../utils/SlateUtilityFunctions";
|
7
7
|
import LinkButton from "../../../Elements/Link/LinkButton";
|
8
8
|
import TextToolIcon from "../../../assets/svg/TextToolIcon";
|
9
9
|
import TextFormat from "../TextFormat";
|
@@ -14,7 +14,7 @@ import MiniColorPicker from "./MiniColorPicker";
|
|
14
14
|
import SelectAlignment from "./SelectAlignment";
|
15
15
|
import SelectFontSize from "./SelectFontSize";
|
16
16
|
import InfinityAITool from "./InfinityAITool";
|
17
|
-
import {
|
17
|
+
import { viewSlateSelection } from "../../../utils/helper";
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
20
|
const DEFAULT_COLOR = {
|
@@ -34,18 +34,12 @@ const MiniTextFormat = props => {
|
|
34
34
|
const [anchorEl, setAnchorEl] = useState(null);
|
35
35
|
const open = Boolean(anchorEl);
|
36
36
|
const id = open ? "popup-edit-tool" : "";
|
37
|
-
const [resizedSize, setResizedSize] = useState();
|
38
37
|
const [size] = useWindowResize();
|
39
|
-
const theme = useTheme();
|
40
|
-
const listType = getListType(editor);
|
41
|
-
const commonProps = {
|
42
|
-
listType
|
43
|
-
};
|
44
38
|
const removeFontStyles = ["superscript", "subscript"];
|
45
39
|
const fontStyle = allTools.filter(f => f.type === "mark" && !removeFontStyles.includes(f.format));
|
46
40
|
const link = allTools.find(f => f.format?.indexOf("link") >= 0);
|
47
41
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
48
|
-
const activeColor =
|
42
|
+
const activeColor = activeMark(editor, textColorFormat) || DEFAULT_COLOR[textColorFormat];
|
49
43
|
const activeBg = activeMark(editor, textBgFormat) || DEFAULT_COLOR[textBgFormat];
|
50
44
|
return /*#__PURE__*/_jsx(Grid, {
|
51
45
|
container: true,
|
@@ -63,7 +57,6 @@ const MiniTextFormat = props => {
|
|
63
57
|
classes: classes,
|
64
58
|
editor: editor,
|
65
59
|
closeMainPopup: closeMainPopup,
|
66
|
-
type: "miniToolBar",
|
67
60
|
customProps: customProps
|
68
61
|
}), /*#__PURE__*/_jsx("div", {
|
69
62
|
className: "verticalLine"
|
@@ -71,8 +64,7 @@ const MiniTextFormat = props => {
|
|
71
64
|
classes: classes,
|
72
65
|
editor: editor,
|
73
66
|
closeMainPopup: closeMainPopup,
|
74
|
-
customProps: customProps
|
75
|
-
commonProps: commonProps
|
67
|
+
customProps: customProps
|
76
68
|
}), /*#__PURE__*/_jsx("div", {
|
77
69
|
className: "verticalLine mr-1"
|
78
70
|
}), /*#__PURE__*/_jsx(SelectAlignment, {
|
@@ -85,10 +77,7 @@ const MiniTextFormat = props => {
|
|
85
77
|
className: "verticalLine mr-1"
|
86
78
|
}), /*#__PURE__*/_jsx(SelectFontSize, {
|
87
79
|
classes: classes,
|
88
|
-
editor: editor
|
89
|
-
fromMiniTextFormat: true,
|
90
|
-
setResizedSize: setResizedSize,
|
91
|
-
resizedSize: resizedSize
|
80
|
+
editor: editor
|
92
81
|
}), /*#__PURE__*/_jsx("div", {
|
93
82
|
className: "verticalLine mr-1"
|
94
83
|
}), fontStyle?.map((m, i) => {
|
@@ -103,8 +92,7 @@ const MiniTextFormat = props => {
|
|
103
92
|
activeColor: activeColor,
|
104
93
|
id: "11_cc",
|
105
94
|
editor: editor,
|
106
|
-
customProps: customProps
|
107
|
-
type: "textColor"
|
95
|
+
customProps: customProps
|
108
96
|
}), /*#__PURE__*/_jsx(MiniColorPicker, {
|
109
97
|
format: textBgFormat,
|
110
98
|
classes: classes,
|
@@ -150,11 +138,7 @@ const MiniTextFormat = props => {
|
|
150
138
|
editor: editor,
|
151
139
|
classes: classes,
|
152
140
|
closeMainPopup: closeMainPopup,
|
153
|
-
customProps: customProps
|
154
|
-
commonProps: commonProps,
|
155
|
-
fromMiniTextFormat: true,
|
156
|
-
setResizedSize: setResizedSize,
|
157
|
-
resizedSize: resizedSize
|
141
|
+
customProps: customProps
|
158
142
|
})]
|
159
143
|
})
|
160
144
|
})
|
@@ -98,9 +98,6 @@ const usePopupStyle = theme => ({
|
|
98
98
|
}
|
99
99
|
}
|
100
100
|
},
|
101
|
-
"& .MuiDivider-root": {
|
102
|
-
border: `0.5px solid ${theme?.palette?.editor?.deviderBgColor}`
|
103
|
-
},
|
104
101
|
"@media only screen and (max-width: 599px)": {
|
105
102
|
// margin: "10px !important",
|
106
103
|
background: "unset",
|
@@ -114,7 +111,6 @@ const usePopupStyle = theme => ({
|
|
114
111
|
width: "323px",
|
115
112
|
maxWidth: "100%",
|
116
113
|
overflowX: "hidden !important",
|
117
|
-
marginTop: "6px",
|
118
114
|
// 30% of window height
|
119
115
|
maxHeight: `${window.innerHeight * 0.45}px`,
|
120
116
|
overflow: "auto",
|
@@ -308,21 +304,6 @@ const usePopupStyle = theme => ({
|
|
308
304
|
paddingRight: "0px !important"
|
309
305
|
}
|
310
306
|
},
|
311
|
-
textFormatContainer: {
|
312
|
-
".saveThemeBtnsWrapper": {
|
313
|
-
position: "sticky",
|
314
|
-
bottom: "0px",
|
315
|
-
right: "0px",
|
316
|
-
boxShadow: `0px -3px 16px 0px ${theme?.palette?.editor?.cardShadow}`,
|
317
|
-
padding: "10px",
|
318
|
-
borderRadius: "8px 8px 19px 19px",
|
319
|
-
display: "flex",
|
320
|
-
justifyContent: "end",
|
321
|
-
alignItems: "center",
|
322
|
-
gap: "8px",
|
323
|
-
background: theme?.palette?.editor?.miniToolBarBackground
|
324
|
-
}
|
325
|
-
},
|
326
307
|
textFormatLabel: {
|
327
308
|
display: "flex",
|
328
309
|
alignItems: "center",
|
@@ -354,10 +335,9 @@ const usePopupStyle = theme => ({
|
|
354
335
|
borderBottom: `1px solid ${theme?.palette?.editor?.deviderBgColor} !important`
|
355
336
|
},
|
356
337
|
textFormatField: {
|
357
|
-
marginBottom: "8px"
|
358
|
-
|
338
|
+
marginBottom: "8px",
|
339
|
+
marginTop: "8px"
|
359
340
|
},
|
360
|
-
|
361
341
|
textFormatField1: {
|
362
342
|
marginBottom: "16px",
|
363
343
|
marginTop: "10px"
|
@@ -436,11 +416,6 @@ const usePopupStyle = theme => ({
|
|
436
416
|
"& .MuiOutlinedInput-notchedOutline": {
|
437
417
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
|
438
418
|
},
|
439
|
-
"& .MuiInputBase-root": {
|
440
|
-
"& input": {
|
441
|
-
border: "none !important"
|
442
|
-
}
|
443
|
-
},
|
444
419
|
"& svg": {
|
445
420
|
width: "20px",
|
446
421
|
height: "24px"
|
@@ -449,6 +424,9 @@ const usePopupStyle = theme => ({
|
|
449
424
|
fontFamilyListOptions: {
|
450
425
|
"& .MuiAutocomplete-listbox": {
|
451
426
|
padding: "0px",
|
427
|
+
// "&::-webkit-scrollbar-thumb": {
|
428
|
+
// background: `none !important`,
|
429
|
+
// },
|
452
430
|
"&::-webkit-scrollbar-thumb": {
|
453
431
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
454
432
|
},
|
@@ -559,7 +537,7 @@ const usePopupStyle = theme => ({
|
|
559
537
|
}
|
560
538
|
},
|
561
539
|
alignItems: "flexStart",
|
562
|
-
|
540
|
+
justifyContent: "center",
|
563
541
|
flexDirection: "row",
|
564
542
|
"&:hover": {
|
565
543
|
background: "unset"
|
@@ -808,13 +786,8 @@ const usePopupStyle = theme => ({
|
|
808
786
|
padding: "0px"
|
809
787
|
},
|
810
788
|
defaultBtn: {
|
811
|
-
color: "#
|
812
|
-
textTransform: "none"
|
813
|
-
textDecoration: "underline",
|
814
|
-
"&.Mui-disabled": {
|
815
|
-
color: "#A0AEC0 !important",
|
816
|
-
textDecoration: "none"
|
817
|
-
}
|
789
|
+
color: "#0F172A",
|
790
|
+
textTransform: "none"
|
818
791
|
},
|
819
792
|
templateCardBtnGrp: {
|
820
793
|
display: "none",
|
@@ -891,7 +864,7 @@ const usePopupStyle = theme => ({
|
|
891
864
|
margin: "30px",
|
892
865
|
"& .MuiPaper-root": {
|
893
866
|
overflow: "auto",
|
894
|
-
backgroundColor: theme?.palette?.editor?.
|
867
|
+
backgroundColor: theme?.palette?.editor?.background,
|
895
868
|
borderRadius: "14px !important",
|
896
869
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`,
|
897
870
|
minWidth: "fit-content",
|
@@ -1159,45 +1132,12 @@ const usePopupStyle = theme => ({
|
|
1159
1132
|
miniFontSizeInput: {
|
1160
1133
|
"& input": {
|
1161
1134
|
fontSize: "14px",
|
1162
|
-
width: "
|
1135
|
+
width: "16px",
|
1163
1136
|
padding: "8px 4px"
|
1164
1137
|
},
|
1165
1138
|
"& fieldset": {
|
1166
1139
|
border: "none !important"
|
1167
1140
|
}
|
1168
|
-
},
|
1169
|
-
customCheckBox: {
|
1170
|
-
marginTop: "4px",
|
1171
|
-
padding: "0px",
|
1172
|
-
"& .MuiCheckbox-root": {
|
1173
|
-
padding: "8px 8px 8px 10px",
|
1174
|
-
"&:hover": {
|
1175
|
-
background: "unset !important"
|
1176
|
-
}
|
1177
|
-
},
|
1178
|
-
"& button": {
|
1179
|
-
width: "14px !important",
|
1180
|
-
height: "14px !important",
|
1181
|
-
borderRadius: "3px",
|
1182
|
-
border: `1px solid ${theme?.palette?.editor?.buttonBorder3}`,
|
1183
|
-
padding: "0px",
|
1184
|
-
"& svg": {
|
1185
|
-
width: "10px",
|
1186
|
-
height: "10px"
|
1187
|
-
}
|
1188
|
-
},
|
1189
|
-
"& .checkedIcon": {
|
1190
|
-
background: "#2563EB",
|
1191
|
-
borderColor: "#2563EB"
|
1192
|
-
},
|
1193
|
-
"& .unCheckedIcon": {
|
1194
|
-
background: theme?.palette?.editor?.checkedIconBg
|
1195
|
-
},
|
1196
|
-
"& p": {
|
1197
|
-
margin: "0px !important",
|
1198
|
-
color: theme?.palette?.editor?.tv_text,
|
1199
|
-
fontSize: "13px"
|
1200
|
-
}
|
1201
1141
|
}
|
1202
1142
|
});
|
1203
1143
|
export default usePopupStyle;
|
@@ -10,8 +10,6 @@ import { AllColors } from "../../Elements/Color Picker/ColorButtons";
|
|
10
10
|
import { fontFamilyMap } from "../../utils/font";
|
11
11
|
import { getBorderColor } from "../../utils/helper";
|
12
12
|
import SelectTypography from "./MiniTextFormat/SelectTypography";
|
13
|
-
import { isTextCustomized, saveToTheme } from "../../helper/theme";
|
14
|
-
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
15
13
|
import SelectSuperSubscript from "./MiniTextFormat/SelectSuperSubscript";
|
16
14
|
import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
|
17
15
|
import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
|
@@ -31,11 +29,7 @@ const TextFormat = props => {
|
|
31
29
|
editor,
|
32
30
|
onClose,
|
33
31
|
closeMainPopup,
|
34
|
-
customProps
|
35
|
-
commonProps,
|
36
|
-
setResizedSize,
|
37
|
-
resizedSize,
|
38
|
-
fromMiniTextFormat
|
32
|
+
customProps
|
39
33
|
} = props;
|
40
34
|
const [anchorEl, setAnchorEl] = useState(null);
|
41
35
|
const [type, setType] = useState(null);
|
@@ -43,23 +37,20 @@ const TextFormat = props => {
|
|
43
37
|
const {
|
44
38
|
translation
|
45
39
|
} = customProps;
|
46
|
-
const {
|
47
|
-
listType
|
48
|
-
} = commonProps || {};
|
49
40
|
const {
|
50
41
|
element: pageSt
|
51
42
|
} = getPageSettings(editor) || {};
|
52
43
|
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
53
44
|
const {
|
54
45
|
fontFamilies,
|
55
|
-
theme
|
46
|
+
theme
|
56
47
|
} = useEditorContext();
|
57
48
|
const breakpoint = getDevice(window.innerWidth);
|
58
49
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
59
50
|
const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
|
60
51
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
61
52
|
const link = allTools.find(f => f.format?.indexOf("link") >= 0);
|
62
|
-
const lists = allTools.filter(f => f.group?.
|
53
|
+
const lists = allTools.filter(f => f.group?.indexOf("list") >= 0);
|
63
54
|
const {
|
64
55
|
isActive: isBlockQuoteActive,
|
65
56
|
props: bqProps
|
@@ -71,11 +62,6 @@ const TextFormat = props => {
|
|
71
62
|
color: "",
|
72
63
|
bgColor: ""
|
73
64
|
};
|
74
|
-
const {
|
75
|
-
theme,
|
76
|
-
updateTheme
|
77
|
-
} = useEditorTheme();
|
78
|
-
const customized = isTextCustomized(editor);
|
79
65
|
let lineSpacingValue = activeMark(editor, "lineHeight");
|
80
66
|
lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
|
81
67
|
const handleColorPicker = type => e => {
|
@@ -130,51 +116,6 @@ const TextFormat = props => {
|
|
130
116
|
sx: classes.textFormatWrapper,
|
131
117
|
className: "text-formatter-popup",
|
132
118
|
children: [/*#__PURE__*/_jsxs(Grid, {
|
133
|
-
item: true,
|
134
|
-
xs: 12,
|
135
|
-
children: [/*#__PURE__*/_jsxs(Grid, {
|
136
|
-
container: true,
|
137
|
-
justifyContent: "space-between",
|
138
|
-
alignItems: "center",
|
139
|
-
children: [/*#__PURE__*/_jsx(Grid, {
|
140
|
-
item: true,
|
141
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
142
|
-
variant: "body1",
|
143
|
-
color: "primary",
|
144
|
-
sx: classes.typoLabel,
|
145
|
-
children: "Style"
|
146
|
-
})
|
147
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
148
|
-
item: true,
|
149
|
-
children: theme?.id ? /*#__PURE__*/_jsx(Button, {
|
150
|
-
sx: classes.defaultBtn,
|
151
|
-
onClick: () => {
|
152
|
-
const {
|
153
|
-
field,
|
154
|
-
theme
|
155
|
-
} = saveToTheme(editor) || {};
|
156
|
-
updateTheme(theme, {
|
157
|
-
action: "ELEMENT_PROPS_CHANGE",
|
158
|
-
fieldName: field
|
159
|
-
});
|
160
|
-
},
|
161
|
-
disabled: !customized,
|
162
|
-
children: "Save to theme"
|
163
|
-
}) : null
|
164
|
-
})]
|
165
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
166
|
-
item: true,
|
167
|
-
xs: 12,
|
168
|
-
sx: classes.textFormatField,
|
169
|
-
children: /*#__PURE__*/_jsx(SelectTypography, {
|
170
|
-
editor: editor,
|
171
|
-
classes: classes,
|
172
|
-
closeMainPopup: closeMainPopup,
|
173
|
-
type: "fullWidth",
|
174
|
-
customProps: customProps
|
175
|
-
})
|
176
|
-
})]
|
177
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
178
119
|
item: true,
|
179
120
|
xs: 12,
|
180
121
|
children: [/*#__PURE__*/_jsxs(Grid, {
|
@@ -255,10 +196,7 @@ const TextFormat = props => {
|
|
255
196
|
format: "fontSize",
|
256
197
|
activeMark: activeMark,
|
257
198
|
editor: editor,
|
258
|
-
fullWidth: true
|
259
|
-
fromMiniTextFormat: fromMiniTextFormat,
|
260
|
-
setResizedSize: setResizedSize,
|
261
|
-
resizedSize: resizedSize
|
199
|
+
fullWidth: true
|
262
200
|
})
|
263
201
|
})]
|
264
202
|
})]
|
@@ -304,8 +242,7 @@ const TextFormat = props => {
|
|
304
242
|
rounded: true,
|
305
243
|
title: translation("textColor"),
|
306
244
|
id: "11_cc",
|
307
|
-
classes: classes
|
308
|
-
type: "textColor"
|
245
|
+
classes: classes
|
309
246
|
}, "11_cc")
|
310
247
|
})]
|
311
248
|
}), /*#__PURE__*/_jsxs(Grid, {
|
@@ -331,7 +268,7 @@ const TextFormat = props => {
|
|
331
268
|
children: /*#__PURE__*/_jsx(Button, {
|
332
269
|
sx: classes.defaultBtn2,
|
333
270
|
startIcon: /*#__PURE__*/_jsx(ColorResetIcon, {
|
334
|
-
stroke:
|
271
|
+
stroke: theme?.palette?.type === "dark" ? "#505359" : "#A2B0B9"
|
335
272
|
}),
|
336
273
|
onClick: handleDefault({
|
337
274
|
format: "bgColor"
|
@@ -399,8 +336,7 @@ const TextFormat = props => {
|
|
399
336
|
return /*#__PURE__*/_jsx(Comp, {
|
400
337
|
editor: editor,
|
401
338
|
...m,
|
402
|
-
customProps: customProps
|
403
|
-
commonProps: commonProps
|
339
|
+
customProps: customProps
|
404
340
|
}, `pptool_block_${i}_${m.id}`);
|
405
341
|
})
|
406
342
|
})]
|
@@ -422,7 +358,12 @@ const TextFormat = props => {
|
|
422
358
|
xs: 12,
|
423
359
|
className: "typo-icons",
|
424
360
|
sx: classes.evenSpace,
|
425
|
-
children: [
|
361
|
+
children: [/*#__PURE__*/_jsx(SelectTypography, {
|
362
|
+
classes: classes,
|
363
|
+
editor: editor,
|
364
|
+
closeMainPopup: closeMainPopup || onClose,
|
365
|
+
customProps: customProps
|
366
|
+
}), fontStyle?.map((m, i) => {
|
426
367
|
return /*#__PURE__*/_jsx(MarkButton, {
|
427
368
|
editor: editor,
|
428
369
|
...m,
|
@@ -461,7 +402,7 @@ const TextFormat = props => {
|
|
461
402
|
value: lineSpacingValue,
|
462
403
|
onChange: handleLineSpacing,
|
463
404
|
data: {
|
464
|
-
key:
|
405
|
+
key: 'lineHeight'
|
465
406
|
}
|
466
407
|
})
|
467
408
|
})]
|
@@ -9,7 +9,7 @@ import { useEditorContext } from "../../hooks/useMouseMove";
|
|
9
9
|
import usePopupStyles from "../PopupTool/PopupToolStyle";
|
10
10
|
import useEditorScroll from "../../hooks/useEditorScroll";
|
11
11
|
import { isCarouselSelected } from "../../helper";
|
12
|
-
import { hideSlateSelection
|
12
|
+
import { hideSlateSelection } from "../../utils/helper";
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
14
|
const isSlateDOM = event => {
|
15
15
|
return event.target.getAttribute("data-slate-string") === "true";
|
@@ -95,18 +95,15 @@ const PopupTool = props => {
|
|
95
95
|
const isFreeGridEnabled = enable === 1 && isFreeGridElement;
|
96
96
|
if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "" || isFreeGridEnabled) {
|
97
97
|
setAnchorEl(null);
|
98
|
-
hideSlateSelection(); // removes slate selection background, when there is no selection
|
99
98
|
} else {
|
100
99
|
updateAnchorEl();
|
101
|
-
|
102
|
-
// hideSlateSelection(); // removes slate selection background, when there is no selection
|
100
|
+
hideSlateSelection(); // removes slate selection background, when there is no selection
|
103
101
|
}
|
104
102
|
}, [selection, event, selectedElement?.enable]);
|
105
103
|
const handleClose = () => {
|
106
104
|
// setAnchorEl(null);
|
107
105
|
setOpen(false);
|
108
106
|
setPopupType("");
|
109
|
-
Transforms.deselect(editor);
|
110
107
|
};
|
111
108
|
return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
|
112
109
|
onClickAway: e => {
|
@@ -28,20 +28,16 @@ export const toolbarGroups = [[{
|
|
28
28
|
type: "dropdown",
|
29
29
|
options: [{
|
30
30
|
text: "Normal",
|
31
|
-
value: "normal"
|
32
|
-
numVal: "400"
|
31
|
+
value: "normal"
|
33
32
|
}, {
|
34
33
|
text: "Bold",
|
35
|
-
value: "bold"
|
36
|
-
numVal: "700"
|
34
|
+
value: "bold"
|
37
35
|
}, {
|
38
36
|
text: "Bolder",
|
39
|
-
value: "bolder"
|
40
|
-
numVal: "700"
|
37
|
+
value: "bolder"
|
41
38
|
}, {
|
42
39
|
text: "Lighter",
|
43
|
-
value: "lighter"
|
44
|
-
numVal: "100"
|
40
|
+
value: "lighter"
|
45
41
|
}],
|
46
42
|
icon: FormatBoldIcon,
|
47
43
|
width: "100px"
|
@@ -50,8 +46,7 @@ export const toolbarGroups = [[{
|
|
50
46
|
format: "bold",
|
51
47
|
type: "mark",
|
52
48
|
title: "Bold",
|
53
|
-
basic: true
|
54
|
-
themeEnabled: true
|
49
|
+
basic: true
|
55
50
|
}, {
|
56
51
|
id: 5,
|
57
52
|
format: "underline",
|
@@ -62,8 +57,7 @@ export const toolbarGroups = [[{
|
|
62
57
|
format: "italic",
|
63
58
|
type: "mark",
|
64
59
|
title: "Italic",
|
65
|
-
basic: true
|
66
|
-
themeEnabled: true
|
60
|
+
basic: true
|
67
61
|
}, {
|
68
62
|
id: 6,
|
69
63
|
format: "strikethrough",
|
@@ -107,42 +101,6 @@ export const toolbarGroups = [[{
|
|
107
101
|
type: "block",
|
108
102
|
title: "H3",
|
109
103
|
group: "typography"
|
110
|
-
}, {
|
111
|
-
id: 39,
|
112
|
-
format: "headingFour",
|
113
|
-
type: "block",
|
114
|
-
title: "H4",
|
115
|
-
group: "typography"
|
116
|
-
}, {
|
117
|
-
id: 40,
|
118
|
-
format: "headingFive",
|
119
|
-
type: "block",
|
120
|
-
title: "H5",
|
121
|
-
group: "typography"
|
122
|
-
}, {
|
123
|
-
id: 41,
|
124
|
-
format: "headingSix",
|
125
|
-
type: "block",
|
126
|
-
title: "H6",
|
127
|
-
group: "typography"
|
128
|
-
}, {
|
129
|
-
id: 42,
|
130
|
-
format: "paragraphOne",
|
131
|
-
type: "block",
|
132
|
-
title: "Paragraph 1",
|
133
|
-
group: "typography"
|
134
|
-
}, {
|
135
|
-
id: 43,
|
136
|
-
format: "paragraphTwo",
|
137
|
-
type: "block",
|
138
|
-
title: "Paragraph 2",
|
139
|
-
group: "typography"
|
140
|
-
}, {
|
141
|
-
id: 44,
|
142
|
-
format: "paragraphThree",
|
143
|
-
type: "block",
|
144
|
-
title: "Paragraph 3",
|
145
|
-
group: "typography"
|
146
104
|
}, {
|
147
105
|
id: 14,
|
148
106
|
format: "doublequote",
|
@@ -154,22 +112,19 @@ export const toolbarGroups = [[{
|
|
154
112
|
format: "orderedList",
|
155
113
|
type: "block",
|
156
114
|
title: "Ordered List",
|
157
|
-
group: "list"
|
158
|
-
hideFor: ["accordion-summary"]
|
115
|
+
group: "list"
|
159
116
|
}, {
|
160
117
|
id: 16,
|
161
118
|
format: "unorderedList",
|
162
119
|
type: "block",
|
163
120
|
title: "Bulleted List",
|
164
|
-
group: "list"
|
165
|
-
hideFor: ["accordion-summary"]
|
121
|
+
group: "list"
|
166
122
|
}, {
|
167
123
|
id: 43,
|
168
124
|
format: "check-list-item",
|
169
125
|
type: "block",
|
170
126
|
title: "Check List",
|
171
|
-
group: "list"
|
172
|
-
hideFor: ["accordion-summary"]
|
127
|
+
group: "list"
|
173
128
|
}], [{
|
174
129
|
id: 17,
|
175
130
|
format: "alignLeft",
|
@@ -272,8 +227,7 @@ export const toolbarGroups = [[{
|
|
272
227
|
format: "accordion",
|
273
228
|
type: "accordion",
|
274
229
|
group: "list",
|
275
|
-
component: "AccordionButton"
|
276
|
-
hideFor: ["list-item"]
|
230
|
+
component: "AccordionButton"
|
277
231
|
}, {
|
278
232
|
id: 31,
|
279
233
|
format: "signature",
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React, { useMemo, useState } from "react";
|
2
2
|
import { Grid, Button, Popover } from "@mui/material";
|
3
|
+
import ColorPickerTool from "react-gcolor-picker";
|
3
4
|
import { colors } from "../Elements/Color Picker/defaultColors";
|
4
5
|
import SwipeableDrawerComponent from "./SwipeableDrawer";
|
5
|
-
import CustomColorPicker from "./CustomColorPicker";
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
8
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -12,10 +12,7 @@ const ColorPickerToolComponent = ({
|
|
12
12
|
onSave = () => {},
|
13
13
|
recentColors = [],
|
14
14
|
hideGradient,
|
15
|
-
handleClose
|
16
|
-
closeDrawer,
|
17
|
-
hideThemeColors,
|
18
|
-
disableEditTheme
|
15
|
+
handleClose
|
19
16
|
}) => {
|
20
17
|
const [color, setColor] = useState(value);
|
21
18
|
const handleSave = () => {
|
@@ -35,32 +32,29 @@ const ColorPickerToolComponent = ({
|
|
35
32
|
return /*#__PURE__*/_jsxs(Grid, {
|
36
33
|
item: true,
|
37
34
|
xs: 12,
|
38
|
-
style: {
|
39
|
-
position: "relative"
|
40
|
-
},
|
41
35
|
children: [/*#__PURE__*/_jsx("div", {
|
42
36
|
style: {
|
43
37
|
minHeight: "460px"
|
44
38
|
},
|
45
|
-
children: /*#__PURE__*/_jsx(
|
39
|
+
children: /*#__PURE__*/_jsx(ColorPickerTool, {
|
46
40
|
gradient: hideGradient ? false : true,
|
47
|
-
|
41
|
+
value: color,
|
48
42
|
onChange: handleColorChange,
|
49
|
-
|
50
|
-
defaultColors: initialColors,
|
51
|
-
closeDrawer: closeDrawer,
|
52
|
-
hideThemeColors: hideThemeColors,
|
53
|
-
disableEditTheme: disableEditTheme
|
43
|
+
defaultColors: initialColors
|
54
44
|
})
|
55
45
|
}), /*#__PURE__*/_jsxs("div", {
|
56
|
-
|
46
|
+
style: {
|
47
|
+
display: "flex",
|
48
|
+
justifyContent: "end",
|
49
|
+
margin: "8px"
|
50
|
+
},
|
57
51
|
children: [/*#__PURE__*/_jsx(Button, {
|
58
52
|
onClick: handleClose,
|
59
|
-
className: "
|
53
|
+
className: "secondaryBtn",
|
60
54
|
children: "Cancel"
|
61
55
|
}), /*#__PURE__*/_jsx(Button, {
|
62
56
|
onClick: handleSave,
|
63
|
-
className: "
|
57
|
+
className: "primaryBtn",
|
64
58
|
children: "Save"
|
65
59
|
})]
|
66
60
|
})]
|
@@ -73,11 +67,7 @@ const ColorPickerButton = props => {
|
|
73
67
|
defaultColors = [],
|
74
68
|
classes = {},
|
75
69
|
recentColors = [],
|
76
|
-
hideGradient
|
77
|
-
children,
|
78
|
-
handleClose: closeDrawer,
|
79
|
-
hideThemeColors,
|
80
|
-
disableEditTheme
|
70
|
+
hideGradient
|
81
71
|
} = props;
|
82
72
|
const [anchorEl, setAnchorEl] = useState(null);
|
83
73
|
const open = Boolean(anchorEl);
|
@@ -89,13 +79,7 @@ const ColorPickerButton = props => {
|
|
89
79
|
setAnchorEl(null);
|
90
80
|
};
|
91
81
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
92
|
-
children: [
|
93
|
-
onClick: handleColorPicker,
|
94
|
-
style: {
|
95
|
-
cursor: "pointer"
|
96
|
-
},
|
97
|
-
children: children
|
98
|
-
}) : /*#__PURE__*/_jsx(Button, {
|
82
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
99
83
|
style: {
|
100
84
|
background: value,
|
101
85
|
height: "22px",
|
@@ -122,10 +106,7 @@ const ColorPickerButton = props => {
|
|
122
106
|
onSave: onSave,
|
123
107
|
recentColors: recentColors,
|
124
108
|
hideGradient: hideGradient,
|
125
|
-
handleClose: handleClose
|
126
|
-
closeDrawer: closeDrawer,
|
127
|
-
hideThemeColors: hideThemeColors,
|
128
|
-
disableEditTheme: disableEditTheme
|
109
|
+
handleClose: handleClose
|
129
110
|
})
|
130
111
|
})
|
131
112
|
}) : /*#__PURE__*/_jsx(Popover, {
|
@@ -151,10 +132,7 @@ const ColorPickerButton = props => {
|
|
151
132
|
onSave: onSave,
|
152
133
|
recentColors: recentColors,
|
153
134
|
hideGradient: hideGradient,
|
154
|
-
handleClose: handleClose
|
155
|
-
closeDrawer: closeDrawer,
|
156
|
-
hideThemeColors: hideThemeColors,
|
157
|
-
disableEditTheme: disableEditTheme
|
135
|
+
handleClose: handleClose
|
158
136
|
})
|
159
137
|
})
|
160
138
|
})]
|