@flozy/editor 11.1.0 → 11.1.1
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 +6 -6
- package/dist/Editor/CommonEditor.js +21 -82
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +4 -37
- 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 -22
- 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/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.css +0 -5
- package/dist/Editor/Elements/Embed/Embed.js +43 -37
- package/dist/Editor/Elements/Embed/Image.js +22 -242
- package/dist/Editor/Elements/Embed/Video.js +32 -277
- package/dist/Editor/Elements/Form/Form.js +35 -10
- 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 +75 -34
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +5 -9
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -3
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -15
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +3 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +13 -2
- package/dist/Editor/Elements/SimpleText/index.js +1 -4
- package/dist/Editor/Elements/Table/Table.js +1 -2
- package/dist/Editor/Elements/Table/TableCell.js +3 -10
- package/dist/Editor/Elements/Title/title.js +5 -4
- package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -4
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +3 -5
- package/dist/Editor/Styles/EditorStyles.js +5 -16
- 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 +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +23 -25
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +5 -15
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +7 -65
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +12 -66
- package/dist/Editor/Toolbar/PopupTool/index.js +4 -6
- package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
- package/dist/Editor/common/ColorPickerButton.js +19 -38
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +0 -1
- 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/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 -3
- 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 +0 -2
- 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/Theme/ViewportStimulator.js +3 -6
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +11 -28
- package/dist/Editor/common/RnD/Utils/index.js +1 -3
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +63 -52
- package/dist/Editor/common/RnD/VirtualElement/helper.js +68 -248
- package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -22
- package/dist/Editor/common/RnD/index.js +14 -61
- package/dist/Editor/common/Shorthands/elements.js +0 -54
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -4
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +0 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +2 -10
- 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/color.js +10 -36
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
- 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/formStyle.js +13 -19
- package/dist/Editor/common/StyleBuilder/index.js +4 -8
- package/dist/Editor/common/Uploader.js +17 -118
- package/dist/Editor/common/iconslist.js +0 -21
- package/dist/Editor/commonStyle.js +3 -37
- package/dist/Editor/helper/index.js +1 -4
- package/dist/Editor/helper/theme.js +2 -203
- package/dist/Editor/hooks/useMouseMove.js +3 -12
- package/dist/Editor/hooks/useTable.js +1 -62
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +3 -56
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/service/fileupload.js +0 -70
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +38 -162
- package/dist/Editor/utils/button.js +17 -1
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +3 -76
- package/dist/Editor/utils/insertAppHeader.js +4 -8
- package/package.json +1 -1
- package/dist/Editor/Elements/Attachments/AttachmentStyles.js +0 -16
- package/dist/Editor/Elements/FreeGrid/helper.js +0 -194
- 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/UploaderWithProgress.js +0 -183
- package/dist/Editor/hooks/useEditorTheme.js +0 -153
- 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
@@ -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"
|
@@ -557,7 +537,7 @@ const usePopupStyle = theme => ({
|
|
557
537
|
}
|
558
538
|
},
|
559
539
|
alignItems: "flexStart",
|
560
|
-
|
540
|
+
justifyContent: "center",
|
561
541
|
flexDirection: "row",
|
562
542
|
"&:hover": {
|
563
543
|
background: "unset"
|
@@ -806,13 +786,8 @@ const usePopupStyle = theme => ({
|
|
806
786
|
padding: "0px"
|
807
787
|
},
|
808
788
|
defaultBtn: {
|
809
|
-
color: "#
|
810
|
-
textTransform: "none"
|
811
|
-
textDecoration: "underline",
|
812
|
-
"&.Mui-disabled": {
|
813
|
-
color: "#A0AEC0 !important",
|
814
|
-
textDecoration: "none"
|
815
|
-
}
|
789
|
+
color: "#0F172A",
|
790
|
+
textTransform: "none"
|
816
791
|
},
|
817
792
|
templateCardBtnGrp: {
|
818
793
|
display: "none",
|
@@ -889,7 +864,7 @@ const usePopupStyle = theme => ({
|
|
889
864
|
margin: "30px",
|
890
865
|
"& .MuiPaper-root": {
|
891
866
|
overflow: "auto",
|
892
|
-
backgroundColor: theme?.palette?.editor?.
|
867
|
+
backgroundColor: theme?.palette?.editor?.background,
|
893
868
|
borderRadius: "14px !important",
|
894
869
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`,
|
895
870
|
minWidth: "fit-content",
|
@@ -1157,45 +1132,12 @@ const usePopupStyle = theme => ({
|
|
1157
1132
|
miniFontSizeInput: {
|
1158
1133
|
"& input": {
|
1159
1134
|
fontSize: "14px",
|
1160
|
-
width: "
|
1135
|
+
width: "16px",
|
1161
1136
|
padding: "8px 4px"
|
1162
1137
|
},
|
1163
1138
|
"& fieldset": {
|
1164
1139
|
border: "none !important"
|
1165
1140
|
}
|
1166
|
-
},
|
1167
|
-
customCheckBox: {
|
1168
|
-
marginTop: "4px",
|
1169
|
-
padding: "0px",
|
1170
|
-
"& .MuiCheckbox-root": {
|
1171
|
-
padding: "8px 8px 8px 10px",
|
1172
|
-
"&:hover": {
|
1173
|
-
background: "unset !important"
|
1174
|
-
}
|
1175
|
-
},
|
1176
|
-
"& button": {
|
1177
|
-
width: "14px !important",
|
1178
|
-
height: "14px !important",
|
1179
|
-
borderRadius: "3px",
|
1180
|
-
border: `1px solid ${theme?.palette?.editor?.buttonBorder3}`,
|
1181
|
-
padding: "0px",
|
1182
|
-
"& svg": {
|
1183
|
-
width: "10px",
|
1184
|
-
height: "10px"
|
1185
|
-
}
|
1186
|
-
},
|
1187
|
-
"& .checkedIcon": {
|
1188
|
-
background: "#2563EB",
|
1189
|
-
borderColor: "#2563EB"
|
1190
|
-
},
|
1191
|
-
"& .unCheckedIcon": {
|
1192
|
-
background: theme?.palette?.editor?.checkedIconBg
|
1193
|
-
},
|
1194
|
-
"& p": {
|
1195
|
-
margin: "0px !important",
|
1196
|
-
color: theme?.palette?.editor?.tv_text,
|
1197
|
-
fontSize: "13px"
|
1198
|
-
}
|
1199
1141
|
}
|
1200
1142
|
});
|
1201
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,10 +29,7 @@ const TextFormat = props => {
|
|
31
29
|
editor,
|
32
30
|
onClose,
|
33
31
|
closeMainPopup,
|
34
|
-
customProps
|
35
|
-
setResizedSize,
|
36
|
-
resizedSize,
|
37
|
-
fromMiniTextFormat
|
32
|
+
customProps
|
38
33
|
} = props;
|
39
34
|
const [anchorEl, setAnchorEl] = useState(null);
|
40
35
|
const [type, setType] = useState(null);
|
@@ -48,7 +43,7 @@ const TextFormat = props => {
|
|
48
43
|
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
49
44
|
const {
|
50
45
|
fontFamilies,
|
51
|
-
theme
|
46
|
+
theme
|
52
47
|
} = useEditorContext();
|
53
48
|
const breakpoint = getDevice(window.innerWidth);
|
54
49
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
@@ -67,11 +62,6 @@ const TextFormat = props => {
|
|
67
62
|
color: "",
|
68
63
|
bgColor: ""
|
69
64
|
};
|
70
|
-
const {
|
71
|
-
theme,
|
72
|
-
updateTheme
|
73
|
-
} = useEditorTheme();
|
74
|
-
const customized = isTextCustomized(editor);
|
75
65
|
let lineSpacingValue = activeMark(editor, "lineHeight");
|
76
66
|
lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
|
77
67
|
const handleColorPicker = type => e => {
|
@@ -126,51 +116,6 @@ const TextFormat = props => {
|
|
126
116
|
sx: classes.textFormatWrapper,
|
127
117
|
className: "text-formatter-popup",
|
128
118
|
children: [/*#__PURE__*/_jsxs(Grid, {
|
129
|
-
item: true,
|
130
|
-
xs: 12,
|
131
|
-
children: [/*#__PURE__*/_jsxs(Grid, {
|
132
|
-
container: true,
|
133
|
-
justifyContent: "space-between",
|
134
|
-
alignItems: "center",
|
135
|
-
children: [/*#__PURE__*/_jsx(Grid, {
|
136
|
-
item: true,
|
137
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
138
|
-
variant: "body1",
|
139
|
-
color: "primary",
|
140
|
-
sx: classes.typoLabel,
|
141
|
-
children: "Style"
|
142
|
-
})
|
143
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
144
|
-
item: true,
|
145
|
-
children: theme?.id ? /*#__PURE__*/_jsx(Button, {
|
146
|
-
sx: classes.defaultBtn,
|
147
|
-
onClick: () => {
|
148
|
-
const {
|
149
|
-
field,
|
150
|
-
theme
|
151
|
-
} = saveToTheme(editor) || {};
|
152
|
-
updateTheme(theme, {
|
153
|
-
action: "ELEMENT_PROPS_CHANGE",
|
154
|
-
fieldName: field
|
155
|
-
});
|
156
|
-
},
|
157
|
-
disabled: !customized,
|
158
|
-
children: "Save to theme"
|
159
|
-
}) : null
|
160
|
-
})]
|
161
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
162
|
-
item: true,
|
163
|
-
xs: 12,
|
164
|
-
sx: classes.textFormatField,
|
165
|
-
children: /*#__PURE__*/_jsx(SelectTypography, {
|
166
|
-
editor: editor,
|
167
|
-
classes: classes,
|
168
|
-
closeMainPopup: closeMainPopup,
|
169
|
-
type: "fullWidth",
|
170
|
-
customProps: customProps
|
171
|
-
})
|
172
|
-
})]
|
173
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
174
119
|
item: true,
|
175
120
|
xs: 12,
|
176
121
|
children: [/*#__PURE__*/_jsxs(Grid, {
|
@@ -251,10 +196,7 @@ const TextFormat = props => {
|
|
251
196
|
format: "fontSize",
|
252
197
|
activeMark: activeMark,
|
253
198
|
editor: editor,
|
254
|
-
fullWidth: true
|
255
|
-
fromMiniTextFormat: fromMiniTextFormat,
|
256
|
-
setResizedSize: setResizedSize,
|
257
|
-
resizedSize: resizedSize
|
199
|
+
fullWidth: true
|
258
200
|
})
|
259
201
|
})]
|
260
202
|
})]
|
@@ -300,8 +242,7 @@ const TextFormat = props => {
|
|
300
242
|
rounded: true,
|
301
243
|
title: translation("textColor"),
|
302
244
|
id: "11_cc",
|
303
|
-
classes: classes
|
304
|
-
type: "textColor"
|
245
|
+
classes: classes
|
305
246
|
}, "11_cc")
|
306
247
|
})]
|
307
248
|
}), /*#__PURE__*/_jsxs(Grid, {
|
@@ -327,7 +268,7 @@ const TextFormat = props => {
|
|
327
268
|
children: /*#__PURE__*/_jsx(Button, {
|
328
269
|
sx: classes.defaultBtn2,
|
329
270
|
startIcon: /*#__PURE__*/_jsx(ColorResetIcon, {
|
330
|
-
stroke:
|
271
|
+
stroke: theme?.palette?.type === "dark" ? "#505359" : "#A2B0B9"
|
331
272
|
}),
|
332
273
|
onClick: handleDefault({
|
333
274
|
format: "bgColor"
|
@@ -417,7 +358,12 @@ const TextFormat = props => {
|
|
417
358
|
xs: 12,
|
418
359
|
className: "typo-icons",
|
419
360
|
sx: classes.evenSpace,
|
420
|
-
children: [
|
361
|
+
children: [/*#__PURE__*/_jsx(SelectTypography, {
|
362
|
+
classes: classes,
|
363
|
+
editor: editor,
|
364
|
+
closeMainPopup: closeMainPopup || onClose,
|
365
|
+
customProps: customProps
|
366
|
+
}), fontStyle?.map((m, i) => {
|
421
367
|
return /*#__PURE__*/_jsx(MarkButton, {
|
422
368
|
editor: editor,
|
423
369
|
...m,
|
@@ -456,7 +402,7 @@ const TextFormat = props => {
|
|
456
402
|
value: lineSpacingValue,
|
457
403
|
onChange: handleLineSpacing,
|
458
404
|
data: {
|
459
|
-
key:
|
405
|
+
key: 'lineHeight'
|
460
406
|
}
|
461
407
|
})
|
462
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 {
|
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";
|
@@ -97,15 +97,13 @@ const PopupTool = props => {
|
|
97
97
|
setAnchorEl(null);
|
98
98
|
} else {
|
99
99
|
updateAnchorEl();
|
100
|
-
|
101
|
-
// hideSlateSelection(); // removes slate selection background, when there is no selection
|
100
|
+
hideSlateSelection(); // removes slate selection background, when there is no selection
|
102
101
|
}
|
103
102
|
}, [selection, event, selectedElement?.enable]);
|
104
103
|
const handleClose = () => {
|
105
104
|
// setAnchorEl(null);
|
106
105
|
setOpen(false);
|
107
106
|
setPopupType("");
|
108
|
-
Transforms.deselect(editor);
|
109
107
|
};
|
110
108
|
return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
|
111
109
|
onClickAway: e => {
|
@@ -142,13 +140,13 @@ const PopupTool = props => {
|
|
142
140
|
sx: classes.popupWrapper,
|
143
141
|
placement: "top-start",
|
144
142
|
style: {
|
145
|
-
boxShadow:
|
143
|
+
boxShadow: 'unset'
|
146
144
|
} //this is for overriding global shadow from popupwrapper used in other places
|
147
145
|
,
|
148
146
|
children: /*#__PURE__*/_jsx(Paper, {
|
149
147
|
sx: {
|
150
148
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
151
|
-
boxShadow:
|
149
|
+
boxShadow: '1px 2px 12px 0px #0000001F'
|
152
150
|
},
|
153
151
|
children: /*#__PURE__*/_jsx(MiniTextFormat, {
|
154
152
|
editor: editor,
|
@@ -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",
|
@@ -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,29 +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: {
|
37
|
+
minHeight: "460px"
|
38
|
+
},
|
39
|
+
children: /*#__PURE__*/_jsx(ColorPickerTool, {
|
43
40
|
gradient: hideGradient ? false : true,
|
44
|
-
|
41
|
+
value: color,
|
45
42
|
onChange: handleColorChange,
|
46
|
-
|
47
|
-
defaultColors: initialColors,
|
48
|
-
closeDrawer: closeDrawer,
|
49
|
-
hideThemeColors: hideThemeColors,
|
50
|
-
disableEditTheme: disableEditTheme
|
43
|
+
defaultColors: initialColors
|
51
44
|
})
|
52
45
|
}), /*#__PURE__*/_jsxs("div", {
|
53
|
-
|
46
|
+
style: {
|
47
|
+
display: "flex",
|
48
|
+
justifyContent: "end",
|
49
|
+
margin: "8px"
|
50
|
+
},
|
54
51
|
children: [/*#__PURE__*/_jsx(Button, {
|
55
52
|
onClick: handleClose,
|
56
|
-
className: "
|
53
|
+
className: "secondaryBtn",
|
57
54
|
children: "Cancel"
|
58
55
|
}), /*#__PURE__*/_jsx(Button, {
|
59
56
|
onClick: handleSave,
|
60
|
-
className: "
|
57
|
+
className: "primaryBtn",
|
61
58
|
children: "Save"
|
62
59
|
})]
|
63
60
|
})]
|
@@ -70,11 +67,7 @@ const ColorPickerButton = props => {
|
|
70
67
|
defaultColors = [],
|
71
68
|
classes = {},
|
72
69
|
recentColors = [],
|
73
|
-
hideGradient
|
74
|
-
children,
|
75
|
-
handleClose: closeDrawer,
|
76
|
-
hideThemeColors,
|
77
|
-
disableEditTheme
|
70
|
+
hideGradient
|
78
71
|
} = props;
|
79
72
|
const [anchorEl, setAnchorEl] = useState(null);
|
80
73
|
const open = Boolean(anchorEl);
|
@@ -86,13 +79,7 @@ const ColorPickerButton = props => {
|
|
86
79
|
setAnchorEl(null);
|
87
80
|
};
|
88
81
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
89
|
-
children: [
|
90
|
-
onClick: handleColorPicker,
|
91
|
-
style: {
|
92
|
-
cursor: "pointer"
|
93
|
-
},
|
94
|
-
children: children
|
95
|
-
}) : /*#__PURE__*/_jsx(Button, {
|
82
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
96
83
|
style: {
|
97
84
|
background: value,
|
98
85
|
height: "22px",
|
@@ -119,10 +106,7 @@ const ColorPickerButton = props => {
|
|
119
106
|
onSave: onSave,
|
120
107
|
recentColors: recentColors,
|
121
108
|
hideGradient: hideGradient,
|
122
|
-
handleClose: handleClose
|
123
|
-
closeDrawer: closeDrawer,
|
124
|
-
hideThemeColors: hideThemeColors,
|
125
|
-
disableEditTheme: disableEditTheme
|
109
|
+
handleClose: handleClose
|
126
110
|
})
|
127
111
|
})
|
128
112
|
}) : /*#__PURE__*/_jsx(Popover, {
|
@@ -148,10 +132,7 @@ const ColorPickerButton = props => {
|
|
148
132
|
onSave: onSave,
|
149
133
|
recentColors: recentColors,
|
150
134
|
hideGradient: hideGradient,
|
151
|
-
handleClose: handleClose
|
152
|
-
closeDrawer: closeDrawer,
|
153
|
-
hideThemeColors: hideThemeColors,
|
154
|
-
disableEditTheme: disableEditTheme
|
135
|
+
handleClose: handleClose
|
155
136
|
})
|
156
137
|
})
|
157
138
|
})]
|
@@ -7,7 +7,7 @@ import { useEditorContext } from "../../hooks/useMouseMove";
|
|
7
7
|
import { Transforms } from "slate";
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
-
const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "
|
10
|
+
const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "grid"];
|
11
11
|
const DragHandleStyle = fromPopper => {
|
12
12
|
const handleDragStyle = fromPopper ? {
|
13
13
|
position: "absolute",
|
@@ -97,7 +97,6 @@ const FontLoader = props => {
|
|
97
97
|
});
|
98
98
|
let families = Array.from(fontSet);
|
99
99
|
families = correctFontArray(families.join(", "));
|
100
|
-
// eslint-disable-next-line no-useless-escape
|
101
100
|
families = families?.map(font => font?.replace(/\"/g, ""));
|
102
101
|
families = families?.map(font => font?.replace(", sans-serif", ""));
|
103
102
|
families = families?.filter(font => googleFontList?.includes(font));
|
@@ -48,16 +48,6 @@ import ChervUp from "../assets/svg/ChervUp";
|
|
48
48
|
import ResetIconNew from "../assets/svg/ResetIconNew";
|
49
49
|
import { jsx as _jsx } from "react/jsx-runtime";
|
50
50
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
51
|
-
const HeadingIcon = ({
|
52
|
-
variant
|
53
|
-
}) => {
|
54
|
-
return /*#__PURE__*/_jsx("div", {
|
55
|
-
style: {
|
56
|
-
color: "#64748B"
|
57
|
-
},
|
58
|
-
children: variant
|
59
|
-
});
|
60
|
-
};
|
61
51
|
const iconList = {
|
62
52
|
fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
|
63
53
|
size: 20
|
@@ -90,24 +80,6 @@ const iconList = {
|
|
90
80
|
size: 18,
|
91
81
|
fill: "#64748B"
|
92
82
|
}),
|
93
|
-
headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
|
94
|
-
variant: "H4"
|
95
|
-
}),
|
96
|
-
headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
|
97
|
-
variant: "H5"
|
98
|
-
}),
|
99
|
-
headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
|
100
|
-
variant: "H6"
|
101
|
-
}),
|
102
|
-
paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
|
103
|
-
variant: "P1"
|
104
|
-
}),
|
105
|
-
paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
|
106
|
-
variant: "P2"
|
107
|
-
}),
|
108
|
-
paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
|
109
|
-
variant: "P3"
|
110
|
-
}),
|
111
83
|
blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
|
112
84
|
size: 20,
|
113
85
|
fill: "#64748B",
|
@@ -17,7 +17,7 @@ const IMAGE_SLECTOR_OPTIONS = {
|
|
17
17
|
};
|
18
18
|
const TAB_SHOW = {
|
19
19
|
Image: ["upload", "choose", "addLink"],
|
20
|
-
Video: ["
|
20
|
+
Video: ["addLink"],
|
21
21
|
Embed: ["addLink"],
|
22
22
|
Document: ["addLink", "upload"]
|
23
23
|
};
|
@@ -31,54 +31,21 @@ const ImageSelector = props => {
|
|
31
31
|
onClose,
|
32
32
|
open,
|
33
33
|
onSelectImage,
|
34
|
-
|
35
|
-
|
36
|
-
disableProgress
|
34
|
+
title,
|
35
|
+
customProps
|
37
36
|
} = props;
|
38
|
-
const {
|
39
|
-
uploadTerminator
|
40
|
-
} = customProps;
|
41
|
-
const [uniqueId, setUniqueId] = useState(null);
|
42
|
-
const title = props.title || "Image";
|
43
37
|
const translation = customProps?.translation;
|
44
38
|
const [tabValue, setTabValue] = useState(title === "Image" ? "choose" : "addLink");
|
45
39
|
const [image, setImage] = useState(value || "");
|
46
|
-
const [s3UploadProp, setS3UploadProp] = useState({
|
47
|
-
file: null,
|
48
|
-
pageId: null,
|
49
|
-
services: customProps?.services,
|
50
|
-
setUploadStatus: setUploadStatus
|
51
|
-
});
|
52
40
|
const handleTabChange = (e, newValue) => {
|
53
41
|
setImage("");
|
54
42
|
setTabValue(newValue);
|
55
|
-
setS3UploadProp({
|
56
|
-
file: null,
|
57
|
-
pageId: null,
|
58
|
-
services: customProps?.services,
|
59
|
-
setUploadStatus: setUploadStatus
|
60
|
-
});
|
61
43
|
};
|
62
44
|
const onUploaded = url => {
|
63
45
|
setImage(url);
|
64
46
|
};
|
65
47
|
const onSave = () => {
|
66
|
-
|
67
|
-
if (disableProgress) {
|
68
|
-
onSelectImage(image);
|
69
|
-
} else {
|
70
|
-
onSelectImage(s3UploadProp);
|
71
|
-
}
|
72
|
-
} else {
|
73
|
-
onSelectImage({
|
74
|
-
embedURL: image,
|
75
|
-
isUpload: false
|
76
|
-
});
|
77
|
-
}
|
78
|
-
};
|
79
|
-
const onCloseUpload = () => {
|
80
|
-
uploadTerminator(uniqueId, setUploadStatus);
|
81
|
-
onClose();
|
48
|
+
onSelectImage(image);
|
82
49
|
};
|
83
50
|
const isActive = val => tabValue === val ? "active" : "";
|
84
51
|
const Comp = IMAGE_SLECTOR_OPTIONS[tabValue] || /*#__PURE__*/_jsx(_Fragment, {});
|
@@ -162,12 +129,7 @@ const ImageSelector = props => {
|
|
162
129
|
children: /*#__PURE__*/_jsx(Comp, {
|
163
130
|
...props,
|
164
131
|
classes: classes,
|
165
|
-
onUploaded: onUploaded
|
166
|
-
setS3UploadProp: setS3UploadProp,
|
167
|
-
s3UploadProp: s3UploadProp,
|
168
|
-
disableProgress: disableProgress,
|
169
|
-
setUniqueId: setUniqueId,
|
170
|
-
uniqueId: uniqueId
|
132
|
+
onUploaded: onUploaded
|
171
133
|
})
|
172
134
|
})]
|
173
135
|
})
|
@@ -181,12 +143,12 @@ const ImageSelector = props => {
|
|
181
143
|
p: 2
|
182
144
|
},
|
183
145
|
children: [/*#__PURE__*/_jsx(Button, {
|
184
|
-
onClick:
|
146
|
+
onClick: onClose,
|
185
147
|
className: "secondaryBtn",
|
186
148
|
sx: classes.closeBtn,
|
187
149
|
children: translation("Cancel")
|
188
150
|
}), /*#__PURE__*/_jsx(Button, {
|
189
|
-
disabled:
|
151
|
+
disabled: !image,
|
190
152
|
onClick: onSave,
|
191
153
|
className: `primaryBtn ${!image ? "disabled" : ""}`,
|
192
154
|
sx: classes.saveBtn,
|