@flozy/editor 3.9.1 → 3.9.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +45 -55
- package/dist/Editor/CommonEditor.js +111 -180
- package/dist/Editor/Editor.css +0 -7
- package/dist/Editor/Elements/AI/AIInput.js +18 -17
- package/dist/Editor/Elements/AI/CustomSelect.js +12 -19
- package/dist/Editor/Elements/AI/PopoverAIInput.js +28 -23
- package/dist/Editor/Elements/AI/Styles.js +1 -2
- package/dist/Editor/Elements/Accordion/Accordion.js +7 -74
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +2 -3
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +60 -4
- package/dist/Editor/Elements/AppHeader/AppHeader.js +4 -26
- package/dist/Editor/Elements/Button/EditorButton.js +16 -28
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +17 -60
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -2
- package/dist/Editor/Elements/Embed/Image.js +19 -27
- package/dist/Editor/Elements/Embed/Video.js +10 -14
- package/dist/Editor/Elements/Emoji/EmojiPicker.js +2 -4
- package/dist/Editor/Elements/Form/Form.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +3 -12
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +1 -2
- package/dist/Editor/Elements/Grid/Grid.js +3 -27
- package/dist/Editor/Elements/Grid/GridItem.js +1 -3
- package/dist/Editor/Elements/Link/Link.js +1 -6
- package/dist/Editor/Elements/Link/LinkButton.js +2 -4
- package/dist/Editor/Elements/Link/LinkPopup.js +3 -10
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -8
- package/dist/Editor/Elements/Signature/SignaturePopup.js +3 -14
- package/dist/Editor/Elements/Table/Styles.js +1 -23
- package/dist/Editor/Elements/Table/Table.js +2 -3
- package/dist/Editor/Elements/Table/TableCell.js +8 -70
- package/dist/Editor/Elements/TableContextMenu/TableContextMenu.js +0 -1
- package/dist/Editor/MiniEditor.js +1 -3
- package/dist/Editor/Styles/EditorStyles.js +1 -1
- package/dist/Editor/Toolbar/Basic/index.js +2 -4
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +2 -26
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +18 -29
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +3 -29
- package/dist/Editor/Toolbar/Mini/Options/Options.js +0 -10
- package/dist/Editor/Toolbar/Mini/Styles.js +0 -7
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +11 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +86 -213
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -22
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +7 -52
- package/dist/Editor/Toolbar/PopupTool/index.js +17 -7
- package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
- package/dist/Editor/assets/svg/AIIcons.js +1 -153
- package/dist/Editor/assets/svg/AddTemplateIcon.js +10 -13
- package/dist/Editor/assets/svg/TextIcon.js +5 -8
- package/dist/Editor/common/ColorPickerButton.js +9 -25
- package/dist/Editor/common/DnD/DragHandleButton.js +47 -56
- package/dist/Editor/common/Icon.js +3 -43
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -5
- package/dist/Editor/common/LinkSettings/index.js +2 -4
- package/dist/Editor/common/LinkSettings/navOptions.js +2 -7
- package/dist/Editor/common/LinkSettings/style.js +8 -11
- package/dist/Editor/common/MentionsPopup/MentionsListCard.js +1 -6
- package/dist/Editor/common/MentionsPopup/Styles.js +2 -5
- package/dist/Editor/common/Section/index.js +7 -57
- package/dist/Editor/common/Section/styles.js +0 -11
- package/dist/Editor/common/Shorthands/elements.js +0 -54
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +7 -7
- package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +16 -16
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +3 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -31
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +3 -14
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +4 -14
- package/dist/Editor/common/StyleBuilder/index.js +1 -1
- package/dist/Editor/common/iconslist.js +31 -0
- package/dist/Editor/helper/deserialize/index.js +9 -14
- package/dist/Editor/helper/theme.js +4 -190
- package/dist/Editor/hooks/useMouseMove.js +2 -4
- package/dist/Editor/hooks/useWindowMessage.js +7 -10
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +5 -47
- package/dist/Editor/plugins/withLayout.js +10 -15
- package/dist/Editor/plugins/withTable.js +2 -2
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +25 -161
- package/dist/Editor/utils/button.js +17 -1
- package/dist/Editor/utils/draftToSlate.js +1 -1
- package/dist/Editor/utils/events.js +6 -65
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +14 -74
- package/dist/Editor/utils/table.js +43 -51
- package/package.json +3 -4
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +0 -73
- package/dist/Editor/Elements/AI/VoiceToText/index.js +0 -177
- package/dist/Editor/Elements/AI/VoiceToText/style.js +0 -40
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +0 -28
- package/dist/Editor/Elements/Redo/RedoButton.js +0 -14
- package/dist/Editor/Elements/Undo/UndoButton.js +0 -14
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
- package/dist/Editor/assets/svg/RedoIcon.js +0 -27
- package/dist/Editor/assets/svg/SettingsIcon.js +0 -28
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
- package/dist/Editor/assets/svg/UndoIcon.js +0 -27
- package/dist/Editor/common/CustomColorPicker/index.js +0 -106
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog/index.js +0 -94
- package/dist/Editor/common/CustomDialog/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -33
- package/dist/Editor/common/EditorCmds.js +0 -35
- package/dist/Editor/hooks/useEditorTheme.js +0 -139
- package/dist/Editor/theme/index.js +0 -144
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
- package/dist/Editor/themeSettings/buttons/index.js +0 -290
- package/dist/Editor/themeSettings/buttons/style.js +0 -21
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -290
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -123
- package/dist/Editor/themeSettings/fonts/index.js +0 -213
- package/dist/Editor/themeSettings/fonts/style.js +0 -44
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -320
- package/dist/Editor/themeSettings/style.js +0 -152
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -356
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -190
- package/dist/Editor/themeSettingsAI/style.js +0 -247
@@ -2,11 +2,8 @@ import { useMemo } from "react";
|
|
2
2
|
import { activeMark, addMarkData, isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
|
3
3
|
import CustomSelectTool from "./CustomSelectTool";
|
4
4
|
import useWindowResize from "../../../hooks/useWindowResize";
|
5
|
-
import { BREAKPOINTS_DEVICES, getBreakPointsValue
|
5
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
|
6
6
|
import { sizeMap } from "../../../utils/font";
|
7
|
-
import { Editor } from "slate";
|
8
|
-
import { MenuItem, Select } from "@mui/material";
|
9
|
-
import { useEditorTheme } from "../../../hooks/useEditorTheme";
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
9
|
function Label({
|
@@ -20,194 +17,93 @@ function Label({
|
|
20
17
|
});
|
21
18
|
}
|
22
19
|
function DisplayHeaderLabel({
|
23
|
-
type
|
24
|
-
isCustomized,
|
25
|
-
isPara = false
|
20
|
+
type
|
26
21
|
}) {
|
27
22
|
return /*#__PURE__*/_jsxs("div", {
|
28
|
-
children: [
|
23
|
+
children: ["H", /*#__PURE__*/_jsx("sub", {
|
29
24
|
children: type
|
30
25
|
})]
|
31
26
|
});
|
32
27
|
}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
type: "
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
id: 17,
|
78
|
-
format: "headingFour",
|
79
|
-
type: "block",
|
80
|
-
title: /*#__PURE__*/_jsx(Label, {
|
81
|
-
label: "H4",
|
82
|
-
type: "Heading"
|
83
|
-
}),
|
84
|
-
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
85
|
-
type: 4,
|
86
|
-
isCustomized: isCustomized
|
87
|
-
}),
|
88
|
-
group: "typography",
|
89
|
-
value: "headingFour"
|
90
|
-
}, {
|
91
|
-
id: 18,
|
92
|
-
format: "headingFive",
|
93
|
-
type: "block",
|
94
|
-
title: /*#__PURE__*/_jsx(Label, {
|
95
|
-
label: "H5",
|
96
|
-
type: "Heading"
|
97
|
-
}),
|
98
|
-
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
99
|
-
type: 5,
|
100
|
-
isCustomized: isCustomized
|
101
|
-
}),
|
102
|
-
group: "typography",
|
103
|
-
value: "headingFive"
|
104
|
-
}, {
|
105
|
-
id: 19,
|
106
|
-
format: "headingSix",
|
107
|
-
type: "block",
|
108
|
-
title: /*#__PURE__*/_jsx(Label, {
|
109
|
-
label: "H6",
|
110
|
-
type: "Heading"
|
111
|
-
}),
|
112
|
-
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
113
|
-
type: 6,
|
114
|
-
isCustomized: isCustomized
|
115
|
-
}),
|
116
|
-
group: "typography",
|
117
|
-
value: "headingSix"
|
118
|
-
}, {
|
119
|
-
id: 20,
|
120
|
-
format: "paragraphOne",
|
121
|
-
type: "block",
|
122
|
-
title: /*#__PURE__*/_jsx(Label, {
|
123
|
-
label: "P1",
|
124
|
-
type: "Paragraph"
|
125
|
-
}),
|
126
|
-
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
127
|
-
type: 1,
|
128
|
-
isCustomized: isCustomized,
|
129
|
-
isPara: true
|
130
|
-
}),
|
131
|
-
group: "typography",
|
132
|
-
value: "paragraphOne"
|
133
|
-
}, {
|
134
|
-
id: 21,
|
135
|
-
format: "paragraphTwo",
|
136
|
-
type: "block",
|
137
|
-
title: /*#__PURE__*/_jsx(Label, {
|
138
|
-
label: "P2",
|
139
|
-
type: "Paragraph"
|
140
|
-
}),
|
141
|
-
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
142
|
-
type: 2,
|
143
|
-
isCustomized: isCustomized,
|
144
|
-
isPara: true
|
145
|
-
}),
|
146
|
-
group: "typography",
|
147
|
-
value: "paragraphTwo"
|
148
|
-
}, {
|
149
|
-
id: 22,
|
150
|
-
format: "paragraphThree",
|
151
|
-
type: "block",
|
152
|
-
title: /*#__PURE__*/_jsx(Label, {
|
153
|
-
label: "P3",
|
154
|
-
type: "Paragraph"
|
155
|
-
}),
|
156
|
-
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
157
|
-
type: 3,
|
158
|
-
isCustomized: isCustomized,
|
159
|
-
isPara: true
|
160
|
-
}),
|
161
|
-
group: "typography",
|
162
|
-
value: "paragraphThree"
|
163
|
-
}, {
|
164
|
-
id: 14,
|
165
|
-
format: "fontSize",
|
166
|
-
type: "mark",
|
167
|
-
title: /*#__PURE__*/_jsx(Label, {
|
168
|
-
label: "L",
|
169
|
-
type: "Large"
|
170
|
-
}),
|
28
|
+
const typographyOptions = [{
|
29
|
+
id: 11,
|
30
|
+
format: "headingOne",
|
31
|
+
type: "block",
|
32
|
+
title: /*#__PURE__*/_jsx(Label, {
|
33
|
+
label: "H1",
|
34
|
+
type: "Header"
|
35
|
+
}),
|
36
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
37
|
+
type: 1
|
38
|
+
}),
|
39
|
+
group: "typography",
|
40
|
+
value: "headingOne"
|
41
|
+
}, {
|
42
|
+
id: 12,
|
43
|
+
format: "headingTwo",
|
44
|
+
type: "block",
|
45
|
+
title: /*#__PURE__*/_jsx(Label, {
|
46
|
+
label: "H2",
|
47
|
+
type: "Header"
|
48
|
+
}),
|
49
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
50
|
+
type: 2
|
51
|
+
}),
|
52
|
+
group: "typography",
|
53
|
+
value: "headingTwo"
|
54
|
+
}, {
|
55
|
+
id: 13,
|
56
|
+
format: "headingThree",
|
57
|
+
type: "block",
|
58
|
+
title: /*#__PURE__*/_jsx(Label, {
|
59
|
+
label: "H3",
|
60
|
+
type: "Header"
|
61
|
+
}),
|
62
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
63
|
+
type: 3
|
64
|
+
}),
|
65
|
+
group: "typography",
|
66
|
+
value: "headingThree"
|
67
|
+
}, {
|
68
|
+
id: 14,
|
69
|
+
format: "fontSize",
|
70
|
+
type: "mark",
|
71
|
+
title: /*#__PURE__*/_jsx(Label, {
|
171
72
|
label: "L",
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
73
|
+
type: "Large"
|
74
|
+
}),
|
75
|
+
label: "L",
|
76
|
+
group: "typography",
|
77
|
+
value: "huge"
|
78
|
+
}, {
|
79
|
+
id: 15,
|
80
|
+
format: "fontSize",
|
81
|
+
type: "mark",
|
82
|
+
title: /*#__PURE__*/_jsx(Label, {
|
182
83
|
label: "M",
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
84
|
+
type: "Medium"
|
85
|
+
}),
|
86
|
+
label: "M",
|
87
|
+
group: "typography",
|
88
|
+
value: "medium"
|
89
|
+
}, {
|
90
|
+
id: 16,
|
91
|
+
format: "fontSize",
|
92
|
+
type: "mark",
|
93
|
+
title: /*#__PURE__*/_jsx(Label, {
|
193
94
|
label: "S",
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
95
|
+
type: "Small"
|
96
|
+
}),
|
97
|
+
label: "S",
|
98
|
+
group: "typography",
|
99
|
+
value: "small"
|
100
|
+
}];
|
199
101
|
function SelectTypography({
|
200
102
|
editor,
|
201
103
|
classes,
|
202
|
-
closeMainPopup
|
203
|
-
type
|
104
|
+
closeMainPopup
|
204
105
|
}) {
|
205
106
|
const [size] = useWindowResize();
|
206
|
-
const {
|
207
|
-
theme
|
208
|
-
} = useEditorTheme();
|
209
|
-
const isTextCustomized = theme?.id ? isCustomized(editor) : false;
|
210
|
-
const typographyOptions = getTypographyOptions(isTextCustomized);
|
211
107
|
const updateMarkData = newVal => {
|
212
108
|
const val = activeMark(editor, "fontSize");
|
213
109
|
let upData = {
|
@@ -252,49 +148,26 @@ function SelectTypography({
|
|
252
148
|
});
|
253
149
|
}, [typographyOptions, activeMark, isBlockActive, editor]);
|
254
150
|
const onChange = (format, option) => {
|
151
|
+
// add/reset block elements
|
152
|
+
toggleBlock(editor, format);
|
255
153
|
if (option.type === "block") {
|
256
|
-
|
257
|
-
|
154
|
+
// reset old font size
|
155
|
+
addMarkData(editor, {
|
156
|
+
format: "fontSize",
|
157
|
+
value: {}
|
258
158
|
});
|
259
|
-
|
260
|
-
// add/reset block elements
|
261
|
-
toggleBlock(editor, format);
|
262
159
|
} else if (option.type === "mark") {
|
263
160
|
const size = sizeMap[option.value] || "";
|
264
161
|
const [sizeInNumber] = size.split("px");
|
265
162
|
updateMarkData(Number(sizeInNumber));
|
266
163
|
}
|
267
164
|
};
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
value: typographyValue,
|
275
|
-
classes: classes
|
276
|
-
});
|
277
|
-
}
|
278
|
-
return /*#__PURE__*/_jsx(Select, {
|
279
|
-
value: typographyValue,
|
280
|
-
className: "editor-dd",
|
281
|
-
onChange: e => {
|
282
|
-
const {
|
283
|
-
value
|
284
|
-
} = e.target;
|
285
|
-
const option = typographyOptions?.find(o => o.value === value);
|
286
|
-
onChange(value, option);
|
287
|
-
},
|
288
|
-
style: {
|
289
|
-
width: "100%",
|
290
|
-
height: "36px",
|
291
|
-
borderRadius: "10px",
|
292
|
-
fontSize: "14px"
|
293
|
-
},
|
294
|
-
children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
|
295
|
-
value: item.value,
|
296
|
-
children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
|
297
|
-
}, index))
|
165
|
+
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
166
|
+
options: typographyOptions,
|
167
|
+
editor: editor,
|
168
|
+
onChange: onChange,
|
169
|
+
value: selectedBlock?.value || "headingOne",
|
170
|
+
classes: classes
|
298
171
|
});
|
299
172
|
}
|
300
173
|
export default SelectTypography;
|
@@ -53,8 +53,7 @@ const MiniTextFormat = props => {
|
|
53
53
|
children: [customProps?.hideTools?.includes("infinityAI") ? null : /*#__PURE__*/_jsx(InfinityAITool, {}), /*#__PURE__*/_jsx(SelectTypography, {
|
54
54
|
classes: classes,
|
55
55
|
editor: editor,
|
56
|
-
closeMainPopup: closeMainPopup
|
57
|
-
type: "miniToolBar"
|
56
|
+
closeMainPopup: closeMainPopup
|
58
57
|
}), /*#__PURE__*/_jsx("div", {
|
59
58
|
className: "verticalLine"
|
60
59
|
}), /*#__PURE__*/_jsx(SelectList, {
|
@@ -3,8 +3,9 @@ const usePopupStyle = theme => ({
|
|
3
3
|
boxShadow: "0px 4px 10px 0px rgba(0, 0, 0, 0.16)",
|
4
4
|
zIndex: 1300,
|
5
5
|
marginBottom: "12px !important",
|
6
|
-
|
7
|
-
|
6
|
+
border: "1px solid #E0E0E0",
|
7
|
+
borderRadius: "10px",
|
8
|
+
maxWidth: "100%",
|
8
9
|
"&.fullscreen": {
|
9
10
|
marginBottom: "0px !important",
|
10
11
|
"& .papper-wrpr": {
|
@@ -18,7 +19,7 @@ const usePopupStyle = theme => ({
|
|
18
19
|
backgroundColor: theme?.palette?.editor?.background
|
19
20
|
},
|
20
21
|
"&.textSettings": {
|
21
|
-
|
22
|
+
'@media only screen and (max-width: 600px)': {
|
22
23
|
margin: "4px !important",
|
23
24
|
marginBottom: "54px !important"
|
24
25
|
}
|
@@ -77,7 +78,7 @@ const usePopupStyle = theme => ({
|
|
77
78
|
paddingTop: "4px"
|
78
79
|
},
|
79
80
|
"@media only screen and (max-width: 599px)": {
|
80
|
-
width:
|
81
|
+
width: '330px'
|
81
82
|
}
|
82
83
|
},
|
83
84
|
"&.templates": {
|
@@ -88,7 +89,7 @@ const usePopupStyle = theme => ({
|
|
88
89
|
maxHeight: "fit-content"
|
89
90
|
},
|
90
91
|
"@media only screen and (max-width: 599px)": {
|
91
|
-
width:
|
92
|
+
width: '330px'
|
92
93
|
}
|
93
94
|
},
|
94
95
|
"& .headerContainer": {},
|
@@ -143,7 +144,7 @@ const usePopupStyle = theme => ({
|
|
143
144
|
}
|
144
145
|
},
|
145
146
|
"@media only screen and (max-width: 599px)": {
|
146
|
-
width:
|
147
|
+
width: '330px'
|
147
148
|
}
|
148
149
|
},
|
149
150
|
textFormatLabel: {
|
@@ -154,13 +155,13 @@ const usePopupStyle = theme => ({
|
|
154
155
|
lineHeight: "25px",
|
155
156
|
marginTop: "12px",
|
156
157
|
marginBottom: "8px",
|
157
|
-
|
158
|
+
'& .searchContainer': {
|
158
159
|
position: "absolute",
|
159
160
|
right: 0,
|
160
161
|
zIndex: 3
|
161
162
|
},
|
162
|
-
|
163
|
-
padding:
|
163
|
+
'& .MuiFormControl-root.MuiTextField-root input': {
|
164
|
+
padding: '8px 35px 6px 12px'
|
164
165
|
}
|
165
166
|
},
|
166
167
|
textFormatField: {
|
@@ -204,8 +205,7 @@ const usePopupStyle = theme => ({
|
|
204
205
|
fontSize: "14px",
|
205
206
|
marginBottom: "5px",
|
206
207
|
paddingLeft: "5px",
|
207
|
-
fontWeight: 500
|
208
|
-
color: "#000000"
|
208
|
+
fontWeight: 500
|
209
209
|
},
|
210
210
|
templateCard: {
|
211
211
|
borderRadius: "10px",
|
@@ -327,13 +327,8 @@ const usePopupStyle = theme => ({
|
|
327
327
|
}
|
328
328
|
},
|
329
329
|
defaultBtn: {
|
330
|
-
color: "#
|
331
|
-
textTransform: "none"
|
332
|
-
textDecoration: "underline",
|
333
|
-
"&.Mui-disabled": {
|
334
|
-
color: "#A0AEC0 !important",
|
335
|
-
textDecoration: "none"
|
336
|
-
}
|
330
|
+
color: "#0F172A",
|
331
|
+
textTransform: "none"
|
337
332
|
},
|
338
333
|
templateCardBtnGrp: {
|
339
334
|
display: "none",
|
@@ -418,8 +413,7 @@ const usePopupStyle = theme => ({
|
|
418
413
|
colorPopper: {
|
419
414
|
"& .MuiPaper-root": {
|
420
415
|
backgroundColor: theme?.palette?.editor?.background,
|
421
|
-
|
422
|
-
"@media only screen and (max-width: 600px)": {
|
416
|
+
'@media only screen and (max-width: 600px)': {
|
423
417
|
marginTop: "-40px"
|
424
418
|
}
|
425
419
|
}
|
@@ -530,9 +524,9 @@ const usePopupStyle = theme => ({
|
|
530
524
|
},
|
531
525
|
customSelectPopoverWrapper: {
|
532
526
|
"& .MuiPopover-paper": {
|
533
|
-
maxHeight:
|
527
|
+
maxHeight: '140px',
|
534
528
|
background: theme?.palette?.editor?.background,
|
535
|
-
|
529
|
+
'@media only screen and (max-width: 600px)': {
|
536
530
|
marginTop: "-40px"
|
537
531
|
}
|
538
532
|
},
|
@@ -14,9 +14,6 @@ import { getPageSettings, updatePageSettings } from "../../utils/pageSettings";
|
|
14
14
|
import { AllColors } from "../../Elements/Color Picker/ColorButtons";
|
15
15
|
import { fontFamilyMap } from "../../utils/font";
|
16
16
|
import { getBorderColor } from "../../utils/helper";
|
17
|
-
import SelectTypography from "./MiniTextFormat/SelectTypography";
|
18
|
-
import { isTextCustomized, saveToTheme } from "../../helper/theme";
|
19
|
-
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
20
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
21
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
22
19
|
const allTools = toolbarGroups.flat();
|
@@ -37,6 +34,7 @@ const TextFormat = props => {
|
|
37
34
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
38
35
|
const link = allTools.find(f => f.format?.indexOf("link") >= 0);
|
39
36
|
const lists = allTools.filter(f => f.group?.indexOf("list") >= 0);
|
37
|
+
const typo = allTools.filter(f => f.group?.indexOf("typography") >= 0);
|
40
38
|
const {
|
41
39
|
pageProps
|
42
40
|
} = getPageSettings(editor)?.element || {};
|
@@ -54,11 +52,6 @@ const TextFormat = props => {
|
|
54
52
|
color: "",
|
55
53
|
bgColor: ""
|
56
54
|
};
|
57
|
-
const {
|
58
|
-
theme,
|
59
|
-
updateTheme
|
60
|
-
} = useEditorTheme();
|
61
|
-
const customized = isTextCustomized(editor);
|
62
55
|
const handlePageWidth = width => () => {
|
63
56
|
updatePageSettings(editor, {
|
64
57
|
...(pageProps || {}),
|
@@ -108,49 +101,6 @@ const TextFormat = props => {
|
|
108
101
|
container: true,
|
109
102
|
sx: classes.textFormatWrapper,
|
110
103
|
children: [/*#__PURE__*/_jsxs(Grid, {
|
111
|
-
item: true,
|
112
|
-
xs: 12,
|
113
|
-
children: [/*#__PURE__*/_jsxs(Grid, {
|
114
|
-
container: true,
|
115
|
-
justifyContent: "space-between",
|
116
|
-
alignItems: "center",
|
117
|
-
children: [/*#__PURE__*/_jsx(Grid, {
|
118
|
-
item: true,
|
119
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
120
|
-
variant: "body1",
|
121
|
-
color: "primary",
|
122
|
-
sx: classes.typoLabel,
|
123
|
-
children: "Theme Style"
|
124
|
-
})
|
125
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
126
|
-
item: true,
|
127
|
-
children: theme?.id ? /*#__PURE__*/_jsx(Button, {
|
128
|
-
sx: classes.defaultBtn,
|
129
|
-
onClick: () => {
|
130
|
-
const {
|
131
|
-
field,
|
132
|
-
theme
|
133
|
-
} = saveToTheme(editor) || {};
|
134
|
-
updateTheme(theme, {
|
135
|
-
action: "ELEMENT_PROPS_CHANGE",
|
136
|
-
fieldName: field
|
137
|
-
});
|
138
|
-
},
|
139
|
-
disabled: !customized,
|
140
|
-
children: "Save to theme"
|
141
|
-
}) : null
|
142
|
-
})]
|
143
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
144
|
-
item: true,
|
145
|
-
xs: 12,
|
146
|
-
sx: classes.textFormatField,
|
147
|
-
children: /*#__PURE__*/_jsx(SelectTypography, {
|
148
|
-
editor: editor,
|
149
|
-
classes: classes,
|
150
|
-
closeMainPopup: () => {}
|
151
|
-
})
|
152
|
-
})]
|
153
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
154
104
|
item: true,
|
155
105
|
xs: 12,
|
156
106
|
children: [/*#__PURE__*/_jsxs(Grid, {
|
@@ -369,7 +319,12 @@ const TextFormat = props => {
|
|
369
319
|
xs: 12,
|
370
320
|
className: "typo-icons",
|
371
321
|
sx: classes.evenSpace,
|
372
|
-
children: [
|
322
|
+
children: [typo?.map((m, i) => {
|
323
|
+
return /*#__PURE__*/_jsx(BlockButton, {
|
324
|
+
editor: editor,
|
325
|
+
...m
|
326
|
+
}, `pptool_mark_${i}_${m.id}`);
|
327
|
+
}), fontStyle?.map((m, i) => {
|
373
328
|
return /*#__PURE__*/_jsx(MarkButton, {
|
374
329
|
editor: editor,
|
375
330
|
...m
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
2
|
import { Popper, Fade, Paper, ClickAwayListener } from "@mui/material";
|
3
3
|
import { Editor, Range } from "slate";
|
4
|
-
import { useSlate } from "slate-react";
|
4
|
+
import { useSlate, useFocused } from "slate-react";
|
5
5
|
import useDrag from "../../hooks/useDrag";
|
6
6
|
import { TableUtil } from "../../utils/table";
|
7
|
+
import useWindowResize from "../../hooks/useWindowResize";
|
7
8
|
import MiniTextFormat from "./MiniTextFormat";
|
8
9
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
9
10
|
import usePopupStyles from "../PopupTool/PopupToolStyle";
|
@@ -22,12 +23,14 @@ const PopupTool = props => {
|
|
22
23
|
const [anchorEl, setAnchorEl] = useState(null);
|
23
24
|
const [open, setOpen] = useState(false);
|
24
25
|
const editor = useSlate();
|
26
|
+
const inFocus = useFocused();
|
25
27
|
const {
|
26
28
|
selection
|
27
29
|
} = editor;
|
28
30
|
const [event] = useDrag(anchorEl);
|
29
31
|
const id = open ? "popup-edit-tool" : "";
|
30
32
|
const table = new TableUtil(editor);
|
33
|
+
const [size] = useWindowResize();
|
31
34
|
useEffect(() => {
|
32
35
|
if (event === "end" && anchorEl && !open) {
|
33
36
|
// for table cell selection
|
@@ -44,7 +47,7 @@ const PopupTool = props => {
|
|
44
47
|
}
|
45
48
|
}, [event, anchorEl]);
|
46
49
|
useEffect(() => {
|
47
|
-
if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "") {
|
50
|
+
if (!selection || !inFocus || Range.isCollapsed(selection) || Editor.string(editor, selection) === "") {
|
48
51
|
setAnchorEl(null);
|
49
52
|
} else {
|
50
53
|
updateAnchorEl();
|
@@ -83,28 +86,35 @@ const PopupTool = props => {
|
|
83
86
|
handleClose();
|
84
87
|
}
|
85
88
|
},
|
86
|
-
children: /*#__PURE__*/_jsx(
|
89
|
+
children: size.device === "xs" ? /*#__PURE__*/_jsx("div", {
|
90
|
+
className: "mobileMiniTextWrapper",
|
91
|
+
children: /*#__PURE__*/_jsx(MiniTextFormat, {
|
92
|
+
editor: editor,
|
93
|
+
classes: classes,
|
94
|
+
closeMainPopup: handleClose,
|
95
|
+
customProps: customProps
|
96
|
+
})
|
97
|
+
}) : /*#__PURE__*/_jsx(Popper, {
|
87
98
|
id: id,
|
88
99
|
open: open,
|
89
100
|
anchorEl: anchorEl,
|
90
101
|
transition: true,
|
91
102
|
placement: "auto-end",
|
92
103
|
sx: classes.popupWrapper,
|
104
|
+
className: `tools-drawer ${size?.device}`,
|
93
105
|
children: ({
|
94
106
|
TransitionProps
|
95
107
|
}) => /*#__PURE__*/_jsx(Fade, {
|
96
108
|
...TransitionProps,
|
97
109
|
children: /*#__PURE__*/_jsx(Paper, {
|
98
110
|
style: {
|
99
|
-
borderRadius: "
|
100
|
-
border: "1px solid #8360FD"
|
111
|
+
borderRadius: "10px"
|
101
112
|
},
|
102
113
|
children: /*#__PURE__*/_jsx(MiniTextFormat, {
|
103
114
|
editor: editor,
|
104
115
|
classes: classes,
|
105
116
|
closeMainPopup: handleClose,
|
106
|
-
customProps: customProps
|
107
|
-
theme: theme
|
117
|
+
customProps: customProps
|
108
118
|
})
|
109
119
|
})
|
110
120
|
})
|